[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] An initial step toward using 'config.guess' more generally
From: |
Greg Chicares |
Subject: |
[lmi] An initial step toward using 'config.guess' more generally |
Date: |
Fri, 5 Apr 2019 23:11:57 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 |
Vadim--With the goal of making lmi's build system more robust, I propose
the following patch, which sets '--build' according to 'config.guess'
for {libxml2, libxslt, liblzma}, as we already do for {wx, wxpdfdoc}.
I've tested it, and it seems to work fine, but I have some questions:
(0) I was going to ask whether it's even necessary to specify '--build'
these days, but the current advice, even in 2019, is apparently that
'--build' must be specified whenever '--host' is specified[0].
(1) Is the order of './configure' options significant? We had defined
$(xmlsoft_common_options) so that {libxml2, libxslt} options could be
written OAOO, but it included '--build' after '--prefix'. Moving
'--build' into library-specific option variables permutes the arguments.
Is that safe? (As long, of course, as the values are independent of
yet-unspecified arguments: clearly
--exec_prefix="$prefix"
--prefix="/home/my-name"
is fragile at best.)
(2) liblzma's 'config.guess' is in a build-aux/ subdirectory, and it
seemed weird to hard-code that...but that's where the wxPdfDoc install
script has it, and the autoconf manual suggests that's the canonical
location...so I guess that's perfectly okay.
It looks like I added the former $(build_type) in commit cc4a6e45ce,
modeling it on the wx installation procedure. It seemed weird that
'x86_64-unknown-linux-gnu' was hard-coded when an updated 'config.guess'
reports 'x86_64-pc-linux-gnu' instead for my machine; but rebuilding
the libraries with the patch below, it's detected as "...-unknown-...",
so the patch doesn't actually change today's current behavior in
that respect.
---------8<--------8<--------8<--------8<--------8<--------8<--------8<-------
diff --git a/install_libxml2_libxslt.make b/install_libxml2_libxslt.make
index 4e2e79e2..d5b10a5c 100644
--- a/install_libxml2_libxslt.make
+++ b/install_libxml2_libxslt.make
@@ -58,13 +58,11 @@ xml_dir := /opt/lmi/xml-scratch
# Variables that normally should be left alone
#################################
mingw_bin_dir :=
-build_type := x86_64-unknown-linux-gnu
host_type := i686-w64-mingw32
uname := $(shell uname 2>/dev/null)
ifeq (CYGWIN,$(findstring CYGWIN,$(uname)))
mingw_bin_dir := $(mingw_dir)/bin/
- build_type := i686-pc-cygwin
host_type := i686-w64-mingw32
endif
@@ -77,7 +75,7 @@ xz_cflags := \
$(xz_version)_options := \
--prefix=$(prefix) \
--exec-prefix=$(exec_prefix) \
- --build=$(build_type) \
+ --build=$(shell $(xml_dir)/$(xz_version)/build-aux/config.guess) \
--host=$(host_type) \
--disable-dependency-tracking \
CFLAGS="-g -O2 $(xz_cflags)" \
@@ -117,7 +115,6 @@ xmlsoft_common_cflags := \
xmlsoft_common_options := \
--prefix=$(prefix) \
--exec-prefix=$(exec_prefix) \
- --build=$(build_type) \
--host=$(host_type) \
--disable-dependency-tracking \
--disable-static \
@@ -129,6 +126,7 @@ xmlsoft_common_options := \
CFLAGS="-g -O2 $(xmlsoft_common_cflags)" \
$(libxml2_version)_options := \
+ --build=$(shell $(xml_dir)/$(libxml2_version)/config.guess) \
$(xmlsoft_common_options) \
--with-lzma=$(prefix) \
--with-schemas \
@@ -144,6 +142,7 @@ $(libxml2_version)_options := \
# libxslt option were named '--with-libxml-exec-prefix'.
$(libxslt_version)_options := \
+ --build=$(shell $(xml_dir)/$(libxslt_version)/config.guess) \
$(xmlsoft_common_options) \
--with-libxml-prefix=$(exec_prefix) \
--without-crypto \
--------->8-------->8-------->8-------->8-------->8-------->8-------->8-------
[patch ends, footnote begins]
---------
[0] "'--build' must be specified whenever '--host' is specified"
Is this another pre-modern practice that should be forgotten, like
FOO="bar"
export FOO
instead of
export FOO="bar"
? Older versions mention historical reasons...
https://ftp.gnu.org/old-gnu/Manuals/autoconf-2.57/html_chapter/autoconf_11.html
| For historical reasons, passing `--host' also changes the build type.
| Therefore, whenever you specify --host, be sure to specify --build too.
| This will be fixed in the future.
https://www.gnu.org/software/autoconf/manual/autoconf-2.68/html_node/Specifying-Target-Triplets.html
| For historical reasons, whenever you specify --host, be sure to specify
| --build too; this will be fixed in the future.
...and the advice persists even in 2.69, the latest version in git:
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Hosts-and-Cross_002dCompilation.html
| when --host is specified but --build isn't, the build system is assumed
| to be the same as --host, and ‘build_alias’ is set to that value.
| Eventually, this historically incorrect behavior will go away. [...]
| Therefore, whenever you specify --host, be sure to specify --build too.
- [lmi] An initial step toward using 'config.guess' more generally,
Greg Chicares <=