lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 0b6e1c4 2/2: Find utilities on $PATH


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 0b6e1c4 2/2: Find utilities on $PATH
Date: Tue, 30 May 2017 13:45:49 -0400 (EDT)

branch: master
commit 0b6e1c4e19f7d445546abeb1fd62cfaec6e9a6be
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Find utilities on $PATH
    
    A long time ago, lmi was built for msw without cygwin, using dodgy ports
    of standard *nix utilities and various nonfree compilers which provided
    their own implementations of some utilities such as grep. In that era,
    it was necessary to specify the full path to the most suitable version
    of each utility; now it is not. For --build=*-pc-cygwin, the cygwin
    utilities are all modern, and there is no distinction between /usr/bin/
    and /bin/ anyway. For --build=*-unknown-linux-gnu, the Filesystem
    Hierarchy Standard doesn't specify the location of every utility: e.g.,
    either /bin/grep or /usr/bin/grep is permitted, and hardcoding either
    one is a mistake.
---
 msw_cygwin.make  | 80 +++++++++++++++++++++---------------------------------
 msw_generic.make | 82 +++++++++++++++++++++-----------------------------------
 2 files changed, 62 insertions(+), 100 deletions(-)

diff --git a/msw_cygwin.make b/msw_cygwin.make
index f15123e..052e143 100644
--- a/msw_cygwin.make
+++ b/msw_cygwin.make
@@ -49,30 +49,12 @@ system_root := /cygdrive/c
 
 
################################################################################
 
-# These makefiles are designed to be independent of $PATH: they work
-# correctly even if $PATH is empty. That seems desirable as a general
-# principle; furthermore, many problems reported on mailing lists are
-# due to users inadvertently mixing cygwin and other tools by setting
-# $PATH incorrectly. OTOH, such problems arise infrequently with real
-# *nix, and some fundamental tools are not necessarily located in any
-# particular location: for example, neither FHS-2.2 nor FHS-3.0
-# prescribes where 'grep' must reside.
-#
-# To force $PATH to be respected instead, set $(USE_STD_PATHS) to a
-# nonempty string.
-#
-# These paths are slash-terminated so that setting them to empty
-# strings does the right thing.
-
-ifeq (,$(USE_STD_PATHS))
-  PATH_BIN     := /bin/
-  PATH_GCC     := /MinGW_/bin/
-  PATH_USR_BIN := /usr/bin/
-endif
+# Compiler, linker, and so on.
 
-################################################################################
+# Full path to gcc binaries, slash-terminated if nonempty. Setting it
+# to an empty string finds gcc on $PATH instead.
 
-# Compiler, linker, and so on.
+gcc_bin_dir := /MinGW_/bin/
 
 # Oddly, MinGW-w64 provides prefixed versions of compilers:
 #   i686-w64-mingw32-gcc.exe
@@ -82,12 +64,12 @@ endif
 #host_prefix := i686-w64-mingw32-
 host_prefix :=
 
-AR      := $(PATH_GCC)$(host_prefix)ar
-CC      := $(PATH_GCC)$(host_prefix)gcc
-CPP     := $(PATH_GCC)$(host_prefix)cpp
-CXX     := $(PATH_GCC)$(host_prefix)g++
-LD      := $(PATH_GCC)$(host_prefix)g++
-RC      := $(PATH_GCC)$(host_prefix)windres
+AR      := $(gcc_bin_dir)$(host_prefix)ar
+CC      := $(gcc_bin_dir)$(host_prefix)gcc
+CPP     := $(gcc_bin_dir)$(host_prefix)cpp
+CXX     := $(gcc_bin_dir)$(host_prefix)g++
+LD      := $(gcc_bin_dir)$(host_prefix)g++
+RC      := $(gcc_bin_dir)$(host_prefix)windres
 
 # Identify run-time libraries for redistribution. See:
 #   https://cygwin.com/ml/cygwin/2010-09/msg00553.html
@@ -105,35 +87,35 @@ compiler_runtime_files := \
 
 # Required in /bin (if anywhere) by FHS-2.2 .
 
-CP      := $(PATH_BIN)cp
-DATE    := $(PATH_BIN)date
-ECHO    := $(PATH_BIN)echo
-GZIP    := $(PATH_BIN)gzip
-LS      := $(PATH_BIN)ls
-MKDIR   := $(PATH_BIN)mkdir
-MV      := $(PATH_BIN)mv
-RM      := $(PATH_BIN)rm
-SED     := $(PATH_BIN)sed
-TAR     := $(PATH_BIN)tar
+CP      := cp
+DATE    := date
+ECHO    := echo
+GZIP    := gzip
+LS      := ls
+MKDIR   := mkdir
+MV      := mv
+RM      := rm
+SED     := sed
+TAR     := tar
 
 # FHS-2.2 would presumably put these in /usr/bin . However, debian
 # puts 'bzip2' and 'grep' in /bin .
 
