2 # Process this file with autoconf to produce a configure script.
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])
10 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
16 # Checks for programs.
20 AC_CONFIG_MACRO_DIR([m4])
22 PKG_CHECK_MODULES([SD_DAEMON],
24 [AC_DEFINE([HAVE_SYSTEMD_DAEMON])],
25 [AC_MSG_NOTICE([Systemd socket activation won't be enabled])])
26 AC_SUBST([SD_DAEMON_LIBS])
27 AC_SUBST([SD_DAEMON_CFLAGS])
29 applyhash='CFLAGS+= -DLWS_LIBRARY_VERSION=\"$(PACKAGE_VERSION)\" -DLWS_BUILD_HASH=\"${shell git log -n 1 --pretty=%h}\"'
31 AM_SUBST_NOTMAKE([applyhash])
33 # Check for existance of the inline keyword.
39 AC_ARG_ENABLE(openssl,
40 [ --enable-openssl Enables https support and needs openssl libs],
44 if test "x$openssl" = "xyes" ; then
45 AC_CHECK_LIB([ssl], [SSL_library_init])
46 CFLAGS="$CFLAGS -DLWS_OPENSSL_SUPPORT"
52 AC_ARG_ENABLE(libcrypto,
53 [ --enable-libcrypto Use libcrypto MD5 and SHA1 implementations],
57 if test "x$libcrypto" = "xyes" ; then
58 CFLAGS="$CFLAGS -DLWS_LIBCRYPTO"
59 LDFLAGS="$LDFLAGS -lcrypto"
61 AM_CONDITIONAL(LIBCRYPTO, test x$libcrypto = xyes)
67 [ --without-testapps dont build the libwebsocket-test- apps],
71 AM_CONDITIONAL(NO_TESTAPPS, test x$no_testapps = xyes)
77 [ --without-client dont build the client part of the library ],
81 if test "x$no_client" = "xyes" ; then
82 CFLAGS="$CFLAGS -DLWS_NO_CLIENT"
84 AM_CONDITIONAL(NO_CLIENT, test x$no_client = xyes)
90 [ --without-server dont build the client part of the library ],
94 if test "x$no_server" = "xyes" ; then
95 CFLAGS="$CFLAGS -DLWS_NO_SERVER"
97 AM_CONDITIONAL(NO_SERVER, test x$no_server = xyes)
102 AC_ARG_WITH(extensions,
103 [ --without-extensions dont build any stuff related to extensions ],
107 if test "x$no_extensions" = "xyes" ; then
108 CFLAGS="$CFLAGS -DLWS_NO_EXTENSIONS"
110 AM_CONDITIONAL(NO_EXTENSIONS, test x$no_extensions = xyes)
116 [ --with-latency Build latency measuring code into the library ],
120 if test "x$latency" = "xyes" ; then
121 CFLAGS="$CFLAGS -DLWS_LATENCY"
123 AM_CONDITIONAL(LATENCY, test x$latency = xyes)
128 AC_ARG_WITH(daemonize,
129 [ --without-daemonize dont build the daemonization api ],
133 if test "x$no_daemonize" = "xyes" ; then
134 CFLAGS="$CFLAGS -DLWS_NO_DAEMONIZE"
136 AM_CONDITIONAL(NO_DAEMONIZE, test x$no_daemonize = xyes)
142 [ --enable-mingw Using mingw compilers, disables ping test build],
147 if test "x$mingw" = "xyes" ; then
148 CFLAGS="$CFLAGS -DLWS_MINGW_SUPPORT"
150 AM_CONDITIONAL(MINGW, test x$mingw = xyes)
155 AC_ARG_WITH([client-cert-dir],
156 [AS_HELP_STRING([--with-client-cert-dir],[directory containing client certs, defaults to /etc/pki/tls/certs/])],
157 [clientcertdir=$withval],
158 [clientcertdir=/etc/pki/tls/certs/]
160 AC_SUBST([clientcertdir])
168 AC_ARG_ENABLE(noping,
169 [ --enable-noping Do not build ping test app, which has some unixy stuff in sources],
173 AM_CONDITIONAL(NOPING, test x$noping = xyes)
179 [ --disable-debug Stops debug-related code from even being compiled in, useful for best speed],
183 if test "x$disable_debug" != "xyes" ; then
184 CFLAGS="$CFLAGS -D_DEBUG"
186 AM_CONDITIONAL(DISABLE_DEBUG, test x$disable_debug = xyes)
192 AC_ARG_ENABLE(builtin-getifaddrs,
193 [ --enable-builtin-getifaddrs Use BSD getifaddrs implementation from libwebsockets... default is your libc provides it],
194 [ builtin_getifaddrs=yes
196 if test "x$builtin-getifaddrs" = "xyes" ; then
197 CFLAGS="$CFLAGS -DLWS_BUILTIN_GETIFADDRS"
199 AM_CONDITIONAL(USE_BUILTIN_GETIFADDRS, test x$builtin_getifaddrs = xyes)
205 [ --with-cyassl Use CyaSSL instead of OpenSSL ],
209 if test "x$use_cyassl" = "xyes" ; then
210 CFLAGS="$CFLAGS -DUSE_CYASSL -DLWS_OPENSSL_SUPPORT"
212 AM_CONDITIONAL(USE_CYASSL, test x$use_cyassl = xyes)
215 # Checks for header files.
216 AC_CHECK_HEADERS([zlib.h fcntl.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h sys/prctl.h])
218 # Checks for typedefs, structures, and compiler characteristics.
221 # Checks for library functions.
225 AC_CHECK_FUNCS([bzero memset socket strerror])
227 AC_CONFIG_FILES([Makefile
229 test-server/Makefile])