Commit c488058e authored by Francis Dupont's avatar Francis Dupont

[3911a] Reorganized library Makefile.am files (exception, util, log)

parent 4a9cb30e
AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
AM_CXXFLAGS = $(KEA_CXXFLAGS)
if USE_STATIC_LINK
......@@ -19,8 +17,9 @@ run_unittests_SOURCES = run_unittests.cc
run_unittests_SOURCES += exceptions_unittest.cc
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD)
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
run_unittests_LDADD = $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
run_unittests_LDADD += $(GTEST_LDADD)
endif
noinst_PROGRAMS = $(TESTS)
......@@ -43,8 +43,10 @@ if USE_GXX
libkea_log_la_CXXFLAGS += -Wno-unused-parameter
endif
libkea_log_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
libkea_log_la_LIBADD = $(top_builddir)/src/lib/util/libkea-util.la
libkea_log_la_LIBADD += interprocess/libkea-log_interprocess.la
libkea_log_la_LIBADD = $(top_builddir)/src/lib/log/interprocess/libkea-log_interprocess.la
libkea_log_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libkea_log_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libkea_log_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libkea_log_la_LIBADD += $(LOG4CPLUS_LIBS)
libkea_log_la_LDFLAGS = -no-undefined -version-info 1:0:1
......
......@@ -15,5 +15,7 @@ bin_PROGRAMS = message
message_SOURCES = message.cc
message_LDADD = $(top_builddir)/src/lib/log/libkea-log.la
message_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
message_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
message_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
message_LDADD += $(LOG4CPLUS_LIBS)
......@@ -16,6 +16,6 @@ libkea_log_interprocess_la_SOURCES += interprocess_sync_file.cc
libkea_log_interprocess_la_SOURCES += interprocess_sync_null.h
libkea_log_interprocess_la_SOURCES += interprocess_sync_null.cc
libkea_log_interprocess_la_LIBADD = $(top_builddir)/src/lib/util/threads/libkea-threads.la
libkea_log_interprocess_la_LIBADD = $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
EXTRA_DIST = README
......@@ -27,9 +27,10 @@ run_unittests_SOURCES += interprocess_sync_null_unittest.cc
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = ../libkea-log_interprocess.la
run_unittests_LDADD = $(top_builddir)/src/lib/log/interprocess/libkea-log_interprocess.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
run_unittests_LDADD += $(GTEST_LDADD)
endif
......
// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -15,7 +15,7 @@
#ifndef LOGGER_MANAGER_H
#define LOGGER_MANAGER_H
#include "exceptions/exceptions.h"
#include <exceptions/exceptions.h>
#include <util/threads/sync.h>
#include <log/logger_specification.h>
......
// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -13,7 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
#include <string>
#include "log/logger_name.h"
#include <log/logger_name.h>
namespace isc {
namespace log {
......
......@@ -27,6 +27,7 @@ logger_example_SOURCES = logger_example.cc
logger_example_CPPFLAGS = $(AM_CPPFLAGS)
logger_example_LDFLAGS = $(AM_LDFLAGS)
logger_example_LDADD = $(top_builddir)/src/lib/log/libkea-log.la
logger_example_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
logger_example_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
logger_example_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
logger_example_LDADD += $(AM_LDADD) $(LOG4CPLUS_LIBS)
......@@ -36,6 +37,7 @@ init_logger_test_SOURCES = init_logger_test.cc
init_logger_test_CPPFLAGS = $(AM_CPPFLAGS)
init_logger_test_LDFLAGS = $(AM_LDFLAGS)
init_logger_test_LDADD = $(top_builddir)/src/lib/log/libkea-log.la
init_logger_test_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
init_logger_test_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
init_logger_test_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
init_logger_test_LDADD += $(AM_LDADD) $(LOG4CPLUS_LIBS)
......@@ -45,20 +47,19 @@ buffer_logger_test_SOURCES = buffer_logger_test.cc
buffer_logger_test_CPPFLAGS = $(AM_CPPFLAGS)
buffer_logger_test_LDFLAGS = $(AM_LDFLAGS)
buffer_logger_test_LDADD = $(top_builddir)/src/lib/log/libkea-log.la
buffer_logger_test_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
buffer_logger_test_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
buffer_logger_test_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
buffer_logger_test_LDADD += $(AM_LDADD) $(LOG4CPLUS_LIBS)
# This test directly uses libkea-threads, and on some systems it seems to
# require explicit LDADD (even if libkea-log has indirect dependencies)
noinst_PROGRAMS += logger_lock_test
logger_lock_test_SOURCES = logger_lock_test.cc
nodist_logger_lock_test_SOURCES = log_test_messages.cc log_test_messages.h
logger_lock_test_CPPFLAGS = $(AM_CPPFLAGS)
logger_lock_test_LDFLAGS = $(AM_LDFLAGS)
logger_lock_test_LDADD = $(top_builddir)/src/lib/log/libkea-log.la
logger_lock_test_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
logger_lock_test_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
logger_lock_test_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
logger_lock_test_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
logger_lock_test_LDADD += $(AM_LDADD) $(LOG4CPLUS_LIBS)
......@@ -69,19 +70,22 @@ if HAVE_GTEST
TESTS =
# Define the flags used in each set of tests
TESTSCXXFLAGS = $(AM_CXXFLAGS)
if USE_CLANGPP
# Workaround unused variables tcout and tcerr in log4cplus's streams.h.
AM_CXXFLAGS += -Wno-unused-variable
TESTSCXXFLAGS += -Wno-unused-variable
endif
AM_CPPFLAGS += $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
AM_LDFLAGS += $(GTEST_LDFLAGS)
AM_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
AM_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
AM_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
AM_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
AM_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
AM_LDADD += $(GTEST_LDADD)
TESTSCPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
TESTSLDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
TESTSLDADD = $(AM_LDADD)
TESTSLDADD += $(top_builddir)/src/lib/log/libkea-log.la
TESTSLDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
TESTSLDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
TESTSLDADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la
TESTSLDADD += $(top_builddir)/src/lib/util/libkea-util.la
TESTSLDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
TESTSLDADD += $(LOG4CPLUS_LIBS) $(GTEST_LDADD)
# Set of unit tests for the general logging classes
TESTS += run_unittests
......@@ -100,11 +104,10 @@ run_unittests_SOURCES += output_option_unittest.cc
run_unittests_SOURCES += buffer_appender_unittest.cc
nodist_run_unittests_SOURCES = log_test_messages.cc log_test_messages.h
run_unittests_CPPFLAGS = $(AM_CPPFLAGS)
run_unittests_CXXFLAGS = $(AM_CXXFLAGS)
run_unittests_LDADD = $(AM_LDADD)
run_unittests_LDADD += $(LOG4CPLUS_LIBS)
run_unittests_LDFLAGS = $(AM_LDFLAGS)
run_unittests_CPPFLAGS = $(TESTSCPPFLAGS)
run_unittests_CXXFLAGS = $(TESTSCXXFLAGS)
run_unittests_LDADD = $(TESTSLDADD)
run_unittests_LDFLAGS = $(TESTSLDFLAGS)
# logging initialization tests. These are put in separate programs to
# ensure that the initialization status at the start of each test is known,
......@@ -115,10 +118,10 @@ initializer_unittests_1_SOURCES = run_initializer_unittests.cc
initializer_unittests_1_SOURCES += message_initializer_1_unittest.cc
initializer_unittests_1_SOURCES += message_initializer_1a_unittest.cc
initializer_unittests_1_CPPFLAGS = $(AM_CPPFLAGS)
initializer_unittests_1_CXXFLAGS = $(AM_CXXFLAGS)
initializer_unittests_1_LDADD = $(AM_LDADD)
initializer_unittests_1_LDFLAGS = $(AM_LDFLAGS)
initializer_unittests_1_CPPFLAGS = $(TESTSCPPFLAGS)
initializer_unittests_1_CXXFLAGS = $(TESTSCXXFLAGS)
initializer_unittests_1_LDADD = $(TESTSLDADD)
initializer_unittests_1_LDFLAGS = $(TESTSLDFLAGS)
noinst_PROGRAMS += $(TESTS)
endif
......
......@@ -17,7 +17,7 @@
#include <log/logger_manager.h>
#include <log/log_messages.h>
#include <log/interprocess/interprocess_sync.h>
#include "log_test_messages.h"
#include <log/tests/log_test_messages.h>
#include <util/threads/sync.h>
#include <iostream>
......
......@@ -35,7 +35,7 @@
#include <log/message_initializer.h>
#include <log/output_option.h>
#include "tempdir.h"
#include <log/tests/tempdir.h>
#include <sys/types.h>
#include <regex.h>
......
......@@ -24,7 +24,7 @@
#include <log/logger_name.h>
#include <log/log_messages.h>
#include <log/interprocess/interprocess_sync_file.h>
#include "log/tests/log_test_messages.h"
#include <log/tests/log_test_messages.h>
#include <iostream>
#include <string>
......
......@@ -3,8 +3,6 @@ AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS = . io unittests tests python threads
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/util -I$(top_builddir)/src/lib/util
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/exceptions -I$(top_builddir)/src/lib/exceptions
AM_CPPFLAGS += $(BOOST_INCLUDES)
AM_CXXFLAGS = $(KEA_CXXFLAGS)
......
// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -12,7 +12,7 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include "fd.h"
#include <util/io/fd.h>
#include <unistd.h>
#include <cerrno>
......
// Copyright (C) 2010, 2014 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -21,7 +21,7 @@
#include <errno.h>
#include <stdlib.h> // for malloc and free
#include <unistd.h>
#include "fd_share.h"
#include <util/io/fd_share.h>
namespace isc {
namespace util {
......
// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -41,9 +41,9 @@
#include <util/buffer.h>
#include "fd_share.h"
#include "socketsession.h"
#include "sockaddr_util.h"
#include <util/io/fd_share.h>
#include <util/io/socketsession.h>
#include <util/io/sockaddr_util.h>
using namespace std;
......
// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -12,7 +12,7 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include "memory_segment_local.h"
#include <util/memory_segment_local.h>
#include <exceptions/exceptions.h>
namespace isc {
......
......@@ -55,9 +55,9 @@ run_unittests_SOURCES += stopwatch_unittest.cc
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(top_builddir)/src/lib/util/libkea-util.la
run_unittests_LDADD = $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
run_unittests_LDADD += $(GTEST_LDADD)
endif
......
......@@ -14,7 +14,7 @@
#include <config.h>
#include "sync.h"
#include <util/threads/sync.h>
#include <exceptions/exceptions.h>
......
......@@ -30,6 +30,9 @@ run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) $(PTHREAD_LDFLAGS)
run_unittests_LDADD = $(top_builddir)/src/lib/util/threads/libkea-threads.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
run_unittests_LDADD += $(GTEST_LDADD)
endif
......
// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -12,8 +12,8 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include "thread.h"
#include "sync.h"
#include <util/threads/thread.h>
#include <util/threads/sync.h>
#include <memory>
#include <string>
......
......@@ -22,8 +22,11 @@ if HAVE_GTEST
libutil_unittests_la_CPPFLAGS += $(GTEST_INCLUDES)
endif
libutil_unittests_la_LIBADD = $(top_builddir)/src/lib/util/libkea-util.la
libutil_unittests_la_LIBADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la
libutil_unittests_la_LIBADD = $(top_builddir)/src/lib/util/io/libkea-util-io.la
libutil_unittests_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libutil_unittests_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
if HAVE_GTEST
libutil_unittests_la_LIBADD += $(GTEST_LDADD)
endif
CLEANFILES = *.gcno *.gcda
// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -12,7 +12,7 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include "fork.h"
#include <util/unittests/fork.h>
#include <util/io/fd.h>
......
// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -17,7 +17,7 @@
#include <new>
#include <stdexcept>
#include "newhook.h"
#include <util/unittests/newhook.h>
#ifdef ENABLE_CUSTOM_OPERATOR_NEW
void*
......
// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -12,7 +12,7 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include "resource.h"
#include <util/unittests/resource.h>
#include <gtest/gtest.h>
......
// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -17,7 +17,7 @@
#include <fstream>
#include <vector>
#include "testdata.h"
#include <util/unittests/testdata.h>
using namespace std;
......
// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -12,7 +12,7 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include "wiredata.h"
#include <util/unittests/wiredata.h>
#include <gtest/gtest.h>
......
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