Configure the bootstrap make in such a way that it can use a shell other

than "sh" for executing commands.  Useful in a cross-build environment.

* Do not define _PATH_BSHELL, because it is no longer used by make.

* In addition to _PATH_DEFSHELLDIR (the directory in which the default
  shell can be found), define _BASENAME_DEFSHELL (the shell's basename).

* Use shell builtin string manipulation instead of sed to extract
  the directory name and basename from $BSHELL.

OK sjg, christos
This commit is contained in:
apb 2006-10-09 20:51:05 +00:00
parent 4e86f6ddf0
commit 71ba9763cb
2 changed files with 11 additions and 9 deletions

10
tools/make/configure vendored
View File

@ -967,14 +967,14 @@ if test x"$BSHELL" = x; then
echo "$as_me: error: sh must be somewhere on \$PATH" >&2;}
{ (exit 1); exit 1; }; }
fi
cat >>confdefs.h <<EOF
#define _PATH_BSHELL "$BSHELL"
EOF
# Make wants to know what directory to find sh in.
nb_path_defshelldir=`echo $BSHELL | sed 's,/sh$,,'`
# Make wants to get the directory name and the basename
# for the default shell in two separate variables.
nb_path_defshelldir="${BSHELL%/*}"
nb_basename_defshell="${BSHELL##*/}"
cat >>confdefs.h <<EOF
#define _PATH_DEFSHELLDIR "$nb_path_defshelldir"
#define _BASENAME_DEFSHELL "$nb_basename_defshell"
EOF
# Make sure we have POSIX regex ability.

View File

@ -1,4 +1,4 @@
# $NetBSD: configure.ac,v 1.6 2003/07/26 20:24:01 salo Exp $
# $NetBSD: configure.ac,v 1.7 2006/10/09 20:51:05 apb Exp $
#
# Autoconf definition file for make.
#
@ -10,10 +10,12 @@ AC_PATH_PROG(BSHELL, sh)
if test x"$BSHELL" = x; then
AC_MSG_ERROR([sh must be somewhere on \$PATH])
fi
AC_DEFINE_UNQUOTED(_PATH_BSHELL, "$BSHELL")
# Make wants to know what directory to find sh in.
nb_path_defshelldir=`echo $BSHELL | sed 's,/sh$,,'`
# Make wants to get the directory name and the basename
# for the default shell in two separate variables.
nb_path_defshelldir="${BSHELL%/*}"
nb_basename_defshell="${BSHELL##*/}"
AC_DEFINE_UNQUOTED(_PATH_DEFSHELLDIR, "$nb_path_defshelldir")
AC_DEFINE_UNQUOTED(_BASENAME_DEFSHELL, "$nb_basename_defshell")
# Make sure we have POSIX regex ability.
AC_CHECK_HEADER(regex.h,, AC_MSG_ERROR([POSIX regex.h is required]))