Current versions of Automake's install-sh depends on substitutions like
${var:-foo}, which are not supported by ULTRIX 4.5 /bin/sh.
Now, ksh does support these and configure does find and use this shell
on ULTRIX, but install-sh starts with #!/bin/sh so when it is executed
directly, it is run with /bin/sh instead of the shell we want.
We can work around the problem by patching up the MKDIR_P and INSTALL
assignments at configure time to include the known-good shell, which
seems to work well.
-dnl Copyright © 2012, 2021 Nick Bowler
+dnl Copyright © 2012, 2021, 2023 Nick Bowler
dnl
dnl Definitions to help maintain compatibility with multiple Automake versions.
dnl
dnl
dnl Definitions to help maintain compatibility with multiple Automake versions.
dnl
dnl Provides definitions to help maintain compatibility with older versions of
dnl Automake. Currently, this means:
dnl
dnl Provides definitions to help maintain compatibility with older versions of
dnl Automake. Currently, this means:
dnl
+dnl - Automake 1.15 includes an install-sh that depends on a "better" shell
+dnl environment. However, even if such a shell is available and found by
+dnl configure, the script includes #!/bin/sh so it won't work if /bin/sh
+dnl is deficient. This problem is worked around by patching MKDIR_P
+dnl and INSTALL to include $SHELL.
+dnl
dnl - AM_V and AM_DEFAULT_V (new in Automake 1.12) are defined and AC_SUBSTed
dnl if Automake did not already, in a manner compatible with silent-rules
dnl support from previous versions.
dnl - AM_V and AM_DEFAULT_V (new in Automake 1.12) are defined and AC_SUBSTed
dnl if Automake did not already, in a manner compatible with silent-rules
dnl support from previous versions.
dnl Automake being targeted (this means you are limited to 6 characters
dnl in Automake 1.11).
dnl Automake being targeted (this means you are limited to 6 characters
dnl in Automake 1.11).
-AC_DEFUN_ONCE([DX_AUTOMAKE_COMPAT], [dnl
-AC_REQUIRE([DX_INIT])
+AC_DEFUN_ONCE([DX_AUTOMAKE_COMPAT],
+[AC_REQUIRE([DX_INIT])dnl
+AC_CONFIG_COMMANDS_PRE([# Patch install-sh references to include $SHELL
+AS_CASE([$MKDIR_P], ["$ac_install_sh"*], [MKDIR_P="$SHELL $MKDIR_P"])
+AS_CASE([$INSTALL], ["$ac_install_sh"*], [INSTALL="$SHELL $INSTALL"])
-AC_CONFIG_COMMANDS_PRE([dnl
- AS_VAR_SET_IF([AM_V], [], [AC_SUBST([AM_V], ['$(V)'])])
- AS_VAR_SET_IF([AM_DEFAULT_V], [],
- [AC_SUBST([AM_DEFAULT_V], ['$(AM_DEFAULT_VERBOSITY)'])])])
+# Substitute AM_V/AM_DEFAULT_V for compatibility with <automake-1.12
+AS_VAR_SET_IF([AM_V], [], [AC_SUBST([AM_V], ['$(V)'])])
+AS_VAR_SET_IF([AM_DEFAULT_V], [],
+ [AC_SUBST([AM_DEFAULT_V], ['$(AM_DEFAULT_VERBOSITY)'])])])dnl
# This will only work if there is a Makefile.in generated at the top srcdir.
AC_CACHE_CHECK([for alignment of silent-rules output], [dx_cv_align_v], [dnl
cat >conftest.sed <<'EOF'
/^am__v_GEN_0 *=/{
# This will only work if there is a Makefile.in generated at the top srcdir.
AC_CACHE_CHECK([for alignment of silent-rules output], [dx_cv_align_v], [dnl
cat >conftest.sed <<'EOF'
/^am__v_GEN_0 *=/{
- s/@<:@^"@:>@*" \(GEN *\).*/\1/
- s/ /x/g
- p
+ s/@<:@^"@:>@*" \(GEN *\).*/\1/
+ s/ /x/g
+ p
}
EOF
if sed -nf conftest.sed "$srcdir/Makefile.in" >conftest.out 2>/dev/null; then
}
EOF
if sed -nf conftest.sed "$srcdir/Makefile.in" >conftest.out 2>/dev/null; then
- read dx_genline <conftest.out
- dx_cv_align_v=`expr "$dx_genline" : '.*'`
- test $dx_cv_align_v -eq 0 && dx_cv_align_v=unknown
+ read dx_genline <conftest.out
+ dx_cv_align_v=`expr "$dx_genline" : '.*'`
+ test $dx_cv_align_v -eq 0 && dx_cv_align_v=unknown
fi
: "${dx_cv_align_v:=unknown}"
rm -f conftest*
fi
: "${dx_cv_align_v:=unknown}"
rm -f conftest*