-BZIP2   := $(PATH_USR_BIN)bzip2
-DIFF    := $(PATH_USR_BIN)diff
-GREP    := $(PATH_USR_BIN)grep
-MD5SUM  := $(PATH_USR_BIN)md5sum
-PATCH   := $(PATH_USR_BIN)patch
-SORT    := $(PATH_USR_BIN)sort
-TOUCH   := $(PATH_USR_BIN)touch
-TR      := $(PATH_USR_BIN)tr
-WC      := $(PATH_USR_BIN)wc
-WGET    := $(PATH_USR_BIN)wget
+BZIP2   := bzip2
+DIFF    := diff
+GREP    := grep
+MD5SUM  := md5sum
+PATCH   := patch
+SORT    := sort
+TOUCH   := touch
+TR      := tr
+WC      := wc
+WGET    := wget
 
 # Programs for which FHS doesn't specify a location.
 
 # Instead of requiring installation of the build system's own libxml2:
-#   XMLLINT := $(PATH_USR_BIN)xmllint
+#   XMLLINT := xmllint
 # use the one that lmi builds:
 XMLLINT := /opt/lmi/local/bin/xmllint
 
diff --git a/msw_generic.make b/msw_generic.make
index 2719487..de5f906 100644
--- a/msw_generic.make
+++ b/msw_generic.make
@@ -35,41 +35,21 @@ PERFORM := wine
 
 
################################################################################
 
-# These makefiles are designed to be independent of $PATH: they work
-# correctly even if $PATH is empty. That seems desirable as a general
-# principle; furthermore, many problems reported on mailing lists are
-# due to users inadvertently mixing cygwin and other tools by setting
-# $PATH incorrectly. OTOH, such problems arise infrequently with real
-# *nix, and some fundamental tools are not necessarily located in any
-# particular location: for example, neither FHS-2.2 nor FHS-3.0
-# prescribes where 'grep' must reside.
-#
-# To force $PATH to be respected instead, set $(USE_STD_PATHS) to a
-# nonempty string.
-#
-# These paths are slash-terminated so that setting them to empty
-# strings does the right thing.
-
-USE_STD_PATHS := NOPE
-
-ifeq (,$(USE_STD_PATHS))
-  PATH_BIN     := /bin/
-  PATH_GCC     := /usr/bin/
-  PATH_USR_BIN := /usr/bin/
-endif
+# Compiler, linker, and so on.
 
-################################################################################
+# Full path to gcc binaries, slash-terminated if nonempty. Setting it
+# to an empty string finds gcc on $PATH instead.
 
-# Compiler, linker, and so on.
+gcc_bin_dir :=
 
 host_prefix := i686-w64-mingw32-
 
-AR      := $(PATH_GCC)$(host_prefix)ar
-CC      := $(PATH_GCC)$(host_prefix)gcc
-CPP     := $(PATH_GCC)$(host_prefix)cpp
-CXX     := $(PATH_GCC)$(host_prefix)g++
-LD      := $(PATH_GCC)$(host_prefix)g++
-RC      := $(PATH_GCC)$(host_prefix)windres
+AR      := $(gcc_bin_dir)$(host_prefix)ar
+CC      := $(gcc_bin_dir)$(host_prefix)gcc
+CPP     := $(gcc_bin_dir)$(host_prefix)cpp
+CXX     := $(gcc_bin_dir)$(host_prefix)g++
+LD      := $(gcc_bin_dir)$(host_prefix)g++
+RC      := $(gcc_bin_dir)$(host_prefix)windres
 
 # Identify run-time libraries for redistribution.
 
@@ -85,35 +65,35 @@ compiler_runtime_files := \
 
 # Required in /bin (if anywhere) by FHS-2.2 .
 
-CP      := $(PATH_BIN)cp
-DATE    := $(PATH_BIN)date
-ECHO    := $(PATH_BIN)echo
-GZIP    := $(PATH_BIN)gzip
-LS      := $(PATH_BIN)ls
-MKDIR   := $(PATH_BIN)mkdir
-MV      := $(PATH_BIN)mv
-RM      := $(PATH_BIN)rm
-SED     := $(PATH_BIN)sed
-TAR     := $(PATH_BIN)tar
+CP      := cp
+DATE    := date
+ECHO    := echo
+GZIP    := gzip
+LS      := ls
+MKDIR   := mkdir
+MV      := mv
+RM      := rm
+SED     := sed
+TAR     := tar
 
 # FHS-2.2 would presumably put these in /usr/bin . However, debian
 # puts 'bzip2' and 'grep' in /bin .
 
-BZIP2   := $(PATH_USR_BIN)bzip2
-DIFF    := $(PATH_USR_BIN)diff
-GREP    := $(PATH_USR_BIN)grep
-MD5SUM  := $(PATH_USR_BIN)md5sum
-PATCH   := $(PATH_USR_BIN)patch
-SORT    := $(PATH_USR_BIN)sort
-TOUCH   := $(PATH_USR_BIN)touch
-TR      := $(PATH_USR_BIN)tr
-WC      := $(PATH_USR_BIN)wc
-WGET    := $(PATH_USR_BIN)wget
+BZIP2   := bzip2
+DIFF    := diff
+GREP    := grep
+MD5SUM  := md5sum
+PATCH   := patch
+SORT    := sort
+TOUCH   := touch
+TR      := tr
+WC      := wc
+WGET    := wget
 
 # Programs for which FHS doesn't specify a location.
 
 # Instead of requiring installation of the build system's own libxml2:
-#   XMLLINT := $(PATH_USR_BIN)xmllint
+#   XMLLINT := xmllint
 # use the one that lmi builds:
 XMLLINT := /opt/lmi/local/bin/xmllint
 



reply via email to

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