lmi-commits
[Top][All Lists]
Advanced

[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
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]