remove current_alloc_len
[profile/ivi/libwebsockets.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.61])
5 AC_INIT(libwebsockets, 1.2, andy@warmcat.com, libwebsockets, http://libwebsockets.org)
6 AC_CONFIG_SRCDIR([test-server/test-server.c])
7 AC_CONFIG_HEADERS([config.h])
8
9 : ${CFLAGS=""}
10 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
11 AM_PROG_AR
12 LT_INIT(shared)
13
14 #AX_PTHREAD
15
16 # Checks for programs.
17 AM_PROG_CC_C_O
18 AC_PROG_INSTALL
19 AC_PROG_MAKE_SET
20 AC_CONFIG_MACRO_DIR([m4])
21
22 applyhash='CFLAGS+= -DLWS_LIBRARY_VERSION=\"$(PACKAGE_VERSION)\" -DLWS_BUILD_HASH=\"${shell git log -n 1 --pretty=%h}\"'
23 AC_SUBST([applyhash])
24 AM_SUBST_NOTMAKE([applyhash])
25
26 # Check for existance of the inline keyword.
27 AC_C_INLINE
28
29 #
30 #
31 #
32 AC_ARG_ENABLE(openssl,
33  [  --enable-openssl  Enables https support and needs openssl libs],
34  [ openssl=yes
35  ])
36
37 if test "x$openssl" = "xyes" ; then
38 AC_CHECK_LIB([ssl], [SSL_library_init])
39 CFLAGS="$CFLAGS -DLWS_OPENSSL_SUPPORT"
40 fi
41
42 #
43 #
44 #
45 AC_ARG_ENABLE(libcrypto,
46  [  --enable-libcrypto  Use libcrypto MD5 and SHA1 implementations],
47  [ libcrypto=yes
48  ])
49
50 if test "x$libcrypto" = "xyes" ; then
51 CFLAGS="$CFLAGS -DLWS_LIBCRYPTO"
52 LDFLAGS="$LDFLAGS -lcrypto"
53 fi
54 AM_CONDITIONAL(LIBCRYPTO, test x$libcrypto = xyes)
55
56
57 #
58 #
59 AC_ARG_WITH(testapps,
60  [  --without-testapps  dont build the libwebsocket-test- apps],
61  [ no_testapps=yes
62  ])
63
64 AM_CONDITIONAL(NO_TESTAPPS, test x$no_testapps = xyes)
65
66
67 #
68 #
69 AC_ARG_WITH(client,
70  [  --without-client  dont build the client part of the library ],
71  [ no_client=yes
72  ])
73
74 if test "x$no_client" = "xyes" ; then                                             
75 CFLAGS="$CFLAGS -DLWS_NO_CLIENT"                                          
76 fi
77 AM_CONDITIONAL(NO_CLIENT, test x$no_client = xyes)
78
79
80 #
81 #
82 AC_ARG_WITH(server,
83  [  --without-server  dont build the client part of the library ],
84  [ no_server=yes
85  ])
86
87 if test "x$no_server" = "xyes" ; then                                             
88 CFLAGS="$CFLAGS -DLWS_NO_SERVER"                                          
89 fi
90 AM_CONDITIONAL(NO_SERVER, test x$no_server = xyes)
91
92
93 #
94 #
95 AC_ARG_WITH(extensions,
96  [  --without-extensions  dont build any stuff related to extensions ],
97  [ no_extensions=yes
98  ])
99
100 if test "x$no_extensions" = "xyes" ; then                                             
101 CFLAGS="$CFLAGS -DLWS_NO_EXTENSIONS"                                          
102 fi
103 AM_CONDITIONAL(NO_EXTENSIONS, test x$no_extensions = xyes)
104
105
106 #
107 #
108 AC_ARG_WITH(latency,
109  [  --with-latency  Build latency measuring code into the library ],
110  [ latency=yes
111  ])
112
113 if test "x$latency" = "xyes" ; then                                             
114 CFLAGS="$CFLAGS -DLWS_LATENCY"                                          
115 fi
116 AM_CONDITIONAL(LATENCY, test x$latency = xyes)
117
118
119 #
120 #
121 AC_ARG_WITH(daemonize,
122  [  --without-daemonize  dont build the daemonization api ],
123  [ no_daemonize=yes
124  ])
125
126 if test "x$no_daemonize" = "xyes" ; then                                             
127 CFLAGS="$CFLAGS -DLWS_NO_DAEMONIZE"                                          
128 fi
129 AM_CONDITIONAL(NO_DAEMONIZE, test x$no_daemonize = xyes)
130
131 #                                                                               
132 #                                                                               
133 #                                                                               
134 AC_ARG_ENABLE(mingw,                                                          
135  [  --enable-mingw  Using mingw compilers, disables ping test build],            
136  [ mingw=yes
137    noping=yes
138  ])                                                                             
139                                                                                 
140 if test "x$mingw" = "xyes" ; then                                             
141 CFLAGS="$CFLAGS -DLWS_MINGW_SUPPORT"                                          
142 fi
143 AM_CONDITIONAL(MINGW, test x$mingw = xyes)
144
145 #
146 #
147 #
148 AC_ARG_WITH([client-cert-dir],
149 [AS_HELP_STRING([--with-client-cert-dir],[directory containing client certs, defaults to /etc/pki/tls/certs/])],
150 [clientcertdir=$withval],
151 [clientcertdir=/etc/pki/tls/certs/]
152 )
153 AC_SUBST([clientcertdir])
154
155 AC_SUBST([CFLAGS])
156
157
158 #
159 #
160 #
161 AC_ARG_ENABLE(noping,
162  [  --enable-noping  Do not build ping test app, which has some unixy stuff in sources],
163  [ noping=yes
164  ])
165
166 AM_CONDITIONAL(NOPING, test x$noping = xyes)
167
168 #
169 #
170 #
171 AC_ARG_ENABLE(debug,
172  [  --disable-debug  Stops debug-related code from even being compiled in, useful for best speed],
173  [ disable_debug=yes
174  ])
175
176 if test "x$disable_debug" != "xyes" ; then
177 CFLAGS="$CFLAGS -D_DEBUG"
178 fi
179 AM_CONDITIONAL(DISABLE_DEBUG, test x$disable_debug = xyes)
180
181
182 #
183 #
184 #
185 AC_ARG_ENABLE(builtin-getifaddrs,
186  [  --enable-builtin-getifaddrs  Use BSD getifaddrs implementation from libwebsockets... default is your libc provides it],
187  [ builtin_getifaddrs=yes
188  ])
189 if test "x$builtin-getifaddrs" = "xyes" ; then
190 CFLAGS="$CFLAGS -DLWS_BUILTIN_GETIFADDRS"
191 fi
192 AM_CONDITIONAL(USE_BUILTIN_GETIFADDRS, test x$builtin_getifaddrs = xyes)
193
194
195 #
196 #
197 AC_ARG_WITH(cyassl,
198  [  --with-cyassl  Use CyaSSL instead of OpenSSL ],
199  [ use_cyassl=yes
200  ])
201
202 if test "x$use_cyassl" = "xyes" ; then                                     
203 CFLAGS="$CFLAGS -DUSE_CYASSL -DLWS_OPENSSL_SUPPORT"
204 fi
205 AM_CONDITIONAL(USE_CYASSL, test x$use_cyassl = xyes)
206
207
208 # Checks for header files.
209 AC_CHECK_HEADERS([zlib.h fcntl.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h sys/prctl.h])
210
211 # Checks for typedefs, structures, and compiler characteristics.
212 AC_TYPE_SIZE_T
213
214 # Checks for library functions.
215
216 AC_FUNC_MALLOC
217 AC_FUNC_REALLOC
218 AC_CHECK_FUNCS([bzero memset socket strerror])
219
220 AC_CONFIG_FILES([Makefile
221                  lib/Makefile
222                  test-server/Makefile])
223
224 AC_OUTPUT([
225 libwebsockets.pc
226 ])