diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 91 |
1 files changed, 76 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac index 8f3e301..98a7024 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,10 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(util/ipmiutil.c) -AM_INIT_AUTOMAKE(ipmiutil,2.9.3) +AC_INIT(ipmiutil,2.9.6) +AC_CONFIG_SRCDIR(util/ipmiutil.c) +echo "ipmiutil version ${PACKAGE_VERSION}" AM_CONFIG_HEADER(config.h) +AC_PREFIX_DEFAULT(/usr) +AM_INIT_AUTOMAKE() AC_PREFIX_DEFAULT(/usr) @@ -47,6 +50,7 @@ fi tmpspec=/tmp/iuspec.tmp$$ archm=`uname -m` +archp=`uname -p` sysname=`uname -s` LIB_DIR="/usr/lib" isredhat=0 @@ -131,8 +135,20 @@ AC_ARG_ENABLE([sha256], fi] ) +GPL_CFLAGS="" CROSS_LFLAGS="" CROSS_CFLAGS="" +LIBSENSORS="" +SAM2OBJ="isensor2.o ievents2.o" +SYSTEMD_DIR=/usr/share/ipmiutil + +AC_ARG_ENABLE([useflags], + [ --enable-useflags include environment CFLAGS and LDFLAGS.], + [if test "x$enableval" = "xyes"; then + CROSS_CFLAGS="$CFLAGS" + CROSS_LFLAGS="$LDFLAGS" + fi] + ) dnl configure for standalone, with no lanplus or GPL libs AC_ARG_ENABLE([standalone], @@ -156,19 +172,26 @@ AC_ARG_ENABLE([standalone], fi] ) +dnl build libipmiutil with sensor modules +AC_ARG_ENABLE([libsensors], + [ --enable-libsensors build libipmiutil with sensor modules [[default=no]]], + [if test "x$enableval" = "xyes"; then + LIBSENSORS="isensor2.o ievents2.o" + SAM2OBJ="" + fi] + ) + dnl configure for GPL build or not (GPL files: md2.h, ipmi_ioctl.h) AC_ARG_ENABLE([gpl], [ --enable-gpl build with some GPL code [[default=no]]], [if test "x$enableval" = "xyes"; then GPL_CFLAGS="-DALLOW_GPL" - else - GPL_CFLAGS="" fi] ) dnl Does this Linux have systemd enabled? Otherwise use sysv init. AC_ARG_ENABLE([systemd], - [ --enable-systemd enable systemd service type=notify support and %_unitdir [[default=disabled]]],) + [ --enable-systemd enable systemd service type=notify support and %_unitdir [[default=disabled]]],) if test "x$enable_systemd" = "xyes"; then GPL_CFLAGS="$GPL_CFLAGS -DENABLE_SYSTEMD" # if systemd enabled, install service scripts in unitdir @@ -189,6 +212,7 @@ else fi fi +dnl start main logic case "$archm" in ia64) IA64_CFLAGS="-D__IA64__" @@ -219,6 +243,30 @@ case "$archm" in ;; esac +dnl pkg-config support +pkgconfigdir='${libdir}/pkgconfig' +AC_MSG_CHECKING(whether to install pkg-config *.pc files) +AC_ARG_WITH(pkgconfig-dir, + AS_HELP_STRING([--with-pkgconfig-dir=PATH], [where to install pkg-config *.pc files (EPREFIX/lib/pkgconfig)]), +[ + case "${withval}" in + yes|auto) + ;; + no) + pkgconfigdir="" + ;; + *) + pkgconfigdir="${withval}" + ;; + esac +], []) +if test -n "${pkgconfigdir}"; then + AC_MSG_RESULT(using ${pkgconfigdir}) +else + AC_MSG_RESULT(no) +fi +AM_CONDITIONAL(WITH_PKG_CONFIG, test -n "${pkgconfigdir}") + dnl # libdir can be set with --libdir=/usr/lib (default=${exec_prefix}/lib) echo $libdir |grep exec_prefix >/dev/null 2>&1 if test $? -ne 0; then @@ -233,7 +281,7 @@ init0= if test "x$sysname" = "xSunOS"; then echo "Detected Solaris" os=solaris - archp=`uname -p` + # archp=`uname -p` if test -d "/usr/sfw/lib"; then sfwdir=/usr/sfw else @@ -344,30 +392,40 @@ else OS_CFLAGS="-DLINUX $MD2_CFLAGS -fPIC $cfwarn $cfhard" else # usually "x$sysname" = "xFreeBSD", but allow NetBSD - echo $sysname | grep BSD >/dev/null 2>&1 - if test $? -eq 0; then + # echo $sysname | grep 'BSD' >/dev/null 2>&1 + macos=1 + echo $sysname | grep -q BSD + bsd=$? + if test "x$sysname" = "xDarwin" ; then + if test "$archp" = "powerpc" ; then + macos=0 + else + bsd=0 + fi + fi + uname -a | grep -i HP-UX >/dev/null 2>&1 + hpux=$? + if test $bsd -eq 0; then os=bsd - OS_CFLAGS="-DBSD" + OS_CFLAGS="-DBSD -fPIC" OS_LFLAGS="" OS_DRIVERS="ipmimv.c ipmidir.c" drivers="open direct" else - uname -a | grep -i HP-UX >/dev/null 2>&1 - hpux=$? if test $hpux -eq 0; then echo "Detected HP-UX" os=hpux MD2_CFLAGS="-DSKIP_MD2" - OS_CFLAGS="-DHPUX" + OS_CFLAGS="-DHPUX $MD2_CFLAGS" OS_LFLAGS="" OS_DRIVERS="ipmimv.c" drivers="open" SHR_LINK="" - elif test "x$sysname" = "xDarwin" ; then + elif test $macos -eq 0; then echo "Detected MacOSX" os=macos MD2_CFLAGS="-DSKIP_MD2" - OS_CFLAGS="-DMACOS" + OS_CFLAGS="-DMACOS $MD2_CFLAGS -fPIC" OS_LFLAGS="" OS_DRIVERS="ipmimv.c ipmidir.c" drivers="open direct" @@ -409,6 +467,8 @@ AC_SUBST(LANPLUS_LDADD) AC_SUBST(LANPLUS_LIB) AC_SUBST(LANPLUS_CRYPTO) AC_SUBST(LANPLUS_SAM) +AC_SUBST(LIBSENSORS) +AC_SUBST(SAM2OBJ) AC_SUBST(LD_SAMX) AC_SUBST(GPL_CFLAGS) AC_SUBST(OS_CFLAGS) @@ -423,8 +483,9 @@ AC_SUBST(CROSS_CFLAGS) AC_SUBST(CROSS_LFLAGS) AC_SUBST(SYSTEMD_DIR) AC_SUBST(SHR_LINK) +AC_SUBST(pkgconfigdir) -AC_OUTPUT(Makefile util/Makefile lib/lanplus/Makefile doc/Makefile scripts/Makefile) +AC_OUTPUT(Makefile util/Makefile lib/Makefile lib/libipmiutil.pc lib/lanplus/Makefile doc/Makefile scripts/Makefile) if test "x$sysname" = "xSunOS"; then sed -e 's/^LDFLAGS = /LDFLAGS = -L\/usr\/sfw\/lib -lxnet -lsocket -lnsl /' -e 's/-DLINUX/-DSOLARIS -I\/usr\/sfw\/include/' util/Makefile >/tmp/make |