Skip to content

Commit 1219911

Browse files
committed
Move generated includes to their own directory to avoid conflicts.
Fixes mobile-shell#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.
1 parent 609fb91 commit 1219911

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

Makefile.am

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ACLOCAL_AMFLAGS = -I m4
22
SUBDIRS = scripts src man conf
33
EXTRA_DIST = autogen.sh ocb-license.html README.md COPYING.iOS
4-
BUILT_SOURCES = version.h
4+
BUILT_SOURCES = VERSION
55
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-compile-warnings=distcheck --enable-examples --enable-syslog
66

77
# non-Automake defines
@@ -29,20 +29,13 @@ VERSION:
2929
fi
3030
@rm -f VERSION.dist VERSION.git
3131

32-
version.h: VERSION
33-
@printf '#define BUILD_VERSION "%s"\n' "$$(cat VERSION)" > version.h.new
34-
@set -e; if ! diff -q version.h version.h.new > /dev/null 2>&1; then \
35-
mv -f version.h.new version.h; \
36-
fi
37-
@rm -f version.h.new
38-
3932
clean-local:
40-
@rm -rf version.h VERSION cov-int mosh-coverity.txz compile_commands.json
33+
@rm -rf VERSION cov-int mosh-coverity.txz compile_commands.json
4134

4235
# Linters and static checkers, for development only. Not included in
4336
# build dependencies, and outside of Automake processing.
4437
cppcheck:
45-
cppcheck $(CPPCHECK_FLAGS) -include config.h -I . \
38+
cppcheck $(CPPCHECK_FLAGS) -include src/include/config.h -I src/include \
4639
-I src/crypto -I src/frontend -I src/network -I src/protobufs \
4740
-I src/statesync -I src/terminal -I src/util \
4841
-I /usr/include -I /usr/include/google/protobuf -I/usr/include/openssl \

configure.ac

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ AM_INIT_AUTOMAKE([foreign std-options -Wall -Werror])
77
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
88
AC_CONFIG_SRCDIR([src/frontend/mosh-client.cc])
99
AC_CONFIG_MACRO_DIR([m4])
10-
AC_CONFIG_HEADERS([config.h])
10+
AC_CONFIG_HEADERS([src/include/config.h])
1111
AC_LANG([C++])
1212

1313
# Checks for programs.
@@ -523,6 +523,7 @@ AC_CONFIG_FILES([
523523
src/Makefile
524524
src/crypto/Makefile
525525
src/frontend/Makefile
526+
src/include/Makefile
526527
src/network/Makefile
527528
src/protobufs/Makefile
528529
src/statesync/Makefile

src/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SUBDIRS = protobufs util crypto terminal network statesync frontend examples tests
1+
SUBDIRS = include protobufs util crypto terminal network statesync frontend examples tests

src/include/Makefile.am

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
BUILT_SOURCES = version.h
2+
nodist_INCLUDES = version.h
3+
4+
clean-local:
5+
@rm -rf version.h
6+
7+
version.h: ../../VERSION
8+
@test -s $<
9+
@printf '#define BUILD_VERSION "%s"\n' "$$(cat $<)" > $@.new
10+
@set -e; if ! diff -q $@ $@.new > /dev/null 2>&1; then \
11+
mv -f $@.new $@; \
12+
fi
13+
@rm -f $@.new
14+

0 commit comments

Comments
 (0)