From: Gary V. Vaughan Date: Tue, 2 Oct 2012 12:39:35 +0000 (+0700) Subject: libtool: unroll nested if into a single case statement. X-Git-Tag: v2.4.2.418~168^2~2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=a252d59d913c9635845721575695f78ca492757e;p=thirdparty%2Flibtool.git libtool: unroll nested if into a single case statement. * build-aux/ltmain.m4sh (func_mode_link): Unroll a hard to understad nested if statement into a more readable single case statement. Signed-off-by: Gary V. Vaughan --- diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh index f4ca699b2..5e879e8b8 100644 --- a/build-aux/ltmain.m4sh +++ b/build-aux/ltmain.m4sh @@ -8206,27 +8206,28 @@ EOF exit $EXIT_SUCCESS fi - if test relink = "$hardcode_action"; then + case $hardcode_action,$fast_install in + relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" - else - if test no != "$fast_install"; then + ;; + *,yes) link_command=$finalize_var$compile_command$finalize_rpath - 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 - relink_command= - fi - else + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + ;; + *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath - fi - fi + ;; + *,needless) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command= + ;; + esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` @@ -8328,21 +8329,24 @@ EOF # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do - if test convenience = "$build_libtool_libs"; then + case $build_libtool_libs in + convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no - else - if test module = "$build_libtool_libs"; then + ;; + module) oldobjs=$libobjs_save + addlibs=$old_convenience build_libtool_libs=no - else + ;; + *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" - fi - addlibs=$old_convenience - fi + addlibs=$old_convenience + ;; + esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x