dist: trusty
sudo: required
compiler: gcc
+ env: CFLAGS='-Wall -Wextra'
- os: linux
dist: trusty
sudo: required
compiler: clang
+ env: CFLAGS='-Weverything -Wno-padded'
- os: osx
compiler: clang
+ env: CFLAGS='-Weverything -Wno-padded'
addons:
apt:
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then brew install gd sqlite check ; fi
script:
- - if [ "${CC}" == "clang" ]; then export CFLAGS='-Weverything -Wno-padded -Werror' ; else export CFLAGS='-Wall -Wextra -Werror' ; fi
- - ./configure && make check || ( cat test.log ; exit 1 ) && egrep '^[0-9]+%' test.log && ./vnstat --version
+ - ./configure --enable-werror && make check || ( cat test.log ; exit 1 ) && egrep '^[0-9]+%' test.log && ./vnstat --version
notifications:
email:
SUBDIRS = .
+AM_CFLAGS = @CFLAG_EXTRAS@
dist_man_MANS = man/vnstat.1 man/vnstat.conf.5 man/vnstatd.1 man/vnstati.1
if HAVE_LIBGD
bin_PROGRAMS += vnstati
endif
-vnstati_LDADD = $(IMAGELIBS)
+vnstati_LDADD = @IMAGELIBS@
vnstat_SOURCES = src/vnstat.c src/vnstat.h \
src/ifinfo.c src/ifinfo.h \
if HAVE_CHECK
TESTS = check_vnstat
check_PROGRAMS = check_vnstat
-check_vnstat_CFLAGS = @CHECK_CFLAGS@ \
+check_vnstat_CFLAGS = @CFLAG_EXTRAS@ @CHECK_CFLAGS@ \
-DPROCNETDEV=\"testdir/proc/dev\" \
-DSYSCLASSNET=\"testdir/sysclassnet\" \
-DCFGFILE=\"$(top_srcdir)/cfg/vnstat.conf\" \
if HAVE_LIBGD
check_vnstat_CFLAGS += -DHAVE_IMAGE
-check_vnstat_LDADD += $(IMAGELIBS)
+check_vnstat_LDADD += @IMAGELIBS@
check_vnstat_SOURCES += tests/image_tests.c tests/image_tests.h \
src/image.c src/image.h
endif
@HAVE_CHECK_TRUE@TESTS = check_vnstat$(EXEEXT)
@HAVE_CHECK_TRUE@check_PROGRAMS = check_vnstat$(EXEEXT)
@HAVE_CHECK_TRUE@@HAVE_LIBGD_TRUE@am__append_2 = -DHAVE_IMAGE
-@HAVE_CHECK_TRUE@@HAVE_LIBGD_TRUE@am__append_3 = $(IMAGELIBS)
+@HAVE_CHECK_TRUE@@HAVE_LIBGD_TRUE@am__append_3 = @IMAGELIBS@
@HAVE_CHECK_TRUE@@HAVE_LIBGD_TRUE@am__append_4 = tests/image_tests.c tests/image_tests.h \
@HAVE_CHECK_TRUE@@HAVE_LIBGD_TRUE@ src/image.c src/image.h
@HAVE_CHECK_TRUE@ $(am__objects_1)
check_vnstat_OBJECTS = $(am_check_vnstat_OBJECTS)
am__DEPENDENCIES_1 =
-@HAVE_CHECK_TRUE@@HAVE_LIBGD_TRUE@am__DEPENDENCIES_2 = \
-@HAVE_CHECK_TRUE@@HAVE_LIBGD_TRUE@ $(am__DEPENDENCIES_1)
-@HAVE_CHECK_TRUE@check_vnstat_DEPENDENCIES = $(am__DEPENDENCIES_2)
+@HAVE_CHECK_TRUE@check_vnstat_DEPENDENCIES = $(am__DEPENDENCIES_1)
check_vnstat_LINK = $(CCLD) $(check_vnstat_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
am_vnstat_OBJECTS = src/vnstat.$(OBJEXT) src/ifinfo.$(OBJEXT) \
src/dbsql.$(OBJEXT) src/common.$(OBJEXT) src/misc.$(OBJEXT) \
src/fs.$(OBJEXT) src/id.$(OBJEXT) src/cfg.$(OBJEXT)
vnstati_OBJECTS = $(am_vnstati_OBJECTS)
-vnstati_DEPENDENCIES = $(am__DEPENDENCIES_1)
+vnstati_DEPENDENCIES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAG_EXTRAS = @CFLAG_EXTRAS@
CHECK_CFLAGS = @CHECK_CFLAGS@
CHECK_LIBS = @CHECK_LIBS@
CPP = @CPP@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = .
+AM_CFLAGS = @CFLAG_EXTRAS@
dist_man_MANS = man/vnstat.1 man/vnstat.conf.5 man/vnstatd.1 man/vnstati.1
EXTRA_DIST = cfg examples UPGRADE CHANGES FAQ INSTALL_BSD INSTALL_OSX UNINSTALL
-vnstati_LDADD = $(IMAGELIBS)
+vnstati_LDADD = @IMAGELIBS@
vnstat_SOURCES = src/vnstat.c src/vnstat.h \
src/ifinfo.c src/ifinfo.h \
src/dbsql.c src/dbsql.h \
src/id.c src/id.h \
src/cfg.c src/cfg.h
-@HAVE_CHECK_TRUE@check_vnstat_CFLAGS = @CHECK_CFLAGS@ \
+@HAVE_CHECK_TRUE@check_vnstat_CFLAGS = @CFLAG_EXTRAS@ @CHECK_CFLAGS@ \
@HAVE_CHECK_TRUE@ -DPROCNETDEV=\"testdir/proc/dev\" \
@HAVE_CHECK_TRUE@ -DSYSCLASSNET=\"testdir/sysclassnet\" \
@HAVE_CHECK_TRUE@ -DCFGFILE=\"$(top_srcdir)/cfg/vnstat.conf\" \
HAVE_LIBGD_FALSE
HAVE_LIBGD_TRUE
IMAGELIBS
+CFLAG_EXTRAS
am__fastdepCC_FALSE
am__fastdepCC_TRUE
CCDEPMODE
enable_maintainer_mode
enable_dependency_tracking
enable_image_output
+enable_werror
'
ac_precious_vars='build_alias
host_alias
--disable-image-output disable PNG image output
+ --enable-werror add -Werror to CFLAGS
+
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
+# Extra options
# Check whether --enable-image-output was given.
if test "${enable_image_output+set}" = set; then :
enableval=$enable_image_output;
fi
+CFLAG_EXTRAS=""
+# Check whether --enable-werror was given.
+if test "${enable_werror+set}" = set; then :
+ enableval=$enable_werror; CFLAG_EXTRAS="-Werror"
+fi
+
+
+
# Checks for libraries.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
AC_PROG_MAKE_SET
AC_PROG_MKDIR_P
+# Extra options
AC_ARG_ENABLE([image-output], [
AS_HELP_STRING([--disable-image-output], [disable PNG image output])])
+CFLAG_EXTRAS=""
+AC_ARG_ENABLE([werror], [
+AS_HELP_STRING([--enable-werror], [add -Werror to CFLAGS])], [CFLAG_EXTRAS="-Werror"])
+AC_SUBST([CFLAG_EXTRAS])
+
# Checks for libraries.
AC_CHECK_LIB([m], [pow], [], [AC_MSG_ERROR([could not find required math library])])
AC_CHECK_LIB([sqlite3], [sqlite3_prepare_v2], [], [AC_MSG_ERROR([could not find required sqlite3 library])])