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"
38 [ --enable-nofork Disables fork-related options],
42 if test "x$nofork" = "xyes" ; then
43 CFLAGS="$CFLAGS -DLWS_NO_FORK"
51 AC_ARG_ENABLE(libcrypto,
52 [ --enable-libcrypto Use libcrypto MD5 and SHA1 implementations],
56 if test "x$libcrypto" = "xyes" ; then
57 CFLAGS="$CFLAGS -DLWS_LIBCRYPTO"
58 LDFLAGS="$LDFLAGS -lcrypto"
60 AM_CONDITIONAL(LIBCRYPTO, test x$libcrypto = xyes)
66 [ --without-testapps dont build the libwebsocket-test- apps],
70 AM_CONDITIONAL(NO_TESTAPPS, test x$no_testapps = xyes)
76 [ --without-client dont build the client part of the library ],
80 if test "x$no_client" = "xyes" ; then
81 CFLAGS="$CFLAGS -DLWS_NO_CLIENT"
83 AM_CONDITIONAL(NO_CLIENT, test x$no_client = xyes)
89 [ --without-server dont build the client part of the library ],
93 if test "x$no_server" = "xyes" ; then
94 CFLAGS="$CFLAGS -DLWS_NO_SERVER"
96 AM_CONDITIONAL(NO_SERVER, test x$no_server = xyes)
101 AC_ARG_WITH(extensions,
102 [ --without-extensions dont build any stuff related to extensions ],
106 if test "x$no_extensions" = "xyes" ; then
107 CFLAGS="$CFLAGS -DLWS_NO_EXTENSIONS"
109 AM_CONDITIONAL(NO_EXTENSIONS, test x$no_extensions = xyes)
114 AC_ARG_WITH(daemonize,
115 [ --without-daemonize dont build the daemonization api ],
119 if test "x$no_daemonize" = "xyes" ; then
120 CFLAGS="$CFLAGS -DLWS_NO_DAEMONIZE"
122 AM_CONDITIONAL(NO_DAEMONIZE, test x$no_daemonize = xyes)
128 [ --enable-mingw Using mingw compilers, disables ping test build],
133 if test "x$mingw" = "xyes" ; then
134 CFLAGS="$CFLAGS -DLWS_MINGW_SUPPORT"
136 AM_CONDITIONAL(MINGW, test x$mingw = xyes)
141 AC_ARG_WITH([client-cert-dir],
142 [AS_HELP_STRING([--with-client-cert-dir],[directory containing client certs, defaults to /etc/pki/tls/certs/])],
143 [clientcertdir=$withval],
144 [clientcertdir=/etc/pki/tls/certs/]
146 AC_SUBST([clientcertdir])
154 AC_ARG_ENABLE(noping,
155 [ --enable-noping Do not build ping test app, which has some unixy stuff in sources],
159 AM_CONDITIONAL(NOPING, test x$noping = xyes)
165 [ --disable-debug Stops debug-related code from even being compiled in, useful for best speed],
169 if test "x$disable_debug" != "xyes" ; then
170 CFLAGS="$CFLAGS -D_DEBUG"
172 AM_CONDITIONAL(DISABLE_DEBUG, test x$disable_debug = xyes)
178 AC_ARG_ENABLE(builtin-getifaddrs,
179 [ --enable-builtin-getifaddrs Use BSD getifaddrs implementation from libwebsockets... default is your libc provides it],
180 [ builtin_getifaddrs=yes
182 if test "x$builtin-getifaddrs" = "xyes" ; then
183 CFLAGS="$CFLAGS -DLWS_BUILTIN_GETIFADDRS"
185 AM_CONDITIONAL(USE_BUILTIN_GETIFADDRS, test x$builtin_getifaddrs = xyes)
189 # Checks for header files.
190 AC_CHECK_HEADERS([zlib.h fcntl.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h sys/prctl.h])
192 # Checks for typedefs, structures, and compiler characteristics.
195 # Checks for library functions.
199 AC_CHECK_FUNCS([bzero memset socket strerror])
201 AC_CONFIG_FILES([Makefile
203 test-server/Makefile])