lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 0fc04fea 6/7: Refactor


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 0fc04fea 6/7: Refactor
Date: Thu, 23 Jun 2022 18:33:54 -0400 (EDT)

branch: master
commit 0fc04feacde99510b507336e0c9760b9d741a3dc
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Refactor
    
    Factored out common code so that each component of the gcc toolchain
    is specified OAOO, in a gcc-specific makefile.
---
 compiler_gcc.make  | 44 ++++++++++++++++++++++++++++++++++++++++++++
 configuration.make | 14 --------------
 msw_cygwin.make    | 24 +-----------------------
 msw_generic.make   | 24 +-----------------------
 msw_wsl.make       | 24 +-----------------------
 posix_fhs.make     | 10 ++--------
 6 files changed, 49 insertions(+), 91 deletions(-)

diff --git a/compiler_gcc.make b/compiler_gcc.make
index 24a52a15..7c46ace1 100644
--- a/compiler_gcc.make
+++ b/compiler_gcc.make
@@ -19,6 +19,50 @@
 # email: <gchicares@sbcglobal.net>
 # snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
 
+AR      := $(gcc_proclitic)ar
+CC      := $(gcc_proclitic)gcc
+CPP     := $(gcc_proclitic)cpp
+CXX     := $(gcc_proclitic)g++
+LD      := $(gcc_proclitic)g++
+# For GNU/Linux, $(RC) is never invoked.
+RC      := $(gcc_proclitic)windres
+
+################################################################################
+
+# GNU tools for special purposes.
+
+# Always use the GNU C++ compiler and preprocessor, version 3.x or
+# later, for testing physical closure and generating autodependencies.
+# This obviates figuring out how other toolchains support these needs.
+#
+# Override these definitions to specify GNU tools when using a
+# toolchain other than gcc-3.x or later.
+
+GNU_CPP := $(CPP)
+GNU_CXX := $(CXX)
+
+################################################################################
+
+# Identify run-time libraries for redistribution. See:
+#   https://lists.nongnu.org/archive/html/lmi/2017-05/msg00046.html
+# Perhaps gcc's '-print-sysroot' would be more suitable, but that
+# 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/$(LMI_TRIPLET)/*-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.
+
+ifeq (mingw32,$(findstring mingw32,$(LMI_TRIPLET)))
+compiler_sysroot := $(dir $(shell $(CXX) -print-libgcc-file-name))
+
+compiler_runtime_files := \
+  $(wildcard $(compiler_sysroot)/libgcc*.dll) \
+  $(wildcard $(compiler_sysroot)/libstdc++*.dll) \
+
+endif
+
 
################################################################################
 
 # $(subst): workaround for debian, whose MinGW-w64 identifies its
diff --git a/configuration.make b/configuration.make
index 8e59e33e..611313e1 100644
--- a/configuration.make
+++ b/configuration.make
@@ -78,17 +78,3 @@ TOUCH   := touch
 TR      := tr
 WC      := wc
 WGET    := wget
-
-################################################################################
-
-# GNU tools for special purposes.
-
-# Always use the GNU C++ compiler and preprocessor, version 3.x or
-# later, for testing physical closure and generating autodependencies.
-# This obviates figuring out how other toolchains support these needs.
-#
-# Override these definitions to specify GNU tools when using a
-# toolchain other than gcc-3.x or later.
-
-GNU_CPP := $(CPP)
-GNU_CXX := $(CXX)
diff --git a/msw_cygwin.make b/msw_cygwin.make
index 82367eb8..f87149e0 100644
--- a/msw_cygwin.make
+++ b/msw_cygwin.make
@@ -65,12 +65,7 @@ gcc_bin_dir := $(mingw_dir)/bin/
 #host_hyphen := $(LMI_TRIPLET)-
 host_hyphen :=
 
-AR      := $(gcc_bin_dir)$(host_hyphen)ar
-CC      := $(gcc_bin_dir)$(host_hyphen)gcc
-CPP     := $(gcc_bin_dir)$(host_hyphen)cpp
-CXX     := $(gcc_bin_dir)$(host_hyphen)g++
-LD      := $(gcc_bin_dir)$(host_hyphen)g++
-RC      := $(gcc_bin_dir)$(host_hyphen)windres
+gcc_proclitic := $(gcc_bin_dir)$(host_hyphen)
 
 # Programs for which FHS doesn't specify a location.
 
@@ -79,23 +74,6 @@ RC      := $(gcc_bin_dir)$(host_hyphen)windres
 # while the build system's own 'xmllint', if installed, may differ:
 #   XMLLINT := xmllint
 
