blob: 23eb4e45721d9a5b6356101b9b855eabb1a4f702 [file] [log] [blame]
Cullen Jennings235513a2005-09-21 22:51:36 +00001dnl Process this file with autoconf to produce a configure script.
Pascal Bühler34acba62017-01-19 10:57:30 +01002AC_INIT([libsrtp2], [2.1.0-pre], [https://github.com/cisco/libsrtp/issues])
Cullen Jennings235513a2005-09-21 22:51:36 +00003
David McGrewb67061f2005-09-28 14:23:06 +00004dnl Must come before AC_PROG_CC
Idar Tollefsen0e790752017-01-26 10:59:03 +01005EMPTY_CFLAGS="no"
Idar Tollefsen27d857c2017-01-19 15:28:18 +01006if test "x$CFLAGS" = "x"; then
David McGrewb67061f2005-09-28 14:23:06 +00007 dnl Default value for CFLAGS if not specified.
Idar Tollefsen0e790752017-01-26 10:59:03 +01008 EMPTY_CFLAGS="yes"
David McGrewb67061f2005-09-28 14:23:06 +00009fi
10
Cullen Jennings235513a2005-09-21 22:51:36 +000011dnl Checks for programs.
Idar Tollefsenba304fc2017-05-03 13:09:03 +020012AC_PROG_CC
13AC_PROG_CPP
14AC_ARG_VAR(
15 [EXTRA_CFLAGS],
16 [C compiler flags appended to the regular C compiler flags instead of overriding them])
Idar Tollefsen38e50762017-05-03 11:45:15 +020017AM_PROG_AR
Cullen Jennings235513a2005-09-21 22:51:36 +000018AC_PROG_RANLIB
David McGrewb67061f2005-09-28 14:23:06 +000019AC_PROG_INSTALL
Idar Tollefsen0e790752017-01-26 10:59:03 +010020AC_PROG_SED
Cullen Jennings235513a2005-09-21 22:51:36 +000021
Marcus Sundbergfaf84ca2007-05-23 17:24:52 +000022dnl Check the byte order
23AC_C_BIGENDIAN
24
25AC_CANONICAL_HOST
26
27dnl check host_cpu type, set defines appropriately
28case $host_cpu in
Idar Tollefsen5fd11872017-01-19 15:25:12 +010029 i*86 | x86_64 )
Idar Tollefsen5e67d392017-01-20 13:03:52 +010030 AC_DEFINE([CPU_CISC], [1], [Define if building for a CISC machine (e.g. Intel).])
31 AC_DEFINE([HAVE_X86], [1], [Define to use X86 inlined assembly code])
Idar Tollefsen5fd11872017-01-19 15:25:12 +010032 ;;
33 * )
Idar Tollefsen5e67d392017-01-20 13:03:52 +010034 AC_DEFINE([CPU_RISC], [1], [Define if building for a RISC machine (assume slow byte access).])
Idar Tollefsen5fd11872017-01-19 15:25:12 +010035 ;;
36esac
Marcus Sundbergfaf84ca2007-05-23 17:24:52 +000037
38dnl Check if we are on a Windows platform.
39case $host_os in
Idar Tollefsen5fd11872017-01-19 15:25:12 +010040 *cygwin*|*mingw* )
41 EXE=.exe
Idar Tollefsen5fd11872017-01-19 15:25:12 +010042 ;;
43 * )
44 EXE=""
45 ;;
Marcus Sundbergfaf84ca2007-05-23 17:24:52 +000046esac
Idar Tollefsen5e67d392017-01-20 13:03:52 +010047AC_SUBST([EXE]) # define executable suffix; this is needed for `make clean'
Marcus Sundbergfaf84ca2007-05-23 17:24:52 +000048
Idar Tollefsen0e790752017-01-26 10:59:03 +010049dnl Checks for supported compiler flags.
50supported_cflags=""
51if test "$EMPTY_CFLAGS" = "no"; then
52 supported_cflags="$CFLAGS"
53fi
54
55dnl For accurate detection, we need warnings as errors.
56dnl I.e. Clang will issue a warning about unsupported flags.
57dnl For the compilation to fail, those warnings needs to be upgraded to errors.
58dnl This will be removed again once the tests are complete (see below).
59WERROR=""
60for w in -Werror -errwarn; do
61 if test "x$WERROR" = "x"; then
Pascal Bühlerbb6ef8a2017-03-29 07:46:21 +020062 AC_MSG_CHECKING([whether ${CC-c} accepts $w])
Idar Tollefsen0e790752017-01-26 10:59:03 +010063 save_cflags="$CFLAGS"
64 AS_IF([test "x$CFLAGS" = "x"], [CFLAGS="$w"], [CFLAGS="$CFLAGS $w"])
Pascal Bühlerbb6ef8a2017-03-29 07:46:21 +020065 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(void) { return 0; }])],
Idar Tollefsen0e790752017-01-26 10:59:03 +010066 [WERROR="$w"
67 AC_MSG_RESULT([yes])],
68 [CFLAGS="$save_cflags"
69 AC_MSG_RESULT([no])])
70 fi
71done
72
Idar Tollefsen475af062017-03-29 11:40:43 +020073dnl Note that -fPIC is not explicitly added to LDFLAGS.
74dnl Since the compiler is used as the link driver, CFLAGS will be part of the
75dnl link line as well and the linker will get the flag from there.
76dnl Adding it to LDFLAGS explicitly would duplicate the flag on the link line,
77dnl but otherwise do no harm.
Pascal Bühlerbb6ef8a2017-03-29 07:46:21 +020078AC_MSG_CHECKING([whether ${CC-c} accepts -fPIC])
Idar Tollefsen0e790752017-01-26 10:59:03 +010079save_cflags="$CFLAGS"
80AS_IF([test "x$CFLAGS" = "x"], [CFLAGS="-fPIC"], [CFLAGS="$CFLAGS -fPIC"])
Pascal Bühlerbb6ef8a2017-03-29 07:46:21 +020081AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(void) { return 0; }])],
Idar Tollefsen0e790752017-01-26 10:59:03 +010082 [AS_IF([test "x$supported_cflags" = "x"], [supported_cflags="-fPIC"], [supported_cflags="$supported_cflags -fPIC"])
Idar Tollefsen0e790752017-01-26 10:59:03 +010083 AC_MSG_RESULT([yes])],
84 [CFLAGS="$save_cflags"
85 AC_MSG_RESULT([no])])
86
87if test "$EMPTY_CFLAGS" = "yes"; then
Pascal Bühlerbb6ef8a2017-03-29 07:46:21 +020088 for f in -Wall -pedantic -Wstrict-prototypes; do
89 AC_MSG_CHECKING([whether ${CC-c} accepts $f])
Idar Tollefsen0e790752017-01-26 10:59:03 +010090 save_cflags="$CFLAGS"
91 AS_IF([test "x$CFLAGS" = "x"], [CFLAGS="$f"], [CFLAGS="$CFLAGS $f"])
Pascal Bühlerbb6ef8a2017-03-29 07:46:21 +020092 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(void) { return 0; }])],
Idar Tollefsen0e790752017-01-26 10:59:03 +010093 [AS_IF([test "x$supported_cflags" = "x"], [supported_cflags="$f"], [supported_cflags="$supported_cflags $f"])
94 AC_MSG_RESULT([yes])],
95 [CFLAGS="$save_cflags"
96 AC_MSG_RESULT([no])])
97 done
98
99 OOPT=""
100 for f in -O4 -O3; do
101 if test "x$OOPT" = "x"; then
Pascal Bühlerbb6ef8a2017-03-29 07:46:21 +0200102 AC_MSG_CHECKING([whether ${CC-c} accepts $f])
Idar Tollefsen0e790752017-01-26 10:59:03 +0100103 save_cflags="$CFLAGS"
104 AS_IF([test "x$CFLAGS" = "x"], [CFLAGS="$f"], [CFLAGS="$CFLAGS $f"])
Pascal Bühlerbb6ef8a2017-03-29 07:46:21 +0200105 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(void) { return 0; }])],
Idar Tollefsen0e790752017-01-26 10:59:03 +0100106 [AS_IF([test "x$supported_cflags" = "x"], [supported_cflags="$f"], [supported_cflags="$supported_cflags $f"])
107 OOPT="$f"
108 AC_MSG_RESULT([yes])],
109 [CFLAGS="$save_cflags"
110 AC_MSG_RESULT([no])])
111 fi
112 done
113
114 for f in -fexpensive-optimizations -funroll-loops; do
Pascal Bühlerbb6ef8a2017-03-29 07:46:21 +0200115 AC_MSG_CHECKING([whether ${CC-c} accepts $f])
Idar Tollefsen0e790752017-01-26 10:59:03 +0100116 save_cflags="$CFLAGS"
117 AS_IF([test "x$CFLAGS" = "x"], [CFLAGS="$f"], [CFLAGS="$CFLAGS $f"])
Pascal Bühlerbb6ef8a2017-03-29 07:46:21 +0200118 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(void) { return 0; }])],
Idar Tollefsen0e790752017-01-26 10:59:03 +0100119 [AS_IF([test "x$supported_cflags" = "x"], [supported_cflags="$f"], [supported_cflags="$supported_cflags $f"])
120 AC_MSG_RESULT([yes])],
121 [CFLAGS="$save_cflags"
122 AC_MSG_RESULT([no])])
123 done
124fi
125
126dnl When turning off warnigns, we're expecting unrecognized command line option errors if they're not
127dnl supported. However, the -Wno-<warning> form isn't consulted unless a warning is triggered.
Idar Tollefsenba304fc2017-05-03 13:09:03 +0200128dnl At least that's the case for GCC. So to check which warnings we can turn off, we need to check
Idar Tollefsen0e790752017-01-26 10:59:03 +0100129dnl if they can be turned on, thereby forcing GCC to take the argument into account right away.
130for f in -Wno-language-extension-token; do
Pascal Bühlerbb6ef8a2017-03-29 07:46:21 +0200131 AC_MSG_CHECKING([whether ${CC-c} accepts $f])
Idar Tollefsen0e790752017-01-26 10:59:03 +0100132 save_cflags="$CFLAGS"
133 testf=$(echo "$f" | $SED 's|-Wno-\(.*\)|-W\1|g')
134 AS_IF([test "x$CFLAGS" = "x"], [CFLAGS="$testf"], [CFLAGS="$CFLAGS $testf"])
Pascal Bühlerbb6ef8a2017-03-29 07:46:21 +0200135 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(void) { return 0; }])],
Idar Tollefsen0e790752017-01-26 10:59:03 +0100136 [AS_IF([test "x$supported_cflags" = "x"], [supported_cflags="$f"], [supported_cflags="$supported_cflags $f"])
137 AC_MSG_RESULT([yes])],
138 [CFLAGS="$save_cflags"
139 AC_MSG_RESULT([no])])
140done
141
142dnl Remowing -Werror again
143CFLAGS="$supported_cflags"
Cullen Jennings235513a2005-09-21 22:51:36 +0000144
145dnl Checks for header files.
146AC_HEADER_STDC
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100147AC_CHECK_HEADERS(
148 [unistd.h byteswap.h stdint.h sys/uio.h inttypes.h sys/types.h machine/types.h sys/int_types.h],
149 [], [], [AC_INCLUDES_DEFAULT])
Cullen Jennings235513a2005-09-21 22:51:36 +0000150
Marcus Sundberg8046c3a2005-10-02 20:02:05 +0000151dnl socket() and friends
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100152AC_CHECK_HEADERS([sys/socket.h netinet/in.h arpa/inet.h], [], [], [AC_INCLUDES_DEFAULT])
153AC_CHECK_HEADERS(
154 [windows.h],
155 [AC_CHECK_HEADERS([winsock2.h], [], [], [AC_INCLUDES_DEFAULT])],
156 [], [AC_INCLUDES_DEFAULT])
Marcus Sundberg8046c3a2005-10-02 20:02:05 +0000157
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100158AC_CHECK_TYPES([int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, uint64_t])
159AC_CHECK_SIZEOF([unsigned long])
160AC_CHECK_SIZEOF([unsigned long long])
Cullen Jennings235513a2005-09-21 22:51:36 +0000161
162dnl Checks for typedefs, structures, and compiler characteristics.
163AC_C_CONST
164AC_C_INLINE
165AC_TYPE_SIZE_T
166
167dnl Checks for library functions.
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100168AC_CHECK_FUNCS([socket inet_aton usleep sigaction])
David McGrewb67061f2005-09-28 14:23:06 +0000169
Marcus Sundberg8046c3a2005-10-02 20:02:05 +0000170dnl Find socket function if not found yet.
171if test "x$ac_cv_func_socket" = "xno"; then
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100172 AC_CHECK_LIB([socket], [socket])
Marcus Sundberg8046c3a2005-10-02 20:02:05 +0000173 AC_MSG_CHECKING([for socket in -lwsock32])
174 SAVELIBS="$LIBS"
175 LIBS="$LIBS -lwsock32"
Pascal Bühlerbb6ef8a2017-03-29 07:46:21 +0200176 AC_LINK_IFELSE(
177 [AC_LANG_SOURCE([
Marcus Sundberg8046c3a2005-10-02 20:02:05 +0000178#include <winsock2.h>
Pascal Bühlerbb6ef8a2017-03-29 07:46:21 +0200179int main(void)
180{
181 int fd = socket(0, 0, 0);
182 if (fd < 0)
183 return -1;
184 else
185 return 0;
186}
187 ])],
188 [ac_cv_func_socket=yes
189 AC_MSG_RESULT([yes])],
190 [LIBS="$SAVELIBS"
191 AC_MSG_RESULT([no])])
Marcus Sundberg8046c3a2005-10-02 20:02:05 +0000192fi
Cullen Jennings235513a2005-09-21 22:51:36 +0000193
Pascal Bühlerb969ed52017-02-10 09:03:54 +0100194AC_MSG_CHECKING([whether to enable debug logging in all modules])
195AC_ARG_ENABLE([debug-logging],
196 [AS_HELP_STRING([--enable-debug-logging], [Enable debug logging in all modules])],
Pascal Bühler88579e62017-01-30 21:05:37 +0100197 [], enable_debug_logging=no)
198if test "$enable_debug_logging" = "yes"; then
Pascal Bühlerb969ed52017-02-10 09:03:54 +0100199 AC_DEFINE([ENABLE_DEBUG_LOGGING], [1], [Define to enabled debug logging for all mudules.])
Cullen Jennings235513a2005-09-21 22:51:36 +0000200fi
Pascal Bühlerb969ed52017-02-10 09:03:54 +0100201AC_MSG_RESULT([$enable_debug_logging])
Cullen Jennings235513a2005-09-21 22:51:36 +0000202
Michael Thomas (malinka)1d4460d2016-06-04 19:59:31 -0400203PKG_PROG_PKG_CONFIG
Idar Tollefsenf9c148d2017-02-09 11:10:04 +0100204AS_IF([test "x$PKG_CONFIG" != "x"], [PKG_CONFIG="$PKG_CONFIG --static"])
Michael Thomas (malinka)1d4460d2016-06-04 19:59:31 -0400205
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100206AC_MSG_CHECKING([whether to leverage OpenSSL crypto])
207AC_ARG_ENABLE([openssl],
208 [AS_HELP_STRING([--enable-openssl], [compile in OpenSSL crypto engine])],
209 [], [enable_openssl=no])
210AC_MSG_RESULT([$enable_openssl])
jfigusa14b5a02013-03-29 12:24:12 -0400211if test "$enable_openssl" = "yes"; then
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100212 AC_MSG_CHECKING([for user specified OpenSSL directory])
213 AC_ARG_WITH([openssl-dir],
jfigus038d2cf2015-05-11 14:10:11 -0400214 [AS_HELP_STRING([--with-openssl-dir], [Location of OpenSSL installation])],
Idar Tollefsen333fa842017-01-20 16:44:33 +0100215 [if test "x$PKG_CONFIG" != "x" && test -f $with_openssl_dir/lib/pkgconfig/libcrypto.pc; then
216 if test "x$PKG_CONFIG_PATH" = "x"; then
217 export PKG_CONFIG_PATH="$with_openssl_dir/lib/pkgconfig"
218 else
219 export PKG_CONFIG_PATH="$with_openssl_dir/lib/pkgconfig:$PKG_CONFIG_PATH"
220 fi
221 AC_MSG_RESULT([$with_openssl_dir])
222 elif test -d $with_openssl_dir/lib; then
223 CFLAGS="$CFLAGS -I$with_openssl_dir/include"
224 if test "x$LDFLAGS" = "x"; then
225 LDFLAGS="-L$with_openssl_dir/lib"
226 else
227 LDFLAGS="$LDFLAGS -L$with_openssl_dir/lib"
228 fi
229 AC_MSG_RESULT([$with_openssl_dir])
230 else
231 AC_MSG_RESULT([invalid])
232 AC_MSG_FAILURE([Invalid OpenSSL location: $with_openssl_dir])
233 fi],
234 [AC_MSG_RESULT([no])])
jfigus038d2cf2015-05-11 14:10:11 -0400235
Idar Tollefsen333fa842017-01-20 16:44:33 +0100236 if test "x$PKG_CONFIG" != "x"; then
Pascal Bühler6c949b62017-02-09 14:22:36 +0100237 PKG_CHECK_MODULES([crypto], [libcrypto >= 1.0.1],
Idar Tollefsen333fa842017-01-20 16:44:33 +0100238 [CFLAGS="$CFLAGS $crypto_CFLAGS"
239 LIBS="$crypto_LIBS $LIBS"])
240 else
241 AC_CHECK_LIB([dl], [dlopen], [], [AC_MSG_WARN([can't find libdl])])
242 AC_CHECK_LIB([z], [inflate], [], [AC_MSG_WARN([can't find libz])])
243 fi
Cullen Jenningse1de50f2013-05-22 12:27:28 -0600244
Idar Tollefsen333fa842017-01-20 16:44:33 +0100245 AC_SEARCH_LIBS([EVP_EncryptInit], [crypto],
Pascal Bühler6c949b62017-02-09 14:22:36 +0100246 [], [AC_MSG_FAILURE([can't find openssl >= 1.0.1 crypto lib])])
Idar Tollefsen333fa842017-01-20 16:44:33 +0100247 AC_SEARCH_LIBS([EVP_aes_128_ctr], [crypto],
Pascal Bühler6c949b62017-02-09 14:22:36 +0100248 [], [AC_MSG_FAILURE([can't find openssl >= 1.0.1 crypto lib])])
Idar Tollefsen333fa842017-01-20 16:44:33 +0100249 AC_SEARCH_LIBS([EVP_aes_128_gcm], [crypto],
Pascal Bühler6c949b62017-02-09 14:22:36 +0100250 [], [AC_MSG_FAILURE([can't find openssl >= 1.0.1 crypto lib])])
Idar Tollefsen333fa842017-01-20 16:44:33 +0100251
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100252 AC_DEFINE([OPENSSL], [1], [Define this to use OpenSSL crypto.])
jfigus7882dd92013-08-02 16:08:23 -0400253 AES_ICM_OBJS="crypto/cipher/aes_icm_ossl.o crypto/cipher/aes_gcm_ossl.o"
jfigus0d3a2682013-04-02 15:42:37 -0400254 HMAC_OBJS=crypto/hash/hmac_ossl.o
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100255 AC_SUBST([USE_OPENSSL], [1])
jfigus038d2cf2015-05-11 14:10:11 -0400256
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100257 AC_MSG_CHECKING([whether to leverage OpenSSL KDF algorithm])
258 AC_ARG_ENABLE([openssl-kdf],
jfigus038d2cf2015-05-11 14:10:11 -0400259 [AS_HELP_STRING([--enable-openssl-kdf], [Use OpenSSL KDF algorithm])],
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100260 [], [enable_openssl_kdf=no])
261 AC_MSG_RESULT([$enable_openssl_kdf])
jfigus038d2cf2015-05-11 14:10:11 -0400262 if test "$enable_openssl_kdf" = "yes"; then
Idar Tollefsen333fa842017-01-20 16:44:33 +0100263 AC_SEARCH_LIBS([kdf_srtp], [crypto],
264 [], [AC_MSG_FAILURE([can't find openssl KDF lib])])
265 AC_DEFINE([OPENSSL_KDF], [1], [Define this to use OpenSSL KDF for SRTP.])
jfigus038d2cf2015-05-11 14:10:11 -0400266 fi
jfigusa14b5a02013-03-29 12:24:12 -0400267else
jfigusa3127b82014-11-19 14:46:52 -0500268 AES_ICM_OBJS="crypto/cipher/aes_icm.o crypto/cipher/aes.o"
jfigus0d3a2682013-04-02 15:42:37 -0400269 HMAC_OBJS="crypto/hash/hmac.o crypto/hash/sha1.o"
jfigusa14b5a02013-03-29 12:24:12 -0400270fi
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100271AC_SUBST([AES_ICM_OBJS])
272AC_SUBST([HMAC_OBJS])
jfigusa14b5a02013-03-29 12:24:12 -0400273
Bernardo Torres79e38ae2014-10-10 05:29:36 -0300274dnl Checking for PCAP
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100275AC_CHECK_LIB([pcap], [pcap_create],
276 [LIBS="-lpcap $LIBS"
277 AC_DEFINE([HAVE_PCAP], [1], [Define to 1 if you have the `pcap' library (-lpcap)])
278 AC_SUBST([HAVE_PCAP], [1])])
Bernardo Torres79e38ae2014-10-10 05:29:36 -0300279
Pascal Bühlerb969ed52017-02-10 09:03:54 +0100280AC_MSG_CHECKING([whether to redirect logging to stdout])
281AC_ARG_ENABLE([log-stdout],
Pascal Bühler88579e62017-01-30 21:05:37 +0100282 [AS_HELP_STRING([--enable-log-stdout], [redirecting logging to stdout])],
Pascal Bühlerb969ed52017-02-10 09:03:54 +0100283 [], [enable_log_stdout=no])
Pascal Bühler88579e62017-01-30 21:05:37 +0100284if test "$enable_log_stdout" = "yes"; then
Pascal Bühlerb969ed52017-02-10 09:03:54 +0100285 AC_DEFINE([ERR_REPORTING_STDOUT], [1], [Define to redirect logging to stdout.])
Cullen Jennings235513a2005-09-21 22:51:36 +0000286fi
Pascal Bühlerb969ed52017-02-10 09:03:54 +0100287AC_MSG_RESULT([$enable_log_stdout])
Cullen Jennings235513a2005-09-21 22:51:36 +0000288
Pascal Bühlerb969ed52017-02-10 09:03:54 +0100289AC_MSG_CHECKING([wheather to use a file for logging])
290AC_ARG_WITH([log-file],
Pascal Bühler88579e62017-01-30 21:05:37 +0100291 [AS_HELP_STRING([--with-log-file], [Use file for logging])],
292 [AS_CASE([x$with_log_file],
293 [x], [valid_with_log_file="no"],
294 [xyes], [valid_with_log_file="no"],
295 [valid_with_error_file="yes"])
296 AS_IF([test "$valid_with_log_file" = "no"],
297 [AC_MSG_RESULT([invalid])
298 AC_MSG_FAILURE([Invalid value for --with-log-file: "$with_log_file"])],
299 [AC_DEFINE_UNQUOTED([ERR_REPORTING_FILE], ["$with_log_file"], [Logging statments will be writen to this file.])
300 AC_MSG_RESULT([using log file: "$with_log_file"])])],
301 [AC_MSG_RESULT([no])])
302
303AS_IF(
304 [test "$enable_log_stdout" = "yes" && test "x$with_log_file" != "x"],
305 [AC_MSG_FAILURE([Can only use one of --enable-log-stdout and --with-log-file; they are mutually exclusive])])
Cullen Jennings235513a2005-09-21 22:51:36 +0000306
Idar Tollefsenba304fc2017-05-03 13:09:03 +0200307dnl Appending EXTRA_CFLAGS, if given
308AC_MSG_CHECKING([for extra C compiler flags])
309AS_IF([test "x$EXTRA_CFLAGS" != "x"],
310 [AS_IF([test "x$CFLAGS" = "x"],
311 [CFLAGS="$EXTRA_CFLAGS"], [CFLAGS="$CFLAGS $EXTRA_CFLAGS"])
312 AC_MSG_RESULT([$EXTRA_CFLAGS])],
313 [AC_MSG_RESULT(no)])
314
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100315AC_CONFIG_HEADER([crypto/include/config.h:config_in.h])
Cullen Jennings235513a2005-09-21 22:51:36 +0000316
Idar Tollefsen3edfcef2017-01-20 16:14:51 +0100317AC_CONFIG_FILES([Makefile crypto/Makefile doc/Makefile libsrtp2.pc])
Saúl Ibarra Corretgéb86063c2014-10-01 11:23:24 +0200318AC_OUTPUT
Marcus Sundberg4ce29b22005-09-29 14:29:53 +0000319
320# This is needed when building outside the source dir.
Idar Tollefsen5e67d392017-01-20 13:03:52 +0100321AS_MKDIR_P([crypto/cipher])
322AS_MKDIR_P([crypto/hash])
323AS_MKDIR_P([crypto/kernel])
324AS_MKDIR_P([crypto/math])
325AS_MKDIR_P([crypto/replay])
326AS_MKDIR_P([crypto/test])
327AS_MKDIR_P([doc])
328AS_MKDIR_P([srtp])
329AS_MKDIR_P([test])