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