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
53 # enable socket access to misdn kernel module on demand
55 AC_ARG_ENABLE([socket_misdn],
56 [AS_HELP_STRING([--enable-socket-misdn],
57 [use socket connection to misdn kernel code (default=disable)])
59 [use_misdn_socket="yes"],
60 [use_misdn_socket="no"]
62 AM_CONDITIONAL(ENABLE_SOCKET_MISDN, test "x$use_misdn_socket" == "xyes" )
65 AC_ARG_WITH([asterisk],
66 [AS_HELP_STRING([--with-asterisk],
67 [compile with built-in Asterisk channel driver @<:@default=no@:>@])
69 [with_asterisk_channel_driver="yes"],
70 [with_asterisk_channel_driver="no"])
71 AM_CONDITIONAL(ENABLE_ASTERISK_CHANNEL_DRIVER, test "x$with_asterisk_channel_driver" == "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])
97 AM_CONDITIONAL(WITH_CRYPTO, test "x$LIBCRYPTO" == "x-lcrypto" )
99 # check for isdn_net.h
100 # check for mISDNlib.h
101 # --with-isdn_net-include=<include>, default: env MISDNUSER= , $include/mISDNuser
103 # self written test for mISDNuser lib
106 # self written test for mISDN kernel header
112 # Checks for libraries.
113 dnl FIXME: Replace `main' with a function in `-ldl':
114 dnl AC_CHECK_LIB([dl], [main])
115 dnl FIXME: Replace `main' with a function in `-lh323_linux_x86_r':
116 dnl AC_CHECK_LIB([h323_linux_x86_r], [main])
117 dnl FIXME: Replace `main' with a function in `-lisdnnet':
118 dnl AC_CHECK_LIB([isdnnet], [main])
119 # FIXME: Replace `main' with a function in `-lm':
120 AC_CHECK_LIB([m], [main])
121 dnl FIXME: Replace `main' with a function in `-lmISDN':
122 dnl AC_CHECK_LIB([mISDN], [main])
123 # FIXME: Replace `main' with a function in `-lncurses':
124 AC_CHECK_LIB([ncurses], [main])
125 dnl FIXME: Replace `main' with a function in `-lpt_linux_x86_r':
126 dnl AC_CHECK_LIB([pt_linux_x86_r], [main])
127 # FIXME: Replace `main' with a function in `-lpthread':
128 AC_CHECK_LIB([pthread], [main])
130 # Checks for header files.
134 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])
137 # Checks for typedefs, structures, and compiler characteristics.
145 # Checks for library functions.
147 AC_PROG_GCC_TRADITIONAL
149 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
156 AC_CHECK_FUNCS([gettimeofday memmove memset mkdir socket strcasecmp strchr strerror strncasecmp strstr strtol strtoul])
158 AC_SUBST(misdnuser_libraries)
159 AC_SUBST(misdnuser_includes)
160 AC_SUBST(misdnkernel_includes)
161 AC_SUBST(all_includes)
162 AC_SUBST(all_libraries)
164 AC_CONFIG_FILES([Makefile])