forked from markfasheh/ocfs2-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
482 lines (413 loc) · 12.9 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
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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
AC_PREREQ(2.54)
AC_INIT(libocfs2/bitmap.c)
PACKAGE=ocfs2-tools
AC_SUBST(PACKAGE)
# Adjust these for the software version.
MAJOR_VERSION=1
MINOR_VERSION=8
MICRO_VERSION=6
EXTRA_VERSION=
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_CANONICAL_HOST
case "$host" in
*-*-linux*)
;;
*)
AC_MSG_ERROR([This filesystem will only work on Linux])
;;
esac
#
# If CFLAGS is non-empty, leave the debugging and optimization symobls
# to the caller. Otherwise, set them according to --enable-debug.
#
OCFS2_DEBUG=
AC_MSG_CHECKING(for debugging)
if test "x$CFLAGS" = "x"; then
AC_ARG_ENABLE(debug, [ --enable-debug=[yes/no] Turn on debugging [default=no]],,enable_debug=no)
if test "x$enable_debug" = "xyes"; then
OCFS2_DEBUG=yes
CFLAGS="-g"
else
CFLAGS="-O2"
fi
AC_MSG_RESULT($enable_debug)
else
AC_MSG_RESULT([skipped, CFLAGS is set])
fi
AC_SUBST(OCFS2_DEBUG)
AC_PROG_CC
AC_PROG_CPP
#
# If OCFS2_DEBUG was set, we know CFLAGS must be "-g". If we're using
# GNU C, get extra debugging symbols.
#
if test "x$GCC" = "xyes" -a "x$OCFS2_DEBUG" = "xyes"; then
CFLAGS="-ggdb"
fi
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB
AC_PATH_PROG(AR, ar)
AC_HEADER_STDC
AC_C_CONST
MB_VENDOR(VENDOR)
if test "x$GCC" != "xyes"; then
AC_MSG_ERROR(GCC is required)
fi
AC_ARG_WITH([root-prefix], [ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root], root_prefix=$withval, root_prefix="")
root_bindir='${root_prefix}/bin'
root_sbindir='${root_prefix}/sbin'
root_sysconfdir='${root_prefix}/etc'
AC_SUBST(root_prefix)
AC_SUBST(root_bindir)
AC_SUBST(root_sbindir)
AC_SUBST(root_sysconfdir)
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)
])
UUID_LIBS=
AC_CHECK_LIB(uuid, uuid_unparse, UUID_LIBS=-luuid)
if test "x$UUID_LIBS" = "x"; then
AC_MSG_ERROR([Unable to find uuid library])
fi
AC_CHECK_HEADER(uuid/uuid.h, :,
AC_MSG_ERROR([Unable to find uuid headers]))
AC_SUBST(UUID_LIBS)
AIO_LIBS=
AC_CHECK_LIB(aio, io_setup, AIO_LIBS=-laio)
if test "x$AIO_LIBS" = "x"; then
AC_MSG_ERROR([Unable to find libaio library])
fi
AC_CHECK_HEADER(libaio.h, :,
AC_MSG_ERROR([Unable to find /usr/include/libaio.h]))
AC_SUBST(AIO_LIBS)
NCURSES_LIBS=
AC_CHECK_LIB(ncurses, tgetstr, NCURSES_LIBS=-lncurses)
if test "x$NCURSES_LIBS" = "x"; then
AC_MSG_ERROR([Unable to find ncurses library])
fi
AC_SUBST(NCURSES_LIBS)
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -lncurses"
READLINE_LIBS=
AC_CHECK_LIB(readline, readline, READLINE_LIBS=-lreadline)
if test "x$READLINE_LIBS" = "x"; then
AC_MSG_ERROR([Unable to find readline library])
fi
AC_CHECK_HEADER(readline/readline.h, :,
AC_MSG_ERROR([Unable to find readline headers]))
AC_SUBST(READLINE_LIBS)
LDFLAGS="$saved_LDFLAGS"
AC_MSG_CHECKING(for debug executables)
AC_ARG_ENABLE(debugexe, [ --enable-debugexe=[yes/no] Enable debug executables for library source files [default=no]],,enable_debugexe=no)
OCFS2_DEBUG_EXE=
if test "x$enable_debugexe" = "xyes"; then
OCFS2_DEBUG_EXE=yes
fi
AC_SUBST(OCFS2_DEBUG_EXE)
AC_MSG_RESULT($enable_debugexe)
GLIB_REQUIRED_VERSION=2.2.3
AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, have_glib=yes,
AC_MSG_ERROR([GLib $GLIB_REQUIRED_VERSION or better is required]))
#
# Can we build statically? This is important
#
dyn_save_CFLAGS="$CFLAGS"
dyn_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="-static $LIBS $GLIB_LIBS $COM_ERR_LIBS"
AC_MSG_CHECKING(whether glib and com_err can be linked statically)
AC_TRY_LINK([
#include <et/com_err.h>
#include <glib.h>
#include <stdio.h>
], [ char *e = error_message(-1); return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], [
static_lib_link=yes
], [
static_lib_link=no
])
AC_MSG_RESULT($static_lib_link)
CFLAGS="$dyn_save_CFLAGS"
LIBS="$dyn_save_LIBS"
OCFS2_DYNAMIC_FSCK=yes
AC_MSG_CHECKING(whether to build fsck dynamically)
AC_ARG_ENABLE([dynamic-fsck], [ --enable-dynamic-fsck=[yes/no] Build fsck dynamically [default=yes]],,enable_dynamic_fsck=yes)
AC_MSG_RESULT($enable_dynamic_fsck)
if test "x$enable_dynamic_fsck" = "xno" -a "x$static_lib_link" = "xno"; then
AC_MSG_ERROR([Unable to statically link fsck.ocfs2])
fi
if test "x$enable_dynamic_fsck" = "xno"; then
OCFS2_DYNAMIC_FSCK=
fi
AC_SUBST(OCFS2_DYNAMIC_FSCK)
OCFS2_DYNAMIC_CTL=yes
AC_MSG_CHECKING(whether to build cluster control tools dynamically)
AC_ARG_ENABLE([dynamic-ctl], [ --enable-dynamic-ctl=[yes/no] Build cluster control tools dynamically [default=yes]],,enable_dynamic_ctl=yes)
AC_MSG_RESULT($enable_dynamic_ctl)
if test "x$enable_dynamic_ctl" = "xno" -a "x$static_lib_link" = "xno"; then
AC_MSG_ERROR([Unable to statically link cluster control tools])
fi
if test "x$enable_dynamic_ctl" = "xno"; then
OCFS2_DYNAMIC_CTL=
fi
AC_SUBST(OCFS2_DYNAMIC_CTL)
BUILD_DEBUGOCFS2=
ocfs_tools_save_LIBS="$LIBS"
LIBS="$LIBS -lncurses"
AC_CHECK_LIB(readline, readline,
[AC_CHECK_HEADER(readline/readline.h,
BUILD_DEBUGOCFS2=yes,
[AC_MSG_WARN([readline not found, debugfs.ocfs2 will not be built])])],
[AC_MSG_WARN([readline not found, debugfs.ocfs2 will not be built])])
LIBS="$ocfs_tools_save_LIBS"
AC_SUBST(BUILD_DEBUGOCFS2)
pcmk_found=
AC_CHECK_LIB(crmcluster, crm_get_peer,
[AC_CHECK_HEADER(pacemaker/crm_config.h, pcmk_found=yes,
[AC_MSG_WARN([Pacemaker headers not found, pacemaker support will not be built])])],
[AC_MSG_WARN([libcrmcluster not found, pacemaker support will not be built])])
# We use cman_replyto_shutdown to insure a new enough libcman
cman_found=
AC_CHECK_LIB(cman, cman_replyto_shutdown,
[AC_CHECK_HEADER(libcman.h, cman_found=yes,
[AC_MSG_WARN([libcman.h not found, cman support will not be built])])],
[AC_MSG_WARN([libcman not found, cman support will not be built])])
cpg_found=
HAVE_COROSYNC=
AC_CHECK_HEADER(corosync/cpg.h, [
cpg_found=yes
HAVE_COROSYNC=yes ],
[AC_CHECK_HEADER(openais/cpg.h, cpg_found=yes,
[AC_MSG_WARN([openais/cpg.h not found, ocfs2_controld will not be built])])])
AC_SUBST(HAVE_COROSYNC)
#
# We can't use AC_CHECK_LIB on corosync or openais libraries, because they
# are in ${libdir}/corosync or ${libdir}/openais, and we can't expand it in
# configure.in. What we'll try instead is to search AIS_TRY_PATH for
# -L<element>/<package> -l<lib>.
# NOTE that the initial colon ':' is *intentional*. We want the empty
# string first in case the user passed LDFLAGS.
#
AIS_TRY_PATH=":/usr/lib64:/usr/lib:/usr/local/lib64:/usr/local/lib"
CPG_LDFLAGS=
if test "x$cpg_found" = "xyes"; then
cpg_found=
if test "x$HAVE_COROSYNC" = "xyes"; then
cpg_package=corosync
else
cpg_package=openais
fi
TRY_PATH="$AIS_TRY_PATH"
AC_MSG_CHECKING([for cpg_initialize in -lcpg])
while test "x$TRY_PATH" != "x"; do
TRY="`echo $TRY_PATH | cut -f1 -d:`"
NEW_TRY_PATH="`echo $TRY_PATH | cut -f2- -d:`"
if test "x$NEW_TRY_PATH" != "x$TRY_PATH"; then
TRY_PATH="$NEW_TRY_PATH"
else
TRY_PATH=""
fi
if test "x$TRY" != "x"; then
TRY="-L${TRY}/${cpg_package}"
fi
# TRY="$TRY"
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $TRY -lcpg"
AC_LINK_IFELSE([AC_LANG_CALL([], [cpg_initialize])],
cpg_found=yes)
LDFLAGS="$saved_LDFLAGS"
if test "x$cpg_found" = "xyes"; then
CPG_LDFLAGS="$TRY"
break
fi
done
fi
if test "x$cpg_found" = "xyes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_WARN([libcpg not found, ocfs2_controld will not be built])
fi
AC_SUBST(CPG_LDFLAGS)
ckpt_found=
AC_CHECK_HEADER(openais/saCkpt.h, ckpt_found=yes,
[AC_MSG_WARN([openais/saCkpt.h not found, ocfs2_controld will not be built])],
[#include <openais/saAis.h>])
AIS_LDFLAGS=
if test "x$ckpt_found" = "xyes"; then
ckpt_found=
TRY_PATH="$AIS_TRY_PATH"
AC_MSG_CHECKING([for saCkptInitialize in -lSaCkpt])
while test "x$TRY_PATH" != "x"; do
TRY="`echo $TRY_PATH | cut -f1 -d:`"
NEW_TRY_PATH="`echo $TRY_PATH | cut -f2- -d:`"
if test "x$NEW_TRY_PATH" != "x$TRY_PATH"; then
TRY_PATH="$NEW_TRY_PATH"
else
TRY_PATH=""
fi
if test "x$TRY" != "x"; then
TRY="-L${TRY}/openais"
fi
# TRY="$TRY"
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $TRY -lSaCkpt"
AC_LINK_IFELSE([AC_LANG_CALL([], [saCkptInitialize])],
ckpt_found=yes)
LDFLAGS="$saved_LDFLAGS"
if test "x$ckpt_found" = "xyes"; then
AIS_LDFLAGS="$TRY"
break
fi
done
fi
if test "x$ckpt_found" = "xyes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_WARN([libSaCkpt not found, ocfs2_controld will not be built])
fi
AC_SUBST(AIS_LDFLAGS)
libdlmcontrol_found=
AC_CHECK_LIB(dlmcontrol, dlmc_fs_connect,
[AC_CHECK_HEADER(libdlmcontrol.h, libdlmcontrol_found=yes,
[AC_MSG_WARN([libdlmcontrol.h not found, ocfs2_controld will not be built])],
[
#include <sys/stat.h>
#include <inttypes.h>
#include <libdlm.h>
])],
[AC_MSG_WARN([libdlmcontrol not found, ocfs2_controld will not be built])])
LIBDLM_FOUND=
AC_CHECK_HEADER(libdlm.h, LIBDLM_FOUND=yes,
[AC_MSG_WARN([libdlm.h not found, fsdlm support will not be built])])
AC_SUBST(LIBDLM_FOUND)
fsdlm_found=
if test "x$LIBDLM_FOUND" = "xyes"; then
AC_CHECK_LIB(dlm_lt, dlm_create_lockspace, fsdlm_found=yes)
if test "xfsdlm_found" = "xyes"; then
AC_MSG_WARN([libdlm_lt not found, fsdlm support will not be built])
fi
fi
BUILD_FSDLM_SUPPORT=
DL_LIBS=
if test "x$fsdlm_found" = "xyes"; then
BUILD_FSDLM_SUPPORT=yes
DL_LIBS=-ldl
fi
AC_SUBST(BUILD_FSDLM_SUPPORT)
AC_SUBST(DL_LIBS)
BUILD_OCFS2_CONTROLD=
if test "x$cpg_found" = "xyes" -a "x$ckpt_found" = "xyes" -a "x$libdlmcontrol_found" = "xyes"; then
if test "x$fsdlm_found" = "xyes"; then
BUILD_OCFS2_CONTROLD=yes
else
AC_MSG_WARN([fsdlm support is not available, ocfs2_controld will not be built])
fi
fi
AC_SUBST(BUILD_OCFS2_CONTROLD)
LIBCMAP_FOUND=
AC_CHECK_HEADER(corosync/cmap.h, LIBCMAP_FOUND=yes,
[AC_MSG_WARN([corosync/cmap.h not found, cmap support will not be built. Older api will be used])])
AC_SUBST(LIBCMAP_FOUND)
fsdlm_found=
if test "x$LIBCMAP_FOUND" = "xyes"; then
AC_CHECK_LIB(cmap, cmap_initialize, cmap_found=yes)
if ! test "x$cmap_found" = "xyes"; then
AC_MSG_WARN([libcmap not found, cmap support will not be built. Older api will be used])
fi
fi
BUILD_CMAP_SUPPORT=
if test "x$cmap_found" = "xyes"; then
BUILD_CMAP_SUPPORT=yes
fi
AC_SUBST(BUILD_CMAP_SUPPORT)
BUILD_PCMK_SUPPORT=
if test "x$pcmk_found" = "xyes" -a "x$BUILD_OCFS2_CONTROLD" = "xyes"; then
BUILD_PCMK_SUPPORT=yes
fi
AC_SUBST(BUILD_PCMK_SUPPORT)
BUILD_CMAN_SUPPORT=
if test "x$cman_found" = "xyes" -a "x$BUILD_OCFS2_CONTROLD" = "xyes"; then
BUILD_CMAN_SUPPORT=yes
fi
AC_SUBST(BUILD_CMAN_SUPPORT)
HAVE_PYTHON=no
AM_PATH_PYTHON(2.3, have_python=yes, have_python=no)
if test "x$have_python" = "xyes"; then
AM_CHECK_PYTHON_HEADERS(have_pythondev=yes, have_pythondev=no)
if test "x$have_pythondev" = "xyes"; then
if $PYTHON -c 'import gobject' >/dev/null 2>&1; then
HAVE_PYTHON=yes
OCFS2_BLKID
else
AC_MSG_WARN([could not find PyGTK, ocfs2console will not be built])
fi
else
AC_MSG_WARN([could not find Python headers, ocfs2console will not be built])
fi
else
AC_MSG_WARN([could not find Python 2.3 or higher, ocfs2console will not be built])
fi
BUILD_OCFS2CONSOLE=
AC_MSG_CHECKING(whether to build ocfs2console)
AC_ARG_ENABLE(ocfs2console, [ --enable-ocfs2console=[yes/no] Build GUI frontend [default=no]],,enable_ocfs2console=no)
AC_MSG_RESULT($enable_ocfs2console)
if test "x$enable_ocfs2console" = "xyes"; then
if test "x$HAVE_PYTHON" = "xno"; then
AC_MSG_ERROR([Unable to build ocfs2console])
fi
BUILD_OCFS2CONSOLE=yes
fi
AC_SUBST(BUILD_OCFS2CONSOLE)
if test "x$BUILD_OCFS2CONSOLE" = "xyes"; then
AC_CONFIG_FILES([
ocfs2console/ocfs2interface/confdefs.py
ocfs2console/ocfs2console.8
])
fi
AC_CONFIG_FILES([
Config.make
o2cb.pc
o2dlm.pc
ocfs2.pc
debugfs.ocfs2/debugfs.ocfs2.8
mkfs.ocfs2/mkfs.ocfs2.8
mounted.ocfs2/mounted.ocfs2.8
fsck.ocfs2/fsck.ocfs2.8
fsck.ocfs2/fsck.ocfs2.checks.8
mount.ocfs2/mount.ocfs2.8
o2cb_ctl/o2cb_ctl.8
o2cb_ctl/o2cb.8
ocfs2_hb_ctl/ocfs2_hb_ctl.8
tunefs.ocfs2/tunefs.ocfs2.8
tunefs.ocfs2/o2cluster.8
o2image/o2image.8
o2info/o2info.1
libo2cb/o2cb.7
o2monitor/o2hbmonitor.8
o2cb_ctl/ocfs2.cluster.conf.5
vendor/common/o2cb.sysconfig.5
libocfs2/ocfs2.7
vendor/common/ocfs2-tools.spec-generic
defragfs.ocfs2/defragfs.ocfs2.8
])
AC_OUTPUT