File: configure.ac

package info (click to toggle)
cpqarrayd 2.3-1.3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,008 kB
  • sloc: sh: 2,907; ansic: 1,039; makefile: 83
file content (85 lines) | stat: -rw-r--r-- 2,634 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Process this file with autoconf to produce a configure script.
AC_INIT(cpqarrayd, 2.1, [spark@knoware.nl])
AM_INIT_AUTOMAKE(cpqarrayd, 2.1)
AC_CONFIG_SRCDIR([cpqarrayd.c])
AM_CONFIG_HEADER(config.h)

# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_AWK
AC_PROG_MAKE_SET

# Checks for libraries.

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h syslog.h unistd.h])

dnl Check for directory with kernel source...
AC_MSG_CHECKING(for directory with kernel source)
AC_ARG_WITH(kernel,
  [  --with-kernel=dir       give the directory with kernel sources]
  [                        [/usr/src/linux]],
  kerneldir="$withval",
  if test -d "/lib/modules/`uname -r`/build" -o -L "/lib/modules/`uname -r`/build"; then
    kerneldir="/lib/modules/`uname -r`/build"
  else
    kerneldir="/usr/src/linux"
  fi
)
if test -d "$kerneldir" -o -L "$kerneldir"; then
  AC_MSG_RESULT(found $kerneldir )
else
  AC_MSG_ERROR(Kernel source directory not found)
fi

CONFIG_KERNEL_SOURCE="$kerneldir"
AC_SUBST(CONFIG_KERNEL_SOURCE)

CPQARRAY_INC="-I$CONFIG_KERNEL_SOURCE/drivers/block -I$CONFIG_KERNEL_SOURCE/include"

CFLAGS="$CFLAGS $CPQARRAY_INC"
CPPFLAGS="$CPPFLAGS $CPQARRAY_INC"

dnl Check for compile.h (2.6.x kernels only?
AC_CHECK_HEADERS(linux/compiler.h)
                                                                       
dnl Check Headers
dnl AC_CHECK_HEADERS(ida_ioctl.h ida_cmd.h cpqarray.h,, 
dnl   AC_MSG_ERROR(You need to have the SmartArray driver in the kernel.))

dnl Check version of SmartArray driver
dnl AC_MSG_CHECKING(SmartArray driver version)
dnl AC_EGREP_HEADER(blk_cnt, ida_ioctl.h,AC_MSG_RESULT(ok), 
dnl   AC_MSG_ERROR(You need to have the SmartArray driver version 1.0.1 or higher installed.))

dnl Check for CCISS header file
AC_CHECK_HEADERS(linux/cciss_ioctl.h,,
  AC_MSG_ERROR(You need to have the CCISS driver in the kernel.))

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

# Checks for library functions.
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_CHECK_FUNCS([dup2 gethostbyname gethostname memset strerror])

# Check for snmp support
SNMPSUPPORT=1
AC_ARG_ENABLE(snmptrap,
  AC_HELP_STRING([--disable-snmptrap],[Disable support for sending snmptraps]),
  [ SNMPSUPPORT= ],
)

if test "$SNMPSUPPORT" = 1 ; then
  AC_CHECK_LIB(crypto,HMAC,,)
  AC_CHECK_LIB(netsnmp,snmp_open,,AC_MSG_ERROR([net-snmp is required for snmptrap option]))
  AC_DEFINE(HAVE_SNMPTRAP,1,"HAVE_SNMPTRAP")
fi

AC_CONFIG_FILES([Makefile
                 scripts/Makefile])
AC_OUTPUT