]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add and use AX_POSIX_SHELL autoconf macro, so we can rely on POSIX shell features
authorOndřej Surý <ondrej@sury.org>
Tue, 6 Nov 2018 10:09:08 +0000 (17:09 +0700)
committerOndřej Surý <ondrej@sury.org>
Wed, 7 Nov 2018 19:52:19 +0000 (02:52 +0700)
aclocal.m4
configure
configure.ac
m4/ax_posix_shell.m4 [new file with mode: 0644]
util/copyrights

index 5a16166751adc92f9b57e193b1727cf24e5eba09..bee01f409b8eb8520ba016131c780022f2cd29f9 100644 (file)
@@ -289,6 +289,7 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl
 ])dnl PKG_CHECK_VAR
 
 m4_include([m4/ax_check_openssl.m4])
+m4_include([m4/ax_posix_shell.m4])
 m4_include([m4/ax_pthread.m4])
 m4_include([m4/libtool.m4])
 m4_include([m4/ltoptions.m4])
index b6a780f78f879cdc804740ba676872d5c38069bd..90cffa9ec42b33091d93544bbff156314374e662 100755 (executable)
--- a/configure
+++ b/configure
@@ -11697,6 +11697,44 @@ else
 $as_echo "no, using $LN_S" >&6; }
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a POSIX-compatible shell" >&5
+$as_echo_n "checking for a POSIX-compatible shell... " >&6; }
+if ${ac_cv_prog_shell+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_test_shell_script='
+                         test "$(expr 1 + 1)" = "2" &&
+                         test "$(( 1 + 1 ))" = "2"
+                         '
+
+                         for ac_cv_prog_shell in \
+                           "$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do
+                           case $ac_cv_prog_shell in #(
+  /*) :
+
+                                     if "$ac_cv_prog_shell" -c "$ac_test_shell_script" 2>/dev/null; then :
+  ac_cv_path_shell=$SHELL
+fi
+                                    ;; #(
+  *) :
+     ;;
+esac
+                         done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_shell" >&5
+$as_echo "$ac_cv_prog_shell" >&6; }
+         if test "$ac_cv_prog_shell" = "no"; then :
+  SHELL=/bin/sh
+                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using $SHELL, even though it does not conform to POSIX" >&5
+$as_echo "$as_me: WARNING: using $SHELL, even though it does not conform to POSIX" >&2;}
+
+else
+  SHELL="$ac_cv_prog_shell"
+
+fi
+
+
 
 
 
index 2b27558a6e857fbf040aa8997ba40f2e5b8e1db5..d100ae29acfdc8f3df763de8831d583d464eb141 100644 (file)
@@ -24,6 +24,7 @@ AC_PROG_MAKE_SET
 AC_PROG_LIBTOOL
 AC_PROG_INSTALL
 AC_PROG_LN_S
+AX_POSIX_SHELL
 
 AC_SUBST(STD_CINCLUDES)
 AC_SUBST(STD_CDEFINES)
diff --git a/m4/ax_posix_shell.m4 b/m4/ax_posix_shell.m4
new file mode 100644 (file)
index 0000000..cdb3b11
--- /dev/null
@@ -0,0 +1,28 @@
+# AX_POSIX_SHELL
+# -------------
+# Check for a POSIX-compatible shell.
+#
+AC_DEFUN([AX_POSIX_SHELL],
+        [AC_CACHE_CHECK([for a POSIX-compatible shell], [ac_cv_prog_shell],
+                        [ac_test_shell_script='
+                         test "$(expr 1 + 1)" = "2" &&
+                         test "$(( 1 + 1 ))" = "2"
+                         '
+
+                         for ac_cv_prog_shell in \
+                           "$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do
+                           AS_CASE([$ac_cv_prog_shell],
+                                   [/*],[
+                                     AS_IF(["$ac_cv_prog_shell" -c "$ac_test_shell_script" 2>/dev/null],
+                                           [ac_cv_path_shell=$SHELL])
+                                   ])
+                         done
+                        ])
+         AS_IF([test "$ac_cv_prog_shell" = "no"],
+               [SHELL=/bin/sh
+                AC_MSG_WARN([using $SHELL, even though it does not conform to POSIX])
+               ],
+               [SHELL="$ac_cv_prog_shell"
+               ])
+         AC_SUBST([SHELL])
+        ])
index ee921366886529d35750d3230c5393673ff8eaa7..81be8677246a61503258dbdd1ed9ee49b33d0cd9 100644 (file)
 ./lib/win32/bindevt/bindevt.vcxproj.in         X       2013,2014,2015,2016,2018
 ./lib/win32/bindevt/bindevt.vcxproj.user       X       2013,2018
 ./ltmain.sh                                    X       1999,2000,2001,2003,2004,2006,2009,2012,2018
-./m4/ax_check_openssl.m4                       X       2018
-./m4/ax_pthread.m4                             X       2018
-./m4/libtool.m4                                        X       2012,2018
-./m4/ltoptions.m4                              X       2012,2018
-./m4/ltsugar.m4                                        X       2012,2018
-./m4/ltversion.m4                              X       2012,2018
-./m4/lt~obsolete.m4                            X       2012,2018
 ./make/includes.in                             MAKE    1999,2000,2001,2004,2005,2007,2012,2014,2016,2017,2018
 ./make/mkdep.in                                        X       1999,2000,2001,2006,2011,2014,2018
 ./make/rules.in                                        MAKE    1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017,2018