fixed dialing-bug when dialing chan_lcr
[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 # check for asterisk
54 AC_ARG_WITH([asterisk],
55         [AS_HELP_STRING([--with-asterisk],
56                         [compile with built-in Asterisk channel driver @<:@default=no@:>@])
57         ],
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" )
61
62 # check for crypto
63 AC_ARG_WITH([ssl],
64         [AS_HELP_STRING([--with-ssl],
65                         [compile with ssl support (libcrypto) @<:@default=check@:>@])
66         ],
67         [],
68         [with_ssl=check])
69 LIBCRYPTO=
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])
76                     ],
77                     [if test "x$with_ssl" != xcheck ; then
78                       AC_MSG_FAILURE(
79                         [--with-ssl was given, but test for libcrypto failed])
80                      fi
81                     ],
82                     -lcrypto
83                    )
84       ]
85      )
86 AM_CONDITIONAL(WITH_CRYPTO, test "x$LIBCRYPTO" == "x-lcrypto" )
87
88 # self written test for mISDNuser lib
89 AC_PATH_MISDNUSER
90
91 # self written test for mISDN kernel header
92 AC_PATH_MISDNKERNEL
93
94
95
96
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])
114
115 # Checks for header files.
116 AC_HEADER_DIRENT
117 AC_HEADER_STDC
118 AC_HEADER_SYS_WAIT
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])
120 AC_HEADER_ASSERT
121
122 # Checks for typedefs, structures, and compiler characteristics.
123 AC_HEADER_STDBOOL
124 AC_C_CONST
125 AC_C_INLINE
126 AC_TYPE_PID_T
127 AC_HEADER_TIME
128 AC_STRUCT_TM
129
130 # Checks for library functions.
131 AC_FUNC_FORK
132 AC_PROG_GCC_TRADITIONAL
133 AC_FUNC_LSTAT
134 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
135 AC_FUNC_MALLOC
136 AC_FUNC_MEMCMP
137 AC_TYPE_SIGNAL
138 AC_FUNC_STRNLEN
139 AC_FUNC_STRTOD
140 AC_FUNC_VPRINTF
141 AC_CHECK_FUNCS([gettimeofday memmove memset mkdir socket strcasecmp strchr strerror strncasecmp strstr strtol strtoul])
142
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)
148
149 AC_CONFIG_FILES([Makefile])
150 AC_OUTPUT