# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_PREREQ([2.66])
-AC_INIT(libwebsockets, 0.3, andy@warmcat.com)
+AC_PREREQ([2.61])
+AC_INIT(libwebsockets, 1.1, andy@warmcat.com, libwebsockets, http://libwebsockets.org)
AC_CONFIG_SRCDIR([test-server/test-server.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+AM_PROG_AR
LT_INIT(shared)
#AX_PTHREAD
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_CONFIG_MACRO_DIR([m4])
-AM_PROG_AR
+
+applyhash='CFLAGS+= -DLWS_LIBRARY_VERSION=\"$(PACKAGE_VERSION)\" -DLWS_BUILD_HASH=\"${shell git log -n 1 --pretty=%h}\"'
+AC_SUBST([applyhash])
+AM_SUBST_NOTMAKE([applyhash])
#
#
#
#
#
-AC_ARG_ENABLE(nofork,
- [ --enable-nofork Disables fork-related options],
- [ nofork=yes
- ])
-
-if test "x$nofork" = "xyes" ; then
-CFLAGS="$CFLAGS -DLWS_NO_FORK"
-else
-AC_FUNC_FORK
-fi
-
-#
-#
-#
AC_ARG_ENABLE(libcrypto,
[ --enable-libcrypto Use libcrypto MD5 and SHA1 implementations],
[ libcrypto=yes
fi
AM_CONDITIONAL(LIBCRYPTO, test x$libcrypto = xyes)
+#
+#
+#
+AC_ARG_WITH(testapps,
+ [ --without-testapps dont build the libwebsocket-test- apps],
+ [ no_testapps=yes
+ ])
+
+AM_CONDITIONAL(NO_TESTAPPS, test x$no_testapps = xyes)
+
+#
+#
+#
+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)
+
+#
+#
+#
+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)
+
+#
+#
+#
+AC_ARG_WITH(extensions,
+ [ --without-extensions dont build any stuff related to extensions ],
+ [ no_extensions=yes
+ ])
+if test "x$no_extensions" = "xyes" ; then
+CFLAGS="$CFLAGS -DLWS_NO_EXTENSIONS"
+fi
+AM_CONDITIONAL(NO_EXTENSIONS, test x$no_extensions = xyes)
+
+#
#
#
+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)
+
+#
#
-AC_ARG_ENABLE(x-google-mux,
- [ --enable-x-google-mux Build experimental x-google-mux],
- [ x_google_mux=yes
+#
+AC_ARG_WITH(daemonize,
+ [ --without-daemonize dont build the daemonization api ],
+ [ no_daemonize=yes
])
-if test "x$x_google_mux" = "xyes" ; then
-CFLAGS="$CFLAGS -DLWS_EXT_GOOGLE_MUX"
+
+if test "x$no_daemonize" = "xyes" ; then
+CFLAGS="$CFLAGS -DLWS_NO_DAEMONIZE"
fi
-AM_CONDITIONAL(EXT_GOOGLE_MUX, test x$x_google_mux = xyes)
+AM_CONDITIONAL(NO_DAEMONIZE, test x$no_daemonize = xyes)
#
#
AM_CONDITIONAL(NOPING, test x$noping = xyes)
+#
+#
+#
+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)
+
+
+#
+#
+#
+AC_ARG_ENABLE(builtin-getifaddrs,
+ [ --enable-builtin-getifaddrs Use BSD getifaddrs implementation from libwebsockets... default is your libc provides it],
+ [ builtin_getifaddrs=yes
+ ])
+if test "x$builtin-getifaddrs" = "xyes" ; then
+CFLAGS="$CFLAGS -DLWS_BUILTIN_GETIFADDRS"
+fi
+AM_CONDITIONAL(USE_BUILTIN_GETIFADDRS, test x$builtin_getifaddrs = xyes)
+
# Checks for header files.