2 # Process this file with autoconf to produce a configure script.
5 AC_INIT(libwebsockets, 1.0, andy@warmcat.com)
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])
24 AC_ARG_ENABLE(openssl,
25 [ --enable-openssl Enables https support and needs openssl libs],
29 if test "x$openssl" = "xyes" ; then
30 AC_CHECK_LIB([ssl], [SSL_library_init])
31 CFLAGS="$CFLAGS -DLWS_OPENSSL_SUPPORT"
37 AC_ARG_ENABLE(libcrypto,
38 [ --enable-libcrypto Use libcrypto MD5 and SHA1 implementations],
42 if test "x$libcrypto" = "xyes" ; then
43 CFLAGS="$CFLAGS -DLWS_LIBCRYPTO"
44 LDFLAGS="$LDFLAGS -lcrypto"
46 AM_CONDITIONAL(LIBCRYPTO, test x$libcrypto = xyes)
52 [ --without-testapps dont build the libwebsocket-test- apps],
56 AM_CONDITIONAL(NO_TESTAPPS, test x$no_testapps = xyes)
62 [ --without-client dont build the client part of the library ],
66 if test "x$no_client" = "xyes" ; then
67 CFLAGS="$CFLAGS -DLWS_NO_CLIENT"
69 AM_CONDITIONAL(NO_CLIENT, test x$no_client = xyes)
75 [ --without-server dont build the client part of the library ],
79 if test "x$no_server" = "xyes" ; then
80 CFLAGS="$CFLAGS -DLWS_NO_SERVER"
82 AM_CONDITIONAL(NO_SERVER, test x$no_server = xyes)
87 AC_ARG_WITH(extensions,
88 [ --without-extensions dont build any stuff related to extensions ],
92 if test "x$no_extensions" = "xyes" ; then
93 CFLAGS="$CFLAGS -DLWS_NO_EXTENSIONS"
95 AM_CONDITIONAL(NO_EXTENSIONS, test x$no_extensions = xyes)
101 [ --with-latency Build latency measuring code into the library ],
105 if test "x$latency" = "xyes" ; then
106 CFLAGS="$CFLAGS -DLWS_LATENCY"
108 AM_CONDITIONAL(LATENCY, test x$latency = xyes)
113 AC_ARG_WITH(daemonize,
114 [ --without-daemonize dont build the daemonization api ],
118 if test "x$no_daemonize" = "xyes" ; then
119 CFLAGS="$CFLAGS -DLWS_NO_DAEMONIZE"
121 AM_CONDITIONAL(NO_DAEMONIZE, test x$no_daemonize = xyes)
127 [ --enable-mingw Using mingw compilers, disables ping test build],
132 if test "x$mingw" = "xyes" ; then
133 CFLAGS="$CFLAGS -DLWS_MINGW_SUPPORT"
135 AM_CONDITIONAL(MINGW, test x$mingw = xyes)
140 AC_ARG_WITH([client-cert-dir],
141 [AS_HELP_STRING([--with-client-cert-dir],[directory containing client certs, defaults to /etc/pki/tls/certs/])],
142 [clientcertdir=$withval],
143 [clientcertdir=/etc/pki/tls/certs/]
145 AC_SUBST([clientcertdir])
153 AC_ARG_ENABLE(noping,
154 [ --enable-noping Do not build ping test app, which has some unixy stuff in sources],
158 AM_CONDITIONAL(NOPING, test x$noping = xyes)
164 [ --disable-debug Stops debug-related code from even being compiled in, useful for best speed],
168 if test "x$disable_debug" != "xyes" ; then
169 CFLAGS="$CFLAGS -D_DEBUG"
171 AM_CONDITIONAL(DISABLE_DEBUG, test x$disable_debug = xyes)
177 AC_ARG_ENABLE(builtin-getifaddrs,
178 [ --enable-builtin-getifaddrs Use BSD getifaddrs implementation from libwebsockets... default is your libc provides it],
179 [ builtin_getifaddrs=yes
181 if test "x$builtin-getifaddrs" = "xyes" ; then
182 CFLAGS="$CFLAGS -DLWS_BUILTIN_GETIFADDRS"
184 AM_CONDITIONAL(USE_BUILTIN_GETIFADDRS, test x$builtin_getifaddrs = xyes)
188 # Checks for header files.
189 AC_CHECK_HEADERS([zlib.h fcntl.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h sys/prctl.h])
191 # Checks for typedefs, structures, and compiler characteristics.
194 # Checks for library functions.
198 AC_CHECK_FUNCS([bzero memset socket strerror])
200 AC_CONFIG_FILES([Makefile
202 test-server/Makefile])