3 dnl This file is part of linux-call-router
4 dnl Copyright (C) 2007 Joerg Habenicht (j.habenicht@gmx.de)
6 dnl This program is free software; you can redistribute it and/or
7 dnl modify it under the terms of the GNU General Public License as
8 dnl published by the Free Software Foundation; either
9 dnl version 2 of the License, or (at your option) any later version.
11 dnl This program is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 dnl GNU General Public License for more details.
16 dnl You should have received a copy of the GNU General Public License
17 dnl along with this library; see the file COPYING. If not, write to
18 dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 dnl Boston, MA 02110-1301, USA.
23 dnl This keeps being the first instruction.
24 dnl Change the 2nd argument if the version increases
25 dnl 1st + 2nd argument is used for distribution package name
26 AC_INIT(lcr, 0.1.20071001, pbx4linux@koeln.ccc.de)
28 AC_CONFIG_SRCDIR([main.c])
29 AC_CONFIG_HEADER([config.h])
31 # fix warnings from autoconf + automake
33 AC_USE_SYSTEM_EXTENSIONS
34 AM_INIT_AUTOMAKE([dist-bzip2])
38 # Checks for programs.
39 dnl AC_CHECK_COMPILERS contains AC_PROG_CC AC_PROG_CPP and AC_PROG_CXX
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=no@:>@])
58 [with_asterisk_channel_driver="yes"],
59 [with_asterisk_channel_driver="no"])
60 AM_CONDITIONAL(ENABLE_ASTERISK_CHANNEL_DRIVER, test "x$with_asterisk_channel_driver" == "xyes" )
64 [AS_HELP_STRING([--with-ssl],
65 [compile with ssl support (libcrypto) @<:@default=check@:>@])
70 AS_IF([test "x$with_ssl" != xno],
71 [AC_CHECK_HEADERS([openssl/rsa.h])
72 AC_CHECK_LIB([crypto], [main],
73 [AC_SUBST([LIBCRYPTO], ["-lcrypto"])
74 AC_DEFINE([HAVE_LIBCRYPTO], [1],
75 [Define if you have libcrypto])
77 [if test "x$with_ssl" != xcheck ; then
79 [--with-ssl was given, but test for libcrypto failed])
86 AM_CONDITIONAL(WITH_CRYPTO, test "x$LIBCRYPTO" == "x-lcrypto" )
88 # self written test for mISDNuser lib
91 # self written test for mISDN kernel header
97 # Checks for libraries.
98 dnl FIXME: Replace `main' with a function in `-ldl':
99 dnl AC_CHECK_LIB([dl], [main])
100 dnl FIXME: Replace `main' with a function in `-lh323_linux_x86_r':
101 dnl AC_CHECK_LIB([h323_linux_x86_r], [main])
102 dnl FIXME: Replace `main' with a function in `-lisdnnet':
103 dnl AC_CHECK_LIB([isdnnet], [main])
104 # FIXME: Replace `main' with a function in `-lm':
105 AC_CHECK_LIB([m], [main])
106 dnl FIXME: Replace `main' with a function in `-lmISDN':
107 dnl AC_CHECK_LIB([mISDN], [main])
108 # FIXME: Replace `main' with a function in `-lncurses':
109 AC_CHECK_LIB([ncurses], [main])
110 dnl FIXME: Replace `main' with a function in `-lpt_linux_x86_r':
111 dnl AC_CHECK_LIB([pt_linux_x86_r], [main])
112 # FIXME: Replace `main' with a function in `-lpthread':
113 AC_CHECK_LIB([pthread], [main])
115 # Checks for header files.
119 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])
122 # Checks for typedefs, structures, and compiler characteristics.
130 # Checks for library functions.
132 AC_PROG_GCC_TRADITIONAL
134 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
141 AC_CHECK_FUNCS([gettimeofday memmove memset mkdir socket strcasecmp strchr strerror strncasecmp strstr strtol strtoul])
143 AC_SUBST(misdnuser_libraries)
144 AC_SUBST(misdnuser_includes)
145 AC_SUBST(misdnkernel_includes)
146 AC_SUBST(all_includes)
147 AC_SUBST(all_libraries)
149 AC_CONFIG_FILES([Makefile])