2010-11-08 17:04:09 +00:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
2013-01-09 15:16:52 +08:00
|
|
|
AC_PREREQ([2.61])
|
2013-01-31 10:12:52 +08:00
|
|
|
AC_INIT(libwebsockets, 1.1, andy@warmcat.com)
|
2010-11-08 17:04:09 +00:00
|
|
|
AC_CONFIG_SRCDIR([test-server/test-server.c])
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
|
|
|
|
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
|
2013-01-10 12:36:59 +08:00
|
|
|
AM_PROG_AR
|
2010-11-08 17:04:09 +00:00
|
|
|
LT_INIT(shared)
|
|
|
|
|
2010-12-18 15:13:50 +00:00
|
|
|
#AX_PTHREAD
|
|
|
|
|
2010-11-08 17:04:09 +00:00
|
|
|
# Checks for programs.
|
2012-10-06 15:17:01 +08:00
|
|
|
AM_PROG_CC_C_O
|
2010-11-08 17:04:09 +00:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2011-01-27 06:26:52 +00:00
|
|
|
|
2011-01-23 17:47:08 +00:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
2010-11-08 17:04:09 +00:00
|
|
|
AC_ARG_ENABLE(openssl,
|
|
|
|
[ --enable-openssl Enables https support and needs openssl libs],
|
|
|
|
[ openssl=yes
|
|
|
|
])
|
|
|
|
|
|
|
|
if test "x$openssl" = "xyes" ; then
|
|
|
|
AC_CHECK_LIB([ssl], [SSL_library_init])
|
|
|
|
CFLAGS="$CFLAGS -DLWS_OPENSSL_SUPPORT"
|
|
|
|
fi
|
|
|
|
|
2011-01-23 17:47:08 +00:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(libcrypto,
|
2011-01-27 06:26:52 +00:00
|
|
|
[ --enable-libcrypto Use libcrypto MD5 and SHA1 implementations],
|
2011-01-23 17:47:08 +00:00
|
|
|
[ libcrypto=yes
|
|
|
|
])
|
|
|
|
|
|
|
|
if test "x$libcrypto" = "xyes" ; then
|
|
|
|
CFLAGS="$CFLAGS -DLWS_LIBCRYPTO"
|
|
|
|
LDFLAGS="$LDFLAGS -lcrypto"
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(LIBCRYPTO, test x$libcrypto = xyes)
|
|
|
|
|
2013-01-15 19:57:06 +08:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
AC_ARG_WITH(testapps,
|
|
|
|
[ --without-testapps dont build the libwebsocket-test- apps],
|
|
|
|
[ no_testapps=yes
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL(NO_TESTAPPS, test x$no_testapps = xyes)
|
|
|
|
|
2013-01-16 11:47:40 +08:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
AC_ARG_WITH(client,
|
|
|
|
[ --without-client dont build the client part of the library ],
|
|
|
|
[ no_client=yes
|
|
|
|
])
|
|
|
|
|
|
|
|
if test "x$no_client" = "xyes" ; then
|
|
|
|
CFLAGS="$CFLAGS -DLWS_NO_CLIENT"
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(NO_CLIENT, test x$no_client = xyes)
|
2013-01-15 19:57:06 +08:00
|
|
|
|
2013-01-18 11:43:21 +08:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
AC_ARG_WITH(server,
|
|
|
|
[ --without-server dont build the client part of the library ],
|
|
|
|
[ no_server=yes
|
|
|
|
])
|
|
|
|
|
|
|
|
if test "x$no_server" = "xyes" ; then
|
|
|
|
CFLAGS="$CFLAGS -DLWS_NO_SERVER"
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(NO_SERVER, test x$no_server = xyes)
|
|
|
|
|
2013-01-20 17:08:31 +08:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
AC_ARG_WITH(extensions,
|
|
|
|
[ --without-extensions dont build any stuff related to extensions ],
|
|
|
|
[ no_extensions=yes
|
|
|
|
])
|
2013-01-18 11:43:21 +08:00
|
|
|
|
2013-01-20 17:08:31 +08:00
|
|
|
if test "x$no_extensions" = "xyes" ; then
|
|
|
|
CFLAGS="$CFLAGS -DLWS_NO_EXTENSIONS"
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(NO_EXTENSIONS, test x$no_extensions = xyes)
|
2013-01-18 11:43:21 +08:00
|
|
|
|
2013-01-29 12:36:17 +08:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
AC_ARG_WITH(latency,
|
|
|
|
[ --with-latency Build latency measuring code into the library ],
|
|
|
|
[ latency=yes
|
|
|
|
])
|
|
|
|
|
|
|
|
if test "x$latency" = "xyes" ; then
|
|
|
|
CFLAGS="$CFLAGS -DLWS_LATENCY"
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(LATENCY, test x$latency = xyes)
|
|
|
|
|
2013-01-17 10:05:39 +08:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
AC_ARG_WITH(daemonize,
|
|
|
|
[ --without-daemonize dont build the daemonization api ],
|
|
|
|
[ no_daemonize=yes
|
|
|
|
])
|
|
|
|
|
2013-01-19 11:11:42 +08:00
|
|
|
if test "x$no_daemonize" = "xyes" ; then
|
|
|
|
CFLAGS="$CFLAGS -DLWS_NO_DAEMONIZE"
|
|
|
|
fi
|
2013-01-17 10:05:39 +08:00
|
|
|
AM_CONDITIONAL(NO_DAEMONIZE, test x$no_daemonize = xyes)
|
|
|
|
|
2013-01-17 19:53:16 +08:00
|
|
|
#
|
2012-04-12 10:11:29 +08:00
|
|
|
#
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(mingw,
|
|
|
|
[ --enable-mingw Using mingw compilers, disables ping test build],
|
|
|
|
[ mingw=yes
|
|
|
|
noping=yes
|
|
|
|
])
|
|
|
|
|
|
|
|
if test "x$mingw" = "xyes" ; then
|
|
|
|
CFLAGS="$CFLAGS -DLWS_MINGW_SUPPORT"
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(MINGW, test x$mingw = xyes)
|
2011-05-23 10:00:03 +01:00
|
|
|
|
2011-01-27 06:26:52 +00:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
AC_ARG_WITH([client-cert-dir],
|
|
|
|
[AS_HELP_STRING([--with-client-cert-dir],[directory containing client certs, defaults to /etc/pki/tls/certs/])],
|
|
|
|
[clientcertdir=$withval],
|
|
|
|
[clientcertdir=/etc/pki/tls/certs/]
|
|
|
|
)
|
|
|
|
AC_SUBST([clientcertdir])
|
|
|
|
|
|
|
|
AC_SUBST([CFLAGS])
|
|
|
|
|
|
|
|
|
2011-01-27 20:06:03 +00:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(noping,
|
|
|
|
[ --enable-noping Do not build ping test app, which has some unixy stuff in sources],
|
|
|
|
[ noping=yes
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL(NOPING, test x$noping = xyes)
|
|
|
|
|
2013-01-10 19:50:35 +08:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
[ --disable-debug Stops debug-related code from even being compiled in, useful for best speed],
|
|
|
|
[ disable_debug=yes
|
|
|
|
])
|
|
|
|
|
|
|
|
if test "x$disable_debug" != "xyes" ; then
|
|
|
|
CFLAGS="$CFLAGS -D_DEBUG"
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(DISABLE_DEBUG, test x$disable_debug = xyes)
|
2011-01-27 20:06:03 +00:00
|
|
|
|
2010-11-08 17:04:09 +00:00
|
|
|
|
2013-01-12 20:39:47 +08:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(builtin-getifaddrs,
|
|
|
|
[ --enable-builtin-getifaddrs Use BSD getifaddrs implementation from libwebsockets... default is your libc provides it],
|
|
|
|
[ builtin_getifaddrs=yes
|
|
|
|
])
|
2013-01-12 23:31:39 +08:00
|
|
|
if test "x$builtin-getifaddrs" = "xyes" ; then
|
2013-01-12 20:39:47 +08:00
|
|
|
CFLAGS="$CFLAGS -DLWS_BUILTIN_GETIFADDRS"
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(USE_BUILTIN_GETIFADDRS, test x$builtin_getifaddrs = xyes)
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-08 17:04:09 +00:00
|
|
|
# Checks for header files.
|
2011-12-14 22:14:03 +01:00
|
|
|
AC_CHECK_HEADERS([zlib.h fcntl.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h sys/prctl.h])
|
2010-11-08 17:04:09 +00:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
|
|
|
|
# Checks for library functions.
|
2011-01-20 10:23:50 +00:00
|
|
|
|
2010-11-08 17:04:09 +00:00
|
|
|
AC_FUNC_MALLOC
|
|
|
|
AC_FUNC_REALLOC
|
|
|
|
AC_CHECK_FUNCS([bzero memset socket strerror])
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile
|
|
|
|
lib/Makefile
|
|
|
|
test-server/Makefile])
|
|
|
|
|
2012-10-19 11:21:54 +02:00
|
|
|
AC_OUTPUT([
|
|
|
|
libwebsockets.pc
|
|
|
|
])
|