2 # Process this file with autoconf to produce a configure script.
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])
10 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
16 # Checks for programs.
20 AC_CONFIG_MACRO_DIR([m4])
22 applyhash='CFLAGS+= -DLWS_LIBRARY_VERSION=\"$(PACKAGE_VERSION)\" -DLWS_BUILD_HASH=\"${shell git log -n 1 --pretty=%h}\"'
24 AM_SUBST_NOTMAKE([applyhash])
26 # Check for existance of the inline keyword.
32 AC_ARG_ENABLE(openssl,
33 [ --enable-openssl Enables https support and needs openssl libs],
37 if test "x$openssl" = "xyes" ; then
38 AC_CHECK_LIB([ssl], [SSL_library_init])
39 CFLAGS="$CFLAGS -DLWS_OPENSSL_SUPPORT"
45 AC_ARG_ENABLE(libcrypto,
46 [ --enable-libcrypto Use libcrypto MD5 and SHA1 implementations],
50 if test "x$libcrypto" = "xyes" ; then
51 CFLAGS="$CFLAGS -DLWS_LIBCRYPTO"
52 LDFLAGS="$LDFLAGS -lcrypto"
54 AM_CONDITIONAL(LIBCRYPTO, test x$libcrypto = xyes)
60 [ --without-testapps dont build the libwebsocket-test- apps],
64 AM_CONDITIONAL(NO_TESTAPPS, test x$no_testapps = xyes)
70 [ --without-client dont build the client part of the library ],
74 if test "x$no_client" = "xyes" ; then
75 CFLAGS="$CFLAGS -DLWS_NO_CLIENT"
77 AM_CONDITIONAL(NO_CLIENT, test x$no_client = xyes)
83 [ --without-server dont build the client part of the library ],
87 if test "x$no_server" = "xyes" ; then
88 CFLAGS="$CFLAGS -DLWS_NO_SERVER"
90 AM_CONDITIONAL(NO_SERVER, test x$no_server = xyes)
95 AC_ARG_WITH(extensions,
96 [ --without-extensions dont build any stuff related to extensions ],
100 if test "x$no_extensions" = "xyes" ; then
101 CFLAGS="$CFLAGS -DLWS_NO_EXTENSIONS"
103 AM_CONDITIONAL(NO_EXTENSIONS, test x$no_extensions = xyes)
109 [ --with-latency Build latency measuring code into the library ],
113 if test "x$latency" = "xyes" ; then
114 CFLAGS="$CFLAGS -DLWS_LATENCY"
116 AM_CONDITIONAL(LATENCY, test x$latency = xyes)
121 AC_ARG_WITH(daemonize,
122 [ --without-daemonize dont build the daemonization api ],
126 if test "x$no_daemonize" = "xyes" ; then
127 CFLAGS="$CFLAGS -DLWS_NO_DAEMONIZE"
129 AM_CONDITIONAL(NO_DAEMONIZE, test x$no_daemonize = xyes)
135 [ --enable-mingw Using mingw compilers, disables ping test build],
140 if test "x$mingw" = "xyes" ; then
141 CFLAGS="$CFLAGS -DLWS_MINGW_SUPPORT"
143 AM_CONDITIONAL(MINGW, test x$mingw = xyes)
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/]
153 AC_SUBST([clientcertdir])
161 AC_ARG_ENABLE(noping,
162 [ --enable-noping Do not build ping test app, which has some unixy stuff in sources],
166 AM_CONDITIONAL(NOPING, test x$noping = xyes)
172 [ --disable-debug Stops debug-related code from even being compiled in, useful for best speed],
176 if test "x$disable_debug" != "xyes" ; then
177 CFLAGS="$CFLAGS -D_DEBUG"
179 AM_CONDITIONAL(DISABLE_DEBUG, test x$disable_debug = xyes)
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
189 if test "x$builtin-getifaddrs" = "xyes" ; then
190 CFLAGS="$CFLAGS -DLWS_BUILTIN_GETIFADDRS"
192 AM_CONDITIONAL(USE_BUILTIN_GETIFADDRS, test x$builtin_getifaddrs = xyes)
198 [ --with-cyassl Use CyaSSL instead of OpenSSL ],
202 if test "x$use_cyassl" = "xyes" ; then
203 CFLAGS="$CFLAGS -DUSE_CYASSL -DLWS_OPENSSL_SUPPORT"
205 AM_CONDITIONAL(USE_CYASSL, test x$use_cyassl = xyes)
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])
211 # Checks for typedefs, structures, and compiler characteristics.
214 # Checks for library functions.
218 AC_CHECK_FUNCS([bzero memset socket strerror])
220 AC_CONFIG_FILES([Makefile
222 test-server/Makefile])