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