From: Gary V. Vaughan Date: Fri, 21 Sep 2012 15:47:16 +0000 (+0700) Subject: syntax-check: fix violations, in m4sh files, of sc_prohibit_test_const_follows_var. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e059dd2b01921311f72f7214e4d1644ce948b8bc;p=thirdparty%2Flibtool.git syntax-check: fix violations, in m4sh files, of sc_prohibit_test_const_follows_var. * build-aux/general.m4sh, build-aux/ltmain.m4sh, libtoolize.m4sh: Swap operands and remove resulting spurious characters. Signed-off-by: Gary V. Vaughan --- diff --git a/build-aux/general.m4sh b/build-aux/general.m4sh index d46f67f79..e30062cc9 100644 --- a/build-aux/general.m4sh +++ b/build-aux/general.m4sh @@ -45,7 +45,7 @@ progpath=$0 M4SH_VERBATIM([[ : ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +test set = "${ECHO+set}" || ECHO=${as_echo-'printf %s\n'} : ${EGREP="@EGREP@"} : ${FGREP="@FGREP@"} : ${GREP="@GREP@"} @@ -311,7 +311,7 @@ func_normal_abspath () -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? - if test "$func_normal_abspath_tpath" = / ; then + if test / = "$func_normal_abspath_tpath" ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ @@ -374,7 +374,7 @@ func_relative_path () *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result - if test "x$func_relative_path_tlibdir" = x ; then + if test -z "$func_relative_path_tlibdir" ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir @@ -389,7 +389,7 @@ func_relative_path () func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" - if test "x$func_stripname_result" != x ; then + if test -n "$func_stripname_result" ; then func_append func_relative_path_result "/$func_stripname_result" fi @@ -545,7 +545,7 @@ func_mkdir_p () my_directory_path=$1 my_dir_list= - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + if test -n "$my_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with `-' case $my_directory_path in @@ -591,7 +591,7 @@ func_mktempdir () { my_template=${TMPDIR-/tmp}/${1-$progname} - if test "$opt_dry_run" = ":"; then + if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir=$my_template-$$ else @@ -692,7 +692,7 @@ func_show_eval () if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? - if test "$my_status" -eq 0; then :; else + if test 0 -eq "$my_status"; then :; else eval "(exit $my_status); $my_fail_exp" fi fi @@ -718,7 +718,7 @@ func_show_eval_locale () $my_cmd" my_status=$? eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else + if test 0 -eq "$my_status"; then :; else eval "(exit $my_status); $my_fail_exp" fi fi diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh index 5d1ea7eb6..7aaf8bf22 100644 --- a/build-aux/ltmain.m4sh +++ b/build-aux/ltmain.m4sh @@ -214,12 +214,12 @@ func_config () func_features () { echo "host: $host" - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" @@ -380,7 +380,7 @@ M4SH_GETOPTS( fi # preserve --debug - test "$debug_cmd" = : || func_append preserve_args " --debug" + test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) @@ -396,7 +396,7 @@ M4SH_GETOPTS( # Sanity checks first: func_check_version_match - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + if test yes != "$build_libtool_libs" && test yes != "$build_old_libs"; then func_fatal_configuration "not configured to build any kind of library" fi @@ -404,7 +404,7 @@ M4SH_GETOPTS( eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE @@ -453,7 +453,7 @@ func_lalib_unsafe_p () done exec 0<&5 5<&- fi - test "$lalib_p" = yes + test yes = "$lalib_p" } # func_ltwrapper_script_p file @@ -636,13 +636,13 @@ func_infer_tag () func_write_libtool_object () { write_libobj=$1 - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none @@ -1301,7 +1301,7 @@ func_mode_compile () for arg in $later; do case $arg in -shared) - test "$build_libtool_libs" != yes && \ + test yes != "$build_libtool_libs" && \ func_fatal_configuration "cannot build a shared library" build_old_libs=no continue @@ -1338,7 +1338,7 @@ func_mode_compile () func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" @@ -1350,14 +1350,14 @@ func_mode_compile () pic_mode=default ;; esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c - if test "$compiler_c_o" = no; then + if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else @@ -1368,12 +1368,12 @@ func_mode_compile () # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then + if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done - elif test "$need_locks" = warn; then + elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: @@ -1403,11 +1403,11 @@ compiler." qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile - if test "$pic_mode" != no; then + if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code @@ -1424,7 +1424,7 @@ compiler." func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - if test "$need_locks" = warn && + if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -1451,20 +1451,20 @@ compiler." fi # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then + if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi - if test "$compiler_c_o" = yes; then + if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi @@ -1473,7 +1473,7 @@ compiler." func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - if test "$need_locks" = warn && + if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -1504,7 +1504,7 @@ compiler." func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked - if test "$need_locks" != no; then + if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi @@ -1514,7 +1514,7 @@ compiler." } $opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () @@ -1706,7 +1706,7 @@ Otherwise, only FILE itself is deleted using RM." # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then - if test "$opt_help" = :; then + if test : = "$opt_help"; then func_mode_help else { @@ -1838,7 +1838,7 @@ func_mode_execute () func_append_quoted args "$file" done - if test "X$opt_dry_run" = Xfalse; then + if test false = "$opt_dry_run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" @@ -1867,7 +1867,7 @@ func_mode_execute () fi } -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... @@ -1987,7 +1987,7 @@ func_mode_finish () exit $EXIT_SUCCESS } -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... @@ -1997,7 +1997,7 @@ func_mode_install () # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + if test "$nonopt" = "$SHELL" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. @@ -2057,7 +2057,7 @@ func_mode_install () *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then + if test x-m = "x$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi @@ -2105,7 +2105,7 @@ func_mode_install () # Check to see that the destination is a directory. test -d "$dest" && isdir=yes - if test "$isdir" = yes; then + if test yes = "$isdir"; then destdir=$dest destname= else @@ -2289,7 +2289,7 @@ func_mode_install () func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result @@ -2365,9 +2365,9 @@ func_mode_install () func_source "$wrapper" outputname= - if test "$fast_install" = no && test -n "$relink_command"; then + if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { - if test "$finalize" = yes; then + if test yes = "$finalize"; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result @@ -2453,7 +2453,7 @@ func_mode_install () fi } -test "$opt_mode" = install && func_mode_install ${1+"$@"} +test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -2469,7 +2469,7 @@ func_generate_dlsyms () my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else @@ -2516,7 +2516,7 @@ extern \"C\" { /* External symbol declarations for the compiler. */\ " - if test "$dlself" = yes; then + if test yes = "$dlself"; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" @@ -2705,7 +2705,7 @@ static const void *lt_preloaded_setup() { *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) - if test "X$my_pic_p" != Xno; then + if test no != "$my_pic_p"; then pic_flag_for_symtable=" $pic_flag" fi ;; @@ -2949,7 +2949,7 @@ func_extract_an_archive () f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 - if test "$lock_old_archive_extraction" = yes; then + if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" @@ -2958,7 +2958,7 @@ func_extract_an_archive () fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then + if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then @@ -3279,7 +3279,7 @@ func_exec_program () test -n \"\$absdir\" && thisdir=\"\$absdir\" " - if test "$fast_install" = yes; then + if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" @@ -3337,7 +3337,7 @@ func_exec_program () fi # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" @@ -3542,7 +3542,7 @@ volatile const char * MAGIC_EXE = "$magic_exe"; const char * LIB_PATH_VARNAME = "$shlibpath_var"; EOF - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then func_to_host_path "$temp_rpath" cat </dev/null 2>&1 then continue @@ -6817,7 +6817,7 @@ func_mode_link () fi # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs" ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. @@ -6842,7 +6842,7 @@ func_mode_link () *) func_append finalize_rpath " $libdir" ;; esac done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi @@ -6867,7 +6867,7 @@ func_mode_link () esac done - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) @@ -6891,7 +6891,7 @@ func_mode_link () ;; *) # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then + if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; @@ -6938,7 +6938,7 @@ EOF -l*) func_stripname -l '' "$i" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes" ; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" @@ -6981,7 +6981,7 @@ EOF $opt_dry_run || $RM conftest if $LTCC $LTCFLAGS -o conftest conftest.c $i; then ldd_output=`ldd conftest` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes" ; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" @@ -7031,7 +7031,7 @@ EOF -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" @@ -7046,9 +7046,9 @@ EOF else libnameglob=$libname fi - test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` + test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - if test "$want_nocaseglob" = yes; then + if test yes = "$want_nocaseglob"; then shopt -s nocaseglob potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` $nocaseglob @@ -7115,7 +7115,7 @@ EOF -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" @@ -7164,7 +7164,7 @@ EOF none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` @@ -7173,7 +7173,7 @@ EOF case $tmp_deplibs in *[!\ \ ]*) echo - if test "X$deplibs_check_method" = "Xnone"; then + if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." @@ -7197,8 +7197,8 @@ EOF ;; esac - if test "$droppeddeps" = yes; then - if test "$module" = yes; then + if test yes = "$droppeddeps"; then + if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" @@ -7211,7 +7211,7 @@ EOF echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi - if test "$build_old_libs" = no; then + if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes @@ -7223,13 +7223,13 @@ EOF echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." - if test "$allow_undefined" = no; then + if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then + if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes @@ -7284,18 +7284,18 @@ EOF dlname= # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac - if test "$hardcode_into_libs" = yes; then + if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath - test "$opt_mode" != relink && rpath=$compile_rpath$rpath + test relink != "$opt_mode" && rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then @@ -7342,7 +7342,7 @@ EOF fi shlibpath=$finalize_shlibpath - test "$opt_mode" != relink && shlibpath=$compile_shlibpath$shlibpath + test relink != "$opt_mode" && shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -7387,7 +7387,7 @@ EOF cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + if test EXPORTS != "`$SED 1q $export_symbols`"; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. @@ -7404,7 +7404,7 @@ EOF # Prepare the list of exported symbols if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols @@ -7425,7 +7425,7 @@ EOF try_normal_branch=no ;; esac - if test "$try_normal_branch" = yes \ + if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then @@ -7460,7 +7460,7 @@ EOF fi done IFS=$save_ifs - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi @@ -7473,7 +7473,7 @@ EOF $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of @@ -7500,7 +7500,7 @@ EOF if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && + test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. @@ -7520,18 +7520,18 @@ EOF fi fi - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then + if test yes = "$module" && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds @@ -7549,7 +7549,7 @@ EOF fi fi - if test "X$skipped_export" != "X:" && + if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then @@ -7582,7 +7582,7 @@ EOF last_robj= k=1 - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output @@ -7595,14 +7595,14 @@ EOF func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= - if test "$compiler_needs_object" = yes; then + if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi @@ -7629,13 +7629,13 @@ EOF func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result - if test "X$objlist" = X || + if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. - if test "$k" -eq 1 ; then + if test 1 -eq "$k" ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" @@ -7698,7 +7698,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7749,7 +7749,7 @@ EOF # value of $libobjs for piecewise linking. # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then + if test yes = "$module" && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else @@ -7791,7 +7791,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7803,7 +7803,7 @@ EOF IFS=$save_ifs # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then @@ -7823,7 +7823,7 @@ EOF done # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then + if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi @@ -7831,7 +7831,7 @@ EOF ;; obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "\`-dlopen' is ignored for objects" fi @@ -7895,7 +7895,7 @@ EOF fi # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && libobjs=$non_pic_objects + test yes != "$build_libtool_libs" && libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs @@ -7912,7 +7912,7 @@ EOF exit $EXIT_SUCCESS fi - if test "$build_libtool_libs" != yes; then + if test yes != "$build_libtool_libs"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi @@ -7924,7 +7924,7 @@ EOF exit $EXIT_SUCCESS fi - if test -n "$pic_flag" || test "$pic_mode" != default; then + if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj @@ -7949,10 +7949,10 @@ EOF test -n "$release" && \ func_warning "\`-release' is ignored for programs" - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ + test yes = "$preload" \ + && test unknown = "$dlopen_support" \ + && test unknown = "$dlopen_self" \ + && test unknown = "$dlopen_self_static" && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in @@ -7967,7 +7967,7 @@ EOF *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then + if test CXX = "$tagname" ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" @@ -8112,7 +8112,7 @@ EOF fi finalize_rpath=$rpath - if test -n "$libobjs" && test "$build_old_libs" = yes; then + if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` @@ -8132,17 +8132,17 @@ EOF wrappers_required=no ;; *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then + if test yes != "$build_libtool_libs"; then wrappers_required=no fi ;; *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=no fi ;; esac - if test "$wrappers_required" = no; then + if test no = "$wrappers_required"; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath @@ -8193,7 +8193,7 @@ EOF fi fi - if test "$no_install" = yes; then + if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. @@ -8212,7 +8212,7 @@ EOF exit $EXIT_SUCCESS fi - if test "$hardcode_action" = relink; then + if test relink = "$hardcode_action"; then # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath @@ -8220,9 +8220,9 @@ EOF func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else - if test "$fast_install" != no; then + if test no != "$fast_install"; then link_command=$finalize_var$compile_command$finalize_rpath - if test "$fast_install" = yes; then + if test yes = "$fast_install"; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless @@ -8334,17 +8334,17 @@ EOF # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do - if test "$build_libtool_libs" = convenience; then + if test convenience = "$build_libtool_libs"; then oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no else - if test "$build_libtool_libs" = module; then + if test module = "$build_libtool_libs"; then oldobjs=$libobjs_save build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then + if test yes = "$preload" && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi @@ -8360,7 +8360,7 @@ EOF fi # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else @@ -8476,7 +8476,7 @@ EOF done RANLIB=$save_RANLIB oldobjs=$objlist - if test "X$oldobjs" = "X" ; then + if test -z "$oldobjs" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" @@ -8493,7 +8493,7 @@ EOF case $output in *.la) old_library= - test "$build_old_libs" = yes && old_library=$libname.$libext + test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior @@ -8510,14 +8510,14 @@ EOF # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then + if test yes = "$hardcode_automatic" ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do - if test "$installed" = yes; then + if test yes = "$installed"; then if test -z "$install_libdir"; then break fi @@ -8617,7 +8617,7 @@ EOF case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; + if test -n "$bindir" ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname @@ -8669,7 +8669,7 @@ dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then + if test no = "$installed" && test yes = "$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi @@ -8684,7 +8684,7 @@ relink_command=\"$relink_command\"" exit $EXIT_SUCCESS } -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && +{ test link = "$opt_mode" || test relink = "$opt_mode"; } && func_mode_link ${1+"$@"} @@ -8719,17 +8719,17 @@ func_mode_uninstall () for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result - if test "X$dir" = X.; then + if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result - test "$opt_mode" = uninstall && odir=$dir + test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then + if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; @@ -8744,7 +8744,7 @@ func_mode_uninstall () elif test -d "$file"; then exit_status=1 continue - elif test "$rmforce" = yes; then + elif test yes = "$rmforce"; then continue fi @@ -8773,12 +8773,12 @@ func_mode_uninstall () uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + func_execute_cmds "$postuninstall_cmds" 'test yes = "$rmforce" || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + func_execute_cmds "$old_postuninstall_cmds" 'test yes = "$rmforce" || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; @@ -8795,20 +8795,20 @@ func_mode_uninstall () # Add PIC object to the list of files to remove. if test -n "$pic_object" && - test "$pic_object" != none; then + test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && - test "$non_pic_object" != none; then + test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) - if test "$opt_mode" = clean ; then + if test clean = "$opt_mode" ; then noexename=$name case $file in *.exe) @@ -8836,7 +8836,7 @@ func_mode_uninstall () # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" - if test "$fast_install" = yes && test -n "$relink_command"; then + if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then @@ -8859,7 +8859,7 @@ func_mode_uninstall () exit $exit_status } -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && +{ test uninstall = "$opt_mode" || test clean = "$opt_mode"; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { diff --git a/libtoolize.m4sh b/libtoolize.m4sh index 87c584895..f424165cc 100644 --- a/libtoolize.m4sh +++ b/libtoolize.m4sh @@ -365,7 +365,7 @@ func_serial () my_filebase=$func_basename_result for my_file in `func_included_files "$my_filename"`; do if test -z "$my_macro_regex" || - test "$my_filename" = aclocal.m4 || + test aclocal.m4 = "$my_filename" || test "X$my_macro_regex" = "X$my_filebase" || func_grep '^AC_DEFUN(\@<:@'"$my_macro_regex" "$my_file" then @@ -446,7 +446,7 @@ func_serial_update_check () my_update_p=: if test -f "$my_destfile"; then - test "X$my_src_serial" = "X0" && { + test 0 = "$my_src_serial" && { func_warning "no serial number on \`$my_srcfile', not copying." return } @@ -489,9 +489,9 @@ func_aclocal_update_check () # Strictly, this libtoolize ought not to have to deal with ancient # serial formats, but we accept them here to be complete: - test "X$my_src_serial" = "X0" && + test 0 = "$my_src_serial" && my_src_serial=`func_serial "$my_srcfile" 'A[CM]_PROG_LIBTOOL'` - test "X$my_dest_serial" = "X0" && + test 0 = "$my_dest_serial" && my_dest_serial=`func_serial "$my_destfile" 'A[CM]_PROG_LIBTOOL'` ;; ltdl.m4) @@ -540,10 +540,10 @@ func_serial_update () # Strictly, this libtoolize ought not to have to deal with ancient # serial formats, but we accept them here to be complete: - test "X$my_src_serial" = "X0" && + test 0 = "$my_src_serial" && my_src_serial=`func_serial "$my_srcfile" "$my_old_macro_regex"` - test "X$my_dest_serial" = "X0" && + test 0 = "$my_dest_serial" && my_dest_serial=`func_serial "$my_destfile" "$my_old_macro_regex"` func_serial_update_check \ @@ -1020,7 +1020,7 @@ func_check_macros () # For nonrecursive mode, warn about continued use of Makefile.inc: # FIXME: Remove in 2013 # (along with last minute rename in func_install_pkgltdl_files) - if test "x$ltdl_mode" = "xnonrecursive"; then + if test nonrecursive = "$ltdl_mode"; then if func_grep "^-\?include $ltdl_dir/Makefile.inc\$" Makefile.am; then func_error "Use of \`include $ltdl_dir/Makefile.inc' is deprecated!" @@ -1030,7 +1030,7 @@ func_check_macros () fi # Suggest modern idioms for storing autoconf macros: - $ac_config_macro_dir_advised || if test -z "$ac_macro_dir" || test "x$macro_dir" = x.; then + $ac_config_macro_dir_advised || if test -z "$ac_macro_dir" || test . = "$macro_dir"; then func_echo "Consider adding \`AC_CONFIG_MACRO_DIR([m4])' to $configure_ac and" func_echo "rerunning $progname, to keep the correct libtool macros in-tree." ac_config_macro_dir_advised=: @@ -1085,7 +1085,7 @@ func_autoconf_configure () test -n "$_G_ac_init" _G_status=$? - test "$_G_status" -ne 0 \ + test 0 -ne "$_G_status" \ && func_verbose "\`$1' not using Autoconf" (exit $_G_status)