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])
9 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
15 # Checks for programs.
19 AC_CONFIG_MACRO_DIR([m4])
21 applyhash='CFLAGS+= -DLWS_LIBRARY_VERSION=\"$(PACKAGE_VERSION)\" -DLWS_BUILD_HASH=\"${shell git log -n 1 --pretty=%h}\"'
23 AM_SUBST_NOTMAKE([applyhash])
25 # Check for existance of the inline keyword.
31 AC_ARG_ENABLE(openssl,
32 [ --enable-openssl Enables https support and needs openssl libs],
36 if test "x$openssl" = "xyes" ; then
37 AC_CHECK_LIB([ssl], [SSL_library_init])
38 CFLAGS="$CFLAGS -DLWS_OPENSSL_SUPPORT"
44 AC_ARG_ENABLE(libcrypto,
45 [ --enable-libcrypto Use libcrypto MD5 and SHA1 implementations],
49 if test "x$libcrypto" = "xyes" ; then
50 CFLAGS="$CFLAGS -DLWS_LIBCRYPTO"
51 LDFLAGS="$LDFLAGS -lcrypto"
53 AM_CONDITIONAL(LIBCRYPTO, test x$libcrypto = xyes)
59 [ --without-testapps dont build the libwebsocket-test- apps],
63 AM_CONDITIONAL(NO_TESTAPPS, test x$no_testapps = xyes)
69 [ --without-client dont build the client part of the library ],
73 if test "x$no_client" = "xyes" ; then
74 CFLAGS="$CFLAGS -DLWS_NO_CLIENT"
76 AM_CONDITIONAL(NO_CLIENT, test x$no_client = xyes)
82 [ --without-server dont build the client part of the library ],
86 if test "x$no_server" = "xyes" ; then
87 CFLAGS="$CFLAGS -DLWS_NO_SERVER"
89 AM_CONDITIONAL(NO_SERVER, test x$no_server = xyes)
94 AC_ARG_WITH(extensions,
95 [ --without-extensions dont build any stuff related to extensions ],
99 if test "x$no_extensions" = "xyes" ; then
100 CFLAGS="$CFLAGS -DLWS_NO_EXTENSIONS"
102 AM_CONDITIONAL(NO_EXTENSIONS, test x$no_extensions = xyes)
108 [ --with-latency Build latency measuring code into the library ],
112 if test "x$latency" = "xyes" ; then
113 CFLAGS="$CFLAGS -DLWS_LATENCY"
115 AM_CONDITIONAL(LATENCY, test x$latency = xyes)
120 AC_ARG_WITH(daemonize,
121 [ --without-daemonize dont build the daemonization api ],
125 if test "x$no_daemonize" = "xyes" ; then
126 CFLAGS="$CFLAGS -DLWS_NO_DAEMONIZE"
128 AM_CONDITIONAL(NO_DAEMONIZE, test x$no_daemonize = xyes)
134 [ --enable-mingw Using mingw compilers, disables ping test build],
139 if test "x$mingw" = "xyes" ; then
140 CFLAGS="$CFLAGS -DLWS_MINGW_SUPPORT"
142 AM_CONDITIONAL(MINGW, test x$mingw = xyes)
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/]
152 AC_SUBST([clientcertdir])
160 AC_ARG_ENABLE(noping,
161 [ --enable-noping Do not build ping test app, which has some unixy stuff in sources],
165 AM_CONDITIONAL(NOPING, test x$noping = xyes)
171 [ --disable-debug Stops debug-related code from even being compiled in, useful for best speed],
175 if test "x$disable_debug" != "xyes" ; then
176 CFLAGS="$CFLAGS -D_DEBUG"
178 AM_CONDITIONAL(DISABLE_DEBUG, test x$disable_debug = xyes)
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
188 if test "x$builtin-getifaddrs" = "xyes" ; then
189 CFLAGS="$CFLAGS -DLWS_BUILTIN_GETIFADDRS"
191 AM_CONDITIONAL(USE_BUILTIN_GETIFADDRS, test x$builtin_getifaddrs = xyes)
197 [ --with-cyassl Use CyaSSL instead of OpenSSL ],
201 if test "x$use_cyassl" = "xyes" ; then
202 CFLAGS="$CFLAGS -DUSE_CYASSL -DLWS_OPENSSL_SUPPORT"
204 AM_CONDITIONAL(USE_CYASSL, test x$use_cyassl = xyes)
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])
210 # Checks for typedefs, structures, and compiler characteristics.
213 # Checks for library functions.
217 AC_CHECK_FUNCS([bzero memset socket strerror])
219 AC_CONFIG_FILES([Makefile
221 test-server/Makefile])