[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/multiarch 04c2657 3/5: Invoke 'config.guess' whe
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/multiarch 04c2657 3/5: Invoke 'config.guess' wherever build type is wanted |
Date: |
Fri, 12 Apr 2019 08:32:58 -0400 (EDT) |
branch: odd/multiarch
commit 04c2657c21cd47bb5147323bcf6012a3e8d1b92d
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Invoke 'config.guess' wherever build type is wanted
Calling 'config.guess' takes very little time, and is more robust than
relying on a value cached in the environment. The 'config.guess' result
is stored in a variable named 'lmi_build_type', so that it can readily
be found and replaced if that someday seems desirable--by an environment
variable, perhaps, if 'config.guess' is too slow in some circumstance.
---
GNUmakefile | 4 ++--
check_git_setup.sh | 9 ++++-----
configuration.make | 6 ++++--
gui_test.sh | 3 ++-
gwc/.zshrc | 5 +++--
install_libxml2_libxslt.make | 4 +++-
install_msw.sh | 4 +++-
set_arch.sh | 10 +++++-----
test_coding_rules_test.sh | 3 ++-
tools/pete-2.1.1/Makefile | 4 +++-
10 files changed, 31 insertions(+), 21 deletions(-)
diff --git a/GNUmakefile b/GNUmakefile
index c7a8798..4c4689e 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -35,8 +35,8 @@ this_makefile := $(abspath $(lastword $(MAKEFILE_LIST)))
# for instance because it can automatically enforce Paul's advice
# "it's best to invoke make with the -r option".
#
-# One of several architecture-specific files is included, based on the
-# value of $LMI_BUILD. Separate files encapsulate variations better.
+# One of several architecture-specific files is included, based on a
+# 'config.guess' probe. Separate files encapsulate variations better.
#
# The ':' command Paul gives for his do-nothing rule seems no longer
# to be necessary.
diff --git a/check_git_setup.sh b/check_git_setup.sh
index 27e85d0..b763f7a 100755
--- a/check_git_setup.sh
+++ b/check_git_setup.sh
@@ -34,17 +34,16 @@ printf '"%s" is git toplevel directory\n' "$toplevel"
#'core.filemode' is "false". See:
# https://lists.nongnu.org/archive/html/lmi/2017-11/msg00018.html
-# Coordinate with changes in other repositories.
-# Call 'config.guess' here, or cache it in $LMI_BUILD?
-case "$LMI_BUILD" in
+lmi_build_type=$(/usr/share/libtool/build-aux/config.guess)
+case "$lmi_build_type" in
(*-*-cygwin*)
printf 'cygwin detected\n'
printf 'forcing correct permissions '
for d in . gwc; do (\
printf '%s...' "$d" \
&& find ./$d -maxdepth 1 -type f \
- -not -name '*.sh' -not -name '*.sed' \
- | xargs chmod -x \
+ -not -name '*.sh' -not -name '*.sed' \
+ | xargs chmod -x \
)done; \
printf 'all permissions forced\n'
git config core.filemode false
diff --git a/configuration.make b/configuration.make
index ab55692..bc0e00a 100644
--- a/configuration.make
+++ b/configuration.make
@@ -23,9 +23,11 @@
# Include platform-specific makefile.
-ifeq (msys,$(findstring msys,$(LMI_BUILD)))
+lmi_build_type := $(shell /usr/share/libtool/build-aux/config.guess)
+
+ifeq (msys,$(findstring msys,$(lmi_build_type)))
platform_makefile := msw_msys.make
-else ifeq (cygwin,$(findstring cygwin,$(LMI_BUILD)))
+else ifeq (cygwin,$(findstring cygwin,$(lmi_build_type)))
platform_makefile := msw_cygwin.make
else
ifeq (mingw32,$(findstring mingw32,$(LMI_HOST)))
diff --git a/gui_test.sh b/gui_test.sh
index abf1768..7c0136c 100755
--- a/gui_test.sh
+++ b/gui_test.sh
@@ -36,7 +36,8 @@ set -e
# provides no convenient alternative):
setopt PIPE_FAIL
-case "$LMI_BUILD" in
+lmi_build_type=$(/usr/share/libtool/build-aux/config.guess)
+case "$lmi_build_type" in
(*-*-linux*)
PERFORM=wine
;;
diff --git a/gwc/.zshrc b/gwc/.zshrc
index c2e8ba1..a9de1a3 100644
--- a/gwc/.zshrc
+++ b/gwc/.zshrc
@@ -1,8 +1,9 @@
# Personal configuration for cross-building in a chroot.
export WINEPATH='Z:\\opt\\lmi\\local\\bin;Z:\\opt\\lmi\\local\\lib'
-# Perhaps use $(/usr/share/libtool/build-aux/config.guess) instead.
-export LMI_BUILD=x86_64-pc-linux-gnu
+# This is probably unnecessary:
+# export LMI_BUILD
+# LMI_BUILD=$(/usr/share/libtool/build-aux/config.guess)
export LMI_HOST=i686-w64-mingw32
export PATH="/opt/lmi/local/bin:/opt/lmi/local/lib:$PATH"
# At a regular user prompt, outside the chroot, do this:
diff --git a/install_libxml2_libxslt.make b/install_libxml2_libxslt.make
index 001d6b3..00950f4 100644
--- a/install_libxml2_libxslt.make
+++ b/install_libxml2_libxslt.make
@@ -62,7 +62,9 @@ xml_dir := /opt/lmi/$(host_type)/xml-scratch
mingw_bin_dir :=
-ifeq (cygwin,$(findstring cygwin,$(LMI_BUILD)))
+lmi_build_type := $(shell /usr/share/libtool/build-aux/config.guess)
+
+ifeq (cygwin,$(findstring cygwin,$(lmi_build_type)))
mingw_bin_dir := $(mingw_dir)/bin/
endif
diff --git a/install_msw.sh b/install_msw.sh
index 172ecea..42ac433 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -45,8 +45,10 @@ then
export coefficiency='--jobs=4'
fi
+lmi_build_type=$(/usr/share/libtool/build-aux/config.guess)
+
export platform
-case "$LMI_BUILD" in
+case "$lmi_build_type" in
(*-*-cygwin*)
platform=Cygwin
;;
diff --git a/set_arch.sh b/set_arch.sh
index 577a5f7..50d5fd0 100755
--- a/set_arch.sh
+++ b/set_arch.sh
@@ -26,10 +26,10 @@
# Invoke as ". ./set_paths.sh" without the quotes.
#
# $LMI_HOST can be overridden at the command line, e.g.:
-# LMI_HOST="$LMI_BUILD" . ./set_paths.sh
+# LMI_HOST="whatever" . ./set_paths.sh
# That command doesn't alter the value of $LMI_HOST in the environment
# because there's an obvious alternative that does so:
-# LMI_HOST="$LMI_BUILD"; . ./set_paths.sh
+# LMI_HOST="whatever"; . ./set_paths.sh
#
# Perhaps $prefix should be similarly overridable.
#
@@ -44,8 +44,8 @@
foo()
{
-local LMI_BUILD
- LMI_BUILD=$(/usr/share/libtool/build-aux/config.guess)
+local lmi_build_type
+ lmi_build_type=$(/usr/share/libtool/build-aux/config.guess)
local prefix="/opt/lmi"
local exec_prefix="$prefix"/"$LMI_HOST"
@@ -88,7 +88,7 @@ unset -v WINEPATH
# 'winepath' doesn't DTRT with '/first/path:/second/path'--need to
# run it against each component, and separate results with ';', not ':'
#
-case "$LMI_BUILD" in
+case "$lmi_build_type" in
(*-*-linux*)
w0="$(winepath -w "$localbindir" | sed -e's/\\/\\\\/g')"
w1="$(winepath -w "$locallibdir" | sed -e's/\\/\\\\/g')"
diff --git a/test_coding_rules_test.sh b/test_coding_rules_test.sh
index 2ab0445..4bd226e 100755
--- a/test_coding_rules_test.sh
+++ b/test_coding_rules_test.sh
@@ -361,7 +361,8 @@ touch another.unexpected.file
# Compare observed to expected. Note that directory '.' is ignored.
-case "$LMI_BUILD" in
+lmi_build_type=$(/usr/share/libtool/build-aux/config.guess)
+case "$lmi_build_type" in
(*-*-linux*)
PERFORM=wine
;;
diff --git a/tools/pete-2.1.1/Makefile b/tools/pete-2.1.1/Makefile
index 55395e4..e4eb2c0 100644
--- a/tools/pete-2.1.1/Makefile
+++ b/tools/pete-2.1.1/Makefile
@@ -21,8 +21,10 @@
################################################################################
+lmi_build_type := $(shell /usr/share/libtool/build-aux/config.guess)
+
EXEEXT :=
-ifeq (cygwin,$(findstring cygwin,$(LMI_BUILD)))
+ifeq (cygwin,$(findstring cygwin,$(lmi_build_type)))
EXEEXT := .exe
endif