AC_DEFUN([FLA_CHECK_ENABLE_STATIC_BUILD],
[
dnl Tell the user we're checking whether to enable the option.
AC_MSG_CHECKING([whether user requested building a static library])
dnl Determine whether the user gave the --enable- or
dnl --disable- . If so, then run the first snippet of code;
dnl otherwise, run the second code block.
AC_ARG_ENABLE([static-build],
AC_HELP_STRING([--enable-static-build],[Enable static library generation. (Enabled by default.)]),
[
dnl If any form of the option is given, handle each case.
if test "$enableval" = "no" ; then
dnl User provided --enable- =no or --disable- .
fla_enable_static_build=no
elif test "$enableval" = "yes" ; then
dnl User provided --enable- =yes or --enable- .
fla_enable_static_build=yes
else
dnl We don't need an else branch because the configure script
dnl should detect whether the user provided an unexpected argument
dnl with the option.
AC_MSG_ERROR([[Reached unreachable branch in FLA_CHECK_ENABLE_STATIC_BUILD!]])
fi
],
[
dnl User did not specify whether to enable or disable the option.
dnl Default behavior is to disable the option.
fla_enable_static_build=yes
]
)
dnl Now act according to whether the option was requested.
if test "$fla_enable_static_build" = "yes" ; then
dnl Output the result.
AC_MSG_RESULT([yes])
elif test "$fla_enable_static_build" = "no" ; then
dnl Output the result.
AC_MSG_RESULT([no])
else
dnl Only "yes" and "no" are accepted, so this block is empty.
AC_MSG_ERROR([[Reached unreachable branch in FLA_CHECK_ENABLE_STATIC_BUILD!]])
fi
dnl Substitute the output variable.
AC_SUBST(fla_enable_static_build)
])