lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 02878aa: Specify --build and --host depending


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 02878aa: Specify --build and --host depending on `uname`
Date: Wed, 24 Aug 2016 22:34:02 +0000 (UTC)

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

    Specify --build and --host depending on `uname`
---
 install_wx.make       |   32 +++++++++++++++++++++++++-------
 install_wxpdfdoc.make |   18 ++++++++++++------
 2 files changed, 37 insertions(+), 13 deletions(-)

diff --git a/install_wx.make b/install_wx.make
index 4fa5b85..12f8156 100644
--- a/install_wx.make
+++ b/install_wx.make
@@ -85,12 +85,30 @@ endif
 
 # Variables that normally should be left alone 
#################################
 
-mingw_bin_dir  := $(mingw_dir)/bin
-
-#triplet_prefix := i686-w64-mingw32-
-triplet_prefix :=
+# Specify $(build_type) explicitly, depending on `uname`. It would
+# seem cleaner to deduce it this way:
+#   build_type  := $(shell /path/to/config.guess)
+# but that script is not easy to find. There's a copy in the wx
+# archive, but that hasn't yet been extracted at this point. Debian
+# GNU/Linux provides it in /usr/share/misc/ and recommends:
+#   https://wiki.debian.org/AutoTools/autoconf
+#   "In general you are much better off building against the current
+#   versions of these files than the ones shipped with the tarball"
+# but that directory is not on $PATH . Alternatively, RH provides it
+# in /usr/lib/rpm/redhat/ .
+
+mingw_bin_dir :=
+build_type    := x86_64-unknown-linux-gnu
+host_type     := i686-w64-mingw32
+
+uname := $(shell uname -s 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
 
-compiler       := gcc-$(shell $(mingw_bin_dir)/$(triplet_prefix)gcc 
-dumpversion)
+compiler       := gcc-$(shell $(mingw_bin_dir)$(host_type)-gcc -dumpversion)
 vendor         := $(subst .,,$(compiler))-$(wx_md5)
 
 build_dir      := $(wx_dir)/wxWidgets-$(wx_version)/$(vendor)
@@ -103,8 +121,8 @@ wx_cxx_flags   := -fno-omit-frame-pointer -std=c++11
 
 config_options = \
   --prefix=$(prefix) \
-  --build=i686-pc-cygwin \
-  --host=i686-w64-mingw32 \
+  --build=$(build_type) \
+  --host=$(host_type) \
   --disable-apple_ieee \
   --disable-aui \
   --disable-compat24 \
diff --git a/install_wxpdfdoc.make b/install_wxpdfdoc.make
index a342fdb..ceaad66 100644
--- a/install_wxpdfdoc.make
+++ b/install_wxpdfdoc.make
@@ -47,20 +47,26 @@ $(wxpdfdoc_archive)-md5     := 
8e3c4d6cd1df9c7f91426c8c4723cb6e
 
 # Variables that normally should be left alone 
#################################
 
-mingw_bin_dir  := $(mingw_dir)/bin
+mingw_bin_dir :=
+build_type    := x86_64-unknown-linux-gnu
+host_type     := i686-w64-mingw32
 
-#triplet_prefix := i686-w64-mingw32-
-triplet_prefix :=
+uname := $(shell uname -s 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
 
-compiler       := gcc-$(shell $(mingw_bin_dir)/$(triplet_prefix)gcc 
-dumpversion)
+compiler       := gcc-$(shell $(mingw_bin_dir)$(host_type)-gcc -dumpversion)
 
 wx_cc_flags    := -fno-omit-frame-pointer
 wx_cxx_flags   := -fno-omit-frame-pointer -std=c++11
 
 config_options = \
   --prefix=$(prefix) \
-  --build=i686-pc-cygwin \
-  --host=i686-w64-mingw32 \
+  --build=$(build_type) \
+  --host=$(host_type) \
   --disable-dependency-tracking \
   --with-wx-config=$(prefix)/bin/wx-config-portable \
   CFLAGS='$(wx_cc_flags)' \



reply via email to

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