[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/multiarch 8ac7a03 2/2: Merge remote-tracking bra
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/multiarch 8ac7a03 2/2: Merge remote-tracking branch 'origin/master' into odd/multiarch |
Date: |
Sun, 19 May 2019 19:36:12 -0400 (EDT) |
branch: odd/multiarch
commit 8ac7a0358711e2825ed310fc8931fb3ca2af9a91
Merge: 50086f8 97a8cf8
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Merge remote-tracking branch 'origin/master' into odd/multiarch
No more work will be done on this branch, as it is now identical to
origin/master:
$git diff odd/multiarch origin/master |wc -l
0
The branch will be removed in good time.
---
GNUmakefile | 33 +++++++++++++++++----------------
INSTALL | 2 +-
gwc/.zshrc | 3 ---
install_libxml2_libxslt.make | 7 ++++---
install_mingw.make | 6 ++++--
install_mingw32.make | 6 ++++--
install_msw.sh | 2 ++
install_wx.sh | 4 ++--
install_wxpdfdoc.sh | 4 ++--
set_toolchain.sh | 16 +++++++++-------
tabs/5/startup_script | 2 +-
test_schemata.sh | 3 +++
12 files changed, 49 insertions(+), 39 deletions(-)
diff --git a/GNUmakefile b/GNUmakefile
index b888b0c..d8c9eaf 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -77,6 +77,20 @@ MAKEFLAGS := \
################################################################################
+# Remake this file to "source" a script that sets various crucial
+# environment variables.
+
+export LMI_ENV_FILE := env_$(shell date -u +'%s_%N').eraseme
+
+GNUmakefile $(srcdir)/GNUmakefile:: $(LMI_ENV_FILE)
+ $(eval include $(LMI_ENV_FILE))
+ @rm $(LMI_ENV_FILE)
+
+$(LMI_ENV_FILE):
+ @. ./set_toolchain.sh
+
+################################################################################
+
# Directories.
# SOMEDAY !! Follow the GNU Coding Standards
@@ -84,9 +98,6 @@ MAKEFLAGS := \
# more closely, changing the value of $(datadir), and perhaps using
# some other standard directories that are commented out for now.
-LMI_COMPILER ?= gcc
-LMI_TRIPLET ?= i686-w64-mingw32
-
prefix := /opt/lmi
# parent directory for machine-specific binaries
exec_prefix := $(prefix)/$(LMI_COMPILER)_$(LMI_TRIPLET)
@@ -131,19 +142,7 @@ touchstone_dir := $(prefix)/touchstone
################################################################################
# Other makefiles included; makefiles not to be remade.
-
-# Remake this file to "source" a script.
-
-export LMI_ENV_FILE := env_$(shell date -u +'%s_%N').eraseme
-
-GNUmakefile $(srcdir)/GNUmakefile:: source_env_vars
- $(eval include $(LMI_ENV_FILE))
- @rm $(LMI_ENV_FILE)
-
-.PHONY: source_env_vars
-source_env_vars:
- @. ./set_toolchain.sh
-
+#
# Included files that don't need to be remade are given explicit empty
# commands, which significantly reduces the number of lines emitted by
# 'make -d', making debug output easier to read.
@@ -373,8 +372,10 @@ raze: source_clean
.PHONY: eviscerate
eviscerate: source_clean
+ -$(RM) --force --recursive $(prefix)/bin
-$(RM) --force --recursive $(prefix)/local
-$(RM) --force --recursive $(prefix)/third_party
+ -$(RM) --force --recursive $(prefix)/zzz
-$(RM) --force --recursive $(prefix)/gcc_i686-w64-mingw32
-$(RM) --force --recursive $(prefix)/gcc_x86_64-w64-mingw32
-$(RM) --force --recursive $(prefix)/gcc_x86_64-pc-linux-gnu
diff --git a/INSTALL b/INSTALL
index 9fd3413..98c39c3 100644
--- a/INSTALL
+++ b/INSTALL
@@ -79,7 +79,7 @@ Installation proceeds silently for anywhere from a few
minutes to a couple
of hours, depending on your computer. When you see "Finished building lmi",
copy and paste these lines into the shell:
- export LMI_COMPILER=gcc ; export LMI_TRIPLET=i686-w64-mingw32 ; .
./set_toolchain.sh
+ . /opt/lmi/src/lmi/set_toolchain.sh
/opt/lmi/bin/lmi_wx_shared --data_path=/opt/lmi/data
You should see lmi's GUI. Try "File | New | Illustration", then press "OK";
diff --git a/gwc/.zshrc b/gwc/.zshrc
index 234f5db..afe8af7 100644
--- a/gwc/.zshrc
+++ b/gwc/.zshrc
@@ -1,8 +1,5 @@
# Personal configuration for cross-building in a chroot.
-export LMI_COMPILER=gcc
-export LMI_TRIPLET=i686-w64-mingw32
-
# To work with lmi, it is crucial to source 'set_toolchain.sh'. It's
# deliberately not sourced here, so that it can assume that some
# things have already been set up: for instance, it assumes that
diff --git a/install_libxml2_libxslt.make b/install_libxml2_libxslt.make
index 714d93a..8be2559 100644
--- a/install_libxml2_libxslt.make
+++ b/install_libxml2_libxslt.make
@@ -43,9 +43,6 @@ host_path := libxml2
mingw_dir := /opt/lmi/${LMI_COMPILER}_${LMI_TRIPLET}/gcc_msw
-LMI_COMPILER ?= gcc
-LMI_TRIPLET ?= i686-w64-mingw32
-
prefix := /opt/lmi/local
exec_prefix := $(prefix)/$(LMI_COMPILER)_$(LMI_TRIPLET)
@@ -158,6 +155,8 @@ initial_setup :| clobber_exec_prefix_only
.PHONY: initial_setup
initial_setup:
+ [ -n "$$LMI_COMPILER" ] || { printf '%s\n' "no LMI_COMPILER" && false; }
+ [ -n "$$LMI_TRIPLET" ] || { printf '%s\n' "no LMI_TRIPLET" && false; }
$(MKDIR) --parents $(prefix)
$(MKDIR) --parents $(exec_prefix)
$(MKDIR) --parents $(cache_dir)
@@ -209,6 +208,8 @@ $(libraries):
.PHONY: clobber_exec_prefix_only
clobber_exec_prefix_only:
+ [ -n "$$LMI_COMPILER" ] || { printf '%s\n' "no LMI_COMPILER" && false; }
+ [ -n "$$LMI_TRIPLET" ] || { printf '%s\n' "no LMI_TRIPLET" && false; }
-$(RM) --force --recursive $(exec_prefix)/bin/*xml2*
-$(RM) --force --recursive $(exec_prefix)/bin/*xslt*
-$(RM) --force --recursive $(exec_prefix)/bin/xmllint*
diff --git a/install_mingw.make b/install_mingw.make
index 0881dea..b58a373 100644
--- a/install_mingw.make
+++ b/install_mingw.make
@@ -107,9 +107,11 @@ $(file_list): initial_setup
.PHONY: initial_setup
initial_setup:
+ [ -n "$$LMI_COMPILER" ] || { printf '%s\n' "no LMI_COMPILER" &&
false; }
+ [ -n "$$LMI_TRIPLET" ] || { printf '%s\n' "no LMI_TRIPLET" &&
false; }
type "$(WGET)" >/dev/null || { printf '%b' $(wget_missing) &&
false; }
- [ ! -e $(prefix) ] || { printf '%b' $(prefix_exists) &&
false; }
- [ ! -e $(ad_hoc_dir) ] || { printf '%b' $(ad_hoc_dir_exists) &&
false; }
+ [ ! -e $(prefix) ] || { printf '%b' $(prefix_exists) &&
false; }
+ [ ! -e $(ad_hoc_dir) ] || { printf '%b' $(ad_hoc_dir_exists) &&
false; }
$(MKDIR) --parents $(prefix)
$(MKDIR) --parents $(ad_hoc_dir)
diff --git a/install_mingw32.make b/install_mingw32.make
index 22f103e..82259b5 100644
--- a/install_mingw32.make
+++ b/install_mingw32.make
@@ -115,9 +115,11 @@ $(file_list): initial_setup
.PHONY: initial_setup
initial_setup:
+ [ -n "$$LMI_COMPILER" ] || { printf '%s\n' "no LMI_COMPILER" &&
false; }
+ [ -n "$$LMI_TRIPLET" ] || { printf '%s\n' "no LMI_TRIPLET" &&
false; }
type "$(WGET)" >/dev/null || { printf '%b' $(wget_missing) &&
false; }
- [ ! -e $(prefix) ] || { printf '%b' $(prefix_exists) &&
false; }
- [ ! -e $(ad_hoc_dir) ] || { printf '%b' $(ad_hoc_dir_exists) &&
false; }
+ [ ! -e $(prefix) ] || { printf '%b' $(prefix_exists) &&
false; }
+ [ ! -e $(ad_hoc_dir) ] || { printf '%b' $(ad_hoc_dir_exists) &&
false; }
$(MKDIR) --parents $(prefix)
$(MKDIR) --parents $(ad_hoc_dir)
diff --git a/install_msw.sh b/install_msw.sh
index 275da78..98e2a96 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -134,6 +134,8 @@ if [ "/opt/lmi/src/lmi" = "$PWD" ]
then
inhibit_git_clone=1
printf 'Running in lmi srcdir, so inhibiting git clone.\n'
+ printf 'Eviscerating...\n'
+ make eviscerate || true
fi
mkdir --parents /opt/lmi/src
diff --git a/install_wx.sh b/install_wx.sh
index 825abea..82c4853 100755
--- a/install_wx.sh
+++ b/install_wx.sh
@@ -41,8 +41,8 @@ coefficiency=${coefficiency:-"--jobs=4"}
MAKE=${MAKE:-"make $coefficiency"}
-LMI_COMPILER=${LMI_COMPILER:-"gcc"}
-LMI_TRIPLET=${LMI_TRIPLET:-"i686-w64-mingw32"}
+[ -n "$LMI_COMPILER" ] || { printf '%s\n' "no LMI_COMPILER" && exit 1; }
+[ -n "$LMI_TRIPLET" ] || { printf '%s\n' "no LMI_TRIPLET" && exit 2; }
# Variables that normally should be left alone
#################################
diff --git a/install_wxpdfdoc.sh b/install_wxpdfdoc.sh
index ee879fa..1500d21 100755
--- a/install_wxpdfdoc.sh
+++ b/install_wxpdfdoc.sh
@@ -41,8 +41,8 @@ coefficiency=${coefficiency:-"--jobs=4"}
MAKE=${MAKE:-"make $coefficiency"}
-LMI_COMPILER=${LMI_COMPILER:-"gcc"}
-LMI_TRIPLET=${LMI_TRIPLET:-"i686-w64-mingw32"}
+[ -n "$LMI_COMPILER" ] || { printf '%s\n' "no LMI_COMPILER" && exit 1; }
+[ -n "$LMI_TRIPLET" ] || { printf '%s\n' "no LMI_TRIPLET" && exit 2; }
# Variables that normally should be left alone
#################################
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) ;;
(*)
diff --git a/tabs/5/startup_script b/tabs/5/startup_script
index 6a7c559..86c2b5b 100755
--- a/tabs/5/startup_script
+++ b/tabs/5/startup_script
@@ -3,7 +3,7 @@
a='schroot --chroot=cross-lmi'
b='cd /opt/lmi/bin'
-c='LMI_COMPILER=gcc ; LMI_TRIPLET=i686-w64-mingw32 ; .
/opt/lmi/src/lmi/set_toolchain.sh'
+c='. /opt/lmi/src/lmi/set_toolchain.sh'
d='wine ./lmi_wx_shared --ash_nazg --data_path=/opt/lmi/data'
e='/opt/lmi/src/lmi/gui_test.sh'
diff --git a/test_schemata.sh b/test_schemata.sh
index af2a59b..4b5737b 100755
--- a/test_schemata.sh
+++ b/test_schemata.sh
@@ -21,6 +21,9 @@
# email: <address@hidden>
# snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
+[ -n "$LMI_COMPILER" ] || { printf '%s\n' "no LMI_COMPILER" && exit 1; }
+[ -n "$LMI_TRIPLET" ] || { printf '%s\n' "no LMI_TRIPLET" && exit 2; }
+
echo " Test schemata..."
# Directory where this script resides.