Skip to content

Commit

Permalink
Merge pull request #1 from adfin/new_gcc
Browse files Browse the repository at this point in the history
Update to work with GCC6
  • Loading branch information
mtanski committed Feb 17, 2017
2 parents a3de0bd + cdd7cec commit 256e167
Show file tree
Hide file tree
Showing 153 changed files with 618 additions and 569 deletions.
25 changes: 14 additions & 11 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ACLOCAL_AMFLAGS=-I m4
AUTOMAKE_OPTIONS=nostdinc subdir-objects
AM_CPPFLAGS=$(OPENSSL_INCLUDES) $(BOOST_CPPFLAGS) $(POSTGRESQL_CFLAGS) $(INCICONV) $(VALGRIND_CPPFLAGS) -I$(top_srcdir)
AM_CPPFLAGS=$(OPENSSL_INCLUDES) $(BOOST_CPPFLAGS) $(POSTGRESQL_CFLAGS) $(INCICONV) $(VALGRIND_CPPFLAGS)
AM_CXXFLAGS=-Wall -Werror -fno-strict-aliasing -std=c++11

nobase_include_HEADERS= \
Expand Down Expand Up @@ -193,7 +193,7 @@ mordor_libmordor_la_SOURCES= \
mordor/platform/cxa_exception.cpp \
mordor/platform/unix_fiber.cpp

mordor_libmordor_la_CPPFLAGS=-I$(top_srcdir) -include mordor/pch.h $(AM_CPPFLAGS)
mordor_libmordor_la_CPPFLAGS=-include mordor/pch.h $(AM_CPPFLAGS)
mordor_libmordor_la_LDFLAGS= \
$(OPENSSL_LDFLAGS) \
$(BOOST_LDFLAGS) \
Expand Down Expand Up @@ -230,17 +230,19 @@ mordor_pq_libmordorpq_la_SOURCES= \
mordor/pq/result.cpp \
mordor/pq/transaction.cpp

mordor_pq_libmordorpq_la_CPPFLAGS=-I$(top_srcdir) -include mordor/pch.h $(AM_CPPFLAGS)
mordor_pq_libmordorpq_la_CPPFLAGS=-include mordor/pch.h $(AM_CPPFLAGS)
mordor_pq_libmordorpq_la_LDFLAGS=$(POSTGRESQL_LDFLAGS)
mordor_pq_libmordorpq_la_LIBADD=mordor/libmordor.la
mordor_pq_libmordorpq_la_LIBADD= \
mordor/libmordor.la \
$(BOOST_SYSTEM_LIB)

if HAVE_PROTOBUF
lib_LTLIBRARIES+=mordor/libmordorprotobuf.la
endif

mordor_libmordorprotobuf_la_SOURCES=mordor/protobuf.cpp
mordor_libmordorprotobuf_la_LDFLAGS=$(PROTOBUF_LIBS)
mordor_libmordorprotobuf_la_CPPFLAGS=-I$(top_srcdir) $(PROTOBUF_CFLAGS) $(AM_CPPFLAGS)
mordor_libmordorprotobuf_la_CPPFLAGS=$(PROTOBUF_CFLAGS) $(AM_CPPFLAGS)
mordor_libmordorprotobuf_la_LIBADD=mordor/libmordor.la

if HAVE_LIBYAML
Expand All @@ -249,7 +251,7 @@ endif

mordor_libmordoryaml_la_SOURCES=mordor/yaml.cpp
mordor_libmordoryaml_la_LDFLAGS=$(LIBYAML)
mordor_libmordoryaml_la_CPPFLAGS=-I$(top_srcdir) $(AM_CPPFLAGS)
mordor_libmordoryaml_la_CPPFLAGS=$(AM_CPPFLAGS)
mordor_libmordoryaml_la_LIBADD=mordor/libmordor.la

if HAVE_LIBSSH2
Expand All @@ -261,7 +263,7 @@ mordor_libmordorssh_la_SOURCES= \
mordor/ssh/channel.cpp \
mordor/ssh/session.cpp
mordor_libmordorssh_la_LDFLAGS=$(LIBSSH2)
mordor_libmordorssh_la_CPPFLAGS=-I$(top_srcdir) $(AM_CPPFLAGS)
mordor_libmordorssh_la_CPPFLAGS=$(AM_CPPFLAGS)
mordor_libmordorssh_la_LIBADD=mordor/libmordor.la

pkgconfigdir=$(libdir)/pkgconfig
Expand Down Expand Up @@ -314,7 +316,10 @@ mordor_test_libmordortest_la_SOURCES= \
mordor/test/stdoutlistener.cpp \
mordor/test/test.cpp

mordor_test_libmordortest_la_LIBADD=mordor/libmordor.la
mordor_test_libmordortest_la_LIBADD= \
mordor/libmordor.la \
$(BOOST_REGEX_LIB) \
$(BOOST_SYSTEM_LIB)

check_PROGRAMS=mordor/tests/run_tests
mordor_tests_run_tests_SOURCES= \
Expand Down Expand Up @@ -366,7 +371,7 @@ mordor_tests_run_tests_SOURCES= \
mordor/tests/zlib.cpp \
mordor/tests/crypto.cpp

