From a9ee361f27e0439530387765924574e5358c8a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 10 Sep 2022 15:44:41 +0200 Subject: New upstream version 1.8.19 --- configure.ac | 126 +++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 105 insertions(+), 21 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index f2fe1f3..d6ba62b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,12 @@ dnl dnl autoconf for ipmitool dnl -AC_INIT([ipmitool], [1.8.18]) +m4_define([git_suffix], m4_esyscmd_s(./csv-revision)) +AC_INIT([ipmitool], [1.8.19git_suffix]) AC_CONFIG_SRCDIR([src/ipmitool.c]) +AC_CONFIG_COMMANDS_PRE([export prefix=$prefix]) AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE([foreign]) AM_CONFIG_HEADER(config.h) AC_PREREQ(2.50) AC_SUBST(ac_configure_args) @@ -16,6 +18,8 @@ AC_PROG_LN_S AC_PROG_MAKE_SET AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm]) AC_CHECK_PROG([SED], [sed], [sed]) +AC_CHECK_PROG([WGET], [wget], [wget]) +AC_CHECK_PROG([CURL], [curl], [curl]) AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h]) @@ -32,7 +36,7 @@ AC_CHECK_FUNCS([alarm gethostbyname getaddrinfo getifaddrs socket select]) AC_CHECK_FUNCS([memmove memset strchr strdup strerror]) AC_CHECK_FUNCS([getpassphrase]) -CFLAGS="$CFLAGS -Wall -Wextra -std=gnu99 -pedantic -Wformat -Wformat-nonliteral" +CFLAGS="$CFLAGS -Wall -Wextra -std=gnu11 -pedantic -Wformat -Wformat-nonliteral" AM_PROG_LIBTOOL LIBTOOL="$LIBTOOL --silent" @@ -52,12 +56,30 @@ if test "x$exec_prefix" = "xNONE"; then exec_prefix="$prefix" fi +if test "x$WGET" = "x"; then + if test "x$CURL" = "x"; then + AC_MSG_WARN([** Neither wget nor curl could be found.]) + AC_MSG_WARN([** IANA PEN database will not be installed by `make install` !]) + else + DOWNLOAD="$CURL --location --progress-bar" + AM_CONDITIONAL([DOWNLOAD], [true]) + fi +else + DOWNLOAD="$WGET -c -nd -O -" + AM_CONDITIONAL([DOWNLOAD], [true]) +fi + +AC_MSG_WARN([** Download is:]) +AC_MSG_WARN($DOWNLOAD) +AC_SUBST(DOWNLOAD, $DOWNLOAD) + dnl dnl set default option values dnl xenable_all_options=yes xenable_intf_bmc=no +xenable_intf_dbus=no xenable_intf_dummy=no xenable_intf_imb=yes xenable_intf_lipmi=yes @@ -190,6 +212,14 @@ AC_CHECK_LIB([crypto], [MD2_Init], fi], [], [-lcrypto]) +dnl check for libsystemd in case dbus-intf is requested +AC_CHECK_LIB([systemd], [sd_bus_default], + [ + LIBS="$LIBS -lsystemd" + have_systemd=yes + ], + [ have_systemd=no],[]) + dnl enable IPMIv1.5 LAN interface AC_ARG_ENABLE([intf-lan], [AC_HELP_STRING([--enable-intf-lan], @@ -553,6 +583,25 @@ if test "x$xenable_intf_bmc" = "xyes"; then IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB bmc/libintf_bmc.la" fi +dnl enable IPMI dbus interface +AC_ARG_ENABLE([intf-dbus], + [AC_HELP_STRING([--enable-intf-dbus], + [enable IPMI dbus interface [default=no]])], + [xenable_intf_dbus=$enableval], + [xenable_intf_dbus=no]) +if test "x$xenable_intf_dbus" != "xno"; then + if test "x$have_systemd" != "xyes"; then + AC_MSG_ERROR([** Unable to find libsystemd required by dbus-intf.]) + xenable_intf_dbus=no + fi +fi +if test "x$xenable_intf_dbus" = "xyes"; then + AC_DEFINE(IPMI_INTF_DBUS, [1], [Define to 1 to enable dbus interface.]) + AC_SUBST(INTF_DBUS, [dbus]) + AC_SUBST(INTF_DBUS_LIB, [libintf_dbus.la]) + IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB dbus/libintf_dbus.la" +fi + dnl enable Dummy interface for testing AC_ARG_ENABLE([intf-dummy], [AC_HELP_STRING([--enable-intf-dummy], @@ -567,30 +616,18 @@ fi AC_SUBST(IPMITOOL_INTF_LIB) -if test "x$xenable_ipmishell" = "xyes"; then - AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap]) - AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes]) - AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes]) - if test "x$have_curses" != "xyes" || test "x$have_readline" != "xyes"; then - xenable_ipmishell=no - fi -fi - -dnl check for readline library to enable ipmi shell AC_ARG_ENABLE([ipmishell], [AC_HELP_STRING([--enable-ipmishell], [enable IPMI shell interface [default=auto]])], [xenable_ipmishell=$enableval], []) + +dnl check for readline library to enable ipmi shell if test "x$xenable_ipmishell" = "xyes"; then - AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap]) - AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes]) AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes]) - if test "x$have_curses" != "xyes"; then - AC_MSG_ERROR([** Unable to find curses required by ipmishell.]) - fi if test "x$have_readline" != "xyes"; then AC_MSG_ERROR([** Unable to find readline required by ipmishell.]) + xenable_ipmishell=no fi AC_DEFINE(HAVE_READLINE, [1], [Define to 1 if readline present.]) fi @@ -642,6 +679,50 @@ AC_TRY_COMPILE([],[ [Define to 1 if you need to use #pragma pack instead of __attribute__ ((packed))])] ) +dnl if no environment variable is set, set the default value for the default intf +if test "${xenable_intf_open}" = "yes"; then + DEFAULT_INTF_NO_ENV=open +else dnl macOS does not build open interface, it defaults to lan + DEFAULT_INTF_NO_ENV=lan +fi +dnl allow for a default interface to be set on configure +AC_ARG_VAR(DEFAULT_INTF, [Set the default interface to use (default='open' if available, 'lan' otherwise)]) + +dnl set the default value for the default interface environment variable +if test "x${DEFAULT_INTF}" = "x"; then + echo "DEFAULT_INTF not found in environment; setting to ${DEFAULT_INTF_NO_ENV}" + DEFAULT_INTF=${DEFAULT_INTF_NO_ENV} +fi + +if test "x"`eval "echo \\\${xenable_intf_${DEFAULT_INTF}}"` != "xyes"; then + AC_MSG_ERROR([** Cannot set ${DEFAULT_INTF} as default; intf-${DEFAULT_INTF} is not enabled.]) +fi + +AC_ARG_VAR(IANADIR, [Configure the path to IANA PEN dictionary (default=DATAROOTDIR/misc)]) +AC_ARG_VAR(IANAUSERDIR, [Configure the path to IANA PEN dictionary wihtin the user's HOME directory (default=.local/usr/share/misc)]) + +if test "x${IANADIR}" = "x"; then + IANADIR=`eval echo "${datarootdir}/misc"` + echo Set IANA PEN dictionary search path to ${IANADIR} +fi + +if test "x${IANAUSERDIR}" = "x"; then + IANAUSERDIR=".local/usr/share/misc" + echo Set user\'s IANA PEN dictionary search path to ${IANAUSERDIR} +fi + +AH_TEMPLATE([IANADIR],[The path to system IANA PEN dictionary]) +AC_DEFINE_UNQUOTED(IANADIR, "`eval "echo ${IANADIR}"`", []) + +AH_TEMPLATE([IANAUSERDIR],[The subpath to user IANA PEN dictionary within the user's HOME]) +AC_DEFINE_UNQUOTED(IANAUSERDIR, "`eval "echo ${IANAUSERDIR}"`", []) + +AH_TEMPLATE([PATH_SEPARATOR], [The path separator string]) +#if defined _WIN32 || defined __CYGWIN__ +AC_DEFINE(PATH_SEPARATOR, "\\") +#else +AC_DEFINE(PATH_SEPARATOR, "/") +#endif dnl Generate files for build AC_CONFIG_FILES([Makefile @@ -650,7 +731,6 @@ AC_CONFIG_FILES([Makefile control/Makefile control/pkginfo control/prototype - control/rpmmacros control/ipmitool.spec lib/Makefile include/Makefile @@ -663,23 +743,27 @@ AC_CONFIG_FILES([Makefile src/plugins/free/Makefile src/plugins/imb/Makefile src/plugins/bmc/Makefile + src/plugins/dbus/Makefile src/plugins/usb/Makefile src/plugins/lipmi/Makefile src/plugins/serial/Makefile - src/plugins/dummy/Makefile]) + src/plugins/dummy/Makefile + doc/ipmitool.1 + doc/ipmievd.8]) AC_OUTPUT AC_MSG_RESULT([]) AC_MSG_RESULT([ipmitool $VERSION]) AC_MSG_RESULT([]) -AC_MSG_RESULT([Interfaces]) +AC_MSG_RESULT([Interfaces (default=$DEFAULT_INTF)]) AC_MSG_RESULT([ lan : $xenable_intf_lan]) AC_MSG_RESULT([ lanplus : $xenable_intf_lanplus]) AC_MSG_RESULT([ open : $xenable_intf_open]) AC_MSG_RESULT([ free : $xenable_intf_free]) AC_MSG_RESULT([ imb : $xenable_intf_imb]) AC_MSG_RESULT([ bmc : $xenable_intf_bmc]) +AC_MSG_RESULT([ dbus : $xenable_intf_dbus]) AC_MSG_RESULT([ usb : $xenable_intf_usb]) AC_MSG_RESULT([ lipmi : $xenable_intf_lipmi]) AC_MSG_RESULT([ serial : $xenable_intf_serial]) -- cgit v1.2.3