forked from markfasheh/ocfs2-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
153 lines (123 loc) · 3.59 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
AC_PREREQ(2.54)
AC_INIT(programs)
PACKAGE=ocfs2-test
AC_SUBST(PACKAGE)
MPICC=`PATH=$PATH:/usr/lib64/mpi/gcc/openmpi/bin:/usr/lib64/mpi/gcc/openmpi1/bin which mpicc`
INSTALLDIR=/usr/local
# Adjust these for the software version.
MAJOR_VERSION=1
MINOR_VERSION=0
MICRO_VERSION=4
EXTRA_VERSION=0
# Adjust this only to bump the RPM packaging version
RPM_VERSION=1
DIST_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
if test -z "$EXTRA_VERSION"; then
VERSION=$DIST_VERSION
else
VERSION=$DIST_VERSION-$EXTRA_VERSION
fi
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(MICRO_VERSION)
AC_SUBST(EXTRA_VERSION)
AC_SUBST(DIST_VERSION)
AC_SUBST(VERSION)
AC_SUBST(RPM_VERSION)
AC_CANONICAL_HOST
case "$host" in
*-*-linux*)
;;
*)
AC_MSG_ERROR([This filesystem will only work on Linux])
;;
esac
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB
AC_PATH_PROG(AR, ar)
AC_HEADER_STDC
AC_C_CONST
if test "x$GCC" != "xyes"; then
AC_MSG_ERROR(GCC is required)
fi
AC_PATH_PROG(MPICC, mpicc)
if test "x$MPICC" = "x"; then
AC_MSG_ERROR([mpicc not found. Install openmpi-libs, openmpi-devel, openmpi and mpi-selector packages. Use mpi-selector to set it as default.])
fi
AC_CHECK_LIB(aio, io_setup, [
AC_CHECK_HEADER(libaio.h, :, [
AC_MSG_ERROR([Unable to find libaio header])
])], [
AC_MSG_ERROR([Unable to find the libaio library])
])
COM_ERR_LIBS=
PKG_CHECK_MODULES(COM_ERR, com_err,, [
AC_CHECK_LIB(com_err, com_err, COM_ERR_LIBS=-lcom_err)
if test "x$COM_ERR_LIBS" = "x"; then
AC_MSG_ERROR([Unable to find com_err library])
fi
AC_CHECK_HEADER(et/com_err.h, :,
AC_MSG_ERROR([Unable to find com_err headers]))
AC_SUBST(COM_ERR_LIBS)
])
O2CB_LIBS=
PKG_CHECK_MODULES(O2CB, o2cb,, [
AC_CHECK_LIB(o2cb, o2cb_init, O2CB_LIBS="-lo2cb $COM_ERR_LIBS")
if test "x$O2CB_LIBS" = "x"; then
AC_MSG_ERROR([Unable to find o2cb library])
fi
AC_CHECK_HEADER(o2cb/o2cb.h, :,
AC_MSG_ERROR([Unable to find o2cb headers]))
AC_SUBST(O2CB_LIBS)
])
O2DLM_LIBS=
PKG_CHECK_MODULES(O2DLM, o2dlm,, [
AC_CHECK_LIB(o2dlm, o2dlm_initialize, O2DLM_LIBS="-lo2dlm $COM_ERR_LIBS")
if test "x$O2DLM_LIBS" = "x"; then
AC_MSG_ERROR([Unable to find o2dlm library])
fi
AC_CHECK_HEADER(o2dlm/o2dlm.h, :,
AC_MSG_ERROR([Unable to find o2dlm headers]))
AC_SUBST(O2DLM_LIBS)
])
OCFS2_LIBS=
PKG_CHECK_MODULES(OCFS2, ocfs2,, [
AC_CHECK_LIB(ocfs2, ocfs2_open, OCFS2_LIBS="-locfs2 -lo2dlm -lo2cb $COM_ERR_LIBS")
if test "x$OCFS2_LIBS" = "x"; then
AC_MSG_ERROR([Unable to find ocfs2 library])
fi
AC_CHECK_HEADER(ocfs2/ocfs2.h, :,
AC_MSG_ERROR([Unable to find ocfs2 headers]))
AC_SUBST(OCFS2_LIBS)
])
AC_MSG_CHECKING(whether to enable third party packages)
AC_ARG_ENABLE([third-party], [ --enable-third-party=[yes/no] Enable third party software build (Disabled by default)],, enable_third_party=no)
OCFS2_TEST_ENABLE_THIRDPARTY=
if test "x$enable_third_party" = "xyes"; then
OCFS2_TEST_ENABLE_THIRDPARTY=yes
fi
AC_SUBST(OCFS2_TEST_ENABLE_THIRDPARTY)
AC_MSG_RESULT($enable_third_party)
dnl check for Python
AM_PATH_PYTHON(2.3, , AC_MSG_ERROR([could not find Python 2.3 or higher.]))
API_COMPAT_HEADERS=""
API_COMPAT_CFLAGS=""
NO_REFLINK=
OCFS2_CHECK_HEADERS([reflink() in unistd.h], unistd.h, ,
NO_REFLINK=yes, [reflink])
AC_SUBST(NO_REFLINK)
if test "x$NO_REFLINK" = "xyes"; then
API_COMPAT_HEADERS="$API_COMPAT_HEADERS reflink.h"
fi
for h in $API_COMPAT_HEADERS; do
API_COMPAT_CFLAGS="$API_COMPAT_CFLAGS -include \$(TOPDIR)/api-compat/include/$h"
done
AC_SUBST(API_COMPAT_CFLAGS)
AC_CONFIG_FILES([
Config.make
vendor/common/ocfs2-test.spec-generic
])
AC_OUTPUT