[Top][All Lists]

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

bootstrap: Portability issue on FreeBSD.

From: Mats Erik Andersson
Subject: bootstrap: Portability issue on FreeBSD.
Date: Fri, 8 Mar 2013 15:04:13 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hello there,

the bootstrap script contains a hardcoded call to 'sh',
which renders the self-bootstraping unusable on FreeBSD
and DragonFlyBSD.  The reason is that the default Bourne
shell on these systems handles the crucial invocation

  $ /bin/sh -c 'echo "$1 --> $2"' -- old new
  new -->

by removing the placeholder '--' despite the switch '-c'.
This is a different behaviour from all other '/bin/sh'
tested by me, including GNU/Linux, other BSDm and multiple
shells on OpenSolaris.

The patch given below, will improve the situation to allow

  $ CONFIG_SHELL=/usr/local/bin/mksh ./bootstrap

with FreeBSD and DragonFlyBSD in a typical source
directory, like GNU Inetutils.

Best regards,
   Mats Erik Andersson, working for GNU Inetutils.

diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index bee7765..43c6219 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -630,7 +630,7 @@ esac
 if $bootstrap_sync; then
   cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
     echo "$0: updating bootstrap and restarting..."
-    exec sh -c \
+    exec "${CONFIG_SHELL-/bin/sh}" -c \
       'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
       -- "$GNULIB_SRCDIR/build-aux/bootstrap" \
       "$0" "$@" --no-bootstrap-sync

reply via email to

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