-# Identify run-time libraries for redistribution. See:
-#   https://lists.nongnu.org/archive/html/lmi/2017-05/msg00046.html
-# Perhaps gcc's '-print-sysroot' would be more suitable, but that
-# 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/$(LMI_TRIPLET)/*-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.
-
-compiler_sysroot := $(dir $(shell $(CXX) -print-libgcc-file-name))
-
-compiler_runtime_files := \
-  $(wildcard $(compiler_sysroot)/libgcc*.dll) \
-  $(wildcard $(compiler_sysroot)/libstdc++*.dll) \
-
 
################################################################################
 
 # Configuration shared by all msw subplatforms.
diff --git a/msw_generic.make b/msw_generic.make
index 7967d6f7..790f81cd 100644
--- a/msw_generic.make
+++ b/msw_generic.make
@@ -38,12 +38,7 @@ gcc_bin_dir :=
 
 host_hyphen := $(LMI_TRIPLET)-
 
-AR      := $(gcc_bin_dir)$(host_hyphen)ar
-CC      := $(gcc_bin_dir)$(host_hyphen)gcc
-CPP     := $(gcc_bin_dir)$(host_hyphen)cpp
-CXX     := $(gcc_bin_dir)$(host_hyphen)g++
-LD      := $(gcc_bin_dir)$(host_hyphen)g++
-RC      := $(gcc_bin_dir)$(host_hyphen)windres
+gcc_proclitic := $(gcc_bin_dir)$(host_hyphen)
 
 # Programs for which FHS doesn't specify a location.
 
@@ -54,23 +49,6 @@ RC      := $(gcc_bin_dir)$(host_hyphen)windres
 # Don't use the one lmi builds until 'wine' is fixed--see:
 #   https://lists.nongnu.org/archive/html/lmi/2019-01/msg00034.html
 
-# Identify run-time libraries for redistribution. See:
-#   https://lists.nongnu.org/archive/html/lmi/2017-05/msg00046.html
-# Perhaps gcc's '-print-sysroot' would be more suitable, but that
-# 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/$(LMI_TRIPLET)/*-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.
-
-compiler_sysroot := $(dir $(shell $(CXX) -print-libgcc-file-name))
-
-compiler_runtime_files := \
-  $(wildcard $(compiler_sysroot)/libgcc*.dll) \
-  $(wildcard $(compiler_sysroot)/libstdc++*.dll) \
-
 
################################################################################
 
 # Configuration shared by all msw subplatforms.
diff --git a/msw_wsl.make b/msw_wsl.make
index 71e2e226..200840ff 100644
--- a/msw_wsl.make
+++ b/msw_wsl.make
@@ -38,12 +38,7 @@ gcc_bin_dir :=
 
 host_hyphen := $(LMI_TRIPLET)-
 
-AR      := $(gcc_bin_dir)$(host_hyphen)ar
-CC      := $(gcc_bin_dir)$(host_hyphen)gcc
-CPP     := $(gcc_bin_dir)$(host_hyphen)cpp
-CXX     := $(gcc_bin_dir)$(host_hyphen)g++
-LD      := $(gcc_bin_dir)$(host_hyphen)g++
-RC      := $(gcc_bin_dir)$(host_hyphen)windres
+gcc_proclitic := $(gcc_bin_dir)$(host_hyphen)
 
 # Programs for which FHS doesn't specify a location.
 
@@ -52,23 +47,6 @@ RC      := $(gcc_bin_dir)$(host_hyphen)windres
 # while the build system's own 'xmllint', if installed, may differ:
 #   XMLLINT := xmllint
 
-# Identify run-time libraries for redistribution. See:
-#   https://lists.nongnu.org/archive/html/lmi/2017-05/msg00046.html
-# Perhaps gcc's '-print-sysroot' would be more suitable, but that
-# 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/$(LMI_TRIPLET)/*-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.
-
-compiler_sysroot := $(dir $(shell $(CXX) -print-libgcc-file-name))
-
-compiler_runtime_files := \
-  $(wildcard $(compiler_sysroot)/libgcc*.dll) \
-  $(wildcard $(compiler_sysroot)/libstdc++*.dll) \
-
 
################################################################################
 
 # Configuration shared by all msw subplatforms.
diff --git a/posix_fhs.make b/posix_fhs.make
index d1b5f4a0..eccc76e4 100644
--- a/posix_fhs.make
+++ b/posix_fhs.make
@@ -24,15 +24,9 @@
 
 SHREXT := .so
 
-EXTRA_LIBS := -ldw -lunwind -ldl
+gcc_proclitic :=
 
-AR      := ar
-CC      := gcc
-CPP     := cpp
-CXX     := g++
-LD      := g++
-# Not used--no value necessary:
-RC      :=
+EXTRA_LIBS := -ldw -lunwind -ldl
 
 # Programs for which FHS doesn't specify a location.
 



reply via email to

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