mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
better detection of linux/compiler.h
This commit is contained in:
parent
9e14d37835
commit
34b21d2d57
@ -183,6 +183,8 @@ else
|
|||||||
enable_intf_lanplus=no
|
enable_intf_lanplus=no
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ORIG_CPPFLAGS=$CPPFLAGS
|
||||||
|
|
||||||
dnl look for OpenIPMI header files
|
dnl look for OpenIPMI header files
|
||||||
AC_ARG_WITH([kerneldir],
|
AC_ARG_WITH([kerneldir],
|
||||||
[AC_HELP_STRING([--with-kerneldir=DIR],
|
[AC_HELP_STRING([--with-kerneldir=DIR],
|
||||||
@ -192,6 +194,8 @@ AC_ARG_WITH([kerneldir],
|
|||||||
fi
|
fi
|
||||||
CFLAGS="$CFLAGS -I ${with_kerneldir}/include"
|
CFLAGS="$CFLAGS -I ${with_kerneldir}/include"
|
||||||
AC_SUBST(CFLAGS)
|
AC_SUBST(CFLAGS)
|
||||||
|
CPPFLAGS="$CPPFLAGS -I ${with_kerneldir}/include"
|
||||||
|
AC_SUBST(CPPFLAGS)
|
||||||
if test -s ${with_kerneldir}/include/linux/version.h ; then
|
if test -s ${with_kerneldir}/include/linux/version.h ; then
|
||||||
kernelver=`grep UTS_RELEASE ${with_kerneldir}/include/linux/version.h | \
|
kernelver=`grep UTS_RELEASE ${with_kerneldir}/include/linux/version.h | \
|
||||||
sed 's/^\#define UTS_RELEASE \"\(2\.[0-9]\)\..*/\1/'`
|
sed 's/^\#define UTS_RELEASE \"\(2\.[0-9]\)\..*/\1/'`
|
||||||
@ -200,11 +204,23 @@ AC_ARG_WITH([kerneldir],
|
|||||||
AC_SUBST(CPPFLAGS)
|
AC_SUBST(CPPFLAGS)
|
||||||
fi
|
fi
|
||||||
fi])
|
fi])
|
||||||
|
|
||||||
|
AH_TEMPLATE([HAVE_LINUX_COMPILER_H], [])
|
||||||
|
AC_MSG_CHECKING([for linux/compiler.h])
|
||||||
|
AC_PREPROC_IFELSE([#include <linux/compiler.h>],
|
||||||
|
[AC_DEFINE(HAVE_LINUX_COMPILER_H, [1],
|
||||||
|
[Define to 1 if you have the <linux/compiler.h> header file.])
|
||||||
|
AC_MSG_RESULT([yes])],
|
||||||
|
[AC_MSG_RESULT([no])])
|
||||||
|
|
||||||
|
CPPFLAGS=$ORIG_CPPFLAGS
|
||||||
|
AC_SUBST(CPPFLAGS)
|
||||||
|
|
||||||
AC_CHECK_HEADER([linux/ipmi.h],
|
AC_CHECK_HEADER([linux/ipmi.h],
|
||||||
[AC_DEFINE(HAVE_OPENIPMI_H, [1],
|
[AC_DEFINE(HAVE_OPENIPMI_H, [1],
|
||||||
[Define to 1 if you have the <linux/ipmi.h> header file.])],
|
[Define to 1 if you have the <linux/ipmi.h> header file.])],
|
||||||
[AC_CHECK_HEADER([sys/ipmi.h],
|
[AC_CHECK_HEADER([sys/ipmi.h],
|
||||||
[AC_DEFINE(HAVE_FREEBSD_IPMI_H, [1],
|
[AC_DEFINE(HAVE_OPENIPMI_H, [1],
|
||||||
[Define to 1 if you have the <sys/ipmi.h> header file.])],
|
[Define to 1 if you have the <sys/ipmi.h> header file.])],
|
||||||
[echo "** Unable to find OpenIPMI header files. Using internal version."])])
|
[echo "** Unable to find OpenIPMI header files. Using internal version."])])
|
||||||
|
|
||||||
|
@ -54,7 +54,9 @@
|
|||||||
|
|
||||||
#ifdef IPMI_INTF_OPEN
|
#ifdef IPMI_INTF_OPEN
|
||||||
# if defined(HAVE_OPENIPMI_H)
|
# if defined(HAVE_OPENIPMI_H)
|
||||||
# include <linux/compiler.h>
|
# if defined(HAVE_LINUX_COMPILER_H)
|
||||||
|
# include <linux/compiler.h>
|
||||||
|
# endif
|
||||||
# include <linux/ipmi.h>
|
# include <linux/ipmi.h>
|
||||||
# elif defined(HAVE_FREEBSD_IPMI_H)
|
# elif defined(HAVE_FREEBSD_IPMI_H)
|
||||||
# include <sys/ipmi.h>
|
# include <sys/ipmi.h>
|
||||||
|
@ -50,7 +50,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_OPENIPMI_H)
|
#if defined(HAVE_OPENIPMI_H)
|
||||||
# include <linux/compiler.h>
|
# if defined(HAVE_LINUX_COMPILER_H)
|
||||||
|
# include <linux/compiler.h>
|
||||||
|
# endif
|
||||||
# include <linux/ipmi.h>
|
# include <linux/ipmi.h>
|
||||||
#elif defined(HAVE_FREEBSD_IPMI_H)
|
#elif defined(HAVE_FREEBSD_IPMI_H)
|
||||||
/* FreeBSD OpenIPMI-compatible header */
|
/* FreeBSD OpenIPMI-compatible header */
|
||||||
@ -61,7 +63,7 @@
|
|||||||
|
|
||||||
extern int verbose;
|
extern int verbose;
|
||||||
|
|
||||||
#define IPMI_OPENIPMI_DEV "/dev/ipmi0"
|
#define IPMI_OPENIPMI_DEV "/dev/ipmi0"
|
||||||
#define IPMI_OPENIPMI_DEVFS "/dev/ipmi/0"
|
#define IPMI_OPENIPMI_DEVFS "/dev/ipmi/0"
|
||||||
#define IPMI_OPENIPMI_DEVFS2 "/dev/ipmidev/0"
|
#define IPMI_OPENIPMI_DEVFS2 "/dev/ipmidev/0"
|
||||||
|
|
||||||
@ -274,4 +276,3 @@ struct ipmi_intf ipmi_open_intf = {
|
|||||||
my_addr: IPMI_BMC_SLAVE_ADDR,
|
my_addr: IPMI_BMC_SLAVE_ADDR,
|
||||||
target_addr: IPMI_BMC_SLAVE_ADDR,
|
target_addr: IPMI_BMC_SLAVE_ADDR,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user