summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in93
1 files changed, 93 insertions, 0 deletions
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..cf2d4c2
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,93 @@
+# Filename: configure.in
+
+AC_INIT(src/crosscomposer.cc)
+
+VERSION="0.0.1"
+AM_INIT_AUTOMAKE( crosscomposer, $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
+
+#AC_PROG_LIBTOOL
+#AM_PROG_LIBTOOL
+
+AM_CONFIG_HEADER(config.h)
+AC_STDC_HEADERS
+
+
+dnl ======================
+dnl Check for getopt
+dnl ======================
+AC_HAVE_HEADERS(getopt.h)
+
+dnl ======================
+dnl Check for eXpat 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(expat.h, , AC_MSG_ERROR([*** eXpat header file not found!]))
+AC_CHECK_LIB(expat, XML_ParserCreate, , AC_MSG_ERROR([*** eXpat library not found!]))
+EXPAT_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS"
+EXPAT_LIBS="$LDFLAGS $LIBS"
+CXXFLAGS="$tmp_CXXFLAGS"
+CPPFLAGS="$tmp_CPPFLAGS"
+CFLAGS="$tmp_CFLAGS"
+LDFLAGS="$tmp_LDFLAGS"
+LIBS="$tmp_LIBS"
+AC_SUBST(EXPAT_CFLAGS)
+AC_SUBST(EXPAT_LIBS)
+
+dnl ======================
+dnl Check for the pthread 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(pthread.h, , AC_MSG_ERROR([*** pthread header file not found!]))
+AC_CHECK_LIB(pthread, pthread_mutex_init, , AC_MSG_ERROR([*** pthread library not found!]))
+PTHREAD_CFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS"
+PTHREAD_LIBS="$LDFLAGS $LIBS"
+CXXFLAGS="$tmp_CXXFLAGS"
+CPPFLAGS="$tmp_CPPFLAGS"
+CFLAGS="$tmp_CFLAGS"
+LDFLAGS="$tmp_LDFLAGS"
+LIBS="$tmp_LIBS"
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_LIBS)
+
+AC_OUTPUT(
+ Makefile
+ src/Makefile)
+