lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] odd/multiarch cd1b383: Distinguish $exec_prefix from


From: Greg Chicares
Subject: [lmi-commits] [lmi] odd/multiarch cd1b383: Distinguish $exec_prefix from $prefix
Date: Fri, 19 Apr 2019 10:40:41 -0400 (EDT)

branch: odd/multiarch
commit cd1b383b6eb30f96476bd2c5ec50d39edf506a18
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Distinguish $exec_prefix from $prefix
    
    In theory at least, $exec_prefix is separate from $prefix:
    
    https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
    | Generally, $(exec_prefix) is used for directories that contain
    | machine-specific files (such as executables and subroutine libraries),
    | while $(prefix) is used directly for other directories.
    
    https://www.gnu.org/software/autoconf/manual/autoconf.html
    | exec_prefix
    | The installation prefix for architecture-dependent files.
    
    and $exec_prefix needn't be identical to $prefix or even a subdirectory
    of $prefix--in theory at least.
    
    Thus, instead of building autotoolized libraries this way:
      --prefix=/opt/lmi/"$host_type"/local
      --exec-prefix="$prefix"
    it would seem better to build them this way [option X]:
      --prefix=/opt/lmi/local
      --exec-prefix="$prefix"/"$host_type"
    or even this way [option Y]:
      --prefix=/opt/lmi/local
      --exec-prefix=/opt/lmi/"$host_type"/local
    
    Attempting to use option Y failed in ways that seemed difficult to fix
    (wxWidgets built successfully with either X or Y, but liblzma and
    libxml2 didn't; perhaps their maintainers have blithely assumed that
    $exec_prefix is a subdirectory of $prefix), so this commit implements
    option X. And it's almost successful: lmi builds and works correctly
    except that lzma support for product files fails the test here:
      https://lists.nongnu.org/archive/html/lmi/2017-08/msg00061.html
    That failure is not unanticipated, because libxml2 configuration says
      "checking for LZMA...no"
    for option X, both with and without this change:
    -  --with-lzma=$(prefix) \
    +  --with-lzma=$(exec_prefix) \
    The difference is that without that change, compilation halts because
    lzma headers cannot be found, whereas with that change, the library
    appears to build despite the "LZMA...no" warning (yet fails to support
    liblzma).
    
    Therefore, although this revision is committed because it's interesting,
    apparently it must be reverted because the autotoolization of libraries
    in widespread use is incompatible with the autotools vision, and the
    only reliable method is '--exec-prefix="$prefix"', which installs
    architecture-independent headers to an architecture-dependent directory.
    
    It is also noteworthy that 'install_msw.sh' had to change, replacing
    '/opt/lmi/"$LMI_HOST"/local/bin' with '/opt/lmi/local/"$LMI_HOST"/bin'.
    This suggests that it's a defect to compose such paths in multiple
    places (and there are other likely defects in the same file, in cygwin-
    specific code). Perhaps this means that all the local variables in
    'set_arch.sh' should be exported.
---
 GNUmakefile                  | 8 +++++---
 install_libxml2_libxslt.make | 8 ++++----
 install_msw.sh               | 2 +-
 install_wx.sh                | 6 +++---
 install_wxpdfdoc.sh          | 6 +++---
 set_arch.sh                  | 4 ++--
 6 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index 81062bc..bb6732b 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -118,9 +118,9 @@ srcdir          := $(CURDIR)
 
 # These directories are outside the scope of the GNU Coding Standards.
 # Therefore, their names may contain '_' for distinction and clarity.
-localbindir     := $(exec_prefix)/local/bin
-locallibdir     := $(exec_prefix)/local/lib
-localincludedir := $(exec_prefix)/local/include
+localbindir     := $(prefix)/local/$(LMI_HOST)/bin
+locallibdir     := $(prefix)/local/$(LMI_HOST)/lib
+localincludedir := $(prefix)/local/include
 # Presuppose that system-test results may legitimately vary by
 # architecture. If experience shows otherwise, then these should
 # become subdirectories of $(prefix) instead.
@@ -380,6 +380,8 @@ raze: clobber
        -$(RM) --force --recursive $(prefix)/i686-w64-mingw32
        -$(RM) --force --recursive $(prefix)/x86_64-w64-mingw32
        -$(RM) --force --recursive $(prefix)/x86_64-pc-linux-gnu
+       -$(RM) --force --recursive $(prefix)/local
+       -$(RM) --force --recursive $(prefix)/third_party
 
 
################################################################################
 
