Evaluation of test command

Could somebody please explain to me why and how the highlighted line(s) (?) of code puts the "test" evaluation into "result" and then to $enable_static ? Or does not ?

I did comment out the original code and changed it to what I feel is less cryptic , but the "result" is still wrong = $enable_static value which is string "no" to start with.

 # Make sure either enable_shared or enable_static is yes.

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
$as_echo_n "checking whether to build static libraries... " >&6; }
echo "@line $LINENO   # Make sure either enable_shared or enable_static is yes."
#  test "$enable_shared" = yes || enable_static=yes  (????) 
test "$enable_shared" = yes || "$enable_static"=yes
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
$as_echo "***************  DEBUG  ****** $enable_static" >&6; }

You changed working code into broken code.

|| && are short form if-then-else statements.

true && echo "This will print"
true || echo "This won't print"
false && echo "This won't print"
false || echo "This will"

# set enable_static to "yes" whenever enable_shared is NOT yes
test "$enable_shared" = yes || enable_static=yes

OK , but the original line of code supposedly evaluate # Make sure either enable_shared or enable_static is yes.and I thought that "||" met "or" . My mistake.

Either way - the code reports " no " which is not correct.

Moderator comments were removed during original forum migration.