File: configure.in

package info (click to toggle)
ipmitool 1.8.1-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,764 kB
  • ctags: 2,636
  • sloc: ansic: 21,161; sh: 9,004; makefile: 202
file content (323 lines) | stat: -rw-r--r-- 10,039 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
dnl
dnl autoconf for ipmitool
dnl
AC_INIT([src/ipmitool.c])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([ipmitool], [1.8.1])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_SRCDIR([src/ipmitool.c])
AC_PREREQ(2.50)
AC_SUBST(ac_configure_args)

dnl check for requirements
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm])
AC_CHECK_PROG([SED], [sed], [sed])

AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h])
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/socket.h])
AC_CHECK_HEADERS([sys/byteorder.h byteswap.h])

AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN

AC_FUNC_MALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRTOD
AC_CHECK_FUNCS([alarm gethostbyname socket select])
AC_CHECK_FUNCS([memmove memset strchr strdup strerror])
AC_CHECK_FUNCS([getpassphrase])

CFLAGS="$CFLAGS -fno-strict-aliasing"

AM_PROG_LIBTOOL
LIBTOOL="$LIBTOOL --silent"

AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_SEARCH_LIBS([socket], [socket], [],
	[AC_CHECK_LIB([nsl], [socket],
		[LIBS="$LIBS -lsocket -lnsl"], [], [-lsocket])])

if test "x$prefix" = "xNONE"; then
  prefix="$ac_default_prefix"
fi

if test "x$exec_prefix" = "xNONE"; then
  exec_prefix="$prefix"
fi

dnl set some things so we build with GNU tools on Solaris
case "$host_os" in
solaris*)
	MAKE=gmake
	STRIP=gstrip
	LD=gld
	AR=gar
	# openssl libs are in /usr/sfw/lib on solaris 10
        LIBS="$LIBS -R/usr/sfw/lib"
	# disable the linux-specific interfaces
	# and bmc on SPARC (there is no bmc driver for SPARC)
	if [[ `mach -p` = sparc ]]; then
		enable_intf_bmc=no
	else
		enable_intf_bmc=yes
	fi
	enable_intf_imb=no
	enable_intf_open=no
	enable_ipmievd=no
	enable_ipmishell=no
	;;
*cygwin*)
	# disable the linux and solaris-specific interfaces
	enable_intf_imb=no
	enable_intf_open=no
	enable_intf_lipmi=no
	enable_intf_bmc=no
	enable_ipmievd=no
	enable_ipmishell=no
	;;
*darwin*)
	# disable the linux and solaris-specific interfaces
	enable_intf_imb=no
	enable_intf_open=no
	enable_intf_lipmi=no
	enable_intf_bmc=no
	enable_ipmived=no
	enable_ipmishell=no
	;;
esac

AC_SUBST(ARCH, $host_cpu)
AC_SUBST(OS, $host_os)
AC_SUBST(PSTAMP, $host)
AC_SUBST(BASEDIR, $prefix)

dnl check for OpenSSL functionality
AC_ARG_ENABLE([internal-md5],
	[AC_HELP_STRING([--enable-internal-md5],
			[enable internal MD5 library [default=no]])],
	[], [enable_internal_md5=no])

AC_CHECK_LIB([crypto], [EVP_aes_128_cbc],
	[if test "x$enable_internal_md5" != "xyes"; then
	    have_crypto=yes; LIBS="$LIBS -lcrypto"
	fi], [have_crypto=no], [-lcrypto])

AC_CHECK_LIB([crypto], [MD5_Init],
	[if test "x$enable_internal_md5" != "xyes"; then
	    if test "x$have_crypto" != "xyes"; then
	    	LIBS="$LIBS -lcrypto"
		have_md5=yes
	    fi
	    AC_DEFINE(HAVE_CRYPTO_MD5, [1], [Define to 1 if libcrypto supports MD5.])
	fi], [], [-lcrypto])

AC_CHECK_LIB([crypto], [MD2_Init],
	[if test "x$enable_internal_md5" != "xyes"; then
	    if test "x$have_crypto" != "xyes" && test "x$have_md5" != "xyes"; then
	        LIBS="$LIBS -lcrypto"
	        have_md2=yes
	    fi
	    AC_DEFINE(HAVE_CRYPTO_MD2, [1], [Define to 1 if libcrypto supports MD2.])
	fi], [], [-lcrypto])

dnl enable IPMIv1.5 LAN interface
AC_ARG_ENABLE([intf-lan],
	[AC_HELP_STRING([--enable-intf-lan],
			[enable IPMIv1.5 LAN interface [default=yes]])],
	[], [enable_intf_lan=yes])
if test "x$enable_intf_lan" = "xstatic" || test "x$enable_intf_lan" = "xplugin"; then
   enable_intf_lan=yes
