summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac43
1 files changed, 43 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..142374b
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,43 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(rrdui, 0.4, stef@thewalter.net)
+AM_INIT_AUTOMAKE(rrdui, 0.4)
+
+LDFLAGS="$LDFLAGS -L/usr/local/lib"
+CFLAGS="$CFLAGS -I/usr/local/include"
+
+AC_CONFIG_SRCDIR([tools/rrdui-cgi.c])
+AM_CONFIG_HEADER([config.h])
+
+CFLAGS="$CFLAGS -Wall"
+
+# Debug mode
+AC_ARG_ENABLE(debug,
+ AC_HELP_STRING([--enable-debug],
+ [Compile binaries in debug mode]))
+
+if test "$enable_debug" = "yes"; then
+ CFLAGS="$CFLAGS -g -O0"
+ AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
+ echo "enabling debug compile mode"
+fi
+
+dnl Check for programs.
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_RANLIB
+
+dnl Checks for libraries
+AC_CHECK_LIB(rrd, rrd_update, ,
+ [echo "ERROR: librrd not found."; exit 1])
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_C_INLINE
+
+AC_HEADER_STDC
+
+AC_MSG_RESULT()
+
+AC_CONFIG_FILES([Makefile tools/Makefile www/Makefile])
+AC_OUTPUT