[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master d3d3147 04/12: Use MinGW directory only as a
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master d3d3147 04/12: Use MinGW directory only as a variable, never as a literal |
Date: |
Sun, 12 May 2019 22:25:16 -0400 (EDT) |
branch: master
commit d3d31472f5907bd16b626a3a2d7bdb2f658cee2c
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Use MinGW directory only as a variable, never as a literal
Rationale: this makes the directory easier to change correctly. It also
simplifies an eventual refactoring to define the variable OAOO.
* install_msw.sh: Hardened an 'rm' command somewhat.
---
install_mingw.make | 3 ++-
install_msw.sh | 3 ++-
msw_cygwin.make | 5 +++--
test_schemata.sh | 6 ++++--
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/install_mingw.make b/install_mingw.make
index 98f637e..a903844 100644
--- a/install_mingw.make
+++ b/install_mingw.make
@@ -42,7 +42,8 @@ file_list = $($(version))
# https://sourceforge.net/p/mingw/mailman/message/15864075/
# [2005-01-17T18:15:26Z from Aaron W. LaFramboise]
-prefix := /opt/lmi/mingw
+mingw_dir := /opt/lmi/mingw
+prefix := $(mingw_dir)
cache_dir := /cache_for_lmi/downloads
diff --git a/install_msw.sh b/install_msw.sh
index 160f7bd..d3f80d2 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -189,7 +189,8 @@ find /cache_for_lmi/downloads -type f | xargs md5sum
if [ "Cygwin" = "$platform" ]
then
# For Cygwin, install and use this msw-native compiler.
- rm --force --recursive /opt/lmi/mingw
+ mingw_dir=/opt/lmi/mingw
+ [ -d "$mingw_dir" ] && rm --force --recursive "$mingw_dir"
make $coefficiency --output-sync=recurse -f install_mingw.make
fi
diff --git a/msw_cygwin.make b/msw_cygwin.make
index e16e32c..d03cf57 100644
--- a/msw_cygwin.make
+++ b/msw_cygwin.make
@@ -54,7 +54,8 @@ system_root := /cygdrive/c
# Full path to gcc binaries, slash-terminated if nonempty. Setting it
# to an empty string finds gcc on $PATH instead.
-gcc_bin_dir := /opt/lmi/mingw/bin/
+mingw_dir := /opt/lmi/mingw
+gcc_bin_dir := $(mingw_dir)/bin/
# Oddly, MinGW-w64 provides prefixed versions of compilers, e.g.:
# i686-w64-mingw32-gcc.exe
@@ -79,7 +80,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 := /opt/lmi/mingw/$(LMI_TRIPLET)/lib
+compiler_sysroot := $(mingw_dir)/$(LMI_TRIPLET)/lib
compiler_runtime_files := \
$(wildcard $(compiler_sysroot)/libgcc*.dll) \
diff --git a/test_schemata.sh b/test_schemata.sh
index cf66cc1..0efd70f 100755
--- a/test_schemata.sh
+++ b/test_schemata.sh
@@ -44,8 +44,10 @@ cp --preserve "$srcdir"/sort_cell_subelements.xsl .
echo " Test cell-subelement sorting."
-PATH="/opt/lmi/mingw/bin:$PATH" xsltproc sort_cell_subelements.xsl sample.cns
| tr --delete '\r' > sorted.cns
-PATH="/opt/lmi/mingw/bin:$PATH" xsltproc sort_cell_subelements.xsl sample.ill
| tr --delete '\r' > sorted.ill
+mingw_dir=/opt/lmi/mingw
+mingw_bin_dir="$mingw_dir"/bin
+PATH="$mingw_bin_dir:$PATH" xsltproc sort_cell_subelements.xsl sample.cns | tr
--delete '\r' > sorted.cns
+PATH="$mingw_bin_dir:$PATH" xsltproc sort_cell_subelements.xsl sample.ill | tr
--delete '\r' > sorted.ill
diff --unified=0 sample.cns sorted.cns
diff --unified=0 sample.ill sorted.ill
- [lmi-commits] [lmi] master updated (fe191f3 -> 46d19dd), Greg Chicares, 2019/05/12
- [lmi-commits] [lmi] master d3d3147 04/12: Use MinGW directory only as a variable, never as a literal,
Greg Chicares <=
- [lmi-commits] [lmi] master f9b8091 09/12: Resolve all shellcheck "SC2003" warnings, Greg Chicares, 2019/05/12
- [lmi-commits] [lmi] master 2c95b12 08/12: Resolve all shellcheck "SC2046" warnings, Greg Chicares, 2019/05/12
- [lmi-commits] [lmi] master 502a7d2 05/12: Install MinGW gcc after LMI_* environment variables have been set, Greg Chicares, 2019/05/12
- [lmi-commits] [lmi] master b53fd90 07/12: Suppress misleading shellcheck diagnostics, Greg Chicares, 2019/05/12
- [lmi-commits] [lmi] master 66ae5a6 03/12: Clarify that obsolete makefiles needn't be maintained, Greg Chicares, 2019/05/12
- [lmi-commits] [lmi] master d5123bd 02/12: Replace some dead gmane URLs, Greg Chicares, 2019/05/12
- [lmi-commits] [lmi] master e91fdeb 10/12: Resolve all shellcheck "SC1117" warnings, Greg Chicares, 2019/05/12
- [lmi-commits] [lmi] master 0c5f914 06/12: Install gcc in an architecture-dependent directory, Greg Chicares, 2019/05/12
- [lmi-commits] [lmi] master 46d19dd 12/12: Resolve all shellcheck "SC2043" warnings, Greg Chicares, 2019/05/12
- [lmi-commits] [lmi] master ca39972 01/12: Remove outdated cross-compiling instructions, Greg Chicares, 2019/05/12