From 57226113be3e1e168849df66c6c8f3b7125b993b Mon Sep 17 00:00:00 2001 From: Alex Chernyakhovsky Date: Sun, 5 Mar 2023 17:57:22 -0500 Subject: [PATCH] Switch to fully-qualified #include Previously, mosh used extensive -I flags and all of the mosh-local makes it really hard to tell what the proper dependency graph is, so instead remove the -I arguments in favvor of $(top_srcdir) and qualify the paths wherever they are used. --- src/crypto/Makefile.am | 2 +- src/crypto/base64.cc | 4 ++-- src/crypto/byteorder.h | 2 +- src/crypto/crypto.cc | 10 +++++----- src/crypto/crypto.h | 2 +- src/crypto/ocb_internal.cc | 8 ++++---- src/crypto/ocb_openssl.cc | 4 ++-- src/crypto/prng.h | 2 +- src/examples/Makefile.am | 2 +- src/examples/benchmark.cc | 14 +++++++------- src/examples/decrypt.cc | 2 +- src/examples/encrypt.cc | 2 +- src/examples/ntester.cc | 12 ++++++------ src/examples/parse.cc | 14 +++++++------- src/examples/termemu.cc | 16 ++++++++-------- src/frontend/Makefile.am | 2 +- src/frontend/mosh-client.cc | 10 +++++----- src/frontend/mosh-server.cc | 24 ++++++++++++------------ src/frontend/stmclient.cc | 22 +++++++++++----------- src/frontend/stmclient.h | 10 +++++----- src/frontend/terminaloverlay.cc | 2 +- src/frontend/terminaloverlay.h | 8 ++++---- src/fuzz/Makefile.am | 4 ++-- src/fuzz/terminal_fuzzer.cc | 4 ++-- src/fuzz/terminal_parser_fuzzer.cc | 2 +- src/network/Makefile.am | 2 +- src/network/compressor.cc | 2 +- src/network/network.cc | 14 +++++++------- src/network/network.h | 2 +- src/network/networktransport-impl.h | 2 +- src/network/networktransport.h | 4 ++-- src/network/transportfragment.cc | 6 +++--- src/network/transportfragment.h | 2 +- src/network/transportsender-impl.h | 2 +- src/network/transportsender.h | 6 +++--- src/statesync/Makefile.am | 2 +- src/statesync/completeterminal.cc | 6 +++--- src/statesync/completeterminal.h | 4 ++-- src/statesync/user.cc | 6 +++--- src/statesync/user.h | 2 +- src/terminal/Makefile.am | 2 +- src/terminal/parser.cc | 2 +- src/terminal/parser.h | 2 +- src/terminal/parseraction.cc | 4 ++-- src/terminal/parseraction.h | 2 +- src/terminal/parserstate.cc | 2 +- src/terminal/parsertransition.h | 2 +- src/terminal/terminal.cc | 2 +- src/terminal/terminal.h | 4 ++-- src/terminal/terminaldispatcher.cc | 4 ++-- src/terminal/terminaldisplay.cc | 2 +- src/terminal/terminaldisplay.h | 2 +- src/terminal/terminaldisplayinit.cc | 2 +- src/terminal/terminalframebuffer.cc | 2 +- src/terminal/terminalframebuffer.h | 2 +- src/terminal/terminalfunctions.cc | 4 ++-- src/terminal/terminaluserinput.h | 2 +- src/tests/Makefile.am | 2 +- src/tests/base64.cc | 8 ++++---- src/tests/encrypt-decrypt.cc | 6 +++--- src/tests/inpty.cc | 6 +++--- src/tests/is-utf8-locale.cc | 2 +- src/tests/nonce-incr.cc | 2 +- src/tests/ocb-aes.cc | 10 +++++----- src/tests/test_utils.h | 2 +- src/util/Makefile.am | 2 +- src/util/dos_assert.h | 2 +- src/util/locale_utils.cc | 4 ++-- src/util/pty_compat.cc | 4 ++-- src/util/pty_compat.h | 2 +- src/util/select.cc | 2 +- src/util/select.h | 4 ++-- src/util/shared.h | 2 +- src/util/swrite.cc | 2 +- src/util/timestamp.cc | 4 ++-- 75 files changed, 177 insertions(+), 177 deletions(-) diff --git a/src/crypto/Makefile.am b/src/crypto/Makefile.am index 1be541206..f80d0211d 100644 --- a/src/crypto/Makefile.am +++ b/src/crypto/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(srcdir)/../util $(CRYPTO_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir)/ $(CRYPTO_CFLAGS) AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS) noinst_LIBRARIES = libmoshcrypto.a diff --git a/src/crypto/base64.cc b/src/crypto/base64.cc index 3247b5293..6d8a9d157 100644 --- a/src/crypto/base64.cc +++ b/src/crypto/base64.cc @@ -33,8 +33,8 @@ #include #include -#include "fatal_assert.h" -#include "base64.h" +#include "src/util/fatal_assert.h" +#include "src/crypto/base64.h" static const char table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; diff --git a/src/crypto/byteorder.h b/src/crypto/byteorder.h index bc91cc267..9148287a5 100644 --- a/src/crypto/byteorder.h +++ b/src/crypto/byteorder.h @@ -33,7 +33,7 @@ #ifndef BYTEORDER_HPP #define BYTEORDER_HPP -#include "config.h" +#include "src/include/config.h" #if HAVE_DECL_BE64TOH || HAVE_DECL_BETOH64 diff --git a/src/crypto/crypto.cc b/src/crypto/crypto.cc index 005cfcca6..10f3a03b9 100644 --- a/src/crypto/crypto.cc +++ b/src/crypto/crypto.cc @@ -38,11 +38,11 @@ #include #include -#include "byteorder.h" -#include "crypto.h" -#include "base64.h" -#include "fatal_assert.h" -#include "prng.h" +#include "src/crypto/byteorder.h" +#include "src/crypto/crypto.h" +#include "src/crypto/base64.h" +#include "src/util/fatal_assert.h" +#include "src/crypto/prng.h" using namespace Crypto; diff --git a/src/crypto/crypto.h b/src/crypto/crypto.h index 2339deb59..e634d3e09 100644 --- a/src/crypto/crypto.h +++ b/src/crypto/crypto.h @@ -33,7 +33,7 @@ #ifndef CRYPTO_HPP #define CRYPTO_HPP -#include "ae.h" +#include "src/crypto/ae.h" #include #include #include diff --git a/src/crypto/ocb_internal.cc b/src/crypto/ocb_internal.cc index bec5c08f7..c25d7bd2a 100644 --- a/src/crypto/ocb_internal.cc +++ b/src/crypto/ocb_internal.cc @@ -24,7 +24,7 @@ / Comments are welcome: Ted Krovetz - Dedicated to Laurel K /------------------------------------------------------------------------- */ -#include "config.h" +#include "src/include/config.h" /* This module implements the ae.h interface for OpenSSL, Apple Common / Crypto, and Nettle. */ @@ -84,9 +84,9 @@ /* Includes and compiler specific definitions */ /* ----------------------------------------------------------------------- */ -#include "ae.h" -#include "crypto.h" -#include "fatal_assert.h" +#include "src/crypto/ae.h" +#include "src/crypto/crypto.h" +#include "src/util/fatal_assert.h" #include #include #if defined(HAVE_STRINGS_H) diff --git a/src/crypto/ocb_openssl.cc b/src/crypto/ocb_openssl.cc index de4609651..3c70369b3 100644 --- a/src/crypto/ocb_openssl.cc +++ b/src/crypto/ocb_openssl.cc @@ -1,5 +1,5 @@ -#include "config.h" -#include "ae.h" +#include "src/include/config.h" +#include "src/crypto/ae.h" #include #include diff --git a/src/crypto/prng.h b/src/crypto/prng.h index efcddf0f8..693080e18 100644 --- a/src/crypto/prng.h +++ b/src/crypto/prng.h @@ -37,7 +37,7 @@ #include #include -#include "crypto.h" +#include "src/crypto/crypto.h" /* Read random bytes from /dev/urandom. diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am index a8c664fe2..6a5717fa5 100644 --- a/src/examples/Makefile.am +++ b/src/examples/Makefile.am @@ -1,4 +1,4 @@ -AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) +AM_CXXFLAGS = -I$(top_srcdir)/ $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) AM_LDFLAGS = $(HARDEN_LDFLAGS) if BUILD_EXAMPLES diff --git a/src/examples/benchmark.cc b/src/examples/benchmark.cc index 2418ddd5d..d2f3b2ab6 100644 --- a/src/examples/benchmark.cc +++ b/src/examples/benchmark.cc @@ -30,7 +30,7 @@ also delete it here. */ -#include "config.h" +#include "src/include/config.h" #include #include @@ -52,12 +52,12 @@ #include #endif -#include "swrite.h" -#include "completeterminal.h" -#include "user.h" -#include "terminaloverlay.h" -#include "locale_utils.h" -#include "fatal_assert.h" +#include "src/util/swrite.h" +#include "src/statesync/completeterminal.h" +#include "src/statesync/user.h" +#include "src/frontend/terminaloverlay.h" +#include "src/util/locale_utils.h" +#include "src/util/fatal_assert.h" const int ITERATIONS = 100000; diff --git a/src/examples/decrypt.cc b/src/examples/decrypt.cc index b3b6cae2a..384cf58a1 100644 --- a/src/examples/decrypt.cc +++ b/src/examples/decrypt.cc @@ -34,7 +34,7 @@ #include #include -#include "crypto.h" +#include "src/crypto/crypto.h" using namespace Crypto; diff --git a/src/examples/encrypt.cc b/src/examples/encrypt.cc index da454bd3b..0957ef7ff 100644 --- a/src/examples/encrypt.cc +++ b/src/examples/encrypt.cc @@ -34,7 +34,7 @@ #include #include -#include "crypto.h" +#include "src/crypto/crypto.h" using namespace Crypto; diff --git a/src/examples/ntester.cc b/src/examples/ntester.cc index 5db1d1ca7..6e3c409fe 100644 --- a/src/examples/ntester.cc +++ b/src/examples/ntester.cc @@ -33,12 +33,12 @@ #include #include -#include "user.h" -#include "fatal_assert.h" -#include "pty_compat.h" -#include "networktransport-impl.h" -#include "select.h" -#include "shared.h" +#include "src/statesync/user.h" +#include "src/util/fatal_assert.h" +#include "src/util/pty_compat.h" +#include "src/network/networktransport-impl.h" +#include "src/util/select.h" +#include "src/util/shared.h" using namespace Network; diff --git a/src/examples/parse.cc b/src/examples/parse.cc index 2a9d0dc44..26c4043b2 100644 --- a/src/examples/parse.cc +++ b/src/examples/parse.cc @@ -30,7 +30,7 @@ also delete it here. */ -#include "config.h" +#include "src/include/config.h" #include #include @@ -53,12 +53,12 @@ #include #endif -#include "parser.h" -#include "swrite.h" -#include "locale_utils.h" -#include "fatal_assert.h" -#include "pty_compat.h" -#include "select.h" +#include "src/terminal/parser.h" +#include "src/util/swrite.h" +#include "src/util/locale_utils.h" +#include "src/util/fatal_assert.h" +#include "src/util/pty_compat.h" +#include "src/util/select.h" const size_t buf_size = 1024; diff --git a/src/examples/termemu.cc b/src/examples/termemu.cc index 4c3cd04fd..e8dd3b5f8 100644 --- a/src/examples/termemu.cc +++ b/src/examples/termemu.cc @@ -30,7 +30,7 @@ also delete it here. */ -#include "config.h" +#include "src/include/config.h" #include #include @@ -60,13 +60,13 @@ #include #endif -#include "parser.h" -#include "completeterminal.h" -#include "swrite.h" -#include "fatal_assert.h" -#include "pty_compat.h" -#include "locale_utils.h" -#include "select.h" +#include "src/terminal/parser.h" +#include "src/statesync/completeterminal.h" +#include "src/util/swrite.h" +#include "src/util/fatal_assert.h" +#include "src/util/pty_compat.h" +#include "src/util/locale_utils.h" +#include "src/util/select.h" const size_t buf_size = 16384; diff --git a/src/frontend/Makefile.am b/src/frontend/Makefile.am index 1aa83fd3f..c4574e963 100644 --- a/src/frontend/Makefile.am +++ b/src/frontend/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(srcdir)/../statesync -I$(srcdir)/../terminal -I$(srcdir)/../network -I$(srcdir)/../crypto -I../protobufs -I$(srcdir)/../util $(TINFO_CFLAGS) $(protobuf_CFLAGS) $(CRYPTO_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir)/ $(TINFO_CFLAGS) $(protobuf_CFLAGS) $(CRYPTO_CFLAGS) AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS) AM_LDFLAGS = $(HARDEN_LDFLAGS) $(CODE_COVERAGE_LIBS) LDADD = ../crypto/libmoshcrypto.a ../network/libmoshnetwork.a ../statesync/libmoshstatesync.a ../terminal/libmoshterminal.a ../util/libmoshutil.a ../protobufs/libmoshprotos.a -lm $(TINFO_LIBS) $(protobuf_LIBS) $(CRYPTO_LIBS) diff --git a/src/frontend/mosh-client.cc b/src/frontend/mosh-client.cc index 5b1a919e4..9c3db8d69 100644 --- a/src/frontend/mosh-client.cc +++ b/src/frontend/mosh-client.cc @@ -30,16 +30,16 @@ also delete it here. */ -#include "config.h" -#include "version.h" +#include "src/include/config.h" +#include "src/include/version.h" #include #include #include "stmclient.h" -#include "crypto.h" -#include "locale_utils.h" -#include "fatal_assert.h" +#include "src/crypto/crypto.h" +#include "src/util/locale_utils.h" +#include "src/util/fatal_assert.h" /* These need to be included last because of conflicting defines. */ /* diff --git a/src/frontend/mosh-server.cc b/src/frontend/mosh-server.cc index f6d2ff3bc..38d8fc22b 100644 --- a/src/frontend/mosh-server.cc +++ b/src/frontend/mosh-server.cc @@ -30,8 +30,8 @@ also delete it here. */ -#include "config.h" -#include "version.h" +#include "src/include/config.h" +#include "src/include/version.h" #include #include @@ -79,21 +79,21 @@ #include #endif -#include "completeterminal.h" -#include "swrite.h" -#include "user.h" -#include "fatal_assert.h" -#include "locale_utils.h" -#include "pty_compat.h" -#include "select.h" -#include "timestamp.h" -#include "fatal_assert.h" +#include "src/statesync/completeterminal.h" +#include "src/util/swrite.h" +#include "src/statesync/user.h" +#include "src/util/fatal_assert.h" +#include "src/util/locale_utils.h" +#include "src/util/pty_compat.h" +#include "src/util/select.h" +#include "src/util/timestamp.h" +#include "src/util/fatal_assert.h" #ifndef _PATH_BSHELL #define _PATH_BSHELL "/bin/sh" #endif -#include "networktransport-impl.h" +#include "src/network/networktransport-impl.h" typedef Network::Transport< Terminal::Complete, Network::UserStream > ServerConnection; diff --git a/src/frontend/stmclient.cc b/src/frontend/stmclient.cc index e6e9b3a31..29cb4f22c 100644 --- a/src/frontend/stmclient.cc +++ b/src/frontend/stmclient.cc @@ -30,7 +30,7 @@ also delete it here. */ -#include "config.h" +#include "src/include/config.h" #include #include @@ -52,16 +52,16 @@ #endif #include "stmclient.h" -#include "swrite.h" -#include "completeterminal.h" -#include "user.h" -#include "fatal_assert.h" -#include "locale_utils.h" -#include "pty_compat.h" -#include "select.h" -#include "timestamp.h" - -#include "networktransport-impl.h" +#include "src/util/swrite.h" +#include "src/statesync/completeterminal.h" +#include "src/statesync/user.h" +#include "src/util/fatal_assert.h" +#include "src/util/locale_utils.h" +#include "src/util/pty_compat.h" +#include "src/util/select.h" +#include "src/util/timestamp.h" + +#include "src/network/networktransport-impl.h" using std::wstring; diff --git a/src/frontend/stmclient.h b/src/frontend/stmclient.h index c1440c3ac..12a951255 100644 --- a/src/frontend/stmclient.h +++ b/src/frontend/stmclient.h @@ -37,11 +37,11 @@ #include #include -#include "completeterminal.h" -#include "networktransport.h" -#include "user.h" -#include "shared.h" -#include "terminaloverlay.h" +#include "src/statesync/completeterminal.h" +#include "src/network/networktransport.h" +#include "src/statesync/user.h" +#include "src/util/shared.h" +#include "src/frontend/terminaloverlay.h" class STMClient { private: diff --git a/src/frontend/terminaloverlay.cc b/src/frontend/terminaloverlay.cc index adee67350..efbdaba6b 100644 --- a/src/frontend/terminaloverlay.cc +++ b/src/frontend/terminaloverlay.cc @@ -36,7 +36,7 @@ #include #include -#include "terminaloverlay.h" +#include "src/frontend/terminaloverlay.h" using namespace Overlay; diff --git a/src/frontend/terminaloverlay.h b/src/frontend/terminaloverlay.h index 84421eb81..16b502950 100644 --- a/src/frontend/terminaloverlay.h +++ b/src/frontend/terminaloverlay.h @@ -33,10 +33,10 @@ #ifndef TERMINAL_OVERLAY_HPP #define TERMINAL_OVERLAY_HPP -#include "terminalframebuffer.h" -#include "network.h" -#include "transportsender.h" -#include "parser.h" +#include "src/terminal/terminalframebuffer.h" +#include "src/network/network.h" +#include "src/network/transportsender.h" +#include "src/terminal/parser.h" #include #include diff --git a/src/fuzz/Makefile.am b/src/fuzz/Makefile.am index 3b8339a32..e28e1031c 100644 --- a/src/fuzz/Makefile.am +++ b/src/fuzz/Makefile.am @@ -4,10 +4,10 @@ if ENABLE_FUZZING noinst_PROGRAMS = terminal_parser_fuzzer terminal_fuzzer endif -terminal_parser_fuzzer_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util +terminal_parser_fuzzer_CPPFLAGS = -I$(top_srcdir)/ terminal_parser_fuzzer_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a terminal_parser_fuzzer_SOURCES = terminal_parser_fuzzer.cc -terminal_fuzzer_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util -I$(srcdir)/../statesync -I../protobufs +terminal_fuzzer_CPPFLAGS = -I$(top_srcdir)/ terminal_fuzzer_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a ../statesync/libmoshstatesync.a ../protobufs/libmoshprotos.a $(TINFO_LIBS) $(protobuf_LIBS) terminal_fuzzer_SOURCES = terminal_fuzzer.cc diff --git a/src/fuzz/terminal_fuzzer.cc b/src/fuzz/terminal_fuzzer.cc index e3506f875..3e2dc25ee 100644 --- a/src/fuzz/terminal_fuzzer.cc +++ b/src/fuzz/terminal_fuzzer.cc @@ -1,8 +1,8 @@ #include #include -#include "parser.h" -#include "completeterminal.h" +#include "src/terminal/parser.h" +#include "src/statesync/completeterminal.h" extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { Terminal::Display display(false); diff --git a/src/fuzz/terminal_parser_fuzzer.cc b/src/fuzz/terminal_parser_fuzzer.cc index 740e252f6..edc63abdf 100644 --- a/src/fuzz/terminal_parser_fuzzer.cc +++ b/src/fuzz/terminal_parser_fuzzer.cc @@ -1,7 +1,7 @@ #include #include -#include "parser.h" +#include "src/terminal/parser.h" extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { Parser::UTF8Parser parser; diff --git a/src/network/Makefile.am b/src/network/Makefile.am index 021d2415c..cbc165778 100644 --- a/src/network/Makefile.am +++ b/src/network/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(srcdir)/../util -I$(srcdir)/../crypto -I../protobufs $(protobuf_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir)/ $(protobuf_CFLAGS) AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS) noinst_LIBRARIES = libmoshnetwork.a diff --git a/src/network/compressor.cc b/src/network/compressor.cc index 97afd1972..2056f6baa 100644 --- a/src/network/compressor.cc +++ b/src/network/compressor.cc @@ -33,7 +33,7 @@ #include #include "compressor.h" -#include "dos_assert.h" +#include "src/util/dos_assert.h" using namespace Network; using std::string; diff --git a/src/network/network.cc b/src/network/network.cc index bb05986be..d4168cc5a 100644 --- a/src/network/network.cc +++ b/src/network/network.cc @@ -30,7 +30,7 @@ also delete it here. */ -#include "config.h" +#include "src/include/config.h" #include #include @@ -44,13 +44,13 @@ #include #include -#include "dos_assert.h" -#include "fatal_assert.h" -#include "byteorder.h" -#include "network.h" -#include "crypto.h" +#include "src/util/dos_assert.h" +#include "src/util/fatal_assert.h" +#include "src/crypto/byteorder.h" +#include "src/network/network.h" +#include "src/crypto/crypto.h" -#include "timestamp.h" +#include "src/util/timestamp.h" #ifndef MSG_DONTWAIT #define MSG_DONTWAIT MSG_NONBLOCK diff --git a/src/network/network.h b/src/network/network.h index 15ba76fff..471aaf5e6 100644 --- a/src/network/network.h +++ b/src/network/network.h @@ -44,7 +44,7 @@ #include #include -#include "crypto.h" +#include "src/crypto/crypto.h" using namespace Crypto; diff --git a/src/network/networktransport-impl.h b/src/network/networktransport-impl.h index e6325093f..b3dc522f4 100644 --- a/src/network/networktransport-impl.h +++ b/src/network/networktransport-impl.h @@ -33,7 +33,7 @@ #ifndef NETWORK_TRANSPORT_IMPL_HPP #define NETWORK_TRANSPORT_IMPL_HPP -#include "networktransport.h" +#include "src/network/networktransport.h" #include "transportsender-impl.h" diff --git a/src/network/networktransport.h b/src/network/networktransport.h index 115ff37e1..3fcbd2229 100644 --- a/src/network/networktransport.h +++ b/src/network/networktransport.h @@ -39,8 +39,8 @@ #include #include -#include "network.h" -#include "transportsender.h" +#include "src/network/network.h" +#include "src/network/transportsender.h" #include "transportfragment.h" diff --git a/src/network/transportfragment.cc b/src/network/transportfragment.cc index a62d9b29b..f68982832 100644 --- a/src/network/transportfragment.cc +++ b/src/network/transportfragment.cc @@ -32,11 +32,11 @@ #include -#include "byteorder.h" +#include "src/crypto/byteorder.h" #include "transportfragment.h" -#include "transportinstruction.pb.h" +#include "src/protobufs/transportinstruction.pb.h" #include "compressor.h" -#include "fatal_assert.h" +#include "src/util/fatal_assert.h" using namespace Network; using namespace TransportBuffers; diff --git a/src/network/transportfragment.h b/src/network/transportfragment.h index 9add05e90..1e7fa92dd 100644 --- a/src/network/transportfragment.h +++ b/src/network/transportfragment.h @@ -37,7 +37,7 @@ #include #include -#include "transportinstruction.pb.h" +#include "src/protobufs/transportinstruction.pb.h" namespace Network { using std::vector; diff --git a/src/network/transportsender-impl.h b/src/network/transportsender-impl.h index 518f1768b..74a3c34dd 100644 --- a/src/network/transportsender-impl.h +++ b/src/network/transportsender-impl.h @@ -39,7 +39,7 @@ #include #include -#include "transportsender.h" +#include "src/network/transportsender.h" #include "transportfragment.h" #include diff --git a/src/network/transportsender.h b/src/network/transportsender.h index db55713fd..5b89e9cda 100644 --- a/src/network/transportsender.h +++ b/src/network/transportsender.h @@ -37,11 +37,11 @@ #include #include -#include "network.h" -#include "transportinstruction.pb.h" +#include "src/network/network.h" +#include "src/protobufs/transportinstruction.pb.h" #include "transportstate.h" #include "transportfragment.h" -#include "prng.h" +#include "src/crypto/prng.h" namespace Network { using std::list; diff --git a/src/statesync/Makefile.am b/src/statesync/Makefile.am index edf1b9e3a..48aa76f2c 100644 --- a/src/statesync/Makefile.am +++ b/src/statesync/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(srcdir)/../util -I$(srcdir)/../terminal -I../protobufs $(protobuf_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir)/ $(protobuf_CFLAGS) AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS) noinst_LIBRARIES = libmoshstatesync.a diff --git a/src/statesync/completeterminal.cc b/src/statesync/completeterminal.cc index c634693d8..47a5c74a3 100644 --- a/src/statesync/completeterminal.cc +++ b/src/statesync/completeterminal.cc @@ -30,10 +30,10 @@ also delete it here. */ -#include "completeterminal.h" -#include "fatal_assert.h" +#include "src/statesync/completeterminal.h" +#include "src/util/fatal_assert.h" -#include "hostinput.pb.h" +#include "src/protobufs/hostinput.pb.h" #include diff --git a/src/statesync/completeterminal.h b/src/statesync/completeterminal.h index 94ee7d9cd..34f9a96cc 100644 --- a/src/statesync/completeterminal.h +++ b/src/statesync/completeterminal.h @@ -36,8 +36,8 @@ #include #include -#include "parser.h" -#include "terminal.h" +#include "src/terminal/parser.h" +#include "src/terminal/terminal.h" /* This class represents the complete terminal -- a UTF8Parser feeding Actions to an Emulator. */ diff --git a/src/statesync/user.cc b/src/statesync/user.cc index 9ea29c122..3315c4d54 100644 --- a/src/statesync/user.cc +++ b/src/statesync/user.cc @@ -33,9 +33,9 @@ #include #include -#include "user.h" -#include "fatal_assert.h" -#include "userinput.pb.h" +#include "src/statesync/user.h" +#include "src/util/fatal_assert.h" +#include "src/protobufs/userinput.pb.h" using namespace Parser; using namespace Network; diff --git a/src/statesync/user.h b/src/statesync/user.h index 67c7853b4..fa905e50a 100644 --- a/src/statesync/user.h +++ b/src/statesync/user.h @@ -38,7 +38,7 @@ #include #include -#include "parseraction.h" +#include "src/terminal/parseraction.h" namespace Network { using std::deque; diff --git a/src/terminal/Makefile.am b/src/terminal/Makefile.am index 2b343c711..b7def6b09 100644 --- a/src/terminal/Makefile.am +++ b/src/terminal/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(srcdir)/../util $(TINFO_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir)/ $(TINFO_CFLAGS) AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS) noinst_LIBRARIES = libmoshterminal.a diff --git a/src/terminal/parser.cc b/src/terminal/parser.cc index 2522d4c90..d1f00b762 100644 --- a/src/terminal/parser.cc +++ b/src/terminal/parser.cc @@ -36,7 +36,7 @@ #include #include -#include "parser.h" +#include "src/terminal/parser.h" const Parser::StateFamily Parser::family; diff --git a/src/terminal/parser.h b/src/terminal/parser.h index c2979b57d..f76096c29 100644 --- a/src/terminal/parser.h +++ b/src/terminal/parser.h @@ -40,7 +40,7 @@ #include #include "parsertransition.h" -#include "parseraction.h" +#include "src/terminal/parseraction.h" #include "parserstate.h" #include "parserstatefamily.h" diff --git a/src/terminal/parseraction.cc b/src/terminal/parseraction.cc index 676aec2ac..531d2a932 100644 --- a/src/terminal/parseraction.cc +++ b/src/terminal/parseraction.cc @@ -33,8 +33,8 @@ #include #include -#include "parseraction.h" -#include "terminal.h" +#include "src/terminal/parseraction.h" +#include "src/terminal/terminal.h" using namespace Parser; diff --git a/src/terminal/parseraction.h b/src/terminal/parseraction.h index 61558d92c..5a6c8ca7e 100644 --- a/src/terminal/parseraction.h +++ b/src/terminal/parseraction.h @@ -36,7 +36,7 @@ #include #include -#include "shared.h" +#include "src/util/shared.h" namespace Terminal { class Emulator; diff --git a/src/terminal/parserstate.cc b/src/terminal/parserstate.cc index 112f856d3..3d60170f7 100644 --- a/src/terminal/parserstate.cc +++ b/src/terminal/parserstate.cc @@ -32,7 +32,7 @@ #include "parserstate.h" #include "parserstatefamily.h" -#include "shared.h" +#include "src/util/shared.h" using namespace Parser; diff --git a/src/terminal/parsertransition.h b/src/terminal/parsertransition.h index 4fac47411..8a5c2055f 100644 --- a/src/terminal/parsertransition.h +++ b/src/terminal/parsertransition.h @@ -35,7 +35,7 @@ #include -#include "parseraction.h" +#include "src/terminal/parseraction.h" namespace Parser { class State; diff --git a/src/terminal/terminal.cc b/src/terminal/terminal.cc index 057b3d013..95a1fd85e 100644 --- a/src/terminal/terminal.cc +++ b/src/terminal/terminal.cc @@ -36,7 +36,7 @@ #include #include -#include "terminal.h" +#include "src/terminal/terminal.h" using namespace Terminal; diff --git a/src/terminal/terminal.h b/src/terminal/terminal.h index b0d5e9b37..f4412ba6c 100644 --- a/src/terminal/terminal.h +++ b/src/terminal/terminal.h @@ -38,8 +38,8 @@ #include #include -#include "parseraction.h" -#include "terminalframebuffer.h" +#include "src/terminal/parseraction.h" +#include "src/terminal/terminalframebuffer.h" #include "terminaldispatcher.h" #include "terminaluserinput.h" #include "terminaldisplay.h" diff --git a/src/terminal/terminaldispatcher.cc b/src/terminal/terminaldispatcher.cc index f8195ee00..450aef3a0 100644 --- a/src/terminal/terminaldispatcher.cc +++ b/src/terminal/terminaldispatcher.cc @@ -37,8 +37,8 @@ #include #include "terminaldispatcher.h" -#include "parseraction.h" -#include "terminalframebuffer.h" +#include "src/terminal/parseraction.h" +#include "src/terminal/terminalframebuffer.h" using namespace Terminal; diff --git a/src/terminal/terminaldisplay.cc b/src/terminal/terminaldisplay.cc index e7595c248..013c6f879 100644 --- a/src/terminal/terminaldisplay.cc +++ b/src/terminal/terminaldisplay.cc @@ -33,7 +33,7 @@ #include #include "terminaldisplay.h" -#include "terminalframebuffer.h" +#include "src/terminal/terminalframebuffer.h" using namespace Terminal; diff --git a/src/terminal/terminaldisplay.h b/src/terminal/terminaldisplay.h index 81009b014..0e066311c 100644 --- a/src/terminal/terminaldisplay.h +++ b/src/terminal/terminaldisplay.h @@ -33,7 +33,7 @@ #ifndef TERMINALDISPLAY_HPP #define TERMINALDISPLAY_HPP -#include "terminalframebuffer.h" +#include "src/terminal/terminalframebuffer.h" namespace Terminal { /* variables used within a new_frame */ diff --git a/src/terminal/terminaldisplayinit.cc b/src/terminal/terminaldisplayinit.cc index 6dffc510e..3defa9dec 100644 --- a/src/terminal/terminaldisplayinit.cc +++ b/src/terminal/terminaldisplayinit.cc @@ -33,7 +33,7 @@ /* This is in its own file because otherwise the ncurses #defines alias our own variable names. */ -#include "config.h" +#include "src/include/config.h" #include "terminaldisplay.h" #include diff --git a/src/terminal/terminalframebuffer.cc b/src/terminal/terminalframebuffer.cc index 70284a493..7a469a943 100644 --- a/src/terminal/terminalframebuffer.cc +++ b/src/terminal/terminalframebuffer.cc @@ -34,7 +34,7 @@ #include #include -#include "terminalframebuffer.h" +#include "src/terminal/terminalframebuffer.h" using namespace Terminal; diff --git a/src/terminal/terminalframebuffer.h b/src/terminal/terminalframebuffer.h index de9386977..430f5c111 100644 --- a/src/terminal/terminalframebuffer.h +++ b/src/terminal/terminalframebuffer.h @@ -42,7 +42,7 @@ #include #include -#include "shared.h" +#include "src/util/shared.h" /* Terminal framebuffer */ diff --git a/src/terminal/terminalfunctions.cc b/src/terminal/terminalfunctions.cc index ca141dd35..212541378 100644 --- a/src/terminal/terminalfunctions.cc +++ b/src/terminal/terminalfunctions.cc @@ -36,8 +36,8 @@ #include #include "terminaldispatcher.h" -#include "terminalframebuffer.h" -#include "parseraction.h" +#include "src/terminal/terminalframebuffer.h" +#include "src/terminal/parseraction.h" using namespace Terminal; diff --git a/src/terminal/terminaluserinput.h b/src/terminal/terminaluserinput.h index a1c8ea090..9512f4b3d 100644 --- a/src/terminal/terminaluserinput.h +++ b/src/terminal/terminaluserinput.h @@ -34,7 +34,7 @@ #define TERMINALUSERINPUT_HPP #include -#include "parseraction.h" +#include "src/terminal/parseraction.h" namespace Terminal { class UserInput { diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index a52f80045..aacdaab69 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -7,7 +7,7 @@ EXTRA_DIST = \ $(displaytests) \ emulation-attributes.test -AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS) +AM_CXXFLAGS = -I$(top_srcdir)/ $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS) AM_LDFLAGS = $(HARDEN_LDFLAGS) $(CODE_COVERAGE_LIBS) displaytests = \ diff --git a/src/tests/base64.cc b/src/tests/base64.cc index b23c585b1..7d49c8822 100644 --- a/src/tests/base64.cc +++ b/src/tests/base64.cc @@ -41,11 +41,11 @@ #include #include -#include "base64.h" +#include "src/crypto/base64.h" #include "base64_vector.h" -#include "crypto.h" -#include "prng.h" -#include "fatal_assert.h" +#include "src/crypto/crypto.h" +#include "src/crypto/prng.h" +#include "src/util/fatal_assert.h" // #include "test_utils.h" #define KEY_LEN 16 diff --git a/src/tests/encrypt-decrypt.cc b/src/tests/encrypt-decrypt.cc index 218ef8eaa..e09f0a828 100644 --- a/src/tests/encrypt-decrypt.cc +++ b/src/tests/encrypt-decrypt.cc @@ -39,9 +39,9 @@ #define __STDC_FORMAT_MACROS #include -#include "crypto.h" -#include "prng.h" -#include "fatal_assert.h" +#include "src/crypto/crypto.h" +#include "src/crypto/prng.h" +#include "src/util/fatal_assert.h" #include "test_utils.h" using namespace Crypto; diff --git a/src/tests/inpty.cc b/src/tests/inpty.cc index 100aee4a3..f57968e99 100644 --- a/src/tests/inpty.cc +++ b/src/tests/inpty.cc @@ -30,7 +30,7 @@ also delete it here. */ -#include "config.h" +#include "src/include/config.h" #include #include @@ -52,8 +52,8 @@ #include #endif -#include "pty_compat.h" -#include "swrite.h" +#include "src/util/pty_compat.h" +#include "src/util/swrite.h" int main( int argc, char *argv[] ) { diff --git a/src/tests/is-utf8-locale.cc b/src/tests/is-utf8-locale.cc index e439952a2..67ef2832e 100644 --- a/src/tests/is-utf8-locale.cc +++ b/src/tests/is-utf8-locale.cc @@ -32,7 +32,7 @@ #include -#include "locale_utils.h" +#include "src/util/locale_utils.h" int main( int argc __attribute__(( unused )), char **argv __attribute__(( unused ))) { diff --git a/src/tests/nonce-incr.cc b/src/tests/nonce-incr.cc index 3a107bc23..82cfc6b3d 100644 --- a/src/tests/nonce-incr.cc +++ b/src/tests/nonce-incr.cc @@ -36,7 +36,7 @@ #include #include -#include "network.h" +#include "src/network/network.h" int main() { diff --git a/src/tests/ocb-aes.cc b/src/tests/ocb-aes.cc index 03ad97c2b..943a704b6 100644 --- a/src/tests/ocb-aes.cc +++ b/src/tests/ocb-aes.cc @@ -41,12 +41,12 @@ #include #include -#include "ae.h" -#include "crypto.h" -#include "prng.h" -#include "fatal_assert.h" +#include "src/crypto/ae.h" +#include "src/crypto/crypto.h" +#include "src/crypto/prng.h" +#include "src/util/fatal_assert.h" #include "test_utils.h" -#include "shared.h" +#include "src/util/shared.h" #define KEY_LEN 16 #define NONCE_LEN 12 diff --git a/src/tests/test_utils.h b/src/tests/test_utils.h index 41e6b3f38..462b07ff7 100644 --- a/src/tests/test_utils.h +++ b/src/tests/test_utils.h @@ -35,7 +35,7 @@ #include -#include "crypto.h" +#include "src/crypto/crypto.h" #define DUMP_NAME_FMT "%-10s " diff --git a/src/util/Makefile.am b/src/util/Makefile.am index d189d49f2..7cd7a5054 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -1,4 +1,4 @@ -AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS) +AM_CXXFLAGS = -I$(top_srcdir)/ $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS) noinst_LIBRARIES = libmoshutil.a diff --git a/src/util/dos_assert.h b/src/util/dos_assert.h index a1a0599b9..2eff034eb 100644 --- a/src/util/dos_assert.h +++ b/src/util/dos_assert.h @@ -36,7 +36,7 @@ #include #include -#include "crypto.h" +#include "src/crypto/crypto.h" static void dos_detected( const char *expression, const char *file, int line, const char *function ) { diff --git a/src/util/locale_utils.cc b/src/util/locale_utils.cc index 469498e80..e8093d528 100644 --- a/src/util/locale_utils.cc +++ b/src/util/locale_utils.cc @@ -30,7 +30,7 @@ also delete it here. */ -#include "config.h" +#include "src/include/config.h" #include #include @@ -43,7 +43,7 @@ #include #endif -#include "locale_utils.h" +#include "src/util/locale_utils.h" const std::string LocaleVar::str( void ) const diff --git a/src/util/pty_compat.cc b/src/util/pty_compat.cc index c7233264e..ce543f757 100644 --- a/src/util/pty_compat.cc +++ b/src/util/pty_compat.cc @@ -30,7 +30,7 @@ also delete it here. */ -#include "config.h" +#include "src/include/config.h" #if !defined(HAVE_FORKPTY) || !defined(HAVE_CFMAKERAW) #include @@ -42,7 +42,7 @@ #include #include -#include "pty_compat.h" +#include "src/util/pty_compat.h" #ifndef HAVE_FORKPTY pid_t my_forkpty( int *amaster, char *name, diff --git a/src/util/pty_compat.h b/src/util/pty_compat.h index a1dc79a87..725372fbe 100644 --- a/src/util/pty_compat.h +++ b/src/util/pty_compat.h @@ -33,7 +33,7 @@ #ifndef PTY_COMPAT_HPP #define PTY_COMPAT_HPP -#include "config.h" +#include "src/include/config.h" #ifndef HAVE_FORKPTY # define forkpty my_forkpty diff --git a/src/util/select.cc b/src/util/select.cc index 8fae0c243..1a829a50d 100644 --- a/src/util/select.cc +++ b/src/util/select.cc @@ -30,7 +30,7 @@ also delete it here. */ -#include "select.h" +#include "src/util/select.h" fd_set Select::dummy_fd_set; diff --git a/src/util/select.h b/src/util/select.h index 52771b926..7361a6499 100644 --- a/src/util/select.h +++ b/src/util/select.h @@ -39,8 +39,8 @@ #include #include -#include "fatal_assert.h" -#include "timestamp.h" +#include "src/util/fatal_assert.h" +#include "src/util/timestamp.h" /* Convenience wrapper for pselect(2). diff --git a/src/util/shared.h b/src/util/shared.h index 60751256d..4b97a5844 100644 --- a/src/util/shared.h +++ b/src/util/shared.h @@ -33,7 +33,7 @@ #ifndef SHARED_HPP #define SHARED_HPP -#include "config.h" +#include "src/include/config.h" #ifdef HAVE_MEMORY #include diff --git a/src/util/swrite.cc b/src/util/swrite.cc index ada96f59b..d3c2ba0bf 100644 --- a/src/util/swrite.cc +++ b/src/util/swrite.cc @@ -34,7 +34,7 @@ #include #include -#include "swrite.h" +#include "src/util/swrite.h" int swrite( int fd, const char *str, ssize_t len ) { diff --git a/src/util/timestamp.cc b/src/util/timestamp.cc index 59a833f68..3eaf283d8 100644 --- a/src/util/timestamp.cc +++ b/src/util/timestamp.cc @@ -30,9 +30,9 @@ also delete it here. */ -#include "config.h" +#include "src/include/config.h" -#include "timestamp.h" +#include "src/util/timestamp.h" #include