From da1fbf80ad75393cdbb980ba970bd0ace7ecab7b Mon Sep 17 00:00:00 2001 From: Alexander Vdolainen Date: Thu, 23 Jul 2015 15:25:16 +0300 Subject: [PATCH] Added tests build; --- Makefile.am | 8 +++++++- configure.ac | 12 +++++++++++- tests/Makefile.am | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 tests/Makefile.am diff --git a/Makefile.am b/Makefile.am index 2c15d00..f281664 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,13 @@ else EXAMPLES = endif -SUBDIRS = include lib $(EXAMPLES) +if BUILD_TESTS +TESTS = tests +else +TESTS = +endif + +SUBDIRS = include lib $(EXAMPLES) $(TESTS) libsntldocdir = ${prefix}/doc/libsntl libsntldoc_DATA = \ diff --git a/configure.ac b/configure.ac index d03ab05..26d18e5 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,15 @@ AS_IF([test "x$enable_build_examples" = "xyes"], [ AM_CONDITIONAL(BUILD_EXAMPLES, test "x$enable_build_examples" = "xyes") +AC_ARG_ENABLE([build_tests], + AS_HELP_STRING([--enable-build-tests], [Enable build test programs])) + +AS_IF([test "x$enable_build_tests" = "xyes"], [ + AC_DEFINE([BUILD_TESTS], 1, [build test programs enabled]) +]) + +AM_CONDITIONAL(BUILD_TESTS, test "x$enable_build_tests" = "xyes") + dnl ************win32********* AC_ARG_ENABLE([win32], @@ -57,4 +66,5 @@ Makefile lib/libsntllv2.pc lib/Makefile include/Makefile -examples/Makefile]) +examples/Makefile +tests/Makefile]) diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..dfa9ce4 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,37 @@ +## AUTOMAKE_OPTIONS = foreign + +AM_CPPFLAGS = \ + -DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \ + -DPACKAGE_SRC_DIR=\""$(srcdir)"\" \ + -DPACKAGE_DATA_DIR=\""$(pkgdatadir)"\" \ + -DCNFPATH=\""$(prefix)/etc"\" \ + -I../include \ + -I../lib + +AM_CFLAGS = -Wall -g + +# where to find libsntl +libsntl = ../lib/.libs/libsntllv2.la + +if !BUILD_WIN32 + +bin_PROGRAMS = lv2sd lv2sc + +lv2sd_SOURCES = lv2sd.c +lv2sd_LDADD = $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \ + $(LIBUUID_LIBS) $(libsntl) + +lv2sc_SOURCES = lv2sc.c +lv2sc_LDADD = $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \ + $(LIBUUID_LIBS) $(libsntl) + +else BUILD_WIN32 + +bin_PROGRAMS = lv2sc + +lv2sc_SOURCES = lv2sc.c +lv2sc_LDADD = $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \ + $(LIBUUID_LIBS) $(libsntl) -lws2_32 + +endif BUILD_WIN32 +