]> err.no Git - varnish/commitdiff
Autoconfuse.
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 2 Jul 2007 08:24:52 +0000 (08:24 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 2 Jul 2007 08:24:52 +0000 (08:24 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1606 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-tools/nagios/Makefile [deleted file]
varnish-tools/nagios/Makefile.am [new file with mode: 0644]
varnish-tools/nagios/autogen.des [new symlink]
varnish-tools/nagios/autogen.sh [new symlink]
varnish-tools/nagios/configure.ac [new file with mode: 0644]

diff --git a/varnish-tools/nagios/Makefile b/varnish-tools/nagios/Makefile
deleted file mode 100644 (file)
index 8b30df8..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-CFLAGS = -I ../../varnish-cache/include -O2 -Wall -pedantic -std=c99 -D_GNU_SOURCE
-LDFLAGS = -L /opt/varnish/lib -lvarnishapi
-
-all: check_varnish
-
-clean:
-       -rm check_varnish
\ No newline at end of file
diff --git a/varnish-tools/nagios/Makefile.am b/varnish-tools/nagios/Makefile.am
new file mode 100644 (file)
index 0000000..810992e
--- /dev/null
@@ -0,0 +1,9 @@
+# $Id$
+
+sbin_PROGRAMS = check_varnish
+
+check_varnish_SOURCES = check_varnish.c
+
+check_varnish_CFLAGS = -include config.h ${VARNISHAPI_CFLAGS}
+
+check_varnish_LDADD = ${VARNISHAPI_LIBS}
diff --git a/varnish-tools/nagios/autogen.des b/varnish-tools/nagios/autogen.des
new file mode 120000 (symlink)
index 0000000..4447636
--- /dev/null
@@ -0,0 +1 @@
+../../varnish-cache/autogen.des
\ No newline at end of file
diff --git a/varnish-tools/nagios/autogen.sh b/varnish-tools/nagios/autogen.sh
new file mode 120000 (symlink)
index 0000000..df1c7cc
--- /dev/null
@@ -0,0 +1 @@
+../../varnish-cache/autogen.sh
\ No newline at end of file
diff --git a/varnish-tools/nagios/configure.ac b/varnish-tools/nagios/configure.ac
new file mode 100644 (file)
index 0000000..ac7cbc2
--- /dev/null
@@ -0,0 +1,66 @@
+# $Id$
+
+AC_PREREQ(2.59)
+AC_COPYRIGHT([Copyright (c) 2007 Linpro AS])
+AC_REVISION([$Id$])
+AC_INIT([check_varnish], [trunk], [varnish-dev@projects.linpro.no])
+AC_CONFIG_SRCDIR(check_varnish.c)
+AM_CONFIG_HEADER(config.h)
+
+AC_CANONICAL_SYSTEM
+AC_LANG(C)
+
+AM_INIT_AUTOMAKE
+
+# Checks for programs.
+AC_GNU_SOURCE
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LIBTOOL
+AC_PROG_MAKE_SET
+
+# Checks for libraries.
+PKG_CHECK_MODULES([VARNISHAPI], [varnishapi])
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_HEADER_TIME
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+
+# Checks for library functions.
+AC_TYPE_SIZE_T
+
+# Now that we're done using the compiler to look for functions and
+# libraries, set CFLAGS to what we want them to be for our own code
+
+# This corresponds to FreeBSD's WARNS level 6
+DEVELOPER_CFLAGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wformat"
+
+# Additional flags for GCC 4
+EXTRA_DEVELOPER_CFLAGS="-Wextra -Wno-missing-field-initializers -Wno-sign-compare"
+
+AC_ARG_ENABLE(developer-warnings,
+       AS_HELP_STRING([--enable-developer-warnings],[enable strict warnings (default is NO)]),
+       CFLAGS="${CFLAGS} ${DEVELOPER_CFLAGS}")
+AC_ARG_ENABLE(debugging-symbols,
+       AS_HELP_STRING([--enable-debugging-symbols],[enable debugging symbols (default is NO)]),
+       CFLAGS="${CFLAGS} -O0 -g -fno-inline")
+AC_ARG_ENABLE(extra-developer-warnings,
+       AS_HELP_STRING([--enable-extra-developer-warnings],[enable even stricter warnings (default is NO)]),
+       CFLAGS="${CFLAGS} ${EXTRA_DEVELOPER_CFLAGS}")
+AC_ARG_ENABLE(stack-protector,
+       AS_HELP_STRING([--enable-stack-protector],[enable stack protector (default is NO)]),
+       CFLAGS="${CFLAGS} -fstack-protector-all")
+AC_ARG_ENABLE(werror,
+       AS_HELP_STRING([--enable-werror],[use -Werror (default is NO)]),
+       CFLAGS="${CFLAGS} -Werror")
+
+# Generate output
+AC_CONFIG_FILES([
+    Makefile
+])
+AC_OUTPUT