From 353b83ee643d309f261d7ad8993211c66eb6380f Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 19 Jul 2017 15:53:01 +1000 Subject: [PATCH] use 'test "constant" "$variable"' [RT #45486] (cherry picked from commit aed501fb88a9f5e864dc1d606c14fe973296b9de) --- configure | 40 ++++++++++++++++++++-------------------- configure.in | 40 ++++++++++++++++++++-------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/configure b/configure index 9b8c09e776..a93b719410 100755 --- a/configure +++ b/configure @@ -15821,7 +15821,7 @@ else fi -if test "$enable_sit" = "yes" +if test "yes" = "$enable_sit" then case $with_sit_alg in *1) @@ -15831,21 +15831,21 @@ then with_sit_alg="sha256" ;; auto) - if test "$with_aes" != "no" + if test "no" != "$with_aes" then with_aes="yes" fi ;; *) with_sit_alg="aes" - if test "$with_aes" != "no" + if test "no" != "$with_aes" then with_aes="yes" fi ;; esac fi -if test "with_aes" = "checksit" +if test "checksit" = "$with_aes" then with_aes="no" fi @@ -16500,7 +16500,7 @@ $as_echo "#define HMAC_SHA256_SIT 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: aes" >&5 $as_echo "aes" >&6; } - if test "$with_aes" != "yes" + if test "yes" != "$with_aes" then as_fn_error $? "\"SIT wants to use unavailable AES\"" "$LINENO" 5; fi @@ -16845,7 +16845,7 @@ fi fi -if test "$have_clock_gt" != "no"; then +if test "no" != "$have_clock_gt"; then $as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h @@ -17525,7 +17525,7 @@ $as_echo "no" >&6; } PURIFY="" ;; *) - if test -f $purify_path || test $purify_path = purify; then + if test -f "$purify_path" || test purify = "$purify_path"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $purify_path" >&5 $as_echo "$purify_path" >&6; } PURIFYFLAGS="`echo $PURIFYOPTIONS`" @@ -17636,12 +17636,12 @@ $as_echo "$as_me: WARNING: Internal symbol table does not work with libtool. Di case $host_os in freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*) MKSYMTBL_PROGRAM="$PERL" - if test $want_symtable = all; then + if test "all" = "$want_symtable"; then ALWAYS_MAKE_SYMTABLE="yes" fi ;; *) - if test $want_symtable = yes -o $want_symtable = all + if test "yes" = "$want_symtable" -o "all" = "$want_symtable" then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: this system is not known to generate internal symbol table safely; disabling it" >&5 $as_echo "$as_me: WARNING: this system is not known to generate internal symbol table safely; disabling it" >&2;} @@ -18940,7 +18940,7 @@ done break fi done - if test "$use_readline" != "auto" && + if test "auto" != "$use_readline" && test "X$READLINE_LIB" = "X" then as_fn_error $? "The readline library was not found." "$LINENO" 5 @@ -18948,7 +18948,7 @@ done LIBS="$saved_LIBS" ;; esac -if test yes = "$ac_cv_func_readline" +if test "yes" = "$ac_cv_func_readline" then case "$READLINE_LIB" in *edit*) @@ -21239,12 +21239,12 @@ if test "yes" = "$idnlib"; then fi IDNLIBS= -if test "$use_idn" != no; then +if test "no" != "$use_idn"; then $as_echo "#define WITH_IDN 1" >>confdefs.h STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include" - if test "$idnlib" != no; then + if test "no" != "$idnlib"; then IDNLIBS="$idnlib $iconvlib" else IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib" @@ -21263,7 +21263,7 @@ else atf="no" fi -if test yes = "$atf"; then +if test "yes" = "$atf"; then atf=`pwd`/unit/atf ATFBUILD=atf-src @@ -21274,7 +21274,7 @@ $as_echo "building ATF from bind9/unit/atf-src" >&6; } fi ATFLIBS= -if test "$atf" != no; then +if test "no" != "$atf"; then $as_echo "#define ATF_TEST 1" >>confdefs.h @@ -25072,9 +25072,9 @@ fi case "$make_clean" in yes) - if test "$no_create" != "yes" + if test "yes" != "$no_create" then - if test "$silent" = "yes" + if test "yes" = "$silent" then make clean > /dev/null else @@ -25124,7 +25124,7 @@ report() { test "X$JSONSTATS" = "X" || echo " JSON statistics (--with-libjson)" fi - if test "$use_pkcs11" != "no"; then + if test "no" != "$use_pkcs11"; then if test "yes" = "$want_native_pkcs11"; then echo " Native PKCS#11/Cryptoki support (--enable-native-pkcs11)" else @@ -25219,14 +25219,14 @@ report() { echo "Unrecognized options:" echo " $ac_unrecognized_opts" fi - if test "$enable_full_report" != "yes"; then + if test "yes" != "$enable_full_report"; then echo "------------------------------------------------------------------------" echo "For more detail, use --enable-full-report." fi echo "========================================================================" } -if test "$silent" != "yes"; then +if test "yes" != "$silent"; then report fi diff --git a/configure.in b/configure.in index bd5dd5d46c..9ee901419d 100644 --- a/configure.in +++ b/configure.in @@ -1485,7 +1485,7 @@ AC_ARG_WITH(sit-alg, [ --with-sit-alg=ALG choose the algorithm for SIT [[aes|sha1|sha256]]], with_sit_alg="$withval", with_sit_alg="auto") -if test "$enable_sit" = "yes" +if test "yes" = "$enable_sit" then case $with_sit_alg in *1) @@ -1495,21 +1495,21 @@ then with_sit_alg="sha256" ;; auto) - if test "$with_aes" != "no" + if test "no" != "$with_aes" then with_aes="yes" fi ;; *) with_sit_alg="aes" - if test "$with_aes" != "no" + if test "no" != "$with_aes" then with_aes="yes" fi ;; esac fi -if test "with_aes" = "checksit" +if test "checksit" = "$with_aes" then with_aes="no" fi @@ -2016,7 +2016,7 @@ case $with_sit_alg in AC_MSG_ERROR("with-sit-alg requires enable-sit"); fi AC_MSG_RESULT(aes) - if test "$with_aes" != "yes" + if test "yes" != "$with_aes" then AC_MSG_ERROR("SIT wants to use unavailable AES"); fi @@ -2267,7 +2267,7 @@ if test "no" = "$have_clock_gt"; then AC_CHECK_LIB(rt,clock_gettime,have_clock_gt=rt,) fi -if test "$have_clock_gt" != "no"; then +if test "no" != "$have_clock_gt"; then AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if clock_gettime is available.]) fi @@ -2612,7 +2612,7 @@ case "$use_purify" in PURIFY="" ;; *) - if test -f $purify_path || test $purify_path = purify; then + if test -f "$purify_path" || test purify = "$purify_path"; then AC_MSG_RESULT($purify_path) PURIFYFLAGS="`echo $PURIFYOPTIONS`" PURIFY="$purify_path $PURIFYFLAGS" @@ -2690,12 +2690,12 @@ Install perl or explicitly disable the feature by --disable-symtable.]) case $host_os in freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*) MKSYMTBL_PROGRAM="$PERL" - if test $want_symtable = all; then + if test "all" = "$want_symtable"; then ALWAYS_MAKE_SYMTABLE="yes" fi ;; *) - if test $want_symtable = yes -o $want_symtable = all + if test "yes" = "$want_symtable" -o "all" = "$want_symtable" then AC_MSG_WARN([this system is not known to generate internal symbol table safely; disabling it]) fi @@ -3421,7 +3421,7 @@ no) ;; break fi done - if test "$use_readline" != "auto" && + if test "auto" != "$use_readline" && test "X$READLINE_LIB" = "X" then AC_MSG_ERROR([The readline library was not found.]) @@ -3429,7 +3429,7 @@ no) ;; LIBS="$saved_LIBS" ;; esac -if test yes = "$ac_cv_func_readline" +if test "yes" = "$ac_cv_func_readline" then case "$READLINE_LIB" in *edit*) @@ -4392,10 +4392,10 @@ if test "yes" = "$idnlib"; then fi IDNLIBS= -if test "$use_idn" != no; then +if test "no" != "$use_idn"; then AC_DEFINE(WITH_IDN, 1, [define if idnkit support is to be included.]) STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include" - if test "$idnlib" != no; then + if test "no" != "$idnlib"; then IDNLIBS="$idnlib $iconvlib" else IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib" @@ -4409,7 +4409,7 @@ AC_SUBST(IDNLIBS) AC_ARG_WITH(atf, [ --with-atf=ARG support Automated Test Framework], atf="$withval", atf="no") -if test yes = "$atf"; then +if test "yes" = "$atf"; then atf=`pwd`/unit/atf ATFBUILD=atf-src AC_SUBST(ATFBUILD) @@ -4428,7 +4428,7 @@ if test yes = "$atf"; then fi ATFLIBS= -if test "$atf" != no; then +if test "no" != "$atf"; then AC_DEFINE(ATF_TEST, 1, [define if ATF unit tests are to be built.]) STD_CINCLUDES="$STD_CINCLUDES -I$atf/include" ATFBIN="$atf/bin" @@ -5053,9 +5053,9 @@ AC_ARG_WITH(make-clean, make_clean="$withval", make_clean="yes") case "$make_clean" in yes) - if test "$no_create" != "yes" + if test "yes" != "$no_create" then - if test "$silent" = "yes" + if test "yes" = "$silent" then make clean > /dev/null else @@ -5102,7 +5102,7 @@ report() { test "X$JSONSTATS" = "X" || echo " JSON statistics (--with-libjson)" fi - if test "$use_pkcs11" != "no"; then + if test "no" != "$use_pkcs11"; then if test "yes" = "$want_native_pkcs11"; then echo " Native PKCS#11/Cryptoki support (--enable-native-pkcs11)" else @@ -5197,14 +5197,14 @@ report() { echo "Unrecognized options:" echo " $ac_unrecognized_opts" fi - if test "$enable_full_report" != "yes"; then + if test "yes" != "$enable_full_report"; then echo "------------------------------------------------------------------------" echo "For more detail, use --enable-full-report." fi echo "========================================================================" } -if test "$silent" != "yes"; then +if test "yes" != "$silent"; then report fi