mordor_tests_run_tests_CPPFLAGS=-I$(top_builddir) -include mordor/pch.h $(AM_CPPFLAGS)
mordor_tests_run_tests_CPPFLAGS=-include mordor/pch.h $(AM_CPPFLAGS)
mordor_tests_run_tests_LDADD=mordor/libmordor.la mordor/test/libmordortest.la \
$(OPENSSL_LIBS) \
$(BOOST_THREAD_LIB) \
Expand Down Expand Up @@ -433,7 +438,6 @@ mordor_examples_echoserver_LDADD=mordor/libmordor.la \
$(SYSTEMCONFIGURATION_FRAMEWORK_LIBS) \
$(BOOST_SYSTEM_LIB) \
$(BOOST_THREAD_LIB)


mordor_examples_iombench_SOURCES= \
mordor/examples/iombench.cpp \
Expand All @@ -447,7 +451,6 @@ mordor_examples_iombench_LDADD=mordor/libmordor.la \

mordor_examples_simplehttpfileserver_SOURCES=mordor/examples/simplehttpfileserver.cpp
mordor_examples_simplehttpfileserver_LDADD=mordor/libmordor.la \
-ljemalloc \
$(BOOST_SYSTEM_LIB) \
$(BOOST_THREAD_LIB) \
$(CORESERVICES_FRAMEWORK_LIBS) \
Expand Down
40 changes: 34 additions & 6 deletions m4/ax_boost_base.m4
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 18
#serial 26

