LCR is now uses socket based mISDN V2 API
[lcr.git] / configure.ac
1 OUTDATED, please update
2
3 ##   -*- autoconf -*-
4
5 dnl    This file is part of linux-call-router
6 dnl    Copyright (C) 2007 Joerg Habenicht (j.habenicht@gmx.de)
7
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.
12
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.
17
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.
22
23
24
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)
29 AC_PREREQ(2.61)
30 AC_CONFIG_SRCDIR([main.c])
31 AC_CONFIG_HEADER([config.h])
32
33 # fix warnings from autoconf + automake
34 AC_GNU_SOURCE
35 AC_USE_SYSTEM_EXTENSIONS
36 AM_INIT_AUTOMAKE([dist-bzip2])
37
38
39
40 # Checks for programs.
41 dnl AC_CHECK_COMPILERS contains AC_PROG_CC AC_PROG_CPP and AC_PROG_CXX
42 AC_CHECK_COMPILERS
43 dnl AC_PROG_CXX
44 dnl AC_PROG_CC
45 AC_PROG_INSTALL
46 AC_PROG_MAKE_SET
47 dnl required, if per binary CFLAGS are used
48 dnl AM_PROG_CC_C_O
49
50
51 # site specific configs
52 dnl enable this to have all special options on one place
53 dnl AC_PRESERVE_HELP_ORDER
54
55 # enable socket access to misdn kernel module on demand
56 dnl SOCKET_MISDN=
57 AC_ARG_ENABLE([socket_misdn],
58               [AS_HELP_STRING([--enable-socket-misdn],
59                               [use socket connection to misdn kernel code (default=disable)])
60               ],
61               [use_misdn_socket="yes"],
62               [use_misdn_socket="no"]
63              )
64 AM_CONDITIONAL(ENABLE_SOCKET_MISDN, test "x$use_misdn_socket" == "xyes" )
65
66 # check for asterisk
67 AC_ARG_WITH([asterisk],
68         [AS_HELP_STRING([--with-asterisk],
69                         [compile with built-in Asterisk channel driver @<:@default=no@:>@])
70         ],
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" )
74
75 # check for crypto
76 AC_ARG_WITH([ssl],
77         [AS_HELP_STRING([--with-ssl],
78                         [compile with ssl support (libcrypto) @<:@default=check@:>@])
79         ],
80         [],
81         [with_ssl=check])
82 LIBCRYPTO=
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])
89                     ],
90                     [if test "x$with_ssl" != xcheck ; then
91                       AC_MSG_FAILURE(
92                         [--with-ssl was given, but test for libcrypto failed])
93                      fi
94                     ],
95                     -lcrypto
96                    )
97       ]
98      )
99 AM_CONDITIONAL(WITH_CRYPTO, test "x$LIBCRYPTO" == "x-lcrypto" )
100
101 # check for isdn_net.h
102 # check for mISDNlib.h
103 # --with-isdn_net-include=<include>, default: env MISDNUSER= , $include/mISDNuser
104
105 # self written test for mISDNuser lib
106 AC_PATH_MISDNUSER
107
108 # self written test for mISDN kernel header
109 AC_PATH_MISDNKERNEL
110
111
112
113
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])
131
132 # Checks for header files.
133 AC_HEADER_DIRENT
134 AC_HEADER_STDC
135 AC_HEADER_SYS_WAIT
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])
137 AC_HEADER_ASSERT
138
139 # Checks for typedefs, structures, and compiler characteristics.
140 AC_HEADER_STDBOOL
141 AC_C_CONST
142 AC_C_INLINE
143 AC_TYPE_PID_T
144 AC_HEADER_TIME
145 AC_STRUCT_TM
146
147 # Checks for library functions.
148 AC_FUNC_FORK
149 AC_PROG_GCC_TRADITIONAL
150 AC_FUNC_LSTAT
151 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
152 AC_FUNC_MALLOC
153 AC_FUNC_MEMCMP
154 AC_TYPE_SIGNAL
155 AC_FUNC_STRNLEN
156 AC_FUNC_STRTOD
157 AC_FUNC_VPRINTF
158 AC_CHECK_FUNCS([gettimeofday memmove memset mkdir socket strcasecmp strchr strerror strncasecmp strstr strtol strtoul])
159
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)
165
166 AC_CONFIG_FILES([Makefile])
167 AC_OUTPUT