-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathconfigure.in
177 lines (143 loc) · 4.41 KB
/
configure.in
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
dnl
dnl autoconf and automake for openhpi
dnl initial file by Andrea Brugger <andrea.l.brugger@intel.com> 1/03
dnl various hacks by Sean Dague <sean@dague.net> 4/23/03
AC_PREREQ(2.50)
AC_INIT(openhpi.spec.in)
AM_INIT_AUTOMAKE(openhpi, 0.1)
AM_CONFIG_HEADER(config.h)
dnl AM_CONFIG_HEADER(./config.h)
AC_PROG_CC
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
HPI_PKG=openhpi
AC_SUBST(HPI_PKG)
AC_SUBST(ac_configure_args)
dnl Checks for programs
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
dnl Check fo libraries
have_uuid=no
have_openipmi=no
AC_CHECK_LIB([glib], [g_slist_alloc],
[
GLIBFLAGS=`pkg-config --cflags glib`
GLIBLIBS=`pkg-config --libs glib`
],
[
echo "************************************************************"
echo "* glib not found!"
echo "* this is require for openhpi internals"
echo "* please ensure glib-devel package is installed"
echo "************************************************************"
exit 1
])
AC_CHECK_LIB([ltdl], [lt_dlopen], [], [
echo "************************************************************"
echo "* libltdl not found!"
echo "* this is require for plugin loading"
echo "************************************************************"
exit 1
])
AC_CHECK_LIB([OpenIPMI], [ipmi_smi_setup_con], [have_openipmi=yes])
AC_CHECK_LIB([uuid], [uuid_generate], [have_uuid=yes], [
echo "************************************************************"
echo "* libuuid not found!"
echo "* Please install e2fsprogs-devel to get the required files"
echo "************************************************************"
exit 1
])
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h])
dnl Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([gettimeofday memset])
dnl Checks for other helper programs
AC_PATH_PROGS(RPM, rpmbuild)
dnl plugin enablement stanzas
AC_ARG_ENABLE([dummy],
[ --enable-dummy build dummy plugin [default=yes]],
[if test "x$enableval" = "xyes"; then
PLUGINS="$PLUGINS dummy"
fi],
[PLUGINS="$PLUGINS dummy"])
AC_ARG_ENABLE([watchdog],
[ --enable-watchdog build watchdog plugin [default=no]],
[if test "x$enableval" = "xyes"; then
PLUGINS="$PLUGINS watchdog"
fi])
dnl
dnl We really need to make ipmi enablement be contigent on OpenIPMI
dnl
AC_ARG_ENABLE([ipmi],
[ --enable-ipmi build openipmi plugin [default=no]],
[if test "x$enableval" = "xyes"; then
if test "x$have_openipmi" = "xyes"; then
PLUGINS="$PLUGINS ipmi"
else
echo "************************************************************"
echo "* OpenIPMI not found!"
echo "* Can't build IPMI support without OpenIPMI!"
echo "* please download and install the latest version of the software"
echo "* from http://openipmi.sf.net"
echo "************************************************************"
exit 1
fi
fi])
dnl plugin replacement stuff
AC_SUBST(PLUGINS)
dnl
dnl This code was borrowed from linux-ha configure.in file
dnl and is used for creating the proper substitutions
dnl in the spec file. Without it, the spec file will
dnl have ${exec_prefix}, etc. instead of the actual
dnl directory.
dnl
dnl
prefix=`eval echo "$prefix"`
case $prefix in
NONE) prefix=/usr/local;;
esac
var() {
case $1 in
*'${'*) res=`eval echo "$1"`;;
*) res="$1";;
esac
case "$res" in
""|NONE) echo "$2";;
*) echo "$res";;
esac
}
exec_prefix=`var "$exec_prefix" "$prefix"`
bindir=`var "$bindir" "$exec_prefix/bin"`
sbindir=`var "$sbindir" "$exec_prefix/sbin"`
libdir=`var "$libdir" "$exec_prefix/lib"`
includedir=`var "$includedir" "$exec_prefix/include"`
base_includedir="${includedir}"
AC_SUBST(base_includedir)
AC_C_STRINGIZE
CC_WARNINGS="-Wall -Wmissing-prototypes \
-Wmissing-declarations \
-Wstrict-prototypes \
-Wpointer-arith \
-Wcast-qual -Wcast-align \
-Werror"
CFLAGS="$CFLAGS $GLIBFLAGS $CC_WARNINGS"
LIBS="$LIBS $GLIBLIBS"
AC_CONFIG_FILES([openhpi.spec
Makefile
src/Makefile
src/plugins/Makefile
src/plugins/dummy/Makefile
src/plugins/watchdog/Makefile
src/plugins/ipmi/Makefile
docs/Makefile
docs/hld/Makefile
examples/Makefile])
AC_OUTPUT