POSIX shell detection in libopts can't be preset
libopts.m4 looks for a POSIX shell but iterates through a hardcoded list of shells, there's no way to override this. In a cross-compilation environment the build host shell may not be the same as the target, so there needs to be a way to directly specify the shell to use.
gnulib has something that looks useful: https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=m4/posix-shell.m4