fi
if test "x$enable_intf_lan" = "xyes"; then
    AC_DEFINE(IPMI_INTF_LAN, [1], [Define to 1 to enable LAN IPMIv1.5 interface.])
    AC_SUBST(INTF_LAN, [lan])
    AC_SUBST(INTF_LAN_LIB, [libintf_lan.la])
    IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lan/libintf_lan.la"
fi

dnl enable IPMIv2.0 RMCP+ LAN interface
AC_ARG_ENABLE([intf-lanplus],
	[AC_HELP_STRING([--enable-intf-lanplus],
			[enable IPMIv2.0 RMCP+ LAN interface [default=auto]])],
	[if test "x$enable_intf_lanplus" != "xno" && test "x$have_crypto" != "xyes"; then
	    echo "** The lanplus interface requires an SSL library with EVP_aes_128_cbc defined."
	    enable_intf_lanplus=no
	fi],
	[enable_intf_lanplus=$have_crypto])
if test "x$enable_intf_lanplus" = "xstatic" || test "x$enable_intf_lanplus" = "xplugin"; then
   enable_intf_lanplus=yes
fi
if test "x$enable_intf_lanplus" = "xyes"; then
    AC_DEFINE(IPMI_INTF_LANPLUS, [1], [Define to 1 to enable LAN+ IPMIv2 interface.])
    AC_SUBST(INTF_LANPLUS, [lanplus])
    AC_SUBST(INTF_LANPLUS_LIB, [libintf_lanplus.la])
    IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lanplus/libintf_lanplus.la"
else
    enable_intf_lanplus=no
fi

dnl look for OpenIPMI header files
AC_ARG_WITH([kerneldir],
	[AC_HELP_STRING([--with-kerneldir=DIR],
			[set kernel include path to DIR])],
	[if test "x$with_kerneldir" = "xyes"; then
	    with_kerneldir="/lib/modules/`uname -r`/build"
	fi
	CFLAGS="$CFLAGS -I ${with_kerneldir}/include"
	AC_SUBST(CFLAGS)
	if test -s ${with_kerneldir}/include/linux/version.h ; then
	    kernelver=`grep UTS_RELEASE ${with_kerneldir}/include/linux/version.h | \
	        sed 's/^\#define UTS_RELEASE \"\(2\.[0-9]\)\..*/\1/'`
	    if test "x$kernelver" = "x2.6"; then
		CPPFLAGS="$CPPFLAGS -D__user="
		AC_SUBST(CPPFLAGS)
	    fi
	fi])
AC_CHECK_HEADER([linux/ipmi.h],
	[AC_DEFINE(HAVE_OPENIPMI_H, [1],
	[Define to 1 if you have the <linux/ipmi.h> header file.])],
	[echo "** Unable to find OpenIPMI header files.  Using internal version."])

dnl enable Linux OpenIPMI interface
AC_ARG_ENABLE([intf-open],
	[AC_HELP_STRING([--enable-intf-open],
			[enable Linux OpenIPMI interface [default=auto]])],
	[], [enable_intf_open=yes])
if test "x$enable_intf_open" = "xstatic" || test "x$enable_intf_open" = "xplugin"; then
   enable_intf_open=yes
fi
if test "x$enable_intf_open" = "xyes"; then
    AC_DEFINE(IPMI_INTF_OPEN, [1], [Define to 1 to enable Linux OpenIPMI interface.])
    AC_SUBST(INTF_OPEN, [open])
    AC_SUBST(INTF_OPEN_LIB, [libintf_open.la])
    IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB open/libintf_open.la"
fi

dnl enable Intel IMB interface
AC_ARG_ENABLE([intf-imb],
	[AC_HELP_STRING([--enable-intf-imb],
			[enable Intel IMB driver interface [default=auto]])],
	[], [enable_intf_imb=yes])
if test "x$enable_intf_imb" = "xstatic" || test "x$enable_intf_imb" = "xplugin"; then
   enable_intf_imb=yes
fi
if test "x$enable_intf_imb" = "xyes"; then
    AC_DEFINE(IPMI_INTF_IMB, [1], [Define to 1 to enable Intel IMB interface.])
    AC_SUBST(INTF_IMB, [imb])
    AC_SUBST(INTF_IMB_LIB, [libintf_imb.la])
    IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB imb/libintf_imb.la"
fi

dnl enable Solaris LIPMI interface
AC_CHECK_HEADER([sys/lipmi/lipmi_intf.h], [have_lipmi=yes], [have_lipmi=no])
AC_ARG_ENABLE([intf-lipmi],
	[AC_HELP_STRING([--enable-intf-lipmi],
			[enable Solaris 9 x86 IPMI interface [default=no]])],
	[if test "x$enable_intf_lipmi" != "xno" && test "x$have_lipmi" != "xyes"; then
	    echo "** Unable to build Solaris 9 x86 IPMI interface support!"
	    enable_intf_lipmi=no
	fi],
	[enable_intf_lipmi=no])
