Commit 189c2f4d authored by Marek Vavruša's avatar Marek Vavruša

Merge branch 'autotools_remove'

parents da3d8e50 032fc1cf
......@@ -39,3 +39,10 @@ tmp*
/ylwrap
/doc/doxyxml
/doc/html
/daemon/kresolved
/tests/test_array
/tests/test_map
/tests/test_module
/tests/test_pack
/tests/test_set
/tests/test_utils
This diff is collapsed.
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = lib daemon tests
#!/bin/sh
set -e
aclocal -I m4 --install
libtoolize --copy
autoheader
automake --copy --add-missing
autoconf
AC_PREREQ(2.60)
# Version/identifiers
m4_define([VERSION_MAJOR],[0])
m4_define([VERSION_MINOR],[0])
m4_define([VERSION_MICRO],[2])
AC_INIT(knot-resolver, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), knot-dns@lists.nic.cz, knot-resolver)
AM_INIT_AUTOMAKE([gnits subdir-objects dist-xz -Wall -Werror])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
# Set compiler compatibility flags
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_CPP_WERROR
# Default compiler flags
CFLAGS="$CFLAGS -Wall -Werror=format-security"
# Checks for programs.
m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # call AM_PROG_AR only if available
# Linker
LT_INIT
# Use pkg-config
PKG_PROG_PKG_CONFIG
# Platform-specific
AM_CONDITIONAL([HOST_DARWIN], [test "x${host_os}" != "x${host_os/darwin/}"])
# Check for dependencies
AC_CHECK_FUNCS([opendir mkdtemp gettimeofday time])
PKG_CHECK_MODULES([libknot], [libknot])
PKG_CHECK_MODULES([libuv], [libuv], [build_daemon=yes], [build_daemon=no])
PKG_CHECK_MODULES([cmocka], [cmocka], [build_tests=yes], [build_tests=no])
# Check for python (integration tests)
AC_ARG_ENABLE([integration-tests],
AS_HELP_STRING([--enable-integration-tests], [enable integration tests (require Python devel), default: no]),
[build_integration=yes], [build_integration=no])
if test "x${build_integration}" == "xyes"; then
AX_PYTHON_DEVEL([>= '2.5'])
fi
# Set up conditionals
AM_CONDITIONAL([BUILD_TESTS], [test "$build_tests" == "yes"])
AM_CONDITIONAL([BUILD_INTEGRATION], [test "$build_integration" == "yes"])
AM_CONDITIONAL([BUILD_DAEMON], [test "$build_daemon" == "yes"])
# Check for code coverage
AC_ARG_ENABLE([code-coverage],
AS_HELP_STRING([--enable-code-coverage], [enable code coverage, default: no]),
[code_coverage=yes], [code_coverage=no])
if test "x${code_coverage}" == "xyes"; then
CFLAGS="${CFLAGS} --coverage -O0 -g"
fi
# Search other libraries
AC_SEARCH_LIBS([mdb_env_open], [lmdb])
# Config files
AC_CONFIG_FILES([Makefile lib/Makefile tests/Makefile daemon/Makefile])
# Output
AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE $VERSION
Target: $host_os $host_cpu
Compiler: ${CC}
CFlags: ${CFLAGS} ${CPPFLAGS} ${libuv_CFLAGS} ${libknot_CFLAGS}
LDFlags: ${LDFLAGS} ${libuv_LIBS} ${libknot_LIBS}
Features:
---------
Build tests: ${build_tests} (integration ${build_integration})
Build daemon: ${build_daemon}
Continue with 'make' command
])
if BUILD_DAEMON
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
-I$(top_srcdir)/lib \
$(libuv_CFLAGS) \
$(libknot_CFLAGS)
kresolved_SOURCES = \
layer/query.h \
layer/query.c \
udp.h \
udp.c \
tcp.h \
tcp.c \
worker.h \
worker.c \
main.c
# sbin programs
sbin_PROGRAMS = kresolved
kresolved_LDADD = $(top_builddir)/lib/libkresolve.la $(libknot_LIBS) $(libuv_LIBS)
endif
# Static version of the library
noinst_LTLIBRARIES = libkresolve_static.la
libkresolve_static_la_CPPFLAGS = $(AM_CPPFLAGS) $(libknot_CFLAGS) $(libuv_CFLAGS)
libkresolve_static_la_LDFLAGS = $(AM_LDFLAGS) $(libknot_LIBS) $(libuv_LIBS)
libkresolve_static_la_SOURCES = \
layer/iterate.h \
layer/iterate.c \
layer/itercache.h \
layer/itercache.c \
layer/static.h \
layer/static.c \
layer/stats.h \
layer/stats.c \
layer.h \
context.h \
context.c \
resolve.h \
resolve.c \
zonecut.h \
zonecut.c \
rplan.h \
rplan.c \
cache.h \
cache.c
# Shared version (to be installed)
lib_LTLIBRARIES = libkresolve.la
libkresolve_la_SOURCES =
libkresolve_la_LIBADD = libkresolve_static.la
libtool.m4
lt~obsolete.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
This diff is collapsed.
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
-I$(top_srcdir)/lib \
$(libknot_CFLAGS) \
$(cmocka_CFLAGS)
LDADD = \
$(top_builddir)/lib/libkresolve_static.la \
$(libknot_LIBS) \
$(cmocka_LIBS)
# Unit tests
if BUILD_TESTS
check_PROGRAMS = \
test_context \
test_rplan \
test_cache \
test_resolve
check-compile-only: $(check_PROGRAMS)
check-local-exec: $(check_PROGRAMS)
@echo "---- Executing unit tests ----"
@cd $(top_builddir)
$(top_builddir)/tests/runtests -b $(top_builddir)/tests $(check_PROGRAMS)
else
check-local-exec:
endif
# Integration tests
if BUILD_INTEGRATION
check_LTLIBRARIES = libmock_calls.la _test_integration.la
libmock_calls_la_SOURCES = mock_calls.c
libmock_calls_la_CPPFLAGS = $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS)
libmock_calls_la_LDFLAGS = $(LDFLAGS) -rpath $(abs_builddir)/tests -shared -avoid-version
libmock_calls_la_LIBADD = $(libknot_LIBS) $(top_builddir)/lib/libkresolve_static.la $(PYTHON_LIBS)
_test_integration_la_SOURCES = test_integration.c
_test_integration_la_CPPFLAGS = $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS)
_test_integration_la_LDFLAGS = $(LDFLAGS) -rpath $(abs_builddir) -module -shared -avoid-version
_test_integration_la_LIBADD = libmock_calls.la $(PYTHON_LIBS)
check_cmd = $(abs_builddir)/test_integration.py testdata
convenience-link: $(check_LTLIBRARIES)
for soname in `echo | $(EGREP) "^dlname=" $(check_LTLIBRARIES) | $(SED) -e "s|\(.*\)dlname='\(.*\)'|\2|"`; do \
rm -f $(abs_builddir)/$$soname; $(LN_S) $(abs_builddir)/.libs/$$soname $$soname || true;\
done
check-local-integration: convenience-link
@echo "---- Executing integration tests ----"
if HOST_DARWIN
@DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_LIBRARY_PATH=$(abs_builddir)/.libs DYLD_INSERT_LIBRARIES=$(abs_builddir)/.libs/libmock_calls.dylib $(check_cmd)
else
@LD_PRELOAD=$(abs_builddir)/.libs/libmock_calls.so $(check_cmd)
endif
clean-local:
rm -f *.so *.dylib || true
else
check-local-integration:
endif
check-local: check-local-exec check-local-integration
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment