From 92d6f935bca53f52d344f35dd0351c9e6dc54450 Mon Sep 17 00:00:00 2001 From: "csilvers+ctemplate@google.com" Date: Fri, 29 Jul 2011 19:58:48 +0000 Subject: [PATCH] Change on 2011-07-29 12:10:58-07:00 by csilvers mingw fixes: 1) mingw needs an #include to have access to mkdir. 2) It needs to always #include port.h (this is an identical bit of code, in configure.ac, that I have in other opensource projects for mingw support.) 3) I moved some code from port.cc to port.h, so I didn't have to add logic to link in port.cc for mingw. Last change before new release! (*knock on wood*) Submitting TBR so I can get the release out today. This isn't exactly a trivial change, so I'm chary to submit TBR, but it's pretty isolated to windows and mingw, and I've tested on those platforms to make sure they compile and all tests pass. DELTA=70 (37 added, 30 deleted, 3 changed) Change on 2011-07-29 12:21:55-07:00 by csilvers Small change to get tests passing on mingw -- using /tmp is causing problems with our diffs, since sometimes it follows the /tmp (built-in msys) symlink, and sometimes it doesn't. R=jad DELTA=10 (8 added, 0 deleted, 2 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=2821 --- Makefile.am | 12 ++++++++++-- Makefile.in | 9 +++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 542e0f0..8593d30 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,6 +11,14 @@ if GCC AM_CXXFLAGS = -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare endif +# mingw does weird directory munging on /tmp, which causes some of our +# tests to fail, so use a different tmpdir there. +if MINGW +TMPDIR = ./ +else +TMPDIR = /tmp +endif + ctemplateincludedir = $(includedir)/ctemplate ## The .h files you want to install (that is, .h files that people ## who install this package can include in their own applications.) @@ -426,14 +434,14 @@ noinst_SCRIPTS += src/tests/make_tpl_varnames_h_unittest.sh make_tpl_varnames_h_unittest_sh: src/tests/make_tpl_varnames_h_unittest.sh \ make_tpl_varnames_h sh $(top_srcdir)/src/tests/make_tpl_varnames_h_unittest.sh \ - $(top_builddir)/make_tpl_varnames_h /tmp/$@_dir + $(top_builddir)/make_tpl_varnames_h $(TMPDIR)/$@_dir check_SCRIPTS += diff_tpl_auto_escape_unittest_sh noinst_SCRIPTS += src/tests/diff_tpl_auto_escape_unittest.sh diff_tpl_auto_escape_unittest_sh: src/tests/diff_tpl_auto_escape_unittest.sh \ diff_tpl_auto_escape sh $(top_srcdir)/src/tests/diff_tpl_auto_escape_unittest.sh \ - $(top_builddir)/diff_tpl_auto_escape /tmp/$@_dir + $(top_builddir)/diff_tpl_auto_escape $(TMPDIR)/$@_dir ## ^^^^ END OF RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS diff --git a/Makefile.in b/Makefile.in index 5220a0d..c254ac5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -777,6 +777,11 @@ AM_CPPFLAGS = -I$(top_srcdir)/src # These are good warnings to turn on by default @GCC_TRUE@AM_CXXFLAGS = -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare +@MINGW_FALSE@TMPDIR = /tmp + +# mingw does weird directory munging on /tmp, which causes some of our +# tests to fail, so use a different tmpdir there. +@MINGW_TRUE@TMPDIR = ./ ctemplateincludedir = $(includedir)/ctemplate nodist_ctemplateinclude_HEADERS = \ src/ctemplate/template.h \ @@ -2730,11 +2735,11 @@ generate_fsm_test_sh: src/tests/generate_fsm_test.sh \ make_tpl_varnames_h_unittest_sh: src/tests/make_tpl_varnames_h_unittest.sh \ make_tpl_varnames_h sh $(top_srcdir)/src/tests/make_tpl_varnames_h_unittest.sh \ - $(top_builddir)/make_tpl_varnames_h /tmp/$@_dir + $(top_builddir)/make_tpl_varnames_h $(TMPDIR)/$@_dir diff_tpl_auto_escape_unittest_sh: src/tests/diff_tpl_auto_escape_unittest.sh \ diff_tpl_auto_escape sh $(top_srcdir)/src/tests/diff_tpl_auto_escape_unittest.sh \ - $(top_builddir)/diff_tpl_auto_escape /tmp/$@_dir + $(top_builddir)/diff_tpl_auto_escape $(TMPDIR)/$@_dir rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec @cd packages && ./rpm.sh ${PACKAGE} ${VERSION}