From 12199114fe4234f791ef4c306163901643b40538 Mon Sep 17 00:00:00 2001 From: John Hood Date: Tue, 9 Jul 2019 00:30:16 -0400 Subject: [PATCH] Move generated includes to their own directory to avoid conflicts. Fixes #1051, mosh fails to build on case-insensitive filesystems. XXX This isn't perfect because autoconf/automake drop several extra files in the directory anyway. --- Makefile.am | 13 +++---------- configure.ac | 3 ++- src/Makefile.am | 2 +- src/include/Makefile.am | 14 ++++++++++++++ 4 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 src/include/Makefile.am diff --git a/Makefile.am b/Makefile.am index 2a0aa6b..100cbef 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = scripts src man conf EXTRA_DIST = autogen.sh ocb-license.html README.md COPYING.iOS -BUILT_SOURCES = version.h +BUILT_SOURCES = VERSION AM_DISTCHECK_CONFIGURE_FLAGS = --enable-compile-warnings=distcheck --enable-examples --enable-syslog # non-Automake defines @@ -29,20 +29,13 @@ VERSION: fi @rm -f VERSION.dist VERSION.git -version.h: VERSION - @printf '#define BUILD_VERSION "%s"\n' "$$(cat VERSION)" > version.h.new - @set -e; if ! diff -q version.h version.h.new > /dev/null 2>&1; then \ - mv -f version.h.new version.h; \ - fi - @rm -f version.h.new - clean-local: - @rm -rf version.h VERSION cov-int mosh-coverity.txz compile_commands.json + @rm -rf VERSION cov-int mosh-coverity.txz compile_commands.json # Linters and static checkers, for development only. Not included in # build dependencies, and outside of Automake processing. cppcheck: - cppcheck $(CPPCHECK_FLAGS) -include config.h -I . \ + cppcheck $(CPPCHECK_FLAGS) -include src/include/config.h -I src/include \ -I src/crypto -I src/frontend -I src/network -I src/protobufs \ -I src/statesync -I src/terminal -I src/util \ -I /usr/include -I /usr/include/google/protobuf -I/usr/include/openssl \ diff --git a/configure.ac b/configure.ac index de52d7c..d4cb1f3 100644 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,7 @@ AM_INIT_AUTOMAKE([foreign std-options -Wall -Werror]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_CONFIG_SRCDIR([src/frontend/mosh-client.cc]) AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_HEADERS([src/include/config.h]) AC_LANG([C++]) # Checks for programs. @@ -523,6 +523,7 @@ AC_CONFIG_FILES([ src/Makefile src/crypto/Makefile src/frontend/Makefile + src/include/Makefile src/network/Makefile src/protobufs/Makefile src/statesync/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 2390f7c..a714997 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1 +1 @@ -SUBDIRS = protobufs util crypto terminal network statesync frontend examples tests +SUBDIRS = include protobufs util crypto terminal network statesync frontend examples tests diff --git a/src/include/Makefile.am b/src/include/Makefile.am new file mode 100644 index 0000000..bd15b83 --- /dev/null +++ b/src/include/Makefile.am @@ -0,0 +1,14 @@ +BUILT_SOURCES = version.h +nodist_INCLUDES = version.h + +clean-local: + @rm -rf version.h + +version.h: ../../VERSION + @test -s $< + @printf '#define BUILD_VERSION "%s"\n' "$$(cat $<)" > $@.new + @set -e; if ! diff -q $@ $@.new > /dev/null 2>&1; then \ + mv -f $@.new $@; \ + fi + @rm -f $@.new +