[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/zero_columns df73fef 1/3: Merge remote-tracking
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/zero_columns df73fef 1/3: Merge remote-tracking branch 'origin/master' into odd/multiarch |
Date: |
Sun, 5 May 2019 15:29:45 -0400 (EDT) |
branch: odd/zero_columns
commit df73fefa45a13d9c06230e08f993604762b02bda
Merge: cb02a88 caf6f55
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Merge remote-tracking branch 'origin/master' into odd/multiarch
---
alert.cpp | 25 +++++++++++++++++--------
alert.hpp | 2 ++
alert_cgi.cpp | 11 +----------
alert_cli.cpp | 12 ++----------
alert_wx.cpp | 19 +++++++------------
authenticity_test.cpp | 4 +++-
gui_test.sh | 1 +
install_cygwin.bat | 1 -
install_libxml2_libxslt.make | 2 +-
install_mingw.make | 15 +++++++--------
install_msw.sh | 7 +++++--
install_wx.sh | 2 +-
install_wxpdfdoc.sh | 2 +-
msw_cygwin.make | 10 ++--------
name_value_pairs_test.cpp | 9 ++++++---
path_utility_test.cpp | 25 ++++++++++++++-----------
16 files changed, 70 insertions(+), 77 deletions(-)
diff --git a/alert.cpp b/alert.cpp
index 43b5483..e3a7301 100644
--- a/alert.cpp
+++ b/alert.cpp
@@ -23,12 +23,11 @@
#include "alert.hpp"
-#if !defined LMI_MSW
-# include <cstdio>
-#else // defined LMI_MSW
+#if defined LMI_MSW
# include <windows.h>
#endif // defined LMI_MSW
+#include <cstdio> // fputc(), fputs()
#include <ios>
#include <sstream> // stringbuf
#include <stdexcept>
@@ -69,11 +68,8 @@ inline bool any_function_pointer_has_been_set()
void report_catastrophe(char const* message)
{
-#if !defined LMI_MSW
- std::fputs(message, stderr);
- std::fputc('\n' , stderr);
- std::fflush(stderr);
-#else // defined LMI_MSW
+ safely_show_on_stderr(message);
+#if defined LMI_MSW
::MessageBoxA
(0
,message
@@ -223,6 +219,19 @@ std::ostream& alarum()
return alert_stream<alarum_buf>();
}
+void safely_show_on_stderr(char const* message)
+{
+ std::fputs(message, stderr);
+ std::fputc('\n' , stderr);
+ // Flush explicitly. C99 7.19.3/7 says only that stderr is
+ // "not fully buffered", not that it is 'unbuffered'. See:
+ // http://article.gmane.org/gmane.comp.gnu.mingw.user/14358
+ // [2004-12-20T09:07:24Z from Danny Smith]
+ // http://article.gmane.org/gmane.comp.gnu.mingw.user/15063
+ // [2005-02-10T17:23:09Z from Greg Chicares]
+ std::fflush(stderr);
+}
+
void safely_show_message(char const* message)
{
if(nullptr == safe_message_alert_function)
diff --git a/alert.hpp b/alert.hpp
index 7b32ec9..1cd130b 100644
--- a/alert.hpp
+++ b/alert.hpp
@@ -163,6 +163,8 @@ std::ostream& LMI_SO warning();
std::ostream& LMI_SO hobsons_choice();
std::ostream& LMI_SO alarum();
+void LMI_SO safely_show_on_stderr(char const*);
+
void LMI_SO safely_show_message(char const*);
void LMI_SO safely_show_message(std::string const&);
diff --git a/alert_cgi.cpp b/alert_cgi.cpp
index e4c739e..fc9284c 100644
--- a/alert_cgi.cpp
+++ b/alert_cgi.cpp
@@ -23,7 +23,6 @@
#include "alert.hpp"
-#include <cstdio> // fputs()
#include <stdexcept>
namespace
@@ -66,13 +65,5 @@ void alarum_alert(std::string const& s)
void safe_message_alert(char const* message)
{
- std::fputs(message, stderr);
- std::fputc('\n', stderr);
- // Flush explicitly. C99 7.19.3/7 says only that stderr is
- // "not fully buffered", not that it is 'unbuffered'. See:
- // http://article.gmane.org/gmane.comp.gnu.mingw.user/14358
- // [2004-12-20T09:07:24Z from Danny Smith]
- // http://article.gmane.org/gmane.comp.gnu.mingw.user/15063
- // [2005-02-10T17:23:09Z from Greg Chicares]
- std::fflush(stderr);
+ safely_show_on_stderr(message);
}
diff --git a/alert_cli.cpp b/alert_cli.cpp
index 8ff349a..c71dc9e 100644
--- a/alert_cli.cpp
+++ b/alert_cli.cpp
@@ -23,7 +23,7 @@
#include "alert.hpp"
-#include <cstdio> // fputs(), getchar()
+#include <cstdio> // getchar()
#include <iostream>
#include <stdexcept>
@@ -99,13 +99,5 @@ void alarum_alert(std::string const& s)
void safe_message_alert(char const* message)
{
- std::fputs(message, stderr);
- std::fputc('\n', stderr);
- // Flush explicitly. C99 7.19.3/7 says only that stderr is
- // "not fully buffered", not that it is 'unbuffered'. See:
- // http://article.gmane.org/gmane.comp.gnu.mingw.user/14358
- // [2004-12-20T09:07:24Z from Danny Smith]
- // http://article.gmane.org/gmane.comp.gnu.mingw.user/15063
- // [2005-02-10T17:23:09Z from Greg Chicares]
- std::fflush(stderr);
+ safely_show_on_stderr(message);
}
diff --git a/alert_wx.cpp b/alert_wx.cpp
index 9f8144c..f5d0dd9 100644
--- a/alert_wx.cpp
+++ b/alert_wx.cpp
@@ -33,7 +33,7 @@
# include <wx/msw/wrapwin.h> // HWND etc.
#endif // defined LMI_MSW
-#include <cstdio>
+#include <iostream>
#include <stdexcept>
LMI_FORCE_LINKING_IN_SITU(alert_wx)
@@ -72,6 +72,7 @@ void status_alert(std::string const& s)
void warning_alert(std::string const& s)
{
+ std::cerr << "Warning: " << s << std::endl;
wxMessageBox(s, "Warning", wxOK, wxTheApp ? wxTheApp->GetTopWindow() :
nullptr);
}
@@ -85,6 +86,8 @@ void warning_alert(std::string const& s)
void hobsons_choice_alert(std::string const& s)
{
+ std::cerr << "Hobson's choice: " << s << std::endl;
+
wxWindow* w = nullptr;
if(wxTheApp)
{
@@ -121,6 +124,7 @@ void hobsons_choice_alert(std::string const& s)
void alarum_alert(std::string const& s)
{
+ std::cerr << "Alarum: " << s << std::endl;
throw std::runtime_error(s);
}
@@ -148,17 +152,8 @@ void alarum_alert(std::string const& s)
void safe_message_alert(char const* message)
{
-#if !defined LMI_MSW
- std::fputs(message, stderr);
- std::fputc('\n' , stderr);
- // Flush explicitly. C99 7.19.3/7 says only that stderr is
- // "not fully buffered", not that it is 'unbuffered'. See:
- // http://article.gmane.org/gmane.comp.gnu.mingw.user/14358
- // [2004-12-20T09:07:24Z from Danny Smith]
- // http://article.gmane.org/gmane.comp.gnu.mingw.user/15063
- // [2005-02-10T17:23:09Z from Greg Chicares]
- std::fflush(stderr);
-#else // defined LMI_MSW
+ safely_show_on_stderr(message);
+#if defined LMI_MSW
HWND handle = 0;
if(wxTheApp && wxTheApp->GetTopWindow())
{
diff --git a/authenticity_test.cpp b/authenticity_test.cpp
index 83316ce..9b3a0fb 100644
--- a/authenticity_test.cpp
+++ b/authenticity_test.cpp
@@ -30,6 +30,7 @@
#include "system_command.hpp"
#include "test_tools.hpp"
+#include <boost/filesystem/convenience.hpp> // basename()
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
@@ -282,7 +283,8 @@ void PasskeyTest::TestFromAfar() const
{
CheckNominal(__FILE__, __LINE__);
- fs::path const remote_dir_0(fs::complete("/tmp"));
+ std::string const tmp = "/tmp/" + fs::basename(__FILE__);
+ fs::path const remote_dir_0(fs::complete(tmp));
fs::create_directory(remote_dir_0);
BOOST_TEST(fs::exists(remote_dir_0) && fs::is_directory(remote_dir_0));
BOOST_TEST_EQUAL(0, chdir(remote_dir_0.string().c_str()));
diff --git a/gui_test.sh b/gui_test.sh
index d3e20ea..3a386bc 100755
--- a/gui_test.sh
+++ b/gui_test.sh
@@ -137,6 +137,7 @@ gui_test_clutter='
/^time=[[:digit:]]\+ms (for validate_output_mec)$/d
/^validate_output_mec: ok$/d
/^time=[[:digit:]]\+ms (for all tests)$/d
+/^Warning: Test files path ..opt.lmi.gui_test. doesn.t exist\.$/d
'
# Directory for test logs.
diff --git a/install_cygwin.bat b/install_cygwin.bat
index 7b32e1e..64a2e7f 100644
--- a/install_cygwin.bat
+++ b/install_cygwin.bat
@@ -35,7 +35,6 @@ START "Installing Cygwin" /WAIT setup-x86_64 ^
"autoconf,automake,bsdtar,dos2unix,doxygen,gdb,git,libtool,make,openssh,patch,pkg-config,rsync,unzip,wget,zip,zsh"
cd C:\cygwin64_lmi\etc
echo # >> fstab
-echo C:/opt/lmi/MinGW-8_1_0 /MinGW_ lmi_specific binary,user 0 0 >>
fstab
echo C:/opt/lmi /opt/lmi lmi_specific binary,user 0 0 >>
fstab
echo C:/cache_for_lmi /cache_for_lmi lmi_specific binary,user 0 0 >>
fstab
echo Cygwin installation seems to have succeeded
diff --git a/install_libxml2_libxslt.make b/install_libxml2_libxslt.make
index 77d44a5..e5574bd 100644
--- a/install_libxml2_libxslt.make
+++ b/install_libxml2_libxslt.make
@@ -46,7 +46,7 @@ host_path := libxml2
$(xz_version).tar.gz: host := https://sourceforge.net
$(xz_version).tar.gz: host_path := projects/lzmautils/files
-mingw_dir := /MinGW_
+mingw_dir := /opt/lmi/mingw
LMI_COMPILER ?= gcc
LMI_TRIPLET ?= i686-w64-mingw32
diff --git a/install_mingw.make b/install_mingw.make
index 9246f5b..21de260 100644
--- a/install_mingw.make
+++ b/install_mingw.make
@@ -28,7 +28,7 @@ this_makefile := $(abspath $(lastword $(MAKEFILE_LIST)))
# rather than release its own; lmi uses i686 builds with native
# threads and SJLJ exceptions.
-version := MinGW-8_1_0
+version := MinGW-7_3_0
file_list = $($(version))
@@ -42,11 +42,11 @@ file_list = $($(version))
# http://article.gmane.org/gmane.comp.gnu.mingw.user/14748
# [2005-01-17T18:15:26Z from Aaron W. LaFramboise]
-prefix := /MinGW_
+prefix := /opt/lmi/mingw
cache_dir := /cache_for_lmi/downloads
-ad_hoc_dir := $(prefix)/ad_hoc
+ad_hoc_dir := /opt/lmi/zzz/mingw-ad_hoc/ad_hoc
# In the past, it seemed necessary to specify a mirror, e.g.:
# mirror := http://easynews.dl.sourceforge.net/sourceforge/mingw
@@ -60,7 +60,6 @@ mirror := http://downloads.sourceforge.net/mingw-w64
MinGW-6_3_0 := i686-6.3.0-release-win32-sjlj-rt_v5-rev2.7z
MinGW-7_2_0 := i686-7.2.0-release-win32-sjlj-rt_v5-rev0.7z
MinGW-7_3_0 := i686-7.3.0-release-win32-sjlj-rt_v5-rev0.7z
-MinGW-8_1_0 := i686-8.1.0-release-win32-sjlj-rt_v6-rev0.7z
# Archive md5sums
##############################################################
@@ -68,7 +67,6 @@ MinGW-8_1_0 := i686-8.1.0-release-win32-sjlj-rt_v6-rev0.7z
$(MinGW-6_3_0)-md5 := 6e15de993400279c24b40b1f978e9380
$(MinGW-7_2_0)-md5 := f34ff6eca4aa7a645f60c977b107c5d2
$(MinGW-7_3_0)-md5 := 37d964d08ce48dc170cc95a84679cc4f
-$(MinGW-8_1_0)-md5 := 28ec1e65ab85a9e1043998516045ab62
# Utilities
####################################################################
@@ -107,8 +105,6 @@ ad_hoc_dir_exists = \
.PHONY: all
all: $(file_list)
- $(MKDIR) --parents $(prefix)
- $(MKDIR) --parents $(ad_hoc_dir)
$(CP) --archive $(ad_hoc_dir)/mingw32 $(prefix)
$(RM) --force --recursive $(ad_hoc_dir)
@@ -119,6 +115,8 @@ initial_setup:
type "$(WGET)" >/dev/null || { printf '%b' $(wget_missing) &&
false; }
[ ! -e $(prefix) ] || { printf '%b' $(prefix_exists) &&
false; }
[ ! -e $(ad_hoc_dir) ] || { printf '%b' $(ad_hoc_dir_exists) &&
false; }
+ $(MKDIR) --parents $(prefix)
+ $(MKDIR) --parents $(ad_hoc_dir)
BSDTARFLAGS := --keep-old-files
@@ -131,4 +129,5 @@ WGETFLAGS := --no-verbose
cd $(cache_dir) && [ -e $@ ] || $(WGET) $(WGETFLAGS) $(mirror)/$@
cd $(cache_dir) && $(ECHO) "$(address@hidden) *$@" | $(MD5SUM) --check
$(BSDTAR) --extract $(BSDTARFLAGS) --directory=$(ad_hoc_dir)
--file=$(cache_dir)/$@ \
- || c:/Program\ Files/7-Zip/7z x `cygpath -w
$(cache_dir)/address@hidden -o$(ad_hoc_dir)
+ || c:/Program\ Files/7-Zip/7z x `cygpath -w
$(cache_dir)/address@hidden -o$(ad_hoc_dir) \
+ || c:/Program\ Files\ \(x86\)/7-Zip/7z x `cygpath -w
$(cache_dir)/address@hidden -o`cygpath -w $(ad_hoc_dir)`
diff --git a/install_msw.sh b/install_msw.sh
index da7241c..fc3eba4 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -163,9 +163,9 @@ then
restore_MinGW_mount=$(mount --mount-entries | grep '/MinGW_ ')
[ -z "$restore_MinGW_mount" ] \
- || printf '%s\n' "$restore_MinGW_mount" | grep --silent
'C:/opt/lmi/MinGW-8_1_0' \
+ || printf '%s\n' "$restore_MinGW_mount" | grep --silent
'C:/opt/lmi/MinGW-7_3_0' \
|| printf 'Replacing former MinGW_ mount:\n %s\n' "$restore_MinGW_mount"
>/dev/tty
- mount --force "C:/opt/lmi/MinGW-8_1_0" "/MinGW_"
+ mount --force "C:/opt/lmi/MinGW-7_3_0" "/MinGW_"
restore_cache_mount=$(mount --mount-entries | grep '/cache_for_lmi ')
[ -z "$restore_cache_mount" ] \
@@ -201,6 +201,7 @@ make $coefficiency --output-sync=recurse -f
install_miscellanea.make
export LMI_COMPILER=gcc
export LMI_TRIPLET
for LMI_TRIPLET in x86_64-w64-mingw32 i686-w64-mingw32 ;
+#for LMI_TRIPLET in i686-w64-mingw32 ;
do
make $coefficiency --output-sync=recurse -f install_libxml2_libxslt.make
@@ -237,6 +238,8 @@ printf '2450449 2472011'
>/opt/lmi/data/expiry
printf '5fc68a795c9c60da1b32be989efc299a expiry\n'
>/opt/lmi/data/validated.md5
printf '391daa5cbc54e118c4737446bcb84eea' >/opt/lmi/data/passkey
+# add proprietary versions to proprietary repository; then prefer them
+#
# Surrogates for proprietary graphics:
for z in company_logo.png group_quote_banner.png ;
do cp --archive /opt/lmi/src/lmi/gwc/$z /opt/lmi/data/ ;
diff --git a/install_wx.sh b/install_wx.sh
index f43c7d6..b1f2cbc 100755
--- a/install_wx.sh
+++ b/install_wx.sh
@@ -46,7 +46,7 @@ LMI_TRIPLET=${LMI_TRIPLET:-"i686-w64-mingw32"}
# Variables that normally should be left alone
#################################
-mingw_dir=/MinGW_
+mingw_dir=/opt/lmi/mingw
prefix=/opt/lmi/"${LMI_COMPILER}_${LMI_TRIPLET}"/local
exec_prefix="$prefix"
diff --git a/install_wxpdfdoc.sh b/install_wxpdfdoc.sh
index 039fa93..b58ec1c 100755
--- a/install_wxpdfdoc.sh
+++ b/install_wxpdfdoc.sh
@@ -46,7 +46,7 @@ LMI_TRIPLET=${LMI_TRIPLET:-"i686-w64-mingw32"}
# Variables that normally should be left alone
#################################
-mingw_dir=/MinGW_
+mingw_dir=/opt/lmi/mingw
prefix=/opt/lmi/"${LMI_COMPILER}_${LMI_TRIPLET}"/local
exec_prefix="$prefix"
diff --git a/msw_cygwin.make b/msw_cygwin.make
index e4cc042..c9bf07e 100644
--- a/msw_cygwin.make
+++ b/msw_cygwin.make
@@ -54,13 +54,7 @@ system_root := /cygdrive/c
# Full path to gcc binaries, slash-terminated if nonempty. Setting it
# to an empty string finds gcc on $PATH instead.
-ifeq (i686-w64-mingw32,$(LMI_TRIPLET))
- gcc_bin_dir := /MinGW_/mingw32/bin/
-else ifeq (x86_64-w64-mingw32,$(LMI_TRIPLET))
- gcc_bin_dir := /MinGW_/mingw64/bin/
-else
- $(warning Unexpected triplet '$(LMI_TRIPLET)')
-endif
+gcc_bin_dir := /opt/lmi/mingw/bin/
# Oddly, MinGW-w64 provides prefixed versions of compilers, e.g.:
# i686-w64-mingw32-gcc.exe
@@ -85,7 +79,7 @@ RC := $(gcc_bin_dir)$(host_hyphen)windres
# https://cygwin.com/ml/cygwin/2010-09/msg00553.html
# Of course manipulating an lmi user's $PATH is out of the question.
-compiler_sysroot := /MinGW_/$(LMI_TRIPLET)/lib
+compiler_sysroot := /opt/lmi/mingw/$(LMI_TRIPLET)/lib
compiler_runtime_files := \
$(wildcard $(compiler_sysroot)/libgcc*.dll) \
diff --git a/name_value_pairs_test.cpp b/name_value_pairs_test.cpp
index 0efa547..3bfc017 100644
--- a/name_value_pairs_test.cpp
+++ b/name_value_pairs_test.cpp
@@ -26,18 +26,21 @@
#include "miscellany.hpp"
#include "test_tools.hpp"
+#include <boost/filesystem/convenience.hpp> // basename()
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <cstdio> // remove()
#include <fstream>
+#include <string>
int test_main(int, char*[])
{
- fs::path const tmpdir(fs::complete("/tmp"));
+ std::string const tmp = "/tmp/" + fs::basename(__FILE__);
+ fs::path const tmpdir(fs::complete(tmp));
fs::create_directory(tmpdir);
- std::string filename0("/tmp/eraseme");
+ std::string filename0(tmp + "/eraseme");
{
std::ofstream os(filename0.c_str(), ios_out_trunc_binary());
@@ -98,7 +101,7 @@ int test_main(int, char*[])
BOOST_TEST_EQUAL("2.718" , nv_pairs_0.string_numeric_value("v"));
BOOST_TEST_EQUAL("0" , nv_pairs_0.string_numeric_value("s"));
- std::string filename1("/tmp/nonexistent_name_value_pairs_test_file");
+ std::string filename1(tmp + "/nonexistent_name_value_pairs_test_file");
name_value_pairs nv_pairs_1(filename1);
std::map<std::string, std::string> m1 = nv_pairs_1.map();
BOOST_TEST_EQUAL(0, m1.size());
diff --git a/path_utility_test.cpp b/path_utility_test.cpp
index 21b4c89..5c6d13f 100644
--- a/path_utility_test.cpp
+++ b/path_utility_test.cpp
@@ -27,6 +27,7 @@
#include "platform_dependent.hpp" // access()
#include "test_tools.hpp"
+#include <boost/filesystem/convenience.hpp> // basename()
#include <boost/filesystem/exception.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/operations.hpp>
@@ -36,6 +37,7 @@
#include <fstream>
#include <sstream>
#include <stdexcept>
+#include <string>
namespace
{
@@ -136,23 +138,24 @@ void test_serial_file_path()
void test_unique_filepath_with_normal_filenames()
{
- fs::path const tmpdir(fs::complete("/tmp"));
+ std::string const tmp = "/tmp/" + fs::basename(__FILE__);
+ fs::path const tmpdir(fs::complete(tmp));
fs::create_directory(tmpdir);
// These tests would fail if read-only files with the following
// names already exist.
- char const* p = "/tmp/eraseme.0";
- char const* q = "/tmp/eraseme.xyzzy";
+ std::string const p = (tmp + "/eraseme.0");
+ std::string const q = (tmp + "/eraseme.xyzzy");
// Don't test the return codes here. These files probably don't
// exist, in which case C99 7.19.4.1 doesn't clearly prescribe
// the semantics of std::remove().
- std::remove(p);
- std::remove(q);
+ std::remove(p.c_str());
+ std::remove(q.c_str());
write_dummy_file(p);
- BOOST_TEST_EQUAL(0, access(p, R_OK));
+ BOOST_TEST_EQUAL(0, access(p.c_str(), R_OK));
fs::path path0 = unique_filepath(fs::path(p), ".xyzzy");
BOOST_TEST_EQUAL(path0.string(), q);
@@ -196,9 +199,9 @@ void test_unique_filepath_with_normal_filenames()
// Even the timestamp's length is implementation dependent, so a
// change in implementation may be discovered by a failure here.
- char const* r = "/tmp/eraseme.abc.def";
- char const* s = "/tmp/eraseme.abc-CCYYMMDDTHHMMSSZ.def";
-// NOT: /tmp/eraseme.abc-CCYYMMDDTHHMMSSZ.abc.def
+ std::string const r = (tmp + "/eraseme.abc.def");
+ std::string const s = (tmp + "/eraseme.abc-CCYYMMDDTHHMMSSZ.def");
+// NOT: tmp + /eraseme.abc-CCYYMMDDTHHMMSSZ.abc.def
fs::path path3 = unique_filepath(fs::path(p), ".abc.def");
BOOST_TEST_EQUAL(path3.string(), r);
@@ -218,8 +221,8 @@ void test_unique_filepath_with_normal_filenames()
BOOST_TEST(0 == std::remove(path3.string().c_str()));
BOOST_TEST(0 == std::remove(path2.string().c_str()));
#endif // defined LMI_MSW
- BOOST_TEST(0 == std::remove(q));
- BOOST_TEST(0 == std::remove(p));
+ BOOST_TEST(0 == std::remove(q.c_str()));
+ BOOST_TEST(0 == std::remove(p.c_str()));
}
void test_unique_filepath_with_ludicrous_filenames()