if test "x$enable_intf_lipmi" = "xstatic" || test "x$enable_intf_lipmi" = "xplugin"; then
   enable_intf_lipmi=yes
fi
if test "x$enable_intf_lipmi" = "xyes"; then
    AC_DEFINE(IPMI_INTF_LIPMI, [1], [Define to 1 to enable Solaris 9 LIPMI interface.])
    AC_SUBST(INTF_LIPMI, [lipmi])
    AC_SUBST(INTF_LIPMI_LIB, [libintf_lipmi.la])
    IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lipmi/libintf_lipmi.la"
fi

dnl enable Solaris BMC interface
AC_ARG_ENABLE([intf-bmc],
	[AC_HELP_STRING([--enable-intf-bmc],
			[enable Solaris 10 x86 IPMI interface [default=auto]])],,
	[enable_intf_bmc=no])
if test "x$enable_intf_bmc" = "xstatic" || test "x$enable_intf_bmc" = "xplugin"; then
   enable_intf_bmc=yes
fi
if test "x$enable_intf_bmc" = "xyes"; then
    AC_DEFINE(IPMI_INTF_BMC, [1], [Define to 1 to enable Solaris 10 BMC interface.])
    AC_SUBST(INTF_BMC, [bmc])
    AC_SUBST(INTF_BMC_LIB, [libintf_bmc.la])
    IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB bmc/libintf_bmc.la"
fi

AC_SUBST(IPMITOOL_INTF_LIB)

dnl check for readline library to enable ipmi shell
AC_ARG_ENABLE([ipmishell],
	[AC_HELP_STRING([--enable-ipmishell],
			[enable IPMI shell interface [default=yes]])],
	[], [enable_ipmishell=yes])
if test "x$enable_ipmishell" = "xyes"; then
	AC_SEARCH_LIBS([readline], [readline], [have_readline=yes])
	AC_SEARCH_LIBS([initscr], [curses ncurses], [have_curses=yes])
	if test "x$have_curses" = "xyes" && test "x$have_readline" = "xyes"; then
		AC_DEFINE(HAVE_READLINE, [1], [Define to 1 if readline present.])
	fi
fi

dnl enable IPMI Event Daemon
AC_ARG_ENABLE([ipmievd],
	[AC_HELP_STRING([--enable-ipmievd],
			[enable IPMI Event daemon [default=auto]])],
	[], [enable_ipmievd=yes])
AM_CONDITIONAL(IPMIEVD, [test "x$enable_ipmievd" = "xyes"])
if test "x$enable_ipmievd" = "xyes"; then
    AC_SUBST(IPMIEVD_BIN, [ipmievd])
fi

dnl Enable -Wall -Werror
AC_ARG_ENABLE([buildcheck],
	[AC_HELP_STRING([--enable-buildcheck],
			[enable -Wall -Werror for build testing [default=no]])],
	[if test "x$enable_buildcheck" != "xno"; then
	    CFLAGS="$CFLAGS -Wall -Werror"
	fi], [])

AC_SUBST(CFLAGS)

dnl Generate files for build
AC_CONFIG_FILES([Makefile
		doc/Makefile
		contrib/Makefile
		control/Makefile
		control/pkginfo
		control/prototype
		control/ipmitool.spec
		lib/Makefile
		include/Makefile
		include/ipmitool/Makefile
		src/Makefile
		src/plugins/Makefile
		src/plugins/lan/Makefile
                src/plugins/lanplus/Makefile
		src/plugins/open/Makefile
		src/plugins/imb/Makefile
		src/plugins/bmc/Makefile
		src/plugins/lipmi/Makefile])

AC_OUTPUT

AC_MSG_RESULT([])
AC_MSG_RESULT([ipmitool $VERSION])
AC_MSG_RESULT([])
AC_MSG_RESULT([Interfaces])
AC_MSG_RESULT([  lan     : $enable_intf_lan])
AC_MSG_RESULT([  lanplus : $enable_intf_lanplus])
AC_MSG_RESULT([  open    : $enable_intf_open])
AC_MSG_RESULT([  imb     : $enable_intf_imb])
AC_MSG_RESULT([  bmc     : $enable_intf_bmc])
AC_MSG_RESULT([  lipmi   : $enable_intf_lipmi])
AC_MSG_RESULT([])
AC_MSG_RESULT([Extra tools])
AC_MSG_RESULT([  ipmievd : $enable_ipmievd])
AC_MSG_RESULT([])