diff --git a/install_libxml2_libxslt.make b/install_libxml2_libxslt.make
index 0e95efb..8d0d764 100644
--- a/install_libxml2_libxslt.make
+++ b/install_libxml2_libxslt.make
@@ -50,12 +50,12 @@ mingw_dir     := /MinGW_
 
 host_type     := $(if $(LMI_HOST),$(LMI_HOST),i686-w64-mingw32)
 
-prefix        := /opt/lmi/$(host_type)/local
-exec_prefix   := $(prefix)
+prefix        := /opt/lmi/local
+exec_prefix   := $(prefix)/$(host_type)
 
 cache_dir     := /cache_for_lmi/downloads
 
-build_dir     := $(prefix)/../xml-ad_hoc
+build_dir     := $(prefix)/ad_hoc/xml-ad_hoc
 
 # Variables that normally should be left alone 
#################################
 
@@ -129,7 +129,7 @@ $(libxml2_version)_options := \
   --build=`$(build_dir)/$(libxml2_version)/config.guess` \
   --host=$(host_type) \
   $(xmlsoft_common_options) \
-  --with-lzma=$(prefix) \
+  --with-lzma=$(exec_prefix) \
   --with-schemas \
   --without-iconv \
   --without-modules \
diff --git a/install_msw.sh b/install_msw.sh
index f5ded01..cdfb66d 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -226,7 +226,7 @@ make $coefficiency --output-sync=recurse -f 
install_libxml2_libxslt.make
 
 if [ "Cygwin" != "$platform" ]
 then
-    cp --archive /opt/lmi/third_party/bin/md5sum.exe 
/opt/lmi/"$LMI_HOST"/local/bin
+    cp --archive /opt/lmi/third_party/bin/md5sum.exe 
/opt/lmi/local/"$LMI_HOST"/bin
 fi
 
 find /cache_for_lmi/downloads -type f | xargs md5sum
diff --git a/install_wx.sh b/install_wx.sh
index 2c6ddef..998d4ef 100755
--- a/install_wx.sh
+++ b/install_wx.sh
@@ -47,8 +47,8 @@ host_type=${LMI_HOST:-"i686-w64-mingw32"}
 
 mingw_dir=/MinGW_
 
-prefix=/opt/lmi/"$host_type"/local
-exec_prefix="$prefix"
+prefix=/opt/lmi/local
+exec_prefix="$prefix"/"$host_type"
 
 repo_name="wxWidgets"
 
@@ -134,7 +134,7 @@ config_options="
 
 [ -n "$mingw_bin_dir" ] && export PATH="$mingw_bin_dir:${PATH}"
 
-build_dir="$prefix"/../wx-ad_hoc/lmi-gcc-$gcc_version
+build_dir="$prefix"/ad_hoc/wx-ad_hoc/lmi-gcc-$gcc_version
 
 if [ "$wx_skip_clean" != 1 ]
 then
diff --git a/install_wxpdfdoc.sh b/install_wxpdfdoc.sh
index f267ca9..62f6afb 100755
--- a/install_wxpdfdoc.sh
+++ b/install_wxpdfdoc.sh
@@ -47,8 +47,8 @@ host_type=${LMI_HOST:-"i686-w64-mingw32"}
 
 mingw_dir=/MinGW_
 
-prefix=/opt/lmi/"$host_type"/local
-exec_prefix="$prefix"
+prefix=/opt/lmi/local
+exec_prefix="$prefix"/"$host_type"
 
 repo_name="wxpdfdoc"
 
@@ -104,7 +104,7 @@ config_options="
 cd "$proxy_wxpdfdoc_dir"
 autoreconf --verbose
 
-build_dir="$prefix"/../wxpdfdoc-ad_hoc/wxpdfdoc-$wxpdfdoc_commit_sha
+build_dir="$prefix"/ad_hoc/wxpdfdoc-ad_hoc/wxpdfdoc-$wxpdfdoc_commit_sha
 
 if [ "$wxpdfdoc_skip_clean" != 1 ]
 then
diff --git a/set_arch.sh b/set_arch.sh
index 1a8b9ec..68277d5 100755
--- a/set_arch.sh
+++ b/set_arch.sh
@@ -49,8 +49,8 @@ local   lmi_build_type
 
 local      prefix="/opt/lmi"
 local exec_prefix="$prefix"/"$LMI_HOST"
-local localbindir="$exec_prefix"/local/bin
-local locallibdir="$exec_prefix"/local/lib
+local localbindir="$prefix"/local/"$LMI_HOST"/bin
+local locallibdir="$prefix"/local/"$LMI_HOST"/lib
 local extrabindir=/opt/lmi/third_party/bin
 
 # Running a command like this many times:



reply via email to

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