1 OUTDATED, please update
5 dnl This file is part of linux-call-router
6 dnl Copyright (C) 2007 Joerg Habenicht (j.habenicht@gmx.de)
8 dnl This program is free software; you can redistribute it and/or
9 dnl modify it under the terms of the GNU General Public License as
10 dnl published by the Free Software Foundation; either
11 dnl version 2 of the License, or (at your option) any later version.
13 dnl This program is distributed in the hope that it will be useful,
14 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
15 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 dnl GNU General Public License for more details.
18 dnl You should have received a copy of the GNU General Public License
19 dnl along with this library; see the file COPYING. If not, write to
20 dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 dnl Boston, MA 02110-1301, USA.
25 dnl This keeps being the first instruction.
26 dnl Change the 2nd argument if the version increases
27 dnl 1st + 2nd argument is used for distribution package name
28 AC_INIT(lcr, 0.1.20071001, pbx4linux@koeln.ccc.de)
30 AC_CONFIG_SRCDIR([main.c])
31 AC_CONFIG_HEADER([config.h])
33 # fix warnings from autoconf + automake
35 AC_USE_SYSTEM_EXTENSIONS
36 AM_INIT_AUTOMAKE([dist-bzip2])
40 # Checks for programs.
41 dnl AC_CHECK_COMPILERS contains AC_PROG_CC AC_PROG_CPP and AC_PROG_CXX
47 dnl required, if per binary CFLAGS are used
51 # site specific configs
52 dnl enable this to have all special options on one place
53 dnl AC_PRESERVE_HELP_ORDER
55 # enable socket access to misdn kernel module on demand
57 AC_ARG_ENABLE([socket_misdn],
58 [AS_HELP_STRING([--enable-socket-misdn],
59 [use socket connection to misdn kernel code (default=disable)])
61 [use_misdn_socket="yes"],
62 [use_misdn_socket="no"]
64 AM_CONDITIONAL(ENABLE_SOCKET_MISDN, test "x$use_misdn_socket" == "xyes" )
67 AC_ARG_WITH([asterisk],
68 [AS_HELP_STRING([--with-asterisk],
69 [compile with built-in Asterisk channel driver @<:@default=no@:>@])
71 [with_asterisk_channel_driver="yes"],
72 [with_asterisk_channel_driver="no"])
73 AM_CONDITIONAL(ENABLE_ASTERISK_CHANNEL_DRIVER, test "x$with_asterisk_channel_driver" == "xyes" )
77 [AS_HELP_STRING([--with-ssl],
78 [compile with ssl support (libcrypto) @<:@default=check@:>@])
83 AS_IF([test "x$with_ssl" != xno],
84 [AC_CHECK_HEADERS([openssl/rsa.h])
85 AC_CHECK_LIB([crypto], [main],
86 [AC_SUBST([LIBCRYPTO], ["-lcrypto"])
87 AC_DEFINE([HAVE_LIBCRYPTO], [1],
88 [Define if you have libcrypto])
90 [if test "x$with_ssl" != xcheck ; then
92 [--with-ssl was given, but test for libcrypto failed])
99 AM_CONDITIONAL(WITH_CRYPTO, test "x$LIBCRYPTO" == "x-lcrypto" )
101 # check for isdn_net.h
102 # check for mISDNlib.h
103 # --with-isdn_net-include=<include>, default: env MISDNUSER= , $include/mISDNuser
105 # self written test for mISDNuser lib
108 # self written test for mISDN kernel header
114 # Checks for libraries.
115 dnl FIXME: Replace `main' with a function in `-ldl':
116 dnl AC_CHECK_LIB([dl], [main])
117 dnl FIXME: Replace `main' with a function in `-lh323_linux_x86_r':
118 dnl AC_CHECK_LIB([h323_linux_x86_r], [main])
119 dnl FIXME: Replace `main' with a function in `-lisdnnet':
120 dnl AC_CHECK_LIB([isdnnet], [main])
121 # FIXME: Replace `main' with a function in `-lm':
122 AC_CHECK_LIB([m], [main])
123 dnl FIXME: Replace `main' with a function in `-lmISDN':
124 dnl AC_CHECK_LIB([mISDN], [main])
125 # FIXME: Replace `main' with a function in `-lncurses':
126 AC_CHECK_LIB([ncurses], [main])
127 dnl FIXME: Replace `main' with a function in `-lpt_linux_x86_r':
128 dnl AC_CHECK_LIB([pt_linux_x86_r], [main])
129 # FIXME: Replace `main' with a function in `-lpthread':
130 AC_CHECK_LIB([pthread], [main])
132 # Checks for header files.
136 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])
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])
160 AC_SUBST(misdnuser_libraries)
161 AC_SUBST(misdnuser_includes)
162 AC_SUBST(misdnkernel_includes)
163 AC_SUBST(all_includes)
164 AC_SUBST(all_libraries)
166 AC_CONFIG_FILES([Makefile])