lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master e5172aa 3/6: Set $LMI_COMPILER and $LMI_TRIPL


From: Greg Chicares
Subject: [lmi-commits] [lmi] master e5172aa 3/6: Set $LMI_COMPILER and $LMI_TRIPLET to defaults if unset or null
Date: Sun, 19 May 2019 19:29:19 -0400 (EDT)

branch: master
commit e5172aa1d73b70da4f635d1a401216414e994b1d
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Set $LMI_COMPILER and $LMI_TRIPLET to defaults if unset or null
---
 set_toolchain.sh | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/set_toolchain.sh b/set_toolchain.sh
index 319fd17..92c8181 100755
--- a/set_toolchain.sh
+++ b/set_toolchain.sh
@@ -23,17 +23,13 @@
 
 # Invoke as ". ./set_toolchain.sh" without the quotes.
 #
-# $LMI_COMPILER and $LMI_TRIPLET can be overridden at the command
-# line, e.g.:
+# $LMI_COMPILER and $LMI_TRIPLET are set to default values currently
+# used in production if they were unset or null beforehand. They can
+# be overridden at the command line, e.g.:
 #
-#   export LMI_COMPILER
-#   export LMI_TRIPLET
 #   LMI_COMPILER=gcc ; LMI_TRIPLET=i686-w64-mingw32 ; . ./set_toolchain.sh
 #   LMI_COMPILER=gcc ; LMI_TRIPLET=x86_64-w64-mingw32 ; . ./set_toolchain.sh
 #
-# where the 'export' commands need be run only once, presumably in a
-# shell startup file.
-#
 # Implemented as a function that runs and then erases itself, so that
 # sourcing this script changes the environment only as intended. This
 # depends on 'local', which isn't yet POSIX, though there's a proposal
@@ -65,6 +61,7 @@
 # Supported values:
 #   LMI_COMPILER : gcc, clang
 #   LMI_TRIPLET  : i686-w64-mingw32, x86_64-w64-mingw32, x86_64-pc-linux-gnu
+# (clang and pc-linux-gnu are not yet tested).
 #
 # Examples:
 #
@@ -150,6 +147,11 @@ fi
 # 'printf' here. Similarly, 'exit' would have a surprising effect.
 # Therefore, these precondition checks use 'echo' and 'return'.
 
+export LMI_COMPILER
+export LMI_TRIPLET
+       LMI_COMPILER=${LMI_COMPILER:-"gcc"}
+       LMI_TRIPLET=${LMI_TRIPLET:-"i686-w64-mingw32"}
+
 case "$LMI_COMPILER" in
     (gcc) ;;
     (*)



reply via email to

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