diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 62 |
1 files changed, 56 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 33e6dab..c1193c6 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.4) +AC_INIT(ipmiutil,2.9.5) +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) @@ -131,8 +134,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 +171,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 +211,7 @@ else fi fi +dnl start main logic case "$archm" in ia64) IA64_CFLAGS="-D__IA64__" @@ -219,6 +242,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 @@ -409,6 +456,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 +472,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 |