summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2012-02-17 12:23:57 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2012-02-17 12:23:57 +0100
commite7665f0d794b9ffa4dea69b03bc42db759fd2600 (patch)
tree7f0e4c35ab74a84babe8dd5030075837ff0fec75 /configure.in
parentf1395d05a2feec5366b8dd1b81899a6fd217864e (diff)
Initial import.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in65
1 files changed, 65 insertions, 0 deletions
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..4a9e870
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,65 @@
+# Filename: configure.in
+
+AC_INIT(src/muniad.cc)
+
+VERSION="0.0.1"
+AM_INIT_AUTOMAKE( munia, $VERSION )
+
+dnl ======================
+dnl Compile with debug options
+dnl ======================
+AC_ARG_WITH(debug,
+ [ --with-debug build with debug support (default=no)],
+ [],
+ [with_debug=no])
+if test x$with_debug == xyes; then
+ AC_MSG_WARN([*** Building with debug support!])
+ AC_DEFINE_UNQUOTED(WITH_DEBUG, , [The project is configured to use debug output])
+ CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector -Wall -Werror -g -O0"
+fi
+
+dnl ======================
+dnl Init pkg-config
+dnl ======================
+PKG_PROG_PKG_CONFIG(0.23)
+
+AC_PROG_CXX
+
+AM_CONFIG_HEADER(config.h)
+AC_STDC_HEADERS
+
+dnl ======================
+dnl Check for getopt
+dnl ======================
+AC_HAVE_HEADERS(getopt.h)
+
+dnl ======================
+dnl Check for libwebsockets library
+dnl ======================
+tmp_CXXFLAGS="$CXXFLAGS"
+tmp_CPPFLAGS="$CPPFLAGS"
+tmp_CFLAGS="$CFLAGS"
+tmp_LDFLAGS="$LDFLAGS"
+tmp_LIBS="$LIBS"
+CXXFLAGS=""
+CPPFLAGS=""
+CFLAGS=""
+LDFLAGS=""
+LIBS=""
+AC_CHECK_HEADER(libwebsockets.h, , AC_MSG_ERROR([*** libwebsockets header file not found!]))
+AC_CHECK_LIB(websockets, libwebsocket_create_context, , AC_MSG_ERROR([*** libwebsockets library not found!]))
+LIBWEBSOCKETS_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS"
+LIBWEBSOCKETS_LIBS="$LDFLAGS $LIBS"
+CXXFLAGS="$tmp_CXXFLAGS"
+CPPFLAGS="$tmp_CPPFLAGS"
+CFLAGS="$tmp_CFLAGS"
+LDFLAGS="$tmp_LDFLAGS"
+LIBS="$tmp_LIBS"
+AC_SUBST(LIBWEBSOCKETS_CFLAGS)
+AC_SUBST(LIBWEBSOCKETS_LIBS)
+
+AC_OUTPUT(
+ Makefile
+ src/Makefile
+ tools/Makefile)
+