AC_DEFUN([AX_BOOST_BASE],
[
Expand All @@ -59,7 +59,7 @@ AC_ARG_WITH([boost],
AC_ARG_WITH([boost-libdir],
AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
[Force given directory for boost libraries. Note that this will overwrite library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
[Force given directory for boost libraries. Note that this will override library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
[
if test -d "$withval"
then
Expand All @@ -84,15 +84,33 @@ if test "x$want_boost" = "xyes"; then
AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
succeeded=no
dnl On x86_64 systems check for system libraries in both lib64 and lib.
dnl On 64-bit systems check for system libraries in both lib64 and lib.
dnl The former is specified by FHS, but e.g. Debian does not adhere to
dnl this (as it rises problems for generic multi-arch support).
dnl The last entry in the list is chosen by default when no libraries
dnl are found, e.g. when only header-only libraries are installed!
libsubdirs="lib"
if test `uname -m` = x86_64; then
libsubdirs="lib64 lib lib64"
fi
ax_arch=`uname -m`
case $ax_arch in
x86_64)
libsubdirs="lib64 libx32 lib lib64"
;;
ppc64|s390x|sparc64|aarch64|ppc64le)
libsubdirs="lib64 lib lib64 ppc64le"
;;
esac
dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give
dnl them priority over the other paths since, if libs are found there, they
dnl are almost assuredly the ones desired.
AC_REQUIRE([AC_CANONICAL_HOST])
libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs"
case ${host_cpu} in
i?86)
libsubdirs="lib/i386-${host_os} $libsubdirs"
;;
esac
dnl first we check the system location for boost libraries
dnl this location ist chosen if boost libraries are installed with the --layout=system option
Expand Down Expand Up @@ -155,6 +173,10 @@ if test "x$want_boost" = "xyes"; then
dnl if we found no boost with system layout we search for boost libraries
dnl built and installed without the --layout=system option or for a staged(not installed) version
if test "x$succeeded" != "xyes"; then
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
BOOST_CPPFLAGS=
BOOST_LDFLAGS=
_version=0
if test "$ac_boost_path" != ""; then
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
Expand All @@ -167,6 +189,12 @@ if test "x$want_boost" = "xyes"; then
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
done
dnl if nothing found search for layout used in Windows distributions
if test -z "$BOOST_CPPFLAGS"; then
if test -d "$ac_boost_path/boost" && test -r "$ac_boost_path/boost"; then
BOOST_CPPFLAGS="-I$ac_boost_path"
fi
fi
fi
else
if test "$cross_compiling" != yes; then
Expand Down
14 changes: 7 additions & 7 deletions mordor/examples/cat.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright (c) 2009 - Mozy, Inc.

#include "mordor/predef.h"
#include "../predef.h"

#include <iostream>

#include "mordor/config.h"
#include "mordor/main.h"
#include "mordor/streams/file.h"
#include "mordor/streams/std.h"
#include "mordor/streams/transfer.h"
#include "mordor/workerpool.h"
#include "../config.h"
#include "../main.h"
#include "../streams/file.h"
#include "../streams/std.h"
#include "../streams/transfer.h"
#include "../workerpool.h"

using namespace Mordor;

Expand Down
10 changes: 5 additions & 5 deletions mordor/examples/decodebacktrace.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright (c) 2009 - Mozy, Inc.

#include "mordor/predef.h"
#include "../predef.h"

#include <iostream>

#include <DbgHelp.h>

#include "mordor/config.h"
#include "mordor/main.h"
#include "mordor/streams/buffered.h"
#include "mordor/streams/std.h"
#include "../config.h"
#include "../main.h"
#include "../streams/buffered.h"
#include "../streams/std.h"

using namespace Mordor;

Expand Down
22 changes: 11 additions & 11 deletions mordor/examples/echoserver.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// Copyright (c) 2009 - Mozy, Inc.

#include "mordor/predef.h"
#include "../predef.h"


#include "mordor/config.h"
#include "mordor/daemon.h"
#include "mordor/http/multipart.h"
#include "mordor/http/server.h"
#include "mordor/iomanager.h"
#include "mordor/main.h"
#include "mordor/socket.h"
#include "../config.h"
#include "../daemon.h"
#include "../http/multipart.h"
#include "../http/server.h"
#include "../iomanager.h"
#include "../main.h"
#include "../socket.h"
#ifdef WINDOWS
#include "mordor/streams/namedpipe.h"
#include "../streams/namedpipe.h"
#endif
#include "mordor/streams/socket.h"
#include "mordor/streams/transfer.h"
#include "../streams/socket.h"
#include "../streams/transfer.h"

using namespace Mordor;

Expand Down
16 changes: 9 additions & 7 deletions mordor/examples/iombench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
// Can act as both the client and the server.
//

#include "mordor/predef.h"
#include "../predef.h"

#include "netbench.h"

#include <iostream>

#include <boost/scoped_array.hpp>

#include "mordor/config.h"
#include "mordor/fibersynchronization.h"
#include "mordor/iomanager.h"
#include "mordor/log.h"
#include "mordor/main.h"
#include "mordor/socket.h"
#include "../config.h"
#include "../fibersynchronization.h"
#include "../iomanager.h"
#include "../log.h"
#include "../main.h"
#include "../socket.h"

using namespace Mordor;

Expand Down Expand Up @@ -303,6 +303,8 @@ MORDOR_MAIN(int argc, char *argv[])
NetBench bench(argc, argv);

Config::loadFromEnvironment();

MORDOR_LOG_INFO(g_log) << "Running " << g_iomThreads->val() << " threads";
IOManager iom(g_iomThreads->val());

IOMBenchServer server(iom);
Expand Down
2 changes: 1 addition & 1 deletion mordor/examples/netbench.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "netbench.h"

#include "mordor/version.h"
#include "../version.h"

#include <stdio.h>
#ifndef WINDOWS
Expand Down
4 changes: 2 additions & 2 deletions mordor/examples/netbench.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class NetBenchServer
{
public:
virtual ~NetBenchServer() {}
virtual ~NetBenchServer() noexcept(false) {}

// start the implementation of the server to be benchmarked
virtual void run(std::string& host,
Expand All @@ -21,7 +21,7 @@ class NetBenchServer
class NetBenchClient
{
public:
virtual ~NetBenchClient () {}
virtual ~NetBenchClient () noexcept(false) {}

// initialize the client to be benchmarked
virtual void init(std::string& host,
Expand Down
18 changes: 9 additions & 9 deletions mordor/examples/simpleappserver.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Copyright (c) 2010 - Mozy, Inc.

#include "mordor/predef.h"
#include "../predef.h"

#include <iostream>

#include "mordor/config.h"
#include "mordor/http/server.h"
#include "mordor/iomanager.h"
#include "mordor/main.h"
#include "mordor/socket.h"
#include "mordor/streams/memory.h"
#include "mordor/streams/socket.h"
#include "mordor/streams/transfer.h"
#include "../config.h"
#include "../http/server.h"
#include "../iomanager.h"
#include "../main.h"
#include "../socket.h"
#include "../streams/memory.h"
#include "../streams/socket.h"
#include "../streams/transfer.h"

using namespace Mordor;

Expand Down
12 changes: 6 additions & 6 deletions mordor/examples/simpleclient.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Copyright (c) 2009 - Mozy, Inc.

#include "mordor/predef.h"
#include "../predef.h"

#include <iostream>

#include "mordor/config.h"
#include "mordor/fiber.h"
#include "mordor/iomanager.h"
#include "mordor/main.h"
#include "mordor/socket.h"
#include "../config.h"
#include "../fiber.h"
#include "../iomanager.h"
#include "../main.h"
#include "../socket.h"

using namespace Mordor;

Expand Down
20 changes: 10 additions & 10 deletions mordor/examples/simplehttpfileserver.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#include "mordor/predef.h"
#include "../predef.h"

#include <memory>
#include <iostream>

#include <boost/thread.hpp>

#include "mordor/config.h"
#include "mordor/http/server.h"
#include "mordor/iomanager.h"
#include "mordor/main.h"
#include "mordor/socket.h"
#include "mordor/streams/file.h"
#include "mordor/streams/socket.h"
#include "mordor/streams/transfer.h"
#include "mordor/streams/ssl.h"
#include "../config.h"
#include "../http/server.h"
#include "../iomanager.h"
#include "../main.h"
#include "../socket.h"
#include "../streams/file.h"
#include "../streams/socket.h"
#include "../streams/transfer.h"
#include "../streams/ssl.h"

using namespace Mordor;

Expand Down
Loading

0 comments on commit 256e167

Please sign in to comment.