bug-gzip
[Top][All Lists]
Advanced

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

FYI: one portability and two build-related patches


From: Jim Meyering
Subject: FYI: one portability and two build-related patches
Date: Mon, 10 Jun 2013 01:00:12 +0200

Testing on Solaris 10 with PATH restricted to stock directories
exposed a portability problem in m4/shell.m4.  Here's a standalone
demonstrator:

    $ /bin/sh -c 'case f in (f);; esac;'
    /bin/sh: syntax error at line 1: `(' unexpected
    [Exit 2]

The first patch below fixes that.

Building with recent automake evoked some warnings, so I've
addressed them with the two following patches.

>From 622e9b1d024da1343b83fc47fb1891e1d245add3 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 9 Jun 2013 15:16:53 -0700
Subject: [PATCH 1/3] build: use more portable shell syntax in search of
 working shell

* m4/shell.m4: Adjust sh/case syntax not to evoke a syntax
error from Solaris 10's /bin/sh.
---
 m4/shell.m4 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/m4/shell.m4 b/m4/shell.m4
index fbde696..017aa27 100644
--- a/m4/shell.m4
+++ b/m4/shell.m4
@@ -37,7 +37,7 @@ AC_DEFUN([AC_PROG_SHELL],
       ac_cv_path_shell=no

       case $SHELL in
-      (/*)
+      /*)
         rm -f conftest.c
         if ("$SHELL" -c "$ac_command") 2>/dev/null; then
           ac_cv_path_shell=$SHELL
@@ -45,7 +45,7 @@ AC_DEFUN([AC_PROG_SHELL],
       esac

       case $ac_cv_path_shell in
-      (no)
+      no)
         # Prefer shells that are more likely to be installed in the
         # same place on all hosts of this platform.  Therefore, prefer
         # shells in /bin and /usr/bin to shells in the installer's
@@ -57,7 +57,7 @@ AC_DEFUN([AC_PROG_SHELL],
         do
           IFS=$as_save_IFS
           case $as_dir in
-          (/*)
+          /*)
             for ac_base in sh bash ksh sh5; do
               rm -f conftest.c
               if ("$as_dir/$ac_base" -c "$ac_command") 2>/dev/null; then
@@ -66,7 +66,7 @@ AC_DEFUN([AC_PROG_SHELL],
               fi
             done
             case $ac_cv_path_shell in
-            (/*) break
+            /*) break
             esac
           esac
         done
--
1.8.3.251.g1462b67


>From 6d08c4dbd39d93d076622ecc885cb9574b774875 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 9 Jun 2013 15:28:28 -0700
Subject: [PATCH 2/3] build: avoid warning about deprecated use of automake's
 ACLOCAL_AMFLAGS

* Makefile.am (ACLOCAL_AMFLAGS): Don't use this deprecated variable.
* configure.ac: Do this instead: AC_CONFIG_MACRO_DIR([m4]).
---
 Makefile.am  | 1 -
 configure.ac | 5 +++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 764c782..a3fade7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,7 +21,6 @@ ALL_RECURSIVE_TARGETS =
 BUILT_SOURCES =

 SUBDIRS = lib doc . tests
-ACLOCAL_AMFLAGS = -I m4
 AM_CPPFLAGS = -I$(top_srcdir)/lib
 AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)

diff --git a/configure.ac b/configure.ac
index cb04125..b2b5d0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,8 +24,9 @@ AC_INIT([gzip],
         m4_esyscmd([build-aux/git-version-gen .tarball-version]),
         address@hidden)

-AC_CONFIG_SRCDIR(gzip.c)
-AC_CONFIG_AUX_DIR(build-aux)
+AC_CONFIG_SRCDIR([gzip.c])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
 AM_INIT_AUTOMAKE([1.11 dist-xz color-tests parallel-tests])
 AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
--
1.8.3.251.g1462b67


>From 22bd8cbbdf5388213b9f60dce4c233beca3532c3 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 9 Jun 2013 15:32:35 -0700
Subject: [PATCH 3/3] build: avoid automake warning that suggests use of
 subdir-objects

* configure.ac (AM_INIT_AUTOMAKE): Use the subdir-objects option.
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index b2b5d0a..af6856f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,7 +28,7 @@ AC_CONFIG_SRCDIR([gzip.c])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
-AM_INIT_AUTOMAKE([1.11 dist-xz color-tests parallel-tests])
+AM_INIT_AUTOMAKE([1.11 subdir-objects dist-xz color-tests parallel-tests])
 AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.

 dnl POSIXCHECK is worthwhile for maintainers, but adds several seconds
--
1.8.3.251.g1462b67



reply via email to

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