ID: 3577766 - configure's knobs and switches don't work

Some of configure's knobs and switches, eg. --disable-intf-open, don't work.
This is caused by poor choice of variable names, resp. using the same variable
names Autoconf is using. And Autoconf doesn't like it, resp. gets confused.

Variable names prefixed with an 'x' in order to make them 'unique'.
This commit is contained in:
Zdenek Styblik 2012-10-17 04:45:14 +00:00
parent c62359bd79
commit 131846fb40

View File

@ -51,7 +51,7 @@ if test "x$exec_prefix" = "xNONE"; then
exec_prefix="$prefix" exec_prefix="$prefix"
fi fi
enable_all_options=yes xenable_all_options=yes
dnl set some things so we build with GNU tools on Solaris dnl set some things so we build with GNU tools on Solaris
case "$host_os" in case "$host_os" in
@ -63,39 +63,39 @@ solaris*)
# openssl libs are in /usr/sfw/lib on solaris 10 # openssl libs are in /usr/sfw/lib on solaris 10
LIBS="$LIBS -R/usr/sfw/lib" LIBS="$LIBS -R/usr/sfw/lib"
# disable the linux-specific interfaces # disable the linux-specific interfaces
enable_intf_bmc=yes xenable_intf_bmc=yes
enable_intf_imb=no xenable_intf_imb=no
enable_intf_open=no xenable_intf_open=no
enable_intf_lipmi=no xenable_intf_lipmi=no
enable_ipmishell=no xenable_ipmishell=no
enable_all_options=no xenable_all_options=no
;; ;;
*cygwin*) *cygwin*)
# disable the linux and solaris-specific interfaces # disable the linux and solaris-specific interfaces
enable_intf_imb=no xenable_intf_imb=no
enable_intf_open=no xenable_intf_open=no
enable_intf_lipmi=no xenable_intf_lipmi=no
enable_intf_bmc=no xenable_intf_bmc=no
enable_ipmishell=no xenable_ipmishell=no
;; ;;
*darwin*|aix*) *darwin*|aix*)
# disable the linux and solaris-specific interfaces # disable the linux and solaris-specific interfaces
enable_intf_imb=no xenable_intf_imb=no
enable_intf_open=no xenable_intf_open=no
enable_intf_lipmi=no xenable_intf_lipmi=no
enable_intf_bmc=no xenable_intf_bmc=no
enable_ipmishell=no xenable_ipmishell=no
;; ;;
*freebsd*) *freebsd*)
enable_intf_imb=no xenable_intf_imb=no
enable_intf_lipmi=no xenable_intf_lipmi=no
enable_intf_bmc=no xenable_intf_bmc=no
;; ;;
*netbsd*) *netbsd*)
enable_intf_imb=no xenable_intf_imb=no
enable_intf_lipmi=no xenable_intf_lipmi=no
enable_intf_bmc=no xenable_intf_bmc=no
enable_intf_open=no xenable_intf_open=no
;; ;;
esac esac
@ -108,8 +108,9 @@ dnl allow solaris builds to include all options
AC_ARG_ENABLE([solaris-opt], AC_ARG_ENABLE([solaris-opt],
[AC_HELP_STRING([--enable-solaris-opt], [AC_HELP_STRING([--enable-solaris-opt],
[enable all options for Solaris [default=no]])], [enable all options for Solaris [default=no]])],
[], [enable_solaris_opt=no]) [xenable_solaris_opt=$enableval],
if test "x$enable_all_options" = "xyes" || test "x$enable_solaris_opt" = "xyes"; then [xenable_solaris_opt=no])
if test "x$xenable_all_options" = "xyes" || test "x$xenable_solaris_opt" = "xyes"; then
AC_DEFINE(ENABLE_ALL_OPTIONS, [1], [Define to 1 to enable all command line options.]) AC_DEFINE(ENABLE_ALL_OPTIONS, [1], [Define to 1 to enable all command line options.])
fi fi
@ -117,40 +118,45 @@ dnl check for OpenSSL functionality
AC_ARG_ENABLE([internal-md5], AC_ARG_ENABLE([internal-md5],
[AC_HELP_STRING([--enable-internal-md5], [AC_HELP_STRING([--enable-internal-md5],
[enable internal MD5 library [default=no]])], [enable internal MD5 library [default=no]])],
[], [enable_internal_md5=no]) [xenable_internal_md5=$enableval],
[xenable_internal_md5=no])
AC_CHECK_LIB([crypto], [EVP_aes_128_cbc], AC_CHECK_LIB([crypto], [EVP_aes_128_cbc],
[if test "x$enable_internal_md5" != "xyes"; then [if test "x$xenable_internal_md5" != "xyes"; then
have_crypto=yes; LIBS="$LIBS -lcrypto" have_crypto=yes; LIBS="$LIBS -lcrypto"
fi], [have_crypto=no], [-lcrypto]) fi],
[have_crypto=no], [-lcrypto])
AC_CHECK_LIB([crypto], [MD5_Init], AC_CHECK_LIB([crypto], [MD5_Init],
[if test "x$enable_internal_md5" != "xyes"; then [if test "x$xenable_internal_md5" != "xyes"; then
if test "x$have_crypto" != "xyes"; then if test "x$have_crypto" != "xyes"; then
LIBS="$LIBS -lcrypto" LIBS="$LIBS -lcrypto"
have_md5=yes have_md5=yes
fi fi
AC_DEFINE(HAVE_CRYPTO_MD5, [1], [Define to 1 if libcrypto supports MD5.]) AC_DEFINE(HAVE_CRYPTO_MD5, [1], [Define to 1 if libcrypto supports MD5.])
fi], [], [-lcrypto]) fi],
[], [-lcrypto])
AC_CHECK_LIB([crypto], [MD2_Init], AC_CHECK_LIB([crypto], [MD2_Init],
[if test "x$enable_internal_md5" != "xyes"; then [if test "x$xenable_internal_md5" != "xyes"; then
if test "x$have_crypto" != "xyes" && test "x$have_md5" != "xyes"; then if test "x$have_crypto" != "xyes" && test "x$have_md5" != "xyes"; then
LIBS="$LIBS -lcrypto" LIBS="$LIBS -lcrypto"
have_md2=yes have_md2=yes
fi fi
AC_DEFINE(HAVE_CRYPTO_MD2, [1], [Define to 1 if libcrypto supports MD2.]) AC_DEFINE(HAVE_CRYPTO_MD2, [1], [Define to 1 if libcrypto supports MD2.])
fi], [], [-lcrypto]) fi],
[], [-lcrypto])
dnl enable IPMIv1.5 LAN interface dnl enable IPMIv1.5 LAN interface
AC_ARG_ENABLE([intf-lan], AC_ARG_ENABLE([intf-lan],
[AC_HELP_STRING([--enable-intf-lan], [AC_HELP_STRING([--enable-intf-lan],
[enable IPMIv1.5 LAN interface [default=yes]])], [enable IPMIv1.5 LAN interface [default=yes]])],
[], [enable_intf_lan=yes]) [xenable_intf_lan=$enableval],
if test "x$enable_intf_lan" = "xstatic" || test "x$enable_intf_lan" = "xplugin"; then [xenable_intf_lan=yes])
enable_intf_lan=yes if test "x$xenable_intf_lan" = "xstatic" || test "x$xenable_intf_lan" = "xplugin"; then
xenable_intf_lan=yes
fi fi
if test "x$enable_intf_lan" = "xyes"; then if test "x$xenable_intf_lan" = "xyes"; then
AC_DEFINE(IPMI_INTF_LAN, [1], [Define to 1 to enable LAN IPMIv1.5 interface.]) AC_DEFINE(IPMI_INTF_LAN, [1], [Define to 1 to enable LAN IPMIv1.5 interface.])
AC_SUBST(INTF_LAN, [lan]) AC_SUBST(INTF_LAN, [lan])
AC_SUBST(INTF_LAN_LIB, [libintf_lan.la]) AC_SUBST(INTF_LAN_LIB, [libintf_lan.la])
@ -161,21 +167,22 @@ dnl enable IPMIv2.0 RMCP+ LAN interface
AC_ARG_ENABLE([intf-lanplus], AC_ARG_ENABLE([intf-lanplus],
[AC_HELP_STRING([--enable-intf-lanplus], [AC_HELP_STRING([--enable-intf-lanplus],
[enable IPMIv2.0 RMCP+ LAN interface [default=auto]])], [enable IPMIv2.0 RMCP+ LAN interface [default=auto]])],
[if test "x$enable_intf_lanplus" != "xno" && test "x$have_crypto" != "xyes"; then [xenable_intf_lanplus=$enableval],
echo "** The lanplus interface requires an SSL library with EVP_aes_128_cbc defined." [xenable_intf_lanplus=$have_crypto])
enable_intf_lanplus=no if test "x$xenable_intf_lanplus" = "xstatic" || test "x$xenable_intf_lanplus" = "xplugin"; then
fi], xenable_intf_lanplus=yes
[enable_intf_lanplus=$have_crypto])
if test "x$enable_intf_lanplus" = "xstatic" || test "x$enable_intf_lanplus" = "xplugin"; then
enable_intf_lanplus=yes
fi fi
if test "x$enable_intf_lanplus" = "xyes"; then if test "x$xenable_intf_lanplus" != "xno" && test "x$have_crypto" != "xyes"; then
echo "** The lanplus interface requires an SSL library with EVP_aes_128_cbc defined."
xenable_intf_lanplus=no
fi
if test "x$xenable_intf_lanplus" = "xyes"; then
AC_DEFINE(IPMI_INTF_LANPLUS, [1], [Define to 1 to enable LAN+ IPMIv2 interface.]) AC_DEFINE(IPMI_INTF_LANPLUS, [1], [Define to 1 to enable LAN+ IPMIv2 interface.])
AC_SUBST(INTF_LANPLUS, [lanplus]) AC_SUBST(INTF_LANPLUS, [lanplus])
AC_SUBST(INTF_LANPLUS_LIB, [libintf_lanplus.la]) AC_SUBST(INTF_LANPLUS_LIB, [libintf_lanplus.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lanplus/libintf_lanplus.la" IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lanplus/libintf_lanplus.la"
else else
enable_intf_lanplus=no xenable_intf_lanplus=no
fi fi
ORIG_CPPFLAGS=$CPPFLAGS ORIG_CPPFLAGS=$CPPFLAGS
@ -231,15 +238,16 @@ fi
AC_ARG_ENABLE([intf-free], AC_ARG_ENABLE([intf-free],
[AC_HELP_STRING([--enable-intf-free], [AC_HELP_STRING([--enable-intf-free],
[enable FreeIPMI IPMI interface [default=auto]])], [enable FreeIPMI IPMI interface [default=auto]])],
[if test "x$enable_intf_free" != "xno" && test "x$have_free" != "xyes"; then [xenable_intf_free=$enableval],
echo "** Unable to build FreeIPMI interface support!" [xenable_intf_free=$have_free])
enable_intf_free=no if test "x$xenable_intf_free" = "xstatic" || test "x$xenable_intf_free" = "xplugin"; then
fi], xenable_intf_free=yes
[enable_intf_free=$have_free])
if test "x$enable_intf_free" = "xstatic" || test "x$enable_intf_free" = "xplugin"; then
enable_intf_free=yes
fi fi
if test "x$enable_intf_free" = "xyes"; then if test "x$xenable_intf_free" != "xno" && test "x$have_free" != "xyes"; then
echo "** Unable to build FreeIPMI interface support!"
xenable_intf_free=no
fi
if test "x$xenable_intf_free" = "xyes"; then
dnl Determine if you got the right FreeIPMI version dnl Determine if you got the right FreeIPMI version
AC_MSG_CHECKING([for libfreeipmi version 0.3.0]) AC_MSG_CHECKING([for libfreeipmi version 0.3.0])
AC_TRY_COMPILE([ AC_TRY_COMPILE([
@ -337,12 +345,13 @@ dnl Determine if you got the right FreeIPMI version
AC_DEFINE(IPMI_INTF_FREE_0_6_0, [1], [Define to 1 for FreeIPMI 0.6.0.]) AC_DEFINE(IPMI_INTF_FREE_0_6_0, [1], [Define to 1 for FreeIPMI 0.6.0.])
fi fi
else else
enable_intf_free=no xenable_intf_free=no
fi fi
AC_CHECK_LIB(freeipmi, AC_CHECK_LIB(freeipmi,
ipmi_cmd_raw_ipmb, ipmi_cmd_raw_ipmb,
AC_DEFINE(IPMI_INTF_FREE_BRIDGING, [1], [Define to 1 to enable FreeIPMI Bridging Support.])) AC_DEFINE(IPMI_INTF_FREE_BRIDGING, [1],
[Define to 1 to enable FreeIPMI Bridging Support.]))
fi fi
dnl look for termios header file dnl look for termios header file
@ -369,11 +378,12 @@ dnl enable Linux OpenIPMI interface
AC_ARG_ENABLE([intf-open], AC_ARG_ENABLE([intf-open],
[AC_HELP_STRING([--enable-intf-open], [AC_HELP_STRING([--enable-intf-open],
[enable Linux OpenIPMI interface [default=auto]])], [enable Linux OpenIPMI interface [default=auto]])],
[], [enable_intf_open=yes]) [xenable_intf_open=$enableval],
if test "x$enable_intf_open" = "xstatic" || test "x$enable_intf_open" = "xplugin"; then [xenable_intf_open=yes])
enable_intf_open=yes if test "x$xenable_intf_open" = "xstatic" || test "x$xenable_intf_open" = "xplugin"; then
xenable_intf_open=yes
fi fi
if test "x$enable_intf_open" = "xyes"; then if test "x$xenable_intf_open" = "xyes"; then
AC_DEFINE(IPMI_INTF_OPEN, [1], [Define to 1 to enable Linux OpenIPMI interface.]) AC_DEFINE(IPMI_INTF_OPEN, [1], [Define to 1 to enable Linux OpenIPMI interface.])
AC_SUBST(INTF_OPEN, [open]) AC_SUBST(INTF_OPEN, [open])
AC_SUBST(INTF_OPEN_LIB, [libintf_open.la]) AC_SUBST(INTF_OPEN_LIB, [libintf_open.la])
@ -411,11 +421,12 @@ dnl enable Intel IMB interface
AC_ARG_ENABLE([intf-imb], AC_ARG_ENABLE([intf-imb],
[AC_HELP_STRING([--enable-intf-imb], [AC_HELP_STRING([--enable-intf-imb],
[enable Intel IMB driver interface [default=auto]])], [enable Intel IMB driver interface [default=auto]])],
[], [enable_intf_imb=yes]) [xenable_intf_imb=$enableval],
if test "x$enable_intf_imb" = "xstatic" || test "x$enable_intf_imb" = "xplugin"; then [xenable_intf_imb=yes])
enable_intf_imb=yes if test "x$xenable_intf_imb" = "xstatic" || test "x$xenable_intf_imb" = "xplugin"; then
xenable_intf_imb=yes
fi fi
if test "x$enable_intf_imb" = "xyes"; then if test "x$xenable_intf_imb" = "xyes"; then
AC_DEFINE(IPMI_INTF_IMB, [1], [Define to 1 to enable Intel IMB interface.]) AC_DEFINE(IPMI_INTF_IMB, [1], [Define to 1 to enable Intel IMB interface.])
AC_SUBST(INTF_IMB, [imb]) AC_SUBST(INTF_IMB, [imb])
AC_SUBST(INTF_IMB_LIB, [libintf_imb.la]) AC_SUBST(INTF_IMB_LIB, [libintf_imb.la])
@ -427,15 +438,16 @@ AC_CHECK_HEADER([sys/lipmi/lipmi_intf.h], [have_lipmi=yes], [have_lipmi=no])
AC_ARG_ENABLE([intf-lipmi], AC_ARG_ENABLE([intf-lipmi],
[AC_HELP_STRING([--enable-intf-lipmi], [AC_HELP_STRING([--enable-intf-lipmi],
[enable Solaris 9 x86 IPMI interface [default=no]])], [enable Solaris 9 x86 IPMI interface [default=no]])],
[if test "x$enable_intf_lipmi" != "xno" && test "x$have_lipmi" != "xyes"; then [xenable_intf_lipmi=$enableval],
echo "** Unable to build Solaris 9 x86 IPMI interface support!" [xenable_intf_lipmi=no])
enable_intf_lipmi=no if test "x$xenable_intf_lipmi" = "xstatic" || test "x$xenable_intf_lipmi" = "xplugin"; then
fi], xenable_intf_lipmi=yes
[enable_intf_lipmi=no])
if test "x$enable_intf_lipmi" = "xstatic" || test "x$enable_intf_lipmi" = "xplugin"; then
enable_intf_lipmi=yes
fi fi
if test "x$enable_intf_lipmi" = "xyes"; then if test "x$xenable_intf_lipmi" != "xno" && test "x$have_lipmi" != "xyes"; then
echo "** Unable to build Solaris 9 x86 IPMI interface support!"
xenable_intf_lipmi=no
fi
if test "x$xenable_intf_lipmi" = "xyes"; then
AC_DEFINE(IPMI_INTF_LIPMI, [1], [Define to 1 to enable Solaris 9 LIPMI interface.]) AC_DEFINE(IPMI_INTF_LIPMI, [1], [Define to 1 to enable Solaris 9 LIPMI interface.])
AC_SUBST(INTF_LIPMI, [lipmi]) AC_SUBST(INTF_LIPMI, [lipmi])
AC_SUBST(INTF_LIPMI_LIB, [libintf_lipmi.la]) AC_SUBST(INTF_LIPMI_LIB, [libintf_lipmi.la])
@ -445,12 +457,13 @@ fi
dnl enable Solaris BMC interface dnl enable Solaris BMC interface
AC_ARG_ENABLE([intf-bmc], AC_ARG_ENABLE([intf-bmc],
[AC_HELP_STRING([--enable-intf-bmc], [AC_HELP_STRING([--enable-intf-bmc],
[enable Solaris 10 x86 IPMI interface [default=auto]])],, [enable Solaris 10 x86 IPMI interface [default=auto]])],
[enable_intf_bmc=no]) [xenable_intf_bmc=$enableval],
if test "x$enable_intf_bmc" = "xstatic" || test "x$enable_intf_bmc" = "xplugin"; then [xenable_intf_bmc=no])
enable_intf_bmc=yes if test "x$xenable_intf_bmc" = "xstatic" || test "x$xenable_intf_bmc" = "xplugin"; then
xenable_intf_bmc=yes
fi fi
if test "x$enable_intf_bmc" = "xyes"; then if test "x$xenable_intf_bmc" = "xyes"; then
AC_DEFINE(IPMI_INTF_BMC, [1], [Define to 1 to enable Solaris 10 BMC interface.]) AC_DEFINE(IPMI_INTF_BMC, [1], [Define to 1 to enable Solaris 10 BMC interface.])
AC_SUBST(INTF_BMC, [bmc]) AC_SUBST(INTF_BMC, [bmc])
AC_SUBST(INTF_BMC_LIB, [libintf_bmc.la]) AC_SUBST(INTF_BMC_LIB, [libintf_bmc.la])
@ -463,8 +476,9 @@ dnl check for readline library to enable ipmi shell
AC_ARG_ENABLE([ipmishell], AC_ARG_ENABLE([ipmishell],
[AC_HELP_STRING([--enable-ipmishell], [AC_HELP_STRING([--enable-ipmishell],
[enable IPMI shell interface [default=yes]])], [enable IPMI shell interface [default=yes]])],
[], [enable_ipmishell=yes]) [xenable_ipmishell=$enableval],
if test "x$enable_ipmishell" = "xyes"; then [xenable_ipmishell=yes])
if test "x$xenable_ipmishell" = "xyes"; then
AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap]) AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap])
AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes]) AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes])
AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes]) AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])
@ -481,19 +495,22 @@ dnl Enable -Wall -Werror
AC_ARG_ENABLE([buildcheck], AC_ARG_ENABLE([buildcheck],
[AC_HELP_STRING([--enable-buildcheck], [AC_HELP_STRING([--enable-buildcheck],
[enable -Wall -Werror for build testing [default=no]])], [enable -Wall -Werror for build testing [default=no]])],
[if test "x$enable_buildcheck" != "xno"; then [xenable_buildcheck=$enableval],
[xenable_buildcheck=no])
if test "x$xenable_buildcheck" != "xno"; then
CFLAGS="$CFLAGS -Wall -Werror -Wpointer-arith -Wstrict-prototypes" CFLAGS="$CFLAGS -Wall -Werror -Wpointer-arith -Wstrict-prototypes"
fi], []) fi
AC_SUBST(CFLAGS) AC_SUBST(CFLAGS)
dnl Enable extra file security paranoia dnl Enable extra file security paranoia
AC_ARG_ENABLE([file-security], AC_ARG_ENABLE([file-security],
[AC_HELP_STRING([--enable-file-security], [AC_HELP_STRING([--enable-file-security],
[enable extra security checks on files opened for read [default=no]])], [enable extra security checks on files opened for read [default=no]])],
[if test "x$enable_file_security" != "xno"; then [xenable_file_security=$enableval],
[xenable_file_security=no])
if test "x$xenable_file_security" != "xno"; then
AC_DEFINE(ENABLE_FILE_SECURITY, [1], [Define to 1 for extra file security.]) AC_DEFINE(ENABLE_FILE_SECURITY, [1], [Define to 1 for extra file security.])
fi], []) fi
AC_TRY_RUN([ AC_TRY_RUN([
@ -515,7 +532,8 @@ AC_TRY_RUN([
else else
return(0); return(0);
} }
],[],[AC_DEFINE(HAVE_PRAGMA_PACK,[1],[Define to 1 if you need to use #pragma pack instead of __attribute__ ((packed))])] ],[],[AC_DEFINE(HAVE_PRAGMA_PACK,[1],
[Define to 1 if you need to use #pragma pack instead of __attribute__ ((packed))])]
) )
@ -547,16 +565,16 @@ AC_MSG_RESULT([])
AC_MSG_RESULT([ipmitool $VERSION]) AC_MSG_RESULT([ipmitool $VERSION])
AC_MSG_RESULT([]) AC_MSG_RESULT([])
AC_MSG_RESULT([Interfaces]) AC_MSG_RESULT([Interfaces])
AC_MSG_RESULT([ lan : $enable_intf_lan]) AC_MSG_RESULT([ lan : $xenable_intf_lan])
AC_MSG_RESULT([ lanplus : $enable_intf_lanplus]) AC_MSG_RESULT([ lanplus : $xenable_intf_lanplus])
AC_MSG_RESULT([ open : $enable_intf_open]) AC_MSG_RESULT([ open : $xenable_intf_open])
AC_MSG_RESULT([ free : $enable_intf_free]) AC_MSG_RESULT([ free : $xenable_intf_free])
AC_MSG_RESULT([ imb : $enable_intf_imb]) AC_MSG_RESULT([ imb : $xenable_intf_imb])
AC_MSG_RESULT([ bmc : $enable_intf_bmc]) AC_MSG_RESULT([ bmc : $xenable_intf_bmc])
AC_MSG_RESULT([ lipmi : $enable_intf_lipmi]) AC_MSG_RESULT([ lipmi : $xenable_intf_lipmi])
AC_MSG_RESULT([]) AC_MSG_RESULT([])
AC_MSG_RESULT([Extra tools]) AC_MSG_RESULT([Extra tools])
AC_MSG_RESULT([ ipmievd : yes]) AC_MSG_RESULT([ ipmievd : yes])
AC_MSG_RESULT([ ipmishell : $enable_ipmishell]) AC_MSG_RESULT([ ipmishell : $xenable_ipmishell])
AC_MSG_RESULT([]) AC_MSG_RESULT([])