147
189
[test "x$static_[]UTIL_PRG" = xyes])
192
dnl UTIL_PKG_STATIC(VARIABLE, MODULES)
193
dnl ----------------------------------
194
AC_DEFUN([UTIL_PKG_STATIC], [
195
if AC_RUN_LOG([pkg-config --exists --print-errors "$2"]); then
196
$1=`pkg-config --libs --static "$2"`
198
AC_MSG_ERROR([pkg-config description of $2, needed for static build, is not available])
150
202
dnl UTIL_CHECK_LIB(LIBRARY, FUNCTION, [VARSUFFIX = $1]))
151
203
dnl The VARSUFFIX is optional and overrides the default behaviour. For example:
152
204
dnl UTIL_CHECK_LIB(yyy, func, xxx) generates have_xxx and HAVE_LIBXXX
197
259
AC_ARG_ENABLE([fsck],
198
AS_HELP_STRING([--enable-fsck], [do build fsck]),
260
AS_HELP_STRING([--disable-fsck], [do not build fsck]),
201
263
AM_CONDITIONAL(BUILD_FSCK, test "x$enable_fsck" = xyes)
204
UTIL_CHECK_LIB(uuid, uuid_is_null)
205
if test "x$have_uuid" = xno; then
266
AC_ARG_ENABLE([libuuid],
267
AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]),
268
[], enable_libuuid=yes
270
AC_SUBST([LIBUUID_VERSION])
271
AC_SUBST([LIBUUID_VERSION_INFO])
272
AM_CONDITIONAL(BUILD_LIBUUID, test "x$enable_libuuid" = xyes)
275
if test "x$enable_libuuid" = xno; then
276
# Check for external (e2fsprogs) libuuid
277
PKG_CHECK_MODULES(UUID, uuid, [have_uuid=yes], [have_uuid=no])
278
if test "x$have_uuid" = xno; then
279
# system without pkg-config or so, try classic check
280
AC_CHECK_LIB(uuid, uuid_is_null, [have_uuid=yes], [have_uuid=no])
282
if test "x$have_uuid" = xyes; then
283
UTIL_SET_FLAGS($UUID_CFLAGS, $UUID_CFLAGS, $UUID_LIBS)
284
AC_CHECK_HEADERS([uuid.h uuid/uuid.h], [break], [])
289
AC_DEFINE(HAVE_UUID_H, 1, [Define to 1 if you have the <uuid.h> header file.])
292
if test "x$have_uuid" = xyes; then
293
AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.])
206
295
AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
209
UTIL_CHECK_LIB(util, openpty)
210
UTIL_CHECK_LIB(termcap, tgetnum)
213
AC_ARG_WITH([fsprobe],
214
[AS_HELP_STRING([--with-fsprobe=LIB], [library to guess filesystems, LIB should be builtin|blkid|volume_id, default is blkid])],
215
[], [with_fsprobe=blkid]
222
if test "x$with_fsprobe" = xbuiltin; then
225
AC_SUBST(LIBBLKID_VERSION)
226
AC_DEFINE_UNQUOTED(LIBBLKID_VERSION, "$LIBBLKID_VERSION", [libblkid version string])
227
AC_DEFINE_UNQUOTED(LIBBLKID_DATE, "$LIBBLKID_DATE", [libblkid date string])
228
AC_DEFINE(HAVE_BLKID_EVALUATE_TAG, 1, [Define to 1 if you have the blkid_evaluate_tag().])
229
AC_DEFINE(HAVE_BLKID_H, 1, [Define to 1 if you have the <blkid.h> header file.])
230
elif test "x$build_mount" = xyes || test "x$enable_fsck" = xyes; then
231
if test "x$with_fsprobe" = xblkid; then
297
AM_CONDITIONAL(HAVE_UUID, test "x$have_uuid" = xyes)
299
: ${UUID_LIBS='-luuid'}
302
AC_ARG_ENABLE([uuidd],
303
AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]),
304
[], enable_uuidd=auto
307
case "$enable_uuidd:$have_uuid" in
309
AC_MSG_ERROR([cannot enable uuidd when libuuid is disabled]) ;;
311
enable_uuidd=$have_uuid ;;
313
if test "x$enable_uuidd" = xyes; then
314
AC_DEFINE(HAVE_UUIDD, 1, [Define to 1 if you want to use uuid daemon.])
316
AM_CONDITIONAL(BUILD_UUIDD, test "x$enable_uuidd" = xyes)
319
AC_ARG_ENABLE([libblkid],
320
AS_HELP_STRING([--disable-libblkid], [do not build libblkid and blkid utilities]),
321
[], enable_libblkid=yes
323
AC_SUBST([LIBBLKID_VERSION])
324
AC_SUBST([LIBBLKID_VERSION_INFO])
325
AM_CONDITIONAL(BUILD_LIBBLKID, test "x$enable_libblkid" = xyes)
326
AC_DEFINE_UNQUOTED(LIBBLKID_VERSION, "$LIBBLKID_VERSION", [libblkid version string])
327
AC_DEFINE_UNQUOTED(LIBBLKID_DATE, "$LIBBLKID_DATE", [libblkid date string])
330
if test "x$enable_libblkid" = xno; then
331
if test "x$build_mount" = xyes || test "x$enable_fsck" = xyes; then
332
# Check for external (e2fsprogs) libblkid
232
333
PKG_CHECK_MODULES(BLKID, blkid, [have_blkid=yes], [have_blkid=no])
233
334
if test "x$have_blkid" = xno; then
234
335
# system without pkg-config or so, try classic check
239
340
AC_CHECK_HEADERS([blkid.h blkid/blkid.h], [break], [])
240
341
UTIL_RESTORE_FLAGS
242
elif test "x$with_fsprobe" = xvolume_id; then
243
PKG_CHECK_MODULES(VOLUME_ID, volume_id, [have_volume_id=yes], [have_volume_id=no])
244
if test "x$have_volume_id" = xno; then
245
# system without pkg-config or so, try classic check
246
AC_CHECK_LIB(volume_id, volume_id_probe_all, [have_volume_id=yes], [have_volume_id=no])
343
if test -n "$enable_static_programs"; then
344
# TODO check only when mount of fsck are requested
345
UTIL_PKG_STATIC([BLKID_LIBS_STATIC], [blkid])
350
AC_DEFINE(HAVE_BLKID_H, 1, [Define to 1 if you have the <blkid.h> header file.])
351
AC_DEFINE(HAVE_BLKID_EVALUATE_TAG, 1, [Define to 1 if you have the blkid_evaluate_tag().])
251
if test "x$have_blkid" = xyes; then
354
if test "x$have_blkid" = xyes; then
252
355
AC_DEFINE(HAVE_LIBBLKID, 1, [Define to 1 if you have the -lblkid.])
253
elif test "x$have_volume_id" = xno; then
254
357
if test "x$build_mount" = xyes; then
255
AC_MSG_ERROR([libblkid or libvolume_id is needed to build util-linux-ng mount])
358
AC_MSG_ERROR([libblkid is needed to build util-linux-ng mount])
257
360
if test "x$enable_fsck" = xyes; then
258
AC_MSG_ERROR([libblkid or libvoume_id is needed to build util-linux-ng fsck])
361
AC_MSG_ERROR([libblkid is needed to build util-linux-ng fsck])
262
364
AM_CONDITIONAL(HAVE_BLKID, test "x$have_blkid" = xyes)
263
AM_CONDITIONAL(HAVE_VOLUME_ID, test "x$have_volume_id" = xyes)
264
AM_CONDITIONAL(BUILD_LIBBLKID, test "x$build_libblkid" = xyes)
267
dnl UTIL_PKG_STATIC(VARIABLE, MODULES)
268
dnl ----------------------------------
269
AC_DEFUN([UTIL_PKG_STATIC], [
270
if AC_RUN_LOG([pkg-config --exists --print-errors "$2"]); then
271
$1=`pkg-config --libs --static "$2"`
273
AC_MSG_ERROR([pkg-config description of $2, needed for static build, is not available])
277
# These default values should work in most cases:
278
366
: ${BLKID_LIBS='-lblkid -luuid'}
279
: ${VOLUME_ID_LIBS='-lvolume_id'}
281
# ... but for static build, we need to consult pkg-config:
282
if test -n "$enable_static_programs"; then
283
case $with_fsprobe in
284
blkid) UTIL_PKG_STATIC([BLKID_LIBS_STATIC], [blkid]) ;;
285
volume_id) UTIL_PKG_STATIC([VOLUME_ID_LIBS_STATIC], [libvolume_id]) ;;
289
368
AC_ARG_VAR([BLKID_LIBS_STATIC], [-l options for linking statically with blkid])
290
AC_ARG_VAR([VOLUME_ID_LIBS_STATIC], [-l options for linking statically with volume_id])
371
UTIL_CHECK_LIB(util, openpty)
372
UTIL_CHECK_LIB(termcap, tgetnum)
293
374
AM_GNU_GETTEXT_VERSION([0.14.1])
294
375
AM_GNU_GETTEXT([external])
566
647
AM_CONDITIONAL(BUILD_CRAMFS, test "x$build_cramfs" = xyes)
650
AC_ARG_ENABLE([switch_root],
651
AS_HELP_STRING([--disable-switch_root], [do not build switch_root]),
652
[], enable_switch_root=check
655
if test "x$enable_switch_root" = xno; then
658
build_switch_root=yes
659
case $enable_switch_root:$linux_os in
660
yes:no) AC_MSG_ERROR([switch_root selected for non-linux system]);;
661
check:no) AC_MSG_WARN([non-linux system; do not build switch_root])
662
build_switch_root=no;;
664
if test "x$build_switch_root" = xyes; then
665
case $enable_switch_root:$have_openat in
666
yes:no) AC_MSG_ERROR([switch_root selected but openat() function not found]);;
667
check:no) AC_MSG_WARN([openat() function not found; do not build switch_root])
668
build_switch_root=no;;
672
AM_CONDITIONAL(BUILD_SWITCH_ROOT, test "x$build_switch_root" = xyes)
569
675
AC_ARG_ENABLE([elvtune],
570
676
AS_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]),
571
677
[], enable_elvtune=no