lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master d969290 6/7: Use $LMI_HOST more flexibly in m


From: Greg Chicares
Subject: [lmi-commits] [lmi] master d969290 6/7: Use $LMI_HOST more flexibly in makefiles and scripts
Date: Wed, 27 Mar 2019 11:06:45 -0400 (EDT)

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

    Use $LMI_HOST more flexibly in makefiles and scripts
---
 configuration.make        |  2 ++
 gui_test.sh               | 12 ++++++++----
 msw_generic.make          |  4 ++--
 nychthemeral_test.sh      | 12 ++++++++----
 test_coding_rules_test.sh | 18 +++++++++++-------
 5 files changed, 31 insertions(+), 17 deletions(-)

diff --git a/configuration.make b/configuration.make
index 38ea1dc..43a48eb 100644
--- a/configuration.make
+++ b/configuration.make
@@ -29,6 +29,8 @@ platform-makefile := posix_fhs.make
 
 ifeq (i686-w64-mingw32,$(findstring i686-w64-mingw32,$(LMI_HOST)))
   platform-makefile := msw_generic.make
+else ifeq (x86_64-w64-mingw32,$(findstring x86_64-w64-mingw32,$(LMI_HOST)))
+  platform-makefile := msw_generic.make
 endif
 
 ifeq (MINGW,$(findstring MINGW,$(uname)))
diff --git a/gui_test.sh b/gui_test.sh
index 221ac7e..b03c9e9 100755
--- a/gui_test.sh
+++ b/gui_test.sh
@@ -36,10 +36,14 @@ set -e
 # provides no convenient alternative):
 setopt PIPE_FAIL
 
-if [ "$LMI_HOST" = "i686-w64-mingw32" ]
-then
-    PERFORM=wine
-fi
+case "$LMI_HOST" in
+    ("i686-w64-mingw32" | "x86_64-w64-mingw32")
+        PERFORM=wine
+        ;;
+    (*)
+        PERFORM=
+        ;;
+esac
 
 # Lines beginning with a capitalized word, viz.
 #   /^NOTE: starting the test suite$/d
diff --git a/msw_generic.make b/msw_generic.make
index 1a86df2..7ee3bbe 100644
--- a/msw_generic.make
+++ b/msw_generic.make
@@ -42,7 +42,7 @@ PERFORM := wine
 
 gcc_bin_dir :=
 
-host_prefix := i686-w64-mingw32-
+host_prefix := $(LMI_HOST)-
 
 AR      := $(gcc_bin_dir)$(host_prefix)ar
 CC      := $(gcc_bin_dir)$(host_prefix)gcc
@@ -57,7 +57,7 @@ RC      := $(gcc_bin_dir)$(host_prefix)windres
 # option returns an empty string with debian cross compilers.
 #
 # It might seem more robust to write something like
-#   compiler_sysroot := $(shell readlink -fn 
/usr/lib/gcc/i686-w64-mingw32/*-win32)
+#   compiler_sysroot := $(shell readlink -fn /usr/lib/gcc/$(LMI_HOST)/*-win32)
 # but that would actually weaken makefile portability, and there
 # is no guarantee that this directory will be named similarly in
 # future debian releases, much less on other OSs.
diff --git a/nychthemeral_test.sh b/nychthemeral_test.sh
index 249abe5..b0d7c00 100755
--- a/nychthemeral_test.sh
+++ b/nychthemeral_test.sh
@@ -36,10 +36,14 @@ set -e
 # provides no convenient alternative):
 setopt PIPE_FAIL
 
-if [ "$LMI_HOST" = "i686-w64-mingw32" ]
-then
-    PERFORM=wine
-fi
+case "$LMI_HOST" in
+    ("i686-w64-mingw32" | "x86_64-w64-mingw32")
+        PERFORM=wine
+        ;;
+    (*)
+        PERFORM=
+        ;;
+esac
 
 coefficiency=${coefficiency:-"--jobs=$(nproc)"}
 
diff --git a/test_coding_rules_test.sh b/test_coding_rules_test.sh
index 2724591..5a20cd6 100755
--- a/test_coding_rules_test.sh
+++ b/test_coding_rules_test.sh
@@ -21,13 +21,8 @@
 # email: <address@hidden>
 # snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
 
-# This script is intended to be invoked by lmi makefiles. If it is
-# run independently, the environment variable PERFORM should be set
-# to indicate any cross interpreter--e.g., use this command:
-#   PERFORM=wine /path/to/test_coding_rules_test.sh
-# to make this script run a cross-compiled 'test_coding_rules.exe'
-# built for msw in a GNU/Linux environment. It can be run natively
-# with $PERFORM unset.
+# This script is intended to be invoked by lmi makefiles; it would
+# rarely make sense to run it independently.
 
 echo "Testing 'test_coding_rules'."
 
@@ -366,6 +361,15 @@ touch another.unexpected.file
 
 # Compare observed to expected. Note that directory '.' is ignored.
 
+case "$LMI_HOST" in
+    ("i686-w64-mingw32" | "x86_64-w64-mingw32")
+        PERFORM=wine
+        ;;
+    (*)
+        PERFORM=
+        ;;
+esac
+
 2>&1 $PERFORM ./test_coding_rules \
   . \
   a_nonexistent_file \



reply via email to

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