3 dnl This file is part of linux-call-router
4 dnl Copyright (C) 2007 Joerg Habenicht (j.habenicht@gmx.de)
5 dnl Copyright (C) 2008 Peter Schlaile (peter -at- schlaile.de)
7 dnl This program is free software; you can redistribute it and/or
8 dnl modify it under the terms of the GNU General Public License as
9 dnl published by the Free Software Foundation; either
10 dnl version 2 of the License, or (at your option) any later version.
12 dnl This program is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 dnl GNU General Public License for more details.
17 dnl You should have received a copy of the GNU General Public License
18 dnl along with this library; see the file COPYING. If not, write to
19 dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 dnl Boston, MA 02110-1301, USA.
24 dnl This keeps being the first instruction.
25 dnl Change the 2nd argument if the version increases
26 dnl 1st + 2nd argument is used for distribution package name
27 AC_INIT(lcr, 1.6, andreas@eversberg.eu)
29 AC_CONFIG_SRCDIR([main.c])
30 AM_CONFIG_HEADER(config.h)
32 # fix warnings from autoconf + automake
34 # AC_USE_SYSTEM_EXTENSIONS
35 AM_INIT_AUTOMAKE(lcr,1.6)
39 # Checks for programs.
45 dnl required, if per binary CFLAGS are used
49 # site specific configs
50 dnl enable this to have all special options on one place
51 dnl AC_PRESERVE_HELP_ORDER
54 AC_ARG_WITH([asterisk],
55 [AS_HELP_STRING([--with-asterisk],
56 [compile with built-in Asterisk channel driver @<:@default=check@:>@])
59 [with_asterisk="check"])
61 AS_IF([test "x$with_asterisk" != xno],
62 [AC_CHECK_HEADERS([asterisk/compiler.h],
63 [with_asterisk="yes"],
64 [if test "x$with_asterisk" != xcheck ; then
66 [--with-asterisk was given, but test for header-file asterisk/compiler.h failed])
71 AM_CONDITIONAL(ENABLE_ASTERISK_CHANNEL_DRIVER, test "x$with_asterisk" == "xyes" )
75 [AS_HELP_STRING([--with-ssl],
76 [compile with ssl support (libcrypto) @<:@default=check@:>@])
81 AS_IF([test "x$with_ssl" != xno],
82 [AC_CHECK_HEADERS([openssl/rsa.h])
83 AC_CHECK_LIB([crypto], [main],
84 [AC_SUBST([LIBCRYPTO], ["-lcrypto"])
85 AC_DEFINE([HAVE_LIBCRYPTO], [1],
86 [Define if you have libcrypto])
88 [if test "x$with_ssl" != xcheck ; then
90 [--with-ssl was given, but test for libcrypto failed])
100 [AS_HELP_STRING([--with-gsm],
101 [compile with OpenBSC support @<:@default=check@:>@])
106 AS_IF([test "x$with_gsm" != xno],
107 [AC_CHECK_FILE([openbsc/include/openbsc/gsm_data.h],
109 [if test "x$with_gsm" != xcheck ; then
111 [--with-gsm was given, but openbsc/include/openbsc/gsm_data.h was not found! Pleas link OpenBSC source directory to LCR source directory: ln -s path_to_openbsc/openbsc/ .])
116 AM_CONDITIONAL(ENABLE_GSM, test "x$with_gsm" == "xyes" )
120 [AS_HELP_STRING([--with-ss5],
121 [compile with CCITT No. 5 support @<:@default=no@:>@])
126 AM_CONDITIONAL(ENABLE_SS5, test "x$with_ss5" == "xyes" )
128 # Checks for libraries.
129 AC_CHECK_LIB([m], [main])
130 AC_CHECK_LIB([ncurses], [main])
131 AC_CHECK_LIB([pthread], [main])
133 # Checks for header files.
137 AC_CHECK_HEADERS([fcntl.h netinet/in.h stdlib.h string.h sys/file.h sys/ioctl.h sys/socket.h sys/time.h unistd.h ctype.h assert.h mISDNuser/mbuffer.h assert.h])
139 # Checks for typedefs, structures, and compiler characteristics.
147 # Checks for library functions.
149 AC_PROG_GCC_TRADITIONAL
151 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
158 AC_CHECK_FUNCS([gettimeofday memmove memset mkdir socket strcasecmp strchr strerror strncasecmp strstr strtol strtoul])
161 AC_CONFIG_FILES([Makefile])