* device-mapper ./WHATS_NEW ./configure ./config ...
@ 2006-10-12 15:42 agk
0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2006-10-12 15:42 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: device-mapper
Changes by: agk@sourceware.org 2006-10-12 15:42:25
Modified files:
. : WHATS_NEW configure configure.in
dmsetup : dmsetup.c
include : configure.h.in
kernel/ioctl : dm-ioctl.h
lib : .exported_symbols libdevmapper.h
lib/ioctl : libdm-iface.c libdm-targets.h
man : dmsetup.8
Log message:
Add suspend noflush support.
Add basic dmsetup loop support.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.124&r2=1.125
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/configure.diff?cvsroot=dm&r1=1.37&r2=1.38
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/configure.in.diff?cvsroot=dm&r1=1.38&r2=1.39
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/dmsetup/dmsetup.c.diff?cvsroot=dm&r1=1.71&r2=1.72
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/include/configure.h.in.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/kernel/ioctl/dm-ioctl.h.diff?cvsroot=dm&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/.exported_symbols.diff?cvsroot=dm&r1=1.22&r2=1.23
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdevmapper.h.diff?cvsroot=dm&r1=1.58&r2=1.59
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/ioctl/libdm-iface.c.diff?cvsroot=dm&r1=1.37&r2=1.38
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/ioctl/libdm-targets.h.diff?cvsroot=dm&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/man/dmsetup.8.diff?cvsroot=dm&r1=1.14&r2=1.15
--- device-mapper/WHATS_NEW 2006/10/03 21:51:28 1.124
+++ device-mapper/WHATS_NEW 2006/10/12 15:42:24 1.125
@@ -1,5 +1,7 @@
Version 1.02.11 -
=============================
+ Add suspend noflush support.
+ Add basic dmsetup loop support.
Version 1.02.10 - 19 Sep 2006
=============================
--- device-mapper/configure 2006/05/10 19:38:25 1.37
+++ device-mapper/configure 2006/10/12 15:42:24 1.38
@@ -3735,7 +3735,8 @@
-for ac_header in termios.h
+
+for ac_header in termios.h sys/statvfs.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -5445,6 +5446,81 @@
################################################################################
+
+echo "$as_me:$LINENO: checking for canonicalize_file_name in -lc" >&5
+echo $ECHO_N "checking for canonicalize_file_name in -lc... $ECHO_C" >&6
+if test "${ac_cv_lib_c_canonicalize_file_name+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char canonicalize_file_name ();
+int
+main ()
+{
+canonicalize_file_name ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_c_canonicalize_file_name=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_c_canonicalize_file_name=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_c_canonicalize_file_name" >&5
+echo "${ECHO_T}$ac_cv_lib_c_canonicalize_file_name" >&6
+if test $ac_cv_lib_c_canonicalize_file_name = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CANONICALIZE_FILE_NAME 1
+_ACEOF
+
+fi
+
+
+################################################################################
echo "$as_me:$LINENO: checking whether to enable selinux support" >&5
echo $ECHO_N "checking whether to enable selinux support... $ECHO_C" >&6
# Check whether --enable-selinux or --disable-selinux was given.
--- device-mapper/configure.in 2006/05/10 19:38:25 1.38
+++ device-mapper/configure.in 2006/10/12 15:42:24 1.39
@@ -71,7 +71,7 @@
AC_CHECK_HEADERS(ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h sys/types.h unistd.h,,AC_MSG_ERROR(bailing out))
-AC_CHECK_HEADERS(termios.h)
+AC_CHECK_HEADERS(termios.h sys/statvfs.h)
################################################################################
dnl -- Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -210,6 +210,11 @@
AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1, [Define to 1 if getline is available.]))
################################################################################
+dnl -- canonicalize_file_name included in recent libc
+
+AC_CHECK_LIB(c, canonicalize_file_name, AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1, [Define to 1 if canonicalize_file_name is available.]))
+
+################################################################################
dnl -- Disable selinux
AC_MSG_CHECKING(whether to enable selinux support)
AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support],
--- device-mapper/dmsetup/dmsetup.c 2006/08/10 20:53:21 1.71
+++ device-mapper/dmsetup/dmsetup.c 2006/10/12 15:42:24 1.72
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
* Copyright (C) 2005 NEC Corperation
*
* This file is part of the device-mapper userspace tools.
@@ -38,6 +38,16 @@
#include <locale.h>
#include <langinfo.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* FIXME Unused so far */
+#undef HAVE_SYS_STATVFS_H
+
+#ifdef HAVE_SYS_STATVFS_H
+# include <sys/statvfs.h>
+#endif
+
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
@@ -78,6 +88,11 @@
#define LINE_SIZE 4096
#define ARGS_MAX 256
+#define LOOP_TABLE_SIZE (PATH_MAX + 255)
+
+/* FIXME Should be elsewhere */
+#define SECTOR_SHIFT 9L
+#define DEV_PATH "/dev/"
#define err(msg, x...) fprintf(stderr, msg "\n", ##x)
@@ -93,6 +108,7 @@
MAJOR_ARG,
MINOR_ARG,
MODE_ARG,
+ NOFLUSH_ARG,
NOHEADINGS_ARG,
NOLOCKFS_ARG,
NOOPENCOUNT_ARG,
@@ -180,7 +196,7 @@
#ifndef HAVE_GETLINE
buffer_size = LINE_SIZE;
- if (!(buffer = malloc(buffer_size))) {
+ if (!(buffer = dm_malloc(buffer_size))) {
err("Failed to malloc line buffer.");
return 0;
}
@@ -195,7 +211,7 @@
r = 1;
out:
- free(buffer);
+ dm_free(buffer);
if (file)
fclose(fp);
return r;
@@ -512,7 +528,7 @@
for (i = 0; i < argc; i++)
sz += strlen(argv[i]) + 1;
- str = malloc(sz);
+ str = dm_malloc(sz);
memset(str, 0, sz);
for (i = 0; i < argc; i++) {
@@ -524,7 +540,7 @@
if (!dm_task_set_message(dmt, str))
goto out;
- free(str);
+ dm_free(str);
if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt))
goto out;
@@ -603,6 +619,9 @@
if (event_nr && !dm_task_set_event_nr(dmt, event_nr))
goto out;
+ if (_switches[NOFLUSH_ARG] && !dm_task_no_flush(dmt))
+ goto out;
+
if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt))
goto out;
@@ -744,28 +763,28 @@
return 0;
if (!_set_task_device(dmt, name, 0))
- goto err;
+ goto error;
if (!dm_task_add_target(dmt, 0, size, "error", ""))
- goto err;
+ goto error;
if (_switches[READ_ONLY] && !dm_task_set_ro(dmt))
- goto err;
+ goto error;
if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt))
- goto err;
+ goto error;
if (!dm_task_run(dmt))
- goto err;
+ goto error;
if (!_simple(DM_DEVICE_RESUME, name, 0, 0)) {
_simple(DM_DEVICE_CLEAR, name, 0, 0);
- goto err;
+ goto error;
}
r = 1;
-err:
+error:
dm_task_destroy(dmt);
return r;
}
@@ -1518,7 +1537,8 @@
fprintf(out, "Usage:\n\n");
fprintf(out, "dmsetup [--version] [-v|--verbose [-v|--verbose ...]]\n"
- " [-r|--readonly] [--noopencount] [--nolockfs]\n\n");
+ " [-r|--readonly] [--noopencount] [--nolockfs]\n"
+ " [--noflush]\n\n");
for (i = 0; _commands[i].name; i++)
fprintf(out, "\t%s %s\n", _commands[i].name, _commands[i].help);
fprintf(out, "\n<device> may be device name or -u <uuid> or "
@@ -1529,6 +1549,13 @@
return;
}
+static void _losetup_usage(FILE *out)
+{
+ fprintf(out, "Usage:\n\n");
+ fprintf(out, "losetup [-d|-a] [-e encryption] "
+ "[-o offset] [-f|loop_device] [file]\n\n");
+}
+
static struct command *_find_command(const char *name)
{
int i;
@@ -1606,11 +1633,225 @@
return 1;
}
+/*
+ * Returns the full absolute path, or NULL if the path could
+ * not be resolved.
+ */
+static char *_get_abspath(char *path)
+{
+ char *_path;
+
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+ _path = canonicalize_file_name(path);
+#else
+ /* FIXME Provide alternative */
+#endif
+ return _path;
+}
+
+static char *parse_loop_device_name(char *dev)
+{
+ char *buf;
+ char *device;
+
+ if (!(buf = dm_malloc(PATH_MAX)));
+ return NULL;
+
+ if (dev[0] == '/') {
+ if (!(device = _get_abspath(dev)))
+ goto error;
+
+ if (strncmp(device, DEV_PATH, strlen(DEV_PATH)))
+ goto error;
+
+ strncpy(buf, strrchr(device, '/') + 1, PATH_MAX);
+ dm_free(device);
+
+ } else {
+ /* check for device number */
+ if (!strncmp(dev, "loop", strlen("loop")))
+ strncpy(buf, dev, PATH_MAX);
+ else
+ goto error;
+ }
+
+ return buf;
+
+error:
+ return NULL;
+}
+
+/*
+ * create a table for a mapped device using the loop target.
+ */
+static int _loop_table(char *table, size_t tlen, char *file, char *dev, off_t off)
+{
+ struct stat fbuf;
+ off_t size, sectors;
+ int fd = -1;
+#ifdef HAVE_SYS_STATVFS_H
+ struct statvfs fsbuf;
+ off_t blksize;
+#endif
+
+ if (!_switches[READ_ONLY])
+ fd = open(file, O_RDWR);
+
+ if (fd < 0) {
+ _switches[READ_ONLY]++;
+ fd = open(file, O_RDONLY);
+ }
+
+ if (fd < 0)
+ goto error;
+
+ if (fstat(fd, &fbuf))
+ goto error;
+
+ size = (fbuf.st_size - off);
+ sectors = size >> SECTOR_SHIFT;
+
+ if (_switches[VERBOSE_ARG])
+ fprintf(stderr, "losetup: set loop size to %llukB (%llu sectors)\n",
+ sectors >> 1, sectors);
+
+#ifdef HAVE_SYS_STATVFS_H
+ if (fstatvfs(fd, &fsbuf))
+ goto error;
+
+ /* FIXME Fragment size currently unused */
+ blksize = fsbuf.f_frsize;
+#endif
+
+ close(fd);
+
+ if (dm_snprintf(table, tlen, "%llu %llu loop %s %llu\n", 0ULL,
+ (long long unsigned)sectors, file, off) < 0)
+ return 0;
+
+ if (_switches[VERBOSE_ARG] > 1)
+ fprintf(stderr, "Table: %s\n", table);
+
+ return 1;
+
+error:
+ if (fd > -1)
+ close(fd);
+ return 0;
+}
+
+static int _process_losetup_switches(const char *base, int *argc, char ***argv)
+{
+ static int ind;
+ int c;
+ int encrypt_loop = 0, delete = 0, find = 0, show_all = 0;
+ char *device_name = NULL;
+ char *loop_file = NULL;
+ off_t offset = 0;
+
+#ifdef HAVE_GETOPTLONG
+ static struct option long_options[] = {
+ {0, 0, 0, 0}
+ };
+#endif
+
+ optarg = 0;
+ optind = OPTIND_INIT;
+ while ((ind = -1, c = GETOPTLONG_FN(*argc, *argv, "ade:fo:v",
+ long_options, NULL)) != -1 ) {
+ if (c == ':' || c == '?')
+ return 0;
+ if (c == 'a')
+ show_all++;
+ if (c == 'd')
+ delete++;
+ if (c == 'e')
+ encrypt_loop++;
+ if (c == 'f')
+ find++;
+ if (c == 'o')
+ offset = atoi(optarg);
+ if (c == 'v')
+ _switches[VERBOSE_ARG]++;
+ }
+
+ *argv += optind ;
+ *argc -= optind ;
+
+ if (encrypt_loop){
+ fprintf(stderr, "%s: Sorry, cryptoloop is not yet implemented "
+ "in this version.\n", base);
+ return 0;
+ }
+
+ if (show_all) {
+ fprintf(stderr, "%s: Sorry, show all is not yet implemented "
+ "in this version.\n", base);
+ return 0;
+ }
+
+ if (find) {
+ fprintf(stderr, "%s: Sorry, find is not yet implemented "
+ "in this version.\n", base);
+ if (!*argc)
+ return 0;
+ }
+
+ if (!*argc) {
+ fprintf(stderr, "%s: Please specify loop_device.\n", base);
+ _losetup_usage(stderr);
+ return 0;
+ }
+
+ if (!(device_name = parse_loop_device_name((*argv)[0]))) {
+ fprintf(stderr, "%s: Could not parse loop_device %s\n",
+ base, (*argv)[0]);
+ _losetup_usage(stderr);
+ return 0;
+ }
+
+ if (delete) {
+ *argc = 2;
+
+ (*argv)[1] = device_name;
+ (*argv)[0] = (char *) "remove";
+
+ return 1;
+ }
+
+ if (*argc != 2) {
+ fprintf(stderr, "%s: Too few arguments\n", base);
+ _losetup_usage(stderr);
+ return 0;
+ }
+
+ /* FIXME move these to make them available to native dmsetup */
+ if (!(loop_file = _get_abspath((*argv)[(find) ? 0 : 1]))) {
+ fprintf(stderr, "%s: Could not parse loop file name %s\n",
+ base, (*argv)[1]);
+ _losetup_usage(stderr);
+ return 0;
+ }
+
+ /* FIXME Missing free */
+ _table = dm_malloc(LOOP_TABLE_SIZE);
+ if (!_loop_table(_table, LOOP_TABLE_SIZE, loop_file, device_name, offset)) {
+ fprintf(stderr, "Could not build device-mapper table for %s\n", (*argv)[0]);
+ return 0;
+ }
+ _switches[TABLE_ARG]++;
+
+ (*argv)[0] = (char *) "create";
+ (*argv)[1] = device_name ;
+
+ return 1;
+}
+
static int _process_switches(int *argc, char ***argv)
{
char *base, *namebase;
static int ind;
- int c;
+ int c, r;
#ifdef HAVE_GETOPTLONG
static struct option long_options[] = {
@@ -1622,6 +1863,7 @@
{"major", 1, &ind, MAJOR_ARG},
{"minor", 1, &ind, MINOR_ARG},
{"mode", 1, &ind, MODE_ARG},
+ {"noflush", 0, &ind, NOFLUSH_ARG},
{"noheadings", 0, &ind, NOHEADINGS_ARG},
{"nolockfs", 0, &ind, NOLOCKFS_ARG},
{"noopencount", 0, &ind, NOOPENCOUNT_ARG},
@@ -1678,6 +1920,12 @@
return 1;
}
+ if(!strcmp(base, "losetup") || !strcmp(base, "dmlosetup")){
+ r = _process_losetup_switches(base, argc, argv);
+ free(namebase);
+ return r;
+ }
+
free(namebase);
optarg = 0;
@@ -1733,6 +1981,8 @@
_switches[TARGET_ARG]++;
_target = optarg;
}
+ if ((ind == NOFLUSH_ARG))
+ _switches[NOFLUSH_ARG]++;
if ((ind == NOHEADINGS_ARG))
_switches[NOHEADINGS_ARG]++;
if ((ind == NOLOCKFS_ARG))
--- device-mapper/include/configure.h.in 2006/05/10 19:38:25 1.1
+++ device-mapper/include/configure.h.in 2006/10/12 15:42:24 1.2
@@ -3,6 +3,9 @@
/* Define to 1 if the `closedir' function returns void instead of `int'. */
#undef CLOSEDIR_VOID
+/* Define to 1 if canonicalize_file_name is available. */
+#undef HAVE_CANONICALIZE_FILE_NAME
+
/* Define to 1 if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
@@ -113,6 +116,9 @@
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
+/* Define to 1 if you have the <sys/statvfs.h> header file. */
+#undef HAVE_SYS_STATVFS_H
+
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
--- device-mapper/kernel/ioctl/dm-ioctl.h 2006/08/21 12:04:49 1.43
+++ device-mapper/kernel/ioctl/dm-ioctl.h 2006/10/12 15:42:24 1.44
@@ -287,9 +287,9 @@
#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
#define DM_VERSION_MAJOR 4
-#define DM_VERSION_MINOR 8
+#define DM_VERSION_MINOR 11
#define DM_VERSION_PATCHLEVEL 0
-#define DM_VERSION_EXTRA "-ioctl (2006-06-08)"
+#define DM_VERSION_EXTRA "-ioctl (2006-10-12)"
/* Status bits */
#define DM_READONLY_FLAG (1 << 0) /* In/Out */
@@ -325,4 +325,9 @@
*/
#define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */
+/*
+ * Set this to suspend without flushing queued ios.
+ */
+#define DM_NOFLUSH_FLAG (1 << 11) /* In */
+
#endif /* _LINUX_DM_IOCTL_H */
--- device-mapper/lib/.exported_symbols 2006/08/21 12:52:39 1.22
+++ device-mapper/lib/.exported_symbols 2006/10/12 15:42:24 1.23
@@ -28,6 +28,7 @@
dm_task_set_mode
dm_task_suppress_identical_reload
dm_task_add_target
+dm_task_no_flush
dm_task_no_open_count
dm_task_skip_lockfs
dm_task_update_nodes
--- device-mapper/lib/libdevmapper.h 2006/08/21 12:52:39 1.58
+++ device-mapper/lib/libdevmapper.h 2006/10/12 15:42:24 1.59
@@ -151,6 +151,7 @@
int dm_task_set_geometry(struct dm_task *dmt, const char *cylinders, const char *heads, const char *sectors, const char *start);
int dm_task_set_message(struct dm_task *dmt, const char *message);
int dm_task_set_sector(struct dm_task *dmt, uint64_t sector);
+int dm_task_no_flush(struct dm_task *dmt);
int dm_task_no_open_count(struct dm_task *dmt);
int dm_task_skip_lockfs(struct dm_task *dmt);
int dm_task_suppress_identical_reload(struct dm_task *dmt);
--- device-mapper/lib/ioctl/libdm-iface.c 2006/08/08 21:22:31 1.37
+++ device-mapper/lib/ioctl/libdm-iface.c 2006/10/12 15:42:24 1.38
@@ -1026,6 +1026,13 @@
return 1;
}
+int dm_task_no_flush(struct dm_task *dmt)
+{
+ dmt->noflush = 1;
+
+ return 1;
+}
+
int dm_task_no_open_count(struct dm_task *dmt)
{
dmt->no_open_count = 1;
@@ -1270,6 +1277,8 @@
if (dmt->type == DM_DEVICE_SUSPEND)
dmi->flags |= DM_SUSPEND_FLAG;
+ if (dmt->noflush)
+ dmi->flags |= DM_NOFLUSH_FLAG;
if (dmt->read_only)
dmi->flags |= DM_READONLY_FLAG;
if (dmt->skip_lockfs)
--- device-mapper/lib/ioctl/libdm-targets.h 2006/02/20 23:55:58 1.18
+++ device-mapper/lib/ioctl/libdm-targets.h 2006/10/12 15:42:24 1.19
@@ -52,6 +52,7 @@
char *message;
char *geometry;
uint64_t sector;
+ int noflush;
int no_open_count;
int skip_lockfs;
int suppress_identical_reload;
--- device-mapper/man/dmsetup.8 2006/08/10 14:11:03 1.14
+++ device-mapper/man/dmsetup.8 2006/10/12 15:42:25 1.15
@@ -13,7 +13,7 @@
.I [-f|--force]
.br
.B dmsetup suspend
-.I [--nolockfs] device_name
+.I [--nolockfs] [--noflush] device_name
.br
.B dmsetup resume
.I device_name
@@ -213,7 +213,7 @@
With --target, only information relating to the specified target type
is displayed.
.IP \fBsuspend
-.I [--nolockfs]
+.I [--nolockfs] [--noflush]
.I device_name
.br
Suspends a device. Any I/O that has already been mapped by the device
@@ -221,6 +221,9 @@
device will be postponed for as long as the device is suspended.
If there's a filesystem on the device which supports the operation,
an attempt will be made to sync it first unless --nolockfs is specified.
+Some targets such as recent (October 2006) versions of multipath may support
+the --noflush option. This lets outstanding I/O that has not yet reached the
+device to remain unflushed.
.IP \fBtable
.I [--target target_type]
.I [device_name]
^ permalink raw reply [flat|nested] 5+ messages in thread* device-mapper ./WHATS_NEW ./configure ./config ...
@ 2007-01-11 21:54 agk
0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2007-01-11 21:54 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: device-mapper
Changes by: agk@sourceware.org 2007-01-11 21:54:53
Modified files:
. : WHATS_NEW configure configure.in
dmeventd : .exported_symbols dmeventd.c
libdevmapper-event.c libdevmapper-event.h
include : configure.h.in
lib : .exported_symbols libdevmapper.h libdm-string.c
Log message:
Lots of dmeventd-related changes.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.141&r2=1.142
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/configure.diff?cvsroot=dm&r1=1.38&r2=1.39
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/configure.in.diff?cvsroot=dm&r1=1.39&r2=1.40
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/dmeventd/.exported_symbols.diff?cvsroot=dm&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/dmeventd/dmeventd.c.diff?cvsroot=dm&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/dmeventd/libdevmapper-event.c.diff?cvsroot=dm&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/dmeventd/libdevmapper-event.h.diff?cvsroot=dm&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/include/configure.h.in.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/.exported_symbols.diff?cvsroot=dm&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdevmapper.h.diff?cvsroot=dm&r1=1.61&r2=1.62
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdm-string.c.diff?cvsroot=dm&r1=1.4&r2=1.5
--- device-mapper/WHATS_NEW 2007/01/11 16:23:21 1.141
+++ device-mapper/WHATS_NEW 2007/01/11 21:54:51 1.142
@@ -1,8 +1,9 @@
Version 1.02.14 -
=============================
+ Add dm_saprintf().
Use CFLAGS when linking so mixed sparc builds can supply -m64.
Add dm_tree_use_no_flush_suspend().
- Lots of dmevent changes.
+ Lots of dmevent changes including revised interface.
Export dm_basename().
Cope with a trailing space when comparing tables prior to possible reload.
Fix dmeventd to cope if monitored device disappears.
--- device-mapper/configure 2006/10/12 15:42:24 1.38
+++ device-mapper/configure 2007/01/11 21:54:51 1.39
@@ -865,12 +865,13 @@
--with-device-uid=UID Set the owner used for new device nodes [UID=0]
--with-device-gid=UID Set the group used for new device nodes [GID=0]
--with-device-mode=MODE Set the mode used for new device nodes [MODE=0600]
- --with-optimisation=OPT C optimisation flag OPT=-O2
- --with-localedir=DIR Translation files in DIR PREFIX/share/locale
+ --with-optimisation=OPT C optimisation flag [OPT=-O2]
+ --with-localedir=DIR Translation files in DIR [PREFIX/share/locale]
--with-kernel-dir=DIR linux kernel source in DIR
--with-kernel-version=VERSION linux kernel version
- --with-tmp-dir=DIR temp directory to make kernel patches /tmp/kerndiff
- --with-interface=IFACE Choose kernel interface (ioctl or fs) ioctl
+ --with-tmp-dir=DIR temp dir to make kernel patches [/tmp/kerndiff]
+ --with-interface=IFACE Choose kernel interface (ioctl or fs) [ioctl]
+ --with-dmeventd-pidfile=PATH dmeventd pidfile [/var/run/dmeventd.pid]
Some influential environment variables:
CC C compiler command
@@ -6039,6 +6040,25 @@
################################################################################
+if test "$DMEVENTD" = yes; then
+
+# Check whether --with-dmeventd-pidfile or --without-dmeventd-pidfile was given.
+if test "${with_dmeventd_pidfile+set}" = set; then
+ withval="$with_dmeventd_pidfile"
+ cat >>confdefs.h <<_ACEOF
+#define DMEVENTD_PIDFILE "$withval"
+_ACEOF
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define DMEVENTD_PIDFILE "/var/run/dmeventd.pid"
+_ACEOF
+
+fi;
+fi
+################################################################################
+
+
--- device-mapper/configure.in 2006/10/12 15:42:24 1.39
+++ device-mapper/configure.in 2007/01/11 21:54:51 1.40
@@ -168,7 +168,7 @@
dnl -- Override optimisation
AC_MSG_CHECKING(for C optimisation flag)
AC_ARG_WITH(optimisation,
- [ --with-optimisation=OPT C optimisation flag [OPT=-O2] ],
+ [ --with-optimisation=OPT C optimisation flag [[OPT=-O2]] ],
[ COPTIMISE_FLAG="$withval" ])
AC_MSG_RESULT($COPTIMISE_FLAG)
@@ -262,7 +262,7 @@
fi;
AC_ARG_WITH(localedir,
- [ --with-localedir=DIR Translation files in DIR [PREFIX/share/locale]],
+ [ --with-localedir=DIR Translation files in DIR [[PREFIX/share/locale]] ],
[ LOCALEDIR="$withval" ],
[ LOCALEDIR='${prefix}/share/locale' ])
fi
@@ -328,7 +328,7 @@
################################################################################
dnl -- Temporary directory for kernel diffs
AC_ARG_WITH(tmp-dir,
- [ --with-tmp-dir=DIR temp directory to make kernel patches [/tmp/kerndiff]],
+ [ --with-tmp-dir=DIR temp dir to make kernel patches [[/tmp/kerndiff]] ],
[ tmpdir="$withval" ],
[ tmpdir=/tmp/kerndiff ])
if test "${with_tmp_dir+set}" = set; then
@@ -342,7 +342,7 @@
dnl -- which kernel interface to use (ioctl or fs)
AC_MSG_CHECKING(for kernel interface choice)
AC_ARG_WITH(interface,
- [ --with-interface=IFACE Choose kernel interface (ioctl or fs) [ioctl]],
+ [ --with-interface=IFACE Choose kernel interface (ioctl or fs) [[ioctl]] ],
[ interface="$withval" ],
[ interface=ioctl ])
if [[ "x$interface" != xfs -a "x$interface" != xioctl ]];
@@ -359,6 +359,15 @@
################################################################################
+dnl -- dmeventd pidfile path
+AH_TEMPLATE(DMEVENTD_PIDFILE, [Path to dmeventd pidfile.])
+if test "$DMEVENTD" = yes; then
+ AC_ARG_WITH(dmeventd-pidfile,
+ [ --with-dmeventd-pidfile=PATH dmeventd pidfile [[/var/run/dmeventd.pid]] ],
+ [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"$withval") ],
+ [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"/var/run/dmeventd.pid") ])
+fi
+################################################################################
AC_SUBST(usrlibdir)
AC_SUBST(JOBS)
AC_SUBST(STATIC_LINK)
--- device-mapper/dmeventd/.exported_symbols 2005/12/02 21:00:33 1.4
+++ device-mapper/dmeventd/.exported_symbols 2007/01/11 21:54:52 1.5
@@ -1,5 +1,16 @@
+dm_event_handler_create
+dm_event_handler_destroy
+dm_event_handler_set_dso
+dm_event_handler_set_name
+dm_event_handler_set_uuid
+dm_event_handler_set_major
+dm_event_handler_set_minor
+dm_event_handler_set_events
+dm_event_handler_get_dso
+dm_event_handler_get_name
+dm_event_handler_get_uuid
+dm_event_handler_get_major
+dm_event_handler_get_minor
+dm_event_handler_get_events
dm_event_register
dm_event_unregister
-dm_event_get_registered_device
-dm_event_set_timeout
-dm_event_get_timeout
--- device-mapper/dmeventd/dmeventd.c 2007/01/08 15:35:08 1.27
+++ device-mapper/dmeventd/dmeventd.c 2007/01/11 21:54:52 1.28
@@ -19,6 +19,7 @@
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
+#include "configure.h"
#include "libdevmapper.h"
#include "libdevmapper-event.h"
#include "list.h"
@@ -44,17 +45,17 @@
#include <sys/resource.h>
#include <unistd.h>
#include <stdarg.h>
-#include <arpa/inet.h> /* for htonl, ntohl */
+#include <arpa/inet.h> /* for htonl, ntohl */
#ifdef linux
#include <malloc.h>
#endif
-/* We must use syslog for now, because multilog is not yet implemented */
+/* FIXME We use syslog for now, because multilog is not yet implemented */
#include <syslog.h>
-static volatile sig_atomic_t _exit_now = 0; /* set to '1' when signal is given to exit */
-static volatile sig_atomic_t _thread_registries_empty = 1; /* registries are empty initially */
+static volatile sig_atomic_t _exit_now = 0; /* set to '1' when signal is given to exit */
+static volatile sig_atomic_t _thread_registries_empty = 1; /* registries are empty initially */
/* List (un)link macros. */
#define LINK(x, head) list_add(head, &(x)->list)
@@ -78,19 +79,24 @@
struct dso_data {
struct list list;
- char *dso_name; /* DSO name (eg, "evms", "dmraid", "lvm2"). */
+ char *dso_name; /* DSO name (eg, "evms", "dmraid", "lvm2"). */
- void *dso_handle; /* Opaque handle as returned from dlopen(). */
- unsigned int ref_count; /* Library reference count. */
+ void *dso_handle; /* Opaque handle as returned from dlopen(). */
+ unsigned int ref_count; /* Library reference count. */
/*
* Event processing.
*
- * The DSO can do whatever appropriate steps if an event happens
- * such as changing the mapping in case a mirror fails, update
- * the application metadata etc.
+ * The DSO can do whatever appropriate steps if an event
+ * happens such as changing the mapping in case a mirror
+ * fails, update the application metadata etc.
+ *
+ * This function gets a dm_task that is a result of
+ * DM_DEVICE_WAITEVENT ioctl (results equivalent to
+ * DM_DEVICE_STATUS). It should not destroy it.
+ * The caller must dispose of the task.
*/
- void (*process_event)(const char *device, enum dm_event_type event);
+ void (*process_event)(struct dm_task *dmt, enum dm_event_type event);
/*
* Device registration.
@@ -100,7 +106,8 @@
* the process_event() function is sane (eg, read metadata
* and activate a mapping).
*/
- int (*register_device)(const char *device);
+ int (*register_device)(const char *device, const char *uuid, int major,
+ int minor);
/*
* Device unregistration.
@@ -109,14 +116,15 @@
* for events, the DSO can recognize this and carry out appropriate
* steps (eg, deactivate mapping, metadata update).
*/
- int (*unregister_device)(const char *device);
+ int (*unregister_device)(const char *device, const char *uuid,
+ int major, int minor);
};
static LIST_INIT(_dso_registry);
/* Structure to keep parsed register variables from client message. */
struct message_data {
char *dso_name; /* Name of DSO. */
- char *device_path; /* Mapped device path. */
+ char *device_uuid; /* Mapped device path. */
union {
char *str; /* Events string as fetched from message. */
enum dm_event_type field; /* Events bitfield. */
@@ -139,15 +147,19 @@
pthread_t thread;
- struct dso_data *dso_data;/* DSO this thread accesses. */
-
- char *device_path; /* Mapped device path. */
+ struct dso_data *dso_data; /* DSO this thread accesses. */
+
+ struct {
+ char *uuid;
+ char *name;
+ int major, minor;
+ } device;
uint32_t event_nr; /* event number */
int processing; /* Set when event is being processed */
int status; /* running/shutdown/done */
enum dm_event_type events; /* bitfield for event filter. */
- enum dm_event_type current_events;/* bitfield for occured events. */
- enum dm_event_type processed_events;/* bitfield for processed events. */
+ enum dm_event_type current_events; /* bitfield for occured events. */
+ struct dm_task *current_task;
time_t next_time;
uint32_t timeout;
struct list timeout_list;
@@ -168,13 +180,16 @@
if (ret) {
if (!memset(ret, 0, sizeof(*ret)) ||
- !(ret->device_path = dm_strdup(data->device_path))) {
+ !(ret->device.uuid = dm_strdup(data->device_uuid))) {
dm_free(ret);
ret = NULL;
} else {
+ ret->current_task = NULL;
+ ret->device.name = NULL;
+ ret->device.major = ret->device.minor = 0;
ret->dso_data = dso_data;
- ret->events = data->events.field;
- ret->timeout = data->timeout.secs;
+ ret->events = data->events.field;
+ ret->timeout = data->timeout.secs;
list_init(&ret->timeout_list);
}
}
@@ -184,7 +199,8 @@
static void free_thread_status(struct thread_status *thread)
{
- dm_free(thread->device_path);
+ dm_free(thread->device.uuid);
+ dm_free(thread->device.name);
dm_free(thread);
}
@@ -213,9 +229,10 @@
/*
* Fetch a string off src and duplicate it into *ptr.
- * Pay attention to 0 lenght strings.
+ * Pay attention to zero-length strings.
*/
-/* FIXME: move to separate module to share with the client lib. */
+/* FIXME? move to libdevmapper to share with the client lib (need to
+ make delimiter a parameter then) */
static const char delimiter = ' ';
static int fetch_string(char **ptr, char **src)
{
@@ -250,8 +267,8 @@
if (message_data->dso_name)
dm_free(message_data->dso_name);
- if (message_data->device_path)
- dm_free(message_data->device_path);
+ if (message_data->device_uuid)
+ dm_free(message_data->device_uuid);
}
@@ -270,7 +287,7 @@
* path and events # string from message.
*/
if (fetch_string(&message_data->dso_name, &p) &&
- fetch_string(&message_data->device_path, &p) &&
+ fetch_string(&message_data->device_uuid, &p) &&
fetch_string(&message_data->events.str, &p) &&
fetch_string(&message_data->timeout.str, &p)) {
if (message_data->events.str) {
@@ -287,7 +304,7 @@
uint32_t secs = atoi(message_data->timeout.str);
dm_free(message_data->timeout.str);
message_data->timeout.secs = secs ? secs :
- DM_EVENT_DEFAULT_TIMEOUT;
+ DM_EVENT_DEFAULT_TIMEOUT;
}
ret = 1;
@@ -330,23 +347,43 @@
return 1;
}
-/* FIXME This is unreliable: should use DM_DEVICE_INFO ioctl instead. */
/* Check, if a device exists. */
-static int device_exists(char *device)
+static int fill_device_data(struct thread_status *ts)
{
- struct stat st_buf;
- char path2[PATH_MAX];
+ struct dm_task *dmt;
+ struct dm_info dmi;
- if (!device || !*device)
+ if (!ts->device.uuid)
return 0;
- if (device[0] == '/') /* absolute path */
- return !stat(device, &st_buf) && S_ISBLK(st_buf.st_mode);
+ ts->device.name = NULL;
+ ts->device.major = ts->device.minor = 0;
- if (PATH_MAX <= snprintf(path2, PATH_MAX, "%s/%s", dm_dir(), device))
+ dmt = dm_task_create(DM_DEVICE_INFO);
+ if (!dmt)
return 0;
- return !stat(path2, &st_buf) && S_ISBLK(st_buf.st_mode);
+ dm_task_set_uuid(dmt, ts->device.uuid);
+ if (!dm_task_run(dmt))
+ goto fail;
+
+ ts->device.name = dm_strdup(dm_task_get_name(dmt));
+ if (!ts->device.name)
+ goto fail;
+
+ if (!dm_task_get_info(dmt, &dmi))
+ goto fail;
+
+ ts->device.major = dmi.major;
+ ts->device.minor = dmi.minor;
+
+ dm_task_destroy(dmt);
+ return 1;
+
+ fail:
+ dm_task_destroy(dmt);
+ dm_free(ts->device.name);
+ return 0;
}
/*
@@ -359,13 +396,12 @@
struct thread_status *thread;
list_iterate_items(thread, &_thread_registry)
- if (!strcmp(data->device_path, thread->device_path))
- return thread;
+ if (!strcmp(data->device_uuid, thread->device.uuid))
+ return thread;
return NULL;
}
-
/* Cleanup at exit. */
static void exit_dm_lib(void)
{
@@ -392,11 +428,10 @@
while (!list_empty(&timeout_registry)) {
struct thread_status *thread;
- timeout.tv_sec = (time_t)-1;
+ timeout.tv_sec = (time_t) -1;
curr_time = time(NULL);
- list_iterate_items_gen(thread, &timeout_registry,
- timeout_list) {
+ list_iterate_items_gen(thread, &timeout_registry, timeout_list) {
if (thread->next_time < curr_time) {
thread->next_time = curr_time + thread->timeout;
pthread_kill(thread->thread, SIGALRM);
@@ -406,7 +441,8 @@
timeout.tv_sec = thread->next_time;
}
- pthread_cond_timedwait(&_timeout_cond, &_timeout_mutex, &timeout);
+ pthread_cond_timedwait(&_timeout_cond, &_timeout_mutex,
+ &timeout);
}
pthread_cleanup_pop(1);
@@ -452,7 +488,7 @@
}
static void no_intr_log(int level, const char *file, int line,
- const char *f, ...)
+ const char *f, ...)
{
va_list ap;
@@ -491,23 +527,22 @@
#define DM_WAIT_FATAL 2
/* Wait on a device until an event occurs. */
-static int event_wait(struct thread_status *thread)
+static int event_wait(struct thread_status *thread, struct dm_task **task)
{
sigset_t set;
int ret = DM_WAIT_RETRY;
-/*
- void *next = NULL;
- char *params, *target_type;
- uint64_t start, length;
-*/
struct dm_task *dmt;
struct dm_info info;
+ *task = 0;
+
if (!(dmt = dm_task_create(DM_DEVICE_WAITEVENT)))
return DM_WAIT_RETRY;
- if (!(ret = dm_task_set_name(dmt, dm_basename(thread->device_path))) ||
- !(ret = dm_task_set_event_nr(dmt, thread->event_nr)))
+ thread->current_task = dmt;
+
+ if (!dm_task_set_uuid(dmt, thread->device.uuid) ||
+ !dm_task_set_event_nr(dmt, thread->event_nr))
goto out;
/*
@@ -517,31 +552,21 @@
set = unblock_sigalrm();
dm_log_init(no_intr_log);
errno = 0;
- if ((ret = dm_task_run(dmt))) {
+ if (dm_task_run(dmt)) {
thread->current_events |= DM_EVENT_DEVICE_ERROR;
ret = DM_WAIT_INTR;
- /*
- * FIXME: I am setting processed_events to zero here
- * because it is causing problems. for example, the
- * mirror target emits a signal for INSYNC, then
- * subsequent events (device failures) are not handled
- */
- thread->processed_events = 0;
-
if ((ret = dm_task_get_info(dmt, &info)))
thread->event_nr = info.event_nr;
} else if (thread->events & DM_EVENT_TIMEOUT && errno == EINTR) {
thread->current_events |= DM_EVENT_TIMEOUT;
ret = DM_WAIT_INTR;
- thread->processed_events = 0;
} else {
- /* FIXME replace with log_* macro */
syslog(LOG_NOTICE, "dm_task_run failed, errno = %d, %s",
errno, strerror(errno));
if (errno == ENXIO) {
- /* FIXME replace with log_* macro */
- syslog(LOG_ERR, "%s disappeared, detaching", thread->device_path);
+ syslog(LOG_ERR, "%s disappeared, detaching",
+ thread->device.name);
ret = DM_WAIT_FATAL;
}
}
@@ -549,8 +574,12 @@
pthread_sigmask(SIG_SETMASK, &set, NULL);
dm_log_init(NULL);
- out:
- dm_task_destroy(dmt);
+ out:
+ if (ret == DM_WAIT_FATAL || ret == DM_WAIT_RETRY) {
+ dm_task_destroy(dmt);
+ thread->current_task = NULL;
+ } else
+ *task = dmt;
return ret;
}
@@ -558,20 +587,25 @@
/* Register a device with the DSO. */
static int do_register_device(struct thread_status *thread)
{
- return thread->dso_data->register_device(thread->device_path);
+ return thread->dso_data->register_device(thread->device.name,
+ thread->device.uuid,
+ thread->device.major,
+ thread->device.minor);
}
/* Unregister a device with the DSO. */
static int do_unregister_device(struct thread_status *thread)
{
- return thread->dso_data->unregister_device(thread->device_path);
+ return thread->dso_data->unregister_device(thread->device.name,
+ thread->device.uuid,
+ thread->device.major,
+ thread->device.minor);
}
/* Process an event in the DSO. */
-static void do_process_event(struct thread_status *thread)
+static void do_process_event(struct thread_status *thread, struct dm_task *task)
{
- thread->dso_data->process_event(thread->device_path,
- thread->current_events);
+ thread->dso_data->process_event(task, thread->current_events);
}
/* Thread cleanup handler to unregister device. */
@@ -581,7 +615,10 @@
if (!do_unregister_device(thread))
syslog(LOG_ERR, "%s: %s unregister failed\n", __func__,
- thread->device_path);
+ thread->device.name);
+ if (thread->current_task)
+ dm_task_destroy(thread->current_task);
+ thread->current_task = NULL;
}
/* Device monitoring thread. */
@@ -589,6 +626,7 @@
{
struct thread_status *thread = arg;
int wait_error = 0;
+ struct dm_task *task;
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
pthread_cleanup_push(monitor_unregister, thread);
@@ -602,25 +640,25 @@
while (1) {
thread->current_events = 0;
- wait_error = event_wait(thread);
+ wait_error = event_wait(thread, &task);
if (wait_error == DM_WAIT_RETRY)
continue;
- /* FIXME Give a DSO a chance to clean up. */
if (wait_error == DM_WAIT_FATAL)
break;
/*
+ * We know that wait succeeded and stored a
+ * pointer to dm_task with device status into task.
+ */
+
+ /*
* Check against filter.
*
* If there's current events delivered from event_wait() AND
* the device got registered for those events AND
* those events haven't been processed yet, call
* the DSO's process_event() handler.
- *
- * FIXME: when does processed_events get cleared? What if
- * the same type of event happens later... after the first
- * was handled properly?
*/
lock_mutex();
if (thread->status == DM_THREAD_SHUTDOWN) {
@@ -629,17 +667,21 @@
}
unlock_mutex();
- if (thread->events &
- thread->current_events &
- ~thread->processed_events) {
+ if (thread->events & thread->current_events) {
lock_mutex();
thread->processing = 1;
unlock_mutex();
- do_process_event(thread);
- thread->processed_events |= thread->current_events;
+
+ do_process_event(thread, task);
+ dm_task_destroy(task);
+ thread->current_task = NULL;
+
lock_mutex();
thread->processing = 0;
unlock_mutex();
+ } else {
+ dm_task_destroy(task);
+ thread->current_task = NULL;
}
}
@@ -647,12 +689,12 @@
thread->status = DM_THREAD_DONE;
unlock_mutex();
- pthread_cleanup_pop(0);
+ pthread_cleanup_pop(1);
+
return NULL;
}
/* Create a device monitoring thread. */
-/* FIXME: call this with mutex hold ? */
static int create_thread(struct thread_status *thread)
{
return pthread_create(&thread->thread, NULL, monitor_thread, thread);
@@ -691,11 +733,11 @@
lock_mutex();
list_iterate_items(dso_data, &_dso_registry)
- if (!strcmp(data->dso_name, dso_data->dso_name)) {
- lib_get(dso_data);
- ret = dso_data;
- break;
- }
+ if (!strcmp(data->dso_name, dso_data->dso_name)) {
+ lib_get(dso_data);
+ ret = dso_data;
+ break;
+ }
unlock_mutex();
@@ -714,12 +756,12 @@
static int lookup_symbols(void *dl, struct dso_data *data)
{
- return lookup_symbol(dl, data, (void*) &data->process_event,
+ return lookup_symbol(dl, data, (void *) &data->process_event,
"process_event") &&
- lookup_symbol(dl, data, (void*) &data->register_device,
- "register_device") &&
- lookup_symbol(dl, data, (void*) &data->unregister_device,
- "unregister_device");
+ lookup_symbol(dl, data, (void *) &data->register_device,
+ "register_device") &&
+ lookup_symbol(dl, data, (void *) &data->unregister_device,
+ "unregister_device");
}
/* Load an application specific DSO. */
@@ -728,13 +770,13 @@
void *dl;
struct dso_data *ret = NULL;
- if (!(dl = dlopen(data->dso_name, RTLD_NOW))){
+ if (!(dl = dlopen(data->dso_name, RTLD_NOW))) {
const char *dlerr = dlerror();
- syslog(LOG_ERR, "dmeventd %s dlopen failed: %s", data->dso_name, dlerr);
- char buf[1024]; /* FIXME */
- snprintf(buf, 1024, "%s dlopen failed: %s", data->dso_name, dlerr);
- data->msg->size = strlen(buf) + 1;
- data->msg->data = dm_strdup(buf);
+ syslog(LOG_ERR, "dmeventd %s dlopen failed: %s", data->dso_name,
+ dlerr);
+ data->msg->size =
+ dm_saprintf(&(data->msg->data), "%s dlopen failed: %s",
+ data->dso_name, dlerr);
return NULL;
}
@@ -763,7 +805,6 @@
return ret;
}
-
/* Return success on daemon active check. */
static int active(struct message_data *message_data)
{
@@ -782,16 +823,9 @@
struct thread_status *thread, *thread_new = NULL;
struct dso_data *dso_data;
- if (!device_exists(message_data->device_path)) {
- stack;
- ret = -ENODEV;
- goto out;
- }
-
if (!(dso_data = lookup_dso(message_data)) &&
!(dso_data = load_dso(message_data))) {
stack;
-/* FIXME */
#ifdef ELIBACC
ret = -ELIBACC;
#else
@@ -799,7 +833,7 @@
#endif
goto out;
}
-
+
/* Preallocate thread status struct to avoid deadlock. */
if (!(thread_new = alloc_thread_status(message_data, dso_data))) {
stack;
@@ -807,15 +841,17 @@
goto out;
}
+ if (!fill_device_data(thread_new)) {
+ stack;
+ ret = -ENODEV;
+ goto out;
+ }
+
lock_mutex();
if (!(thread = lookup_thread_status(message_data))) {
unlock_mutex();
- /*
- * FIXME: better do this asynchronously in the
- * monitoring thread ?
- */
if (!(ret = do_register_device(thread_new)))
goto out;
@@ -836,7 +872,7 @@
/* Or event # into events bitfield. */
thread->events |= message_data->events.field;
- unlock_mutex();
+ unlock_mutex();
/* FIXME - If you fail to register for timeout events, you
still monitor all the other events. Is this the right
@@ -847,7 +883,7 @@
if (thread->events & DM_EVENT_TIMEOUT)
ret = -register_for_timeout(thread);
- out:
+ out:
/*
* Deallocate thread status after releasing
* the lock in case we haven't used it.
@@ -894,7 +930,7 @@
}
unlock_mutex();
- out:
+ out:
return ret;
}
@@ -906,42 +942,40 @@
static int registered_device(struct message_data *message_data,
struct thread_status *thread)
{
- char test[1];
struct dm_event_daemon_message *msg = message_data->msg;
const char *fmt = "%s %s %u";
const char *dso = thread->dso_data->dso_name;
- const char *dev = thread->device_path;
- unsigned events = ((thread->status == DM_THREAD_RUNNING) && (thread->events)) ?
- thread->events : thread->events | DM_EVENT_REGISTRATION_PENDING;
+ const char *dev = thread->device.uuid;
+ unsigned events = ((thread->status == DM_THREAD_RUNNING)
+ && (thread->events)) ? thread->events : thread->
+ events | DM_EVENT_REGISTRATION_PENDING;
if (msg->data)
dm_free(msg->data);
- msg->size = snprintf(test, 1, fmt, dso, dev, events);
- msg->data = dm_malloc(msg->size);
- snprintf(msg->data, msg->size, fmt, dso, dev, events);
+ msg->size = dm_saprintf(&(msg->data), fmt, dso, dev, events);
unlock_mutex();
return 0;
}
-static int want_registered_device(char *dso_name, char *device_path,
+static int want_registered_device(char *dso_name, char *device_uuid,
struct thread_status *thread)
{
/* If DSO names and device paths are equal. */
- if (dso_name && device_path)
+ if (dso_name && device_uuid)
return !strcmp(dso_name, thread->dso_data->dso_name) &&
- !strcmp(device_path, thread->device_path);
+ !strcmp(device_uuid, thread->device.uuid);
/* If DSO names are equal. */
if (dso_name)
return !strcmp(dso_name, thread->dso_data->dso_name);
-
+
/* If device paths are equal. */
- if (device_path)
- return !strcmp(device_path, thread->device_path);
+ if (device_uuid)
+ return !strcmp(device_uuid, thread->device.uuid);
return 1;
}
@@ -955,10 +989,10 @@
/* Iterate list of threads checking if we want a particular one. */
list_iterate_items(thread, &_thread_registry)
- if ((hit = want_registered_device(message_data->dso_name,
- message_data->device_path,
- thread)))
- break;
+ if ((hit = want_registered_device(message_data->dso_name,
+ message_data->device_uuid,
+ thread)))
+ break;
/*
* If we got a registered device and want the next one ->
@@ -970,15 +1004,13 @@
do {
if (list_end(&_thread_registry, &thread->list))
goto out;
-
- thread = list_item(thread->list.n,
- struct thread_status);
- } while (!want_registered_device(message_data->dso_name,
- NULL, thread));
+
+ thread = list_item(thread->list.n, struct thread_status);
+ } while (!want_registered_device(message_data->dso_name, NULL, thread));
return registered_device(message_data, thread);
- out:
+ out:
unlock_mutex();
return -ENOENT;
@@ -1000,7 +1032,7 @@
lock_mutex();
if ((thread = lookup_thread_status(message_data)))
- thread->timeout = message_data->timeout.secs;
+ thread->timeout = message_data->timeout.secs;
unlock_mutex();
return thread ? 0 : -ENODEV;
@@ -1016,9 +1048,8 @@
lock_mutex();
if ((thread = lookup_thread_status(message_data))) {
- msg->data = dm_malloc(8*sizeof(uint32_t)); /* FIXME */
- msg->size = snprintf(msg->data, 8*sizeof(uint32_t),
- "%"PRIu32, thread->timeout);
+ msg->size =
+ dm_saprintf(&(msg->data), "%" PRIu32, thread->timeout);
} else {
msg->data = NULL;
msg->size = 0;
@@ -1027,7 +1058,6 @@
return thread ? 0 : -ENODEV;
}
-
/* Initialize a fifos structure with path names. */
static void init_fifos(struct dm_event_fifos *fifos)
@@ -1049,17 +1079,27 @@
return -errno;
}
- /* FIXME Warn/abort if perms are wrong - not something to fix silently. */
+ struct stat st;
+
+ /* Warn about wrong permissions if applicable */
+ if ((!stat(fifos->client_path, &st)) && (st.st_mode & 0777) != 0600)
+ syslog(LOG_WARNING, "Fixing wrong permissions on %s",
+ fifos->client_path);
+
+ if ((!stat(fifos->server_path, &st)) && (st.st_mode & 0777) != 0600)
+ syslog(LOG_WARNING, "Fixing wrong permissions on %s",
+ fifos->server_path);
+
/* If they were already there, make sure permissions are ok. */
if (chmod(fifos->client_path, 0600)) {
syslog(LOG_ERR, "Unable to set correct file permissions on %s",
- fifos->client_path);
+ fifos->client_path);
return -errno;
}
if (chmod(fifos->server_path, 0600)) {
syslog(LOG_ERR, "Unable to set correct file permissions on %s",
- fifos->server_path);
+ fifos->server_path);
return -errno;
}
@@ -1083,7 +1123,8 @@
* Read message from client making sure that data is available
* and a complete message is read. Must not block indefinitely.
*/
-static int client_read(struct dm_event_fifos *fifos, struct dm_event_daemon_message *msg)
+static int client_read(struct dm_event_fifos *fifos,
+ struct dm_event_daemon_message *msg)
{
struct timeval t;
unsigned bytes = 0;
@@ -1102,22 +1143,22 @@
FD_SET(fifos->client, &fds);
t.tv_sec = 1;
t.tv_usec = 0;
- ret = select(fifos->client+1, &fds, NULL, NULL, &t);
+ ret = select(fifos->client + 1, &fds, NULL, NULL, &t);
- if (!ret && !bytes) /* nothing to read */
+ if (!ret && !bytes) /* nothing to read */
return 0;
- if (!ret) /* trying to finish read */
+ if (!ret) /* trying to finish read */
continue;
- if (ret < 0) /* error */
+ if (ret < 0) /* error */
return 0;
ret = read(fifos->client, buf + bytes, size - bytes);
bytes += ret > 0 ? ret : 0;
- if (bytes == 2*sizeof(uint32_t) && header) {
- msg->cmd = ntohl(*((uint32_t *)buf));
- msg->size = ntohl(*((uint32_t *)buf + 1));
+ if (bytes == 2 * sizeof(uint32_t) && header) {
+ msg->cmd = ntohl(*((uint32_t *) buf));
+ msg->size = ntohl(*((uint32_t *) buf + 1));
buf = msg->data = dm_malloc(msg->size);
size = msg->size;
bytes = 0;
@@ -1129,6 +1170,7 @@
if (msg->data)
dm_free(msg->data);
msg->data = NULL;
+ msg->size = 0;
}
return bytes == size;
@@ -1137,18 +1179,20 @@
/*
* Write a message to the client making sure that it is ready to write.
*/
-static int client_write(struct dm_event_fifos *fifos, struct dm_event_daemon_message *msg)
+static int client_write(struct dm_event_fifos *fifos,
+ struct dm_event_daemon_message *msg)
{
unsigned bytes = 0;
int ret = 0;
fd_set fds;
- size_t size = 2*sizeof(uint32_t) + msg->size;
+ size_t size = 2 * sizeof(uint32_t) + msg->size;
char *buf = alloca(size);
*((uint32_t *)buf) = htonl(msg->cmd);
*((uint32_t *)buf + 1) = htonl(msg->size);
- memcpy(buf + 2*sizeof(uint32_t), msg->data, msg->size);
+ if (msg->data)
+ memcpy(buf + 2 * sizeof(uint32_t), msg->data, msg->size);
errno = 0;
while (bytes < size && errno != EIO) {
@@ -1156,7 +1200,8 @@
/* Watch client write FIFO to be ready for output. */
FD_ZERO(&fds);
FD_SET(fifos->server, &fds);
- } while (select(fifos->server +1, NULL, &fds, NULL, NULL) != 1);
+ } while (select(fifos->server + 1, NULL, &fds, NULL, NULL) !=
+ 1);
ret = write(fifos->server, buf + bytes, size - bytes);
bytes += ret > 0 ? ret : 0;
@@ -1176,15 +1221,16 @@
{
static struct {
unsigned int cmd;
- int (*f)(struct message_data*);
+ int (*f)(struct message_data *);
} requests[] = {
- { DM_EVENT_CMD_REGISTER_FOR_EVENT, register_for_event },
- { DM_EVENT_CMD_UNREGISTER_FOR_EVENT, unregister_for_event },
- { DM_EVENT_CMD_GET_REGISTERED_DEVICE, get_registered_device },
- { DM_EVENT_CMD_GET_NEXT_REGISTERED_DEVICE, get_next_registered_device },
- { DM_EVENT_CMD_SET_TIMEOUT, set_timeout },
- { DM_EVENT_CMD_GET_TIMEOUT, get_timeout },
- { DM_EVENT_CMD_ACTIVE, active },
+ { DM_EVENT_CMD_REGISTER_FOR_EVENT, register_for_event},
+ { DM_EVENT_CMD_UNREGISTER_FOR_EVENT, unregister_for_event},
+ { DM_EVENT_CMD_GET_REGISTERED_DEVICE, get_registered_device},
+ { DM_EVENT_CMD_GET_NEXT_REGISTERED_DEVICE,
+ get_next_registered_device},
+ { DM_EVENT_CMD_SET_TIMEOUT, set_timeout},
+ { DM_EVENT_CMD_GET_TIMEOUT, get_timeout},
+ { DM_EVENT_CMD_ACTIVE, active},
}, *req;
for (req = requests; req < requests + sizeof(requests); req++)
@@ -1203,8 +1249,7 @@
/* Parse the message. */
memset(&message_data, 0, sizeof(message_data));
message_data.msg = msg;
- if (msg->cmd != DM_EVENT_CMD_ACTIVE &&
- !parse_message(&message_data)) {
+ if (msg->cmd != DM_EVENT_CMD_ACTIVE && !parse_message(&message_data)) {
stack;
ret = -EINVAL;
} else
@@ -1220,15 +1265,11 @@
{
struct dm_event_daemon_message msg;
- /* FIXME: better error handling */
-
memset(&msg, 0, sizeof(msg));
/*
- * Read the request from the client.
- * Of course, it's tough to tell what to do when
- * we use fucking retarded return codes like
- * 0 for error.
+ * Read the request from the client (client_read, client_write
+ * give true on success and false on failure).
*/
if (!client_read(fifos, &msg))
return;
@@ -1236,7 +1277,12 @@
msg.cmd = do_process_request(&msg);
if (!msg.data) {
msg.data = dm_strdup(strerror(-msg.cmd));
- msg.size = strlen(msg.data) + 1;
+ if (msg.data)
+ msg.size = strlen(msg.data) + 1;
+ else {
+ msg.size = 0;
+ stack;
+ }
}
if (!client_write(fifos, &msg))
@@ -1256,7 +1302,7 @@
while ((l = list_first(&_thread_registry_unused))) {
thread = list_item(l, struct thread_status);
if (thread->processing) {
- goto out; /* cleanup on the next round */
+ goto out; /* cleanup on the next round */
}
if (thread->status == DM_THREAD_RUNNING) {
@@ -1270,14 +1316,16 @@
if (ret == ESRCH) {
thread->status = DM_THREAD_DONE;
} else if (ret) {
- syslog(LOG_ERR, "Unable to terminate thread: %s\n",
+ syslog(LOG_ERR,
+ "Unable to terminate thread: %s\n",
strerror(-ret));
stack;
}
goto out;
} else {
list_del(l);
- syslog(LOG_ERR, "thread can't be on unused list unless !thread->events");
+ syslog(LOG_ERR,
+ "thread can't be on unused list unless !thread->events");
thread->status = DM_THREAD_RUNNING;
LINK_THREAD(thread);
}
@@ -1288,7 +1336,7 @@
free_thread_status(thread);
}
}
-out:
+ out:
unlock_mutex();
}
@@ -1302,7 +1350,7 @@
{
sigset_t my_sigset;
struct sigaction act;
-
+
memset(&act, 0, sizeof(act));
act.sa_handler = sig_alarm;
sigaction(SIGALRM, &act, NULL);
@@ -1344,7 +1392,7 @@
static int lock_pidfile(void)
{
int lf;
- char pidfile[] = "/var/run/dmeventd.pid"; /* FIXME Must be configurable at compile-time! */
+ char pidfile[] = DMEVENTD_PIDFILE;
if ((lf = open(pidfile, O_CREAT | O_RDWR, 0644)) < 0)
exit(EXIT_OPEN_PID_FAILURE);
@@ -1383,11 +1431,11 @@
/* Wait for response from child */
while (!waitpid(pid, &status, WNOHANG) && !_exit_now) {
tval.tv_sec = 0;
- tval.tv_usec = 250000; /* .25 sec */
+ tval.tv_usec = 250000; /* .25 sec */
select(0, NULL, NULL, NULL, &tval);
}
- if (_exit_now) /* Child has signaled it is ok - we can exit now */
+ if (_exit_now) /* Child has signaled it is ok - we can exit now */
exit(EXIT_SUCCESS);
/* Problem with child. Determine what it is by exit code */
@@ -1408,7 +1456,7 @@
break;
}
- exit(EXIT_FAILURE); /* Redundant */
+ exit(EXIT_FAILURE); /* Redundant */
}
setsid();
@@ -1416,7 +1464,7 @@
exit(EXIT_CHDIR_FAILURE);
if (getrlimit(RLIMIT_NOFILE, &rlim) < 0)
- fd = 256; /* just have to guess */
+ fd = 256; /* just have to guess */
else
fd = rlim.rlim_cur;
@@ -1430,7 +1478,7 @@
openlog("dmeventd", LOG_PID, LOG_DAEMON);
- lock_pidfile(); /* exits if failure */
+ lock_pidfile(); /* exits if failure */
/* Set the rest of the signals to cause '_exit_now' to be set */
signal(SIGINT, &exit_handler);
@@ -1472,7 +1520,8 @@
while (!_exit_now) {
process_request(&fifos);
cleanup_unused_threads();
- if (!list_empty(&_thread_registry) || !list_empty(&_thread_registry_unused))
+ if (!list_empty(&_thread_registry)
+ || !list_empty(&_thread_registry_unused))
_thread_registries_empty = 0;
else
_thread_registries_empty = 1;
--- device-mapper/dmeventd/libdevmapper-event.c 2007/01/08 15:18:52 1.10
+++ device-mapper/dmeventd/libdevmapper-event.c 2007/01/11 21:54:52 1.11
@@ -28,45 +28,112 @@
#include <sys/stat.h>
#include <unistd.h>
#include <sys/wait.h>
-#include <arpa/inet.h> /* for htonl, ntohl */
+#include <arpa/inet.h> /* for htonl, ntohl */
-/* Set by any of the external fxns the first time one of them is called */
-/* FIXME Unused */
-// static int _logging = 0;
+struct dm_event_handler {
+ const char *dso;
+ const char *device;
+ const char *uuid;
+ int major;
+ int minor;
+ enum dm_event_type events;
+};
-/* Fetch a string off src and duplicate it into *dest. */
-/* FIXME: move to seperate module to share with the daemon. */
-static const char delimiter = ' ';
-static char *fetch_string(char **src)
+static void dm_event_handler_clear_device(struct dm_event_handler *h)
{
- char *p, *ret;
+ h->device = h->uuid = NULL;
+ h->major = h->minor = 0;
+}
- if ((p = strchr(*src, delimiter)))
- *p = 0;
+struct dm_event_handler *dm_event_handler_create(void)
+{
+ struct dm_event_handler *ret = 0;
- if ((ret = dm_strdup(*src)))
- *src += strlen(ret) + 1;
+ if (!(ret = dm_malloc(sizeof(*ret))))
+ return NULL;
- if (p)
- *p = delimiter;
+ ret->dso = ret->device = ret->uuid = NULL;
+ ret->major = ret->minor = 0;
+ ret->events = 0;
return ret;
}
-/* Parse a device message from the daemon. */
-static int parse_message(struct dm_event_daemon_message *msg, char **dso_name,
- char **device, enum dm_event_type *events)
+void dm_event_handler_destroy(struct dm_event_handler *h)
{
- char *p = msg->data;
+ dm_free(h);
+}
- if ((*dso_name = fetch_string(&p)) &&
- (*device = fetch_string(&p))) {
- *events = atoi(p);
+void dm_event_handler_set_dso(struct dm_event_handler *h, const char *path)
+{
+ h->dso = path;
+}
- return 0;
- }
+void dm_event_handler_set_name(struct dm_event_handler *h, const char *name)
+{
+ dm_event_handler_clear_device(h);
+ h->device = name;
+}
- return -ENOMEM;
+void dm_event_handler_set_uuid(struct dm_event_handler *h, const char *uuid)
+{
+ dm_event_handler_clear_device(h);
+ h->uuid = uuid;
+}
+
+void dm_event_handler_set_major(struct dm_event_handler *h, int major)
+{
+ int minor = h->minor;
+
+ dm_event_handler_clear_device(h);
+ h->major = major;
+ h->minor = minor;
+}
+
+void dm_event_handler_set_minor(struct dm_event_handler *h, int minor)
+{
+ int major = h->major;
+
+ dm_event_handler_clear_device(h);
+
+ h->major = major;
+ h->minor = minor;
+}
+
+void dm_event_handler_set_events(struct dm_event_handler *h,
+ enum dm_event_type event)
+{
+ h->events = event;
+}
+
+const char *dm_event_handler_get_dso(const struct dm_event_handler *h)
+{
+ return h->dso;
+}
+
+const char *dm_event_handler_get_name(const struct dm_event_handler *h)
+{
+ return h->device;
+}
+
+const char *dm_event_handler_get_uuid(const struct dm_event_handler *h)
+{
+ return h->uuid;
+}
+
+int dm_event_handler_get_major(const struct dm_event_handler *h)
+{
+ return h->major;
+}
+
+int dm_event_handler_get_minor(const struct dm_event_handler *h)
+{
+ return h->minor;
+}
+
+enum dm_event_type dm_event_handler_get_events(const struct dm_event_handler *h)
+{
+ return h->events;
}
/*
@@ -78,13 +145,14 @@
*
* Returns: 0 on failure, 1 on success
*/
-static int daemon_read(struct dm_event_fifos *fifos, struct dm_event_daemon_message *msg)
+static int daemon_read(struct dm_event_fifos *fifos,
+ struct dm_event_daemon_message *msg)
{
unsigned bytes = 0;
int ret, i;
fd_set fds;
- struct timeval tval = {0, 0};
- size_t size = 2 * sizeof(uint32_t); // status + size
+ struct timeval tval = { 0, 0 };
+ size_t size = 2 * sizeof(uint32_t); /* status + size */
char *buf = alloca(size);
int header = 1;
@@ -94,7 +162,8 @@
FD_ZERO(&fds);
FD_SET(fifos->server, &fds);
tval.tv_sec = 1;
- ret = select(fifos->server+1, &fds, NULL, NULL, &tval);
+ ret = select(fifos->server + 1, &fds, NULL, NULL,
+ &tval);
if (ret < 0 && errno != EINTR) {
log_error("Unable to read from event server");
return 0;
@@ -116,7 +185,7 @@
}
bytes += ret;
- if (bytes == 2*sizeof(uint32_t) && header) {
+ if (bytes == 2 * sizeof(uint32_t) && header) {
msg->cmd = ntohl(*((uint32_t *)buf));
msg->size = ntohl(*((uint32_t *)buf + 1));
buf = msg->data = dm_malloc(msg->size);
@@ -136,32 +205,34 @@
}
/* Write message to daemon. */
-static int daemon_write(struct dm_event_fifos *fifos, struct dm_event_daemon_message *msg)
+static int daemon_write(struct dm_event_fifos *fifos,
+ struct dm_event_daemon_message *msg)
{
unsigned bytes = 0;
int ret = 0;
fd_set fds;
- size_t size = 2*sizeof(uint32_t) + msg->size;
+ size_t size = 2 * sizeof(uint32_t) + msg->size;
char *buf = alloca(size);
*((uint32_t *)buf) = htonl(msg->cmd);
*((uint32_t *)buf + 1) = htonl(msg->size);
- memcpy(buf + 2*sizeof(uint32_t), msg->data, msg->size);
+ memcpy(buf + 2 * sizeof(uint32_t), msg->data, msg->size);
while (bytes < size) {
do {
/* Watch daemon write FIFO to be ready for output. */
FD_ZERO(&fds);
FD_SET(fifos->client, &fds);
- ret = select(fifos->client +1, NULL, &fds, NULL, NULL);
+ ret = select(fifos->client + 1, NULL, &fds, NULL, NULL);
if ((ret < 0) && (errno != EINTR)) {
log_error("Unable to talk to event daemon");
return 0;
}
} while (ret < 1);
- ret = write(fifos->client, ((char *) buf) + bytes, size - bytes);
+ ret = write(fifos->client, ((char *) buf) + bytes,
+ size - bytes);
if (ret < 0) {
if ((errno == EINTR) || (errno == EAGAIN))
continue;
@@ -177,14 +248,14 @@
return bytes == size;
}
-static int daemon_talk(struct dm_event_fifos *fifos, struct dm_event_daemon_message *msg,
- int cmd, const char *dso_name, const char *device,
+static int daemon_talk(struct dm_event_fifos *fifos,
+ struct dm_event_daemon_message *msg, int cmd,
+ const char *dso_name, const char *device,
enum dm_event_type events, uint32_t timeout)
{
- char test[1];
const char *dso = dso_name ? dso_name : "";
const char *dev = device ? device : "";
- const char *fmt = "%s %s %u %"PRIu32;
+ const char *fmt = "%s %s %u %" PRIu32;
memset(msg, 0, sizeof(*msg));
/*
@@ -192,10 +263,7 @@
* into ASCII message string.
*/
msg->cmd = cmd;
- /* FIXME depends on glibc 2.1+ */
- msg->size = snprintf(test, 1, fmt, dso, dev, events, timeout);
- msg->data = alloca(msg->size);
- snprintf(msg->data, msg->size, fmt, dso, dev, events, timeout);
+ msg->size = dm_saprintf(&(msg->data), fmt, dso, dev, events, timeout);
/*
* Write command and message to and
@@ -256,7 +324,7 @@
return 0;
}
-start_server:
+ start_server:
/* server is not running */
pid = fork();
@@ -264,11 +332,13 @@
log_error("Unable to fork.");
else if (!pid) {
- execvp("dmeventd", NULL); /* security risk if admin has bad PATH */
+ /* FIXME configure path (cf. lvm2 modprobe) */
+ execvp("dmeventd", NULL);
exit(EXIT_FAILURE);
} else {
if (waitpid(pid, &status, 0) < 0)
- log_error("Unable to start dmeventd: %s", strerror(errno));
+ log_error("Unable to start dmeventd: %s",
+ strerror(errno));
else if (WEXITSTATUS(status))
log_error("Unable to start dmeventd.");
else
@@ -281,8 +351,8 @@
/* Initialize client. */
static int init_client(struct dm_event_fifos *fifos)
{
- /* FIXME Is fifo the most suitable method? */
- /* FIXME Why not share comms/daemon code with something else e.g. multipath? */
+ /* FIXME? Is fifo the most suitable method? Why not share
+ comms/daemon code with something else e.g. multipath? */
/* init fifos */
memset(fifos, 0, sizeof(*fifos));
@@ -297,20 +367,19 @@
/* Open the fifo used to read from the daemon. */
if ((fifos->server = open(fifos->server_path, O_RDWR)) < 0) {
log_error("%s: open server fifo %s",
- __func__, fifos->server_path);
+ __func__, fifos->server_path);
stack;
return 0;
}
/* Lock out anyone else trying to do communication with the daemon. */
- if (flock(fifos->server, LOCK_EX) < 0){
+ if (flock(fifos->server, LOCK_EX) < 0) {
log_error("%s: flock %s", __func__, fifos->server_path);
close(fifos->server);
return 0;
}
-/* if ((fifos->client = open(fifos->client_path,
- O_WRONLY | O_NONBLOCK)) < 0) {*/
+/* if ((fifos->client = open(fifos->client_path, O_WRONLY | O_NONBLOCK)) < 0) {*/
if ((fifos->client = open(fifos->client_path, O_RDWR | O_NONBLOCK)) < 0) {
log_error("%s: Can't open client fifo %s: %s",
__func__, fifos->client_path, strerror(errno));
@@ -318,7 +387,7 @@
stack;
return 0;
}
-
+
return 1;
}
@@ -331,65 +400,72 @@
close(fifos->server);
}
-/* Check, if a block device exists. */
-static int device_exists(const char *device)
+/* Get uuid of a device, if it exists (otherwise NULL). */
+static struct dm_task *get_device_info(const struct dm_event_handler *h)
{
- struct stat st_buf;
- char path2[PATH_MAX];
+ struct dm_task *dmt = dm_task_create(DM_DEVICE_INFO);
+ struct dm_task *ret;
- if (!device)
- return 0;
-
- if (device[0] == '/') /* absolute path */
- return !stat(device, &st_buf) && S_ISBLK(st_buf.st_mode);
+ if (!dmt)
+ return NULL;
- if (PATH_MAX <= snprintf(path2, PATH_MAX, "%s/%s", dm_dir(), device))
- return 0;
+ if (h->uuid)
+ dm_task_set_uuid(dmt, h->uuid);
+ else if (h->device)
+ dm_task_set_name(dmt, h->device);
+ else if (h->major && h->minor) {
+ dm_task_set_major(dmt, h->major);
+ dm_task_set_minor(dmt, h->minor);
+ }
+
+ if (!dm_task_run(dmt))
+ ret = NULL;
+ else
+ ret = dmt;
- return !stat(path2, &st_buf) && S_ISBLK(st_buf.st_mode);
+ return ret;
}
/* Handle the event (de)registration call and return negative error codes. */
static int do_event(int cmd, struct dm_event_daemon_message *msg,
- const char *dso_name, const char *device, enum dm_event_type events,
- uint32_t timeout)
+ const char *dso_name, const char *device,
+ enum dm_event_type events, uint32_t timeout)
{
int ret;
struct dm_event_fifos fifos;
- /* FIXME Start the daemon here if it's not running e.g. exclusive lock file */
- /* FIXME Move this to separate 'dm_event_register_handler' - if no daemon here, fail */
if (!init_client(&fifos)) {
stack;
return -ESRCH;
}
- /* FIXME Use separate 'dm_event_register_handler' function to pass in dso? */
ret = daemon_talk(&fifos, msg, cmd, dso_name, device, events, timeout);
/* what is the opposite of init? */
dtr_client(&fifos);
-
+
return ret;
}
-/* FIXME remove dso_name - use handle instead */
-/* FIXME Use uuid not path! */
/* External library interface. */
-int dm_event_register(const char *dso_name, const char *device_path,
- enum dm_event_type events)
+int dm_event_register(const struct dm_event_handler *h)
{
int ret, err;
+ const char *uuid;
+ struct dm_task *dmt;
struct dm_event_daemon_message msg;
- if (!device_exists(device_path)) {
- log_error("%s: device not found", device_path);
+ if (!(dmt = get_device_info(h))) {
+ log_error("%s: device not found", h->device);
return 0;
}
+ uuid = dm_task_get_uuid(dmt);
+
if ((err = do_event(DM_EVENT_CMD_REGISTER_FOR_EVENT, &msg,
- dso_name, device_path, events, 0)) < 0) {
- log_error("%s: event registration failed: %s", device_path,
+ h->dso, uuid, h->events, 0)) < 0) {
+ log_error("%s: event registration failed: %s",
+ dm_task_get_name(dmt),
msg.data ? msg.data : strerror(-err));
ret = 0;
} else
@@ -398,23 +474,29 @@
if (msg.data)
dm_free(msg.data);
+ dm_task_destroy(dmt);
+
return ret;
}
-int dm_event_unregister(const char *dso_name, const char *device_path,
- enum dm_event_type events)
+int dm_event_unregister(const struct dm_event_handler *h)
{
int ret, err;
+ const char *uuid;
+ struct dm_task *dmt;
struct dm_event_daemon_message msg;
- if (!device_exists(device_path)) {
- log_error("%s: device not found", device_path);
+ if (!(dmt = get_device_info(h))) {
+ log_error("%s: device not found", dm_task_get_name(dmt));
return 0;
}
+ uuid = dm_task_get_uuid(dmt);
+
if ((err = do_event(DM_EVENT_CMD_UNREGISTER_FOR_EVENT, &msg,
- dso_name, device_path, events, 0)) < 0) {
- log_error("%s: event deregistration failed: %s", device_path,
+ h->dso, uuid, h->events, 0)) < 0) {
+ log_error("%s: event deregistration failed: %s",
+ dm_task_get_name(dmt),
msg.data ? msg.data : strerror(-err));
ret = 0;
} else
@@ -422,9 +504,48 @@
if (msg.data)
dm_free(msg.data);
+
+ dm_task_destroy(dmt);
+
return ret;
}
+#if 0 /* left out for now */
+
+/* Fetch a string off src and duplicate it into *dest. */
+/* FIXME: move to seperate module to share with the daemon. */
+static const char delimiter = ' ';
+static char *fetch_string(char **src)
+{
+ char *p, *ret;
+
+ if ((p = strchr(*src, delimiter)))
+ *p = 0;
+
+ if ((ret = dm_strdup(*src)))
+ *src += strlen(ret) + 1;
+
+ if (p)
+ *p = delimiter;
+
+ return ret;
+}
+
+/* Parse a device message from the daemon. */
+static int parse_message(struct dm_event_daemon_message *msg, char **dso_name,
+ char **device, enum dm_event_type *events)
+{
+ char *p = msg->data;
+
+ if ((*dso_name = fetch_string(&p)) && (*device = fetch_string(&p))) {
+ *events = atoi(p);
+
+ return 0;
+ }
+
+ return -ENOMEM;
+}
+
/*
* dm_event_get_registered_device
* @dso_name
@@ -437,18 +558,18 @@
* Returns: 1 if device found, 0 otherwise (even on error)
*/
int dm_event_get_registered_device(char **dso_name, char **device_path,
- enum dm_event_type *events, int next)
+ enum dm_event_type *events, int next)
{
int ret;
char *dso_name_arg = NULL, *device_path_arg = NULL;
struct dm_event_daemon_message msg;
if (!(ret = do_event(next ? DM_EVENT_CMD_GET_NEXT_REGISTERED_DEVICE :
- DM_EVENT_CMD_GET_REGISTERED_DEVICE,
+ DM_EVENT_CMD_GET_REGISTERED_DEVICE,
&msg, *dso_name, *device_path, *events, 0))) {
ret = !parse_message(&msg, &dso_name_arg, &device_path_arg,
events);
- } else /* FIXME: Make sure this is ENOENT */
+ } else /* FIXME: Make sure this is ENOENT */
ret = 0;
if (msg.data)
@@ -488,9 +609,11 @@
if (!device_exists(device_path))
return -ENODEV;
- if (!(ret = do_event(DM_EVENT_CMD_GET_TIMEOUT, &msg, NULL, device_path, 0, 0)))
+ if (!(ret = do_event(DM_EVENT_CMD_GET_TIMEOUT, &msg, NULL, device_path,
+ 0, 0)))
*timeout = atoi(msg.data);
if (msg.data)
dm_free(msg.data);
return ret;
}
+#endif
--- device-mapper/dmeventd/libdevmapper-event.h 2007/01/08 15:18:52 1.4
+++ device-mapper/dmeventd/libdevmapper-event.h 2007/01/11 21:54:52 1.5
@@ -24,50 +24,70 @@
#include <stdint.h>
/* Event type definitions. */
-/* FIXME Use masks to separate the types and provide for extension. */
enum dm_event_type {
- DM_EVENT_SINGLE = 0x01, /* Report multiple errors just once. */
- DM_EVENT_MULTI = 0x02, /* Report all of them. */
+ DM_EVENT_SETTINGS_MASK = 0x0000FF,
+ DM_EVENT_SINGLE = 0x000001, /* Report multiple errors just once. */
+ DM_EVENT_MULTI = 0x000002, /* Report all of them. */
+
+ DM_EVENT_ERROR_MASK = 0x00FF00,
+ DM_EVENT_SECTOR_ERROR = 0x000100, /* Failure on a particular sector. */
+ DM_EVENT_DEVICE_ERROR = 0x000200, /* Device failure. */
+ DM_EVENT_PATH_ERROR = 0x000400, /* Failure on an io path. */
+ DM_EVENT_ADAPTOR_ERROR = 0x000800, /* Failure off a host adaptor. */
+
+ DM_EVENT_STATUS_MASK = 0xFF0000,
+ DM_EVENT_SYNC_STATUS = 0x010000, /* Mirror synchronization completed/failed. */
+ DM_EVENT_TIMEOUT = 0x020000, /* Timeout has occured */
- DM_EVENT_SECTOR_ERROR = 0x04, /* Failure on a particular sector. */
- DM_EVENT_DEVICE_ERROR = 0x08, /* Device failure. */
- DM_EVENT_PATH_ERROR = 0x10, /* Failure on an io path. */
- DM_EVENT_ADAPTOR_ERROR = 0x20, /* Failure off a host adaptor. */
-
- DM_EVENT_SYNC_STATUS = 0x40, /* Mirror synchronization completed/failed. */
- DM_EVENT_TIMEOUT = 0x80, /* Timeout has occured */
- DM_EVENT_REGISTRATION_PENDING = 0X100, /* Monitor thread is setting-up/shutting-down */
+ DM_EVENT_REGISTRATION_PENDING = 0x1000000, /* Monitor thread is setting-up/shutting-down */
};
-/* FIXME Use a mask. */
-#define DM_EVENT_ALL_ERRORS (DM_EVENT_SECTOR_ERROR | DM_EVENT_DEVICE_ERROR | \
- DM_EVENT_PATH_ERROR | DM_EVENT_ADAPTOR_ERROR)
+#define DM_EVENT_ALL_ERRORS DM_EVENT_ERROR_MASK
/* Prototypes for event lib interface. */
-/* FIXME Replace device with standard name/uuid/devno choice */
-/* Interface changes:
- First register a handler, passing in a unique ref for the device. */
-
-// int dm_event_register_handler(const char *dso_name, const char *device);
-// int dm_event_register(const char *dso_name, const char *name, const char *uuid, uint32_t major, uint32_t minor, enum dm_event_type events);
-
-/* Or (better?) add to task structure and use existing functions - run
- a task to register/unregister events - we may need to run task
- withe that with the new event mechanism anyway, then the dso calls
- just hook in. */
-
-int dm_event_register(const char *dso_name, const char *device, enum dm_event_type events);
-int dm_event_unregister(const char *dso_name, const char *device,
- enum dm_event_type events);
-int dm_event_get_registered_device(char **dso_name, char **device,
- enum dm_event_type *events, int next);
-int dm_event_set_timeout(const char *device, uint32_t timeout);
-int dm_event_get_timeout(const char *device, uint32_t *timeout);
-
-/* Prototypes for DSO interface. */
-void process_event(const char *device, enum dm_event_type event);
-int register_device(const char *device);
-int unregister_device(const char *device);
+struct dm_event_handler;
+
+/* Create and destroy dm_event_handler struct, which is passed to
+ register/unregister functions below */
+struct dm_event_handler *dm_event_handler_create(void);
+void dm_event_handler_destroy(struct dm_event_handler *h);
+
+/* Set parameters of a handler:
+ - dso - shared library path to handle the events
+ (only one of the following three needs to be set)
+ - name - device name or path
+ - uuid - device uuid
+ - major and minor - device major/minor numbers
+ - events - a bitfield defining which events to handle (see
+ enum dm_event_type above)
+*/
+void dm_event_handler_set_dso(struct dm_event_handler *h, const char *path);
+void dm_event_handler_set_name(struct dm_event_handler *h, const char *name);
+void dm_event_handler_set_uuid(struct dm_event_handler *h, const char *uuid);
+void dm_event_handler_set_major(struct dm_event_handler *h, int major);
+void dm_event_handler_set_minor(struct dm_event_handler *h, int minor);
+void dm_event_handler_set_events(struct dm_event_handler *h,
+ enum dm_event_type event);
+
+/* Get parameters of a handler, same as above */
+const char *dm_event_handler_get_dso(const struct dm_event_handler *h);
+const char *dm_event_handler_get_name(const struct dm_event_handler *h);
+const char *dm_event_handler_get_uuid(const struct dm_event_handler *h);
+int dm_event_handler_get_major(const struct dm_event_handler *h);
+int dm_event_handler_get_minor(const struct dm_event_handler *h);
+enum dm_event_type dm_event_handler_get_events(const struct dm_event_handler *h);
+
+/* Call out to dmeventd to register or unregister a handler. If
+ dmeventd is not running, it is spawned first. */
+int dm_event_register(const struct dm_event_handler *h);
+int dm_event_unregister(const struct dm_event_handler *h);
+
+/* Prototypes for DSO interface, see dmeventd.c, struct dso_data for
+ detailed descriptions. */
+void process_event(struct dm_task *dmt, enum dm_event_type event);
+int register_device(const char *device, const char *uuid, int major, int minor);
+int unregister_device(const char *device, const char *uuid, int major,
+ int minor);
#endif
--- device-mapper/include/configure.h.in 2006/10/12 15:42:24 1.2
+++ device-mapper/include/configure.h.in 2007/01/11 21:54:52 1.3
@@ -3,6 +3,9 @@
/* Define to 1 if the `closedir' function returns void instead of `int'. */
#undef CLOSEDIR_VOID
+/* Path to dmeventd pidfile. */
+#undef DMEVENTD_PIDFILE
+
/* Define to 1 if canonicalize_file_name is available. */
#undef HAVE_CANONICALIZE_FILE_NAME
@@ -168,11 +171,9 @@
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+ if it is not supported. */
#undef inline
-#endif
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc
--- device-mapper/lib/.exported_symbols 2007/01/09 19:44:07 1.25
+++ device-mapper/lib/.exported_symbols 2007/01/11 21:54:53 1.26
@@ -115,3 +115,4 @@
dm_split_words
dm_snprintf
dm_basename
+dm_saprintf
--- device-mapper/lib/libdevmapper.h 2007/01/09 19:44:07 1.61
+++ device-mapper/lib/libdevmapper.h 2007/01/11 21:54:53 1.62
@@ -623,4 +623,10 @@
*/
char *dm_basename(const char *path);
+/*
+ * Returns size of a buffer which is allocated with dm_malloc.
+ * Pointer to the buffer is stored in *buf.
+ */
+int dm_saprintf(char **buf, const char *format, ...);
+
#endif /* LIB_DEVICE_MAPPER_H */
--- device-mapper/lib/libdm-string.c 2007/01/08 15:35:08 1.4
+++ device-mapper/lib/libdm-string.c 2007/01/11 21:54:53 1.5
@@ -129,3 +129,33 @@
return p ? p + 1 : (char *) path;
}
+int dm_saprintf(char **result, const char *format, ...)
+{
+ int n, ok = 0, size = 32;
+ va_list ap;
+ char *buf = dm_malloc(size);
+
+ *result = 0;
+
+ if (!buf)
+ return -1;
+
+ while (!ok) {
+ va_start(ap, format);
+ n = vsnprintf(buf, size, format, ap);
+ if (0 <= n && n < size)
+ ok = 1;
+ else {
+ dm_free(buf);
+ size *= 2;
+ buf = dm_malloc(size);
+ if (!buf)
+ return -1;
+ };
+ va_end(ap);
+ }
+
+ *result = dm_strdup(buf);
+ dm_free(buf);
+ return n + 1;
+}
^ permalink raw reply [flat|nested] 5+ messages in thread* device-mapper ./WHATS_NEW ./configure ./config ...
@ 2007-01-19 15:53 agk
0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2007-01-19 15:53 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: device-mapper
Changes by: agk@sourceware.org 2007-01-19 15:53:01
Modified files:
. : WHATS_NEW configure configure.in
include : configure.h.in
Added files:
lib : libdm-common.h
Removed files:
lib : libdm-common.h.in
Log message:
Add DM_LIB_VERSION definition to configure.h.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.153&r2=1.154
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/configure.diff?cvsroot=dm&r1=1.40&r2=1.41
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/configure.in.diff?cvsroot=dm&r1=1.42&r2=1.43
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/include/configure.h.in.diff?cvsroot=dm&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdm-common.h.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdm-common.h.in.diff?cvsroot=dm&r1=1.13&r2=NONE
--- device-mapper/WHATS_NEW 2007/01/18 22:15:04 1.153
+++ device-mapper/WHATS_NEW 2007/01/19 15:53:00 1.154
@@ -1,5 +1,6 @@
Version 1.02.16 -
===================================
+ Add DM_LIB_VERSION definition to configure.h.
Suppress 'Unrecognised field' error if report field is 'help'.
Add --separator and --sort to dmsetup (unused).
Make alignment flag optional when specifying report fields.
--- device-mapper/configure 2007/01/15 19:06:59 1.40
+++ device-mapper/configure 2007/01/19 15:53:00 1.41
@@ -6038,6 +6038,11 @@
fi
+cat >>confdefs.h <<_ACEOF
+#define DM_LIB_VERSION $DM_LIB_VERSION
+_ACEOF
+
+
################################################################################
@@ -6115,7 +6120,7 @@
################################################################################
- ac_config_files="$ac_config_files Makefile make.tmpl include/Makefile dmsetup/Makefile lib/Makefile lib/libdevmapper.pc lib/libdm-common.h dmeventd/Makefile dmeventd/libdevmapper-event.pc kernel/Makefile man/Makefile po/Makefile"
+ ac_config_files="$ac_config_files Makefile make.tmpl include/Makefile dmsetup/Makefile lib/Makefile lib/libdevmapper.pc dmeventd/Makefile dmeventd/libdevmapper-event.pc kernel/Makefile man/Makefile po/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -6647,7 +6652,6 @@
"dmsetup/Makefile" ) CONFIG_FILES="$CONFIG_FILES dmsetup/Makefile" ;;
"lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
"lib/libdevmapper.pc" ) CONFIG_FILES="$CONFIG_FILES lib/libdevmapper.pc" ;;
- "lib/libdm-common.h" ) CONFIG_FILES="$CONFIG_FILES lib/libdm-common.h" ;;
"dmeventd/Makefile" ) CONFIG_FILES="$CONFIG_FILES dmeventd/Makefile" ;;
"dmeventd/libdevmapper-event.pc" ) CONFIG_FILES="$CONFIG_FILES dmeventd/libdevmapper-event.pc" ;;
"kernel/Makefile" ) CONFIG_FILES="$CONFIG_FILES kernel/Makefile" ;;
--- device-mapper/configure.in 2007/01/15 19:06:59 1.42
+++ device-mapper/configure.in 2007/01/19 15:53:01 1.43
@@ -357,6 +357,7 @@
DM_LIB_VERSION="Unknown version ($interface)"
fi
+AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version])
################################################################################
dnl -- dmeventd pidfile and executable path
@@ -423,7 +424,6 @@
dmsetup/Makefile \
lib/Makefile \
lib/libdevmapper.pc \
-lib/libdm-common.h \
dmeventd/Makefile \
dmeventd/libdevmapper-event.pc \
kernel/Makefile \
--- device-mapper/include/configure.h.in 2007/01/15 19:06:59 1.4
+++ device-mapper/include/configure.h.in 2007/01/19 15:53:01 1.5
@@ -9,6 +9,9 @@
/* Path to dmeventd pidfile. */
#undef DMEVENTD_PIDFILE
+/* Library version */
+#undef DM_LIB_VERSION
+
/* Define to 1 if canonicalize_file_name is available. */
#undef HAVE_CANONICALIZE_FILE_NAME
@@ -174,11 +177,9 @@
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+ if it is not supported. */
#undef inline
-#endif
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc
--- device-mapper/lib/libdm-common.h 2002/01/17 14:13:25 1.2
+++ device-mapper/lib/libdm-common.h 2007/01/19 15:53:01 1.3
@@ -1,16 +1,31 @@
/*
- * Copyright (C) 2001 Sistina Software (UK) Limited.
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
+ * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
*
- * This file is released under the LGPL.
+ * This file is part of the device-mapper userspace tools.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-extern dm_log_fn _log;
-#define log(msg, x...) _log(1, __FILE__, __LINE__, msg, ## x)
+#ifndef LIB_DMCOMMON_H
+#define LIB_DMCOMMON_H
+
+#include "libdevmapper.h"
-extern struct target *create_target(uint64_t start,
- uint64_t len,
- const char *type, const char *params);
+struct target *create_target(uint64_t start,
+ uint64_t len,
+ const char *type, const char *params);
-int add_dev_node(const char *dev_name, dev_t dev);
+int add_dev_node(const char *dev_name, uint32_t minor, uint32_t major,
+ uid_t uid, gid_t gid, mode_t mode);
int rm_dev_node(const char *dev_name);
+int rename_dev_node(const char *old_name, const char *new_name);
+void update_devs(void);
+#endif
^ permalink raw reply [flat|nested] 5+ messages in thread
* device-mapper ./WHATS_NEW ./configure ./config ...
@ 2007-08-21 20:32 meyering
0 siblings, 0 replies; 5+ messages in thread
From: meyering @ 2007-08-21 20:32 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: device-mapper
Changes by: meyering@sourceware.org 2007-08-21 20:32:30
Modified files:
. : WHATS_NEW configure configure.in
dmsetup : Makefile.in
Log message:
Avoid static link failure with some SELinux libraries.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.203&r2=1.204
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/configure.diff?cvsroot=dm&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/configure.in.diff?cvsroot=dm&r1=1.45&r2=1.46
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/dmsetup/Makefile.in.diff?cvsroot=dm&r1=1.17&r2=1.18
--- device-mapper/WHATS_NEW 2007/08/21 18:41:58 1.203
+++ device-mapper/WHATS_NEW 2007/08/21 20:32:29 1.204
@@ -1,5 +1,6 @@
Version 1.02.23 -
==================================
+ Avoid static link failure with some SELinux libraries.
Remove obsolete dmfs code from tree and update INSTALL.
Version 1.02.22 - 21st August 2007
--- device-mapper/configure 2007/08/21 18:41:58 1.43
+++ device-mapper/configure 2007/08/21 20:32:29 1.44
@@ -708,6 +708,7 @@
DEVICE_MODE
DMEVENTD
PKGCONFIG
+LIB_PTHREAD
LTLIBOBJS'
ac_subst_files=''
ac_precious_vars='build_alias
@@ -6176,6 +6177,99 @@
{ echo "$as_me:$LINENO: WARNING: Disabling selinux" >&5
echo "$as_me: WARNING: Disabling selinux" >&2;}
fi
+
+ # With --enable-static_link and selinux enabled, linking dmsetup
+ # fails on at least Debian unstable due to unsatisfied references
+ # to pthread_mutex_lock and _unlock. See if we need -lpthread.
+ if test "$STATIC_LINK-$HAVE_SELINUX" = yes-yes; then
+ dm_saved_libs=$LIBS
+ LIBS="$LIBS -static"
+ { echo "$as_me:$LINENO: checking for library containing pthread_mutex_lock" >&5
+echo $ECHO_N "checking for library containing pthread_mutex_lock... $ECHO_C" >&6; }
+if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_mutex_lock ();
+int
+main ()
+{
+return pthread_mutex_lock ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' pthread; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_search_pthread_mutex_lock=$ac_res
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then
+ :
+else
+ ac_cv_search_pthread_mutex_lock=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_pthread_mutex_lock" >&5
+echo "${ECHO_T}$ac_cv_search_pthread_mutex_lock" >&6; }
+ac_res=$ac_cv_search_pthread_mutex_lock
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ test "$ac_cv_search_pthread_mutex_lock" = "none required" ||
+ LIB_PTHREAD=-lpthread
+fi
+
+ LIBS=$dm_saved_libs
+ fi
fi
################################################################################
@@ -6589,6 +6683,7 @@
+
################################################################################
ac_config_files="$ac_config_files Makefile make.tmpl include/Makefile dmsetup/Makefile lib/Makefile lib/libdevmapper.pc dmeventd/Makefile dmeventd/libdevmapper-event.pc kernel/Makefile man/Makefile po/Makefile"
@@ -7312,10 +7407,11 @@
DEVICE_MODE!$DEVICE_MODE$ac_delim
DMEVENTD!$DMEVENTD$ac_delim
PKGCONFIG!$PKGCONFIG$ac_delim
+LIB_PTHREAD!$LIB_PTHREAD$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 95; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -7334,7 +7430,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
_ACEOF
sed '
s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
@@ -7347,8 +7443,6 @@
' >>$CONFIG_STATUS <conf$$subs.sed
rm -f conf$$subs.sed
cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
CEOF$ac_eof
_ACEOF
@@ -7596,7 +7690,7 @@
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
--- device-mapper/configure.in 2007/08/21 18:41:58 1.45
+++ device-mapper/configure.in 2007/08/21 20:32:29 1.46
@@ -240,6 +240,18 @@
else
AC_MSG_WARN(Disabling selinux)
fi
+
+ # With --enable-static_link and selinux enabled, linking dmsetup
+ # fails on at least Debian unstable due to unsatisfied references
+ # to pthread_mutex_lock and _unlock. See if we need -lpthread.
+ if test "$STATIC_LINK-$HAVE_SELINUX" = yes-yes; then
+ dm_saved_libs=$LIBS
+ LIBS="$LIBS -static"
+ AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
+ [test "$ac_cv_search_pthread_mutex_lock" = "none required" ||
+ LIB_PTHREAD=-lpthread])
+ LIBS=$dm_saved_libs
+ fi
fi
################################################################################
@@ -414,6 +426,7 @@
AC_SUBST(DEVICE_MODE)
AC_SUBST(DMEVENTD)
AC_SUBST(PKGCONFIG)
+AC_SUBST([LIB_PTHREAD])
################################################################################
dnl -- First and last lines should not contain files to generate in order to
--- device-mapper/dmsetup/Makefile.in 2007/08/21 16:26:06 1.17
+++ device-mapper/dmsetup/Makefile.in 2007/08/21 20:32:30 1.18
@@ -18,6 +18,7 @@
TARGETS = dmsetup
INSTALL_TYPE = install_dynamic
+LIB_PTHREAD = @LIB_PTHREAD@
ifeq ("@STATIC_LINK@", "yes")
TARGETS += dmsetup.static
@@ -35,7 +36,8 @@
dmsetup.static: $(OBJECTS) $(interfacedir)/libdevmapper.a
$(CC) -o $@ $(OBJECTS) $(CFLAGS) $(LDFLAGS) -static \
- -L$(interfacedir) -L$(DESTDIR)/lib -ldevmapper $(LIBS)
+ -L$(interfacedir) -L$(DESTDIR)/lib -ldevmapper $(LIBS) \
+ $(LIB_PTHREAD)
install: $(INSTALL_TYPE)
^ permalink raw reply [flat|nested] 5+ messages in thread* device-mapper ./WHATS_NEW ./configure ./config ...
@ 2008-06-06 20:33 agk
0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2008-06-06 20:33 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: device-mapper
Changes by: agk@sourceware.org 2008-06-06 20:33:14
Modified files:
. : WHATS_NEW configure configure.in
include : configure.h.in
Log message:
Bring configure.in into line with the lvm2 version.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.237&r2=1.238
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/configure.diff?cvsroot=dm&r1=1.45&r2=1.46
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/configure.in.diff?cvsroot=dm&r1=1.47&r2=1.48
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/include/configure.h.in.diff?cvsroot=dm&r1=1.6&r2=1.7
--- device-mapper/WHATS_NEW 2008/06/06 19:22:09 1.237
+++ device-mapper/WHATS_NEW 2008/06/06 20:33:13 1.238
@@ -1,5 +1,6 @@
Version 1.02.27 -
===============================
+ Bring configure.in into line with the lvm2 version.
Version 1.02.26 - 6th June 2008
===============================
--- device-mapper/configure 2007/10/10 00:02:03 1.45
+++ device-mapper/configure 2008/06/06 20:33:13 1.46
@@ -680,35 +680,58 @@
LN_S
SET_MAKE
RANLIB
+CFLOW_CMD
+CSCOPE_CMD
+ALLOCA
LIBOBJS
+POW_LIB
MSGFMT
-usrlibdir
-JOBS
-STATIC_LINK
-OWNER
-GROUP
-interface
-kerneldir
-missingkernel
-kernelvsn
-tmpdir
-COPTIMISE_FLAG
CLDFLAGS
-LDDEPS
-LIB_SUFFIX
-DEBUG
-DM_LIB_VERSION
+CLDNOWHOLEARCHIVE
+CLDWHOLEARCHIVE
+CLUSTER
+CLVMD
+CMDLIB
COMPAT
-DMIOCTLS
-LOCALEDIR
-INTL_PACKAGE
-INTL
-DEVICE_UID
+CONFDIR
+COPTIMISE_FLAG
+DEBUG
DEVICE_GID
DEVICE_MODE
+DEVICE_UID
+DEVMAPPER
+DMDIR
DMEVENTD
+DMIOCTLS
+DM_LIB_VERSION
+FSADM
+GROUP
+HAVE_LIBDL
+HAVE_REALTIME
+HAVE_SELINUX
+INTL
+INTL_PACKAGE
+JOBS
+LDDEPS
+LIB_SUFFIX
+LOCALEDIR
+LVM1
+LVM1_FALLBACK
+LVM_VERSION
+MIRRORS
+OWNER
PKGCONFIG
+POOL
+SNAPSHOTS
+STATICDIR
+STATIC_LINK
LIB_PTHREAD
+interface
+kerneldir
+missingkernel
+kernelvsn
+tmpdir
+usrlibdir
LTLIBOBJS'
ac_subst_files=''
ac_precious_vars='build_alias
@@ -1293,7 +1316,6 @@
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-jobs=NUM Number of jobs to run simultaneously
--enable-debug Enable debugging
--enable-compat Enable support for old device-mapper versions
--disable-driver Disable calls to device-mapper in the kernel
@@ -1754,8 +1776,6 @@
-
-################################################################################
ac_config_headers="$ac_config_headers include/configure.h"
@@ -1922,21 +1942,35 @@
case "$host_os" in
linux*)
- CFLAGS="$CFLAGS"
COPTIMISE_FLAG="-O2"
CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
+ CLDWHOLEARCHIVE="-Wl,-whole-archive"
+ CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
LDDEPS="$LDDEPS .export.sym"
- LIB_SUFFIX="so"
- DMIOCTLS="yes"
- SELINUX="yes" ;;
+ LIB_SUFFIX=so
+ DEVMAPPER=yes
+ ODIRECT=yes
+ DMIOCTLS=yes
+ SELINUX=yes
+ REALTIME=yes
+ CLUSTER=internal
+ FSADM=no
+ ;;
darwin*)
CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
COPTIMISE_FLAG="-O2"
CLDFLAGS="$CLDFLAGS"
- LDDEPS="$LDDEPS"
- LIB_SUFFIX="dylib"
- DMIOCTLS="no"
- SELINUX="no" ;;
+ CLDWHOLEARCHIVE="-all_load"
+ CLDNOWHOLEARCHIVE=
+ LIB_SUFFIX=dylib
+ DEVMAPPER=yes
+ ODIRECT=no
+ DMIOCTLS=no
+ SELINUX=no
+ REALTIME=no
+ CLUSTER=none
+ FSADM=no
+ ;;
esac
################################################################################
@@ -2905,6 +2939,7 @@
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3566,6 +3601,87 @@
fi
+# Extract the first word of "cflow", so it can be a program name with args.
+set dummy cflow; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_CFLOW_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $CFLOW_CMD in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_CFLOW_CMD="$CFLOW_CMD" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_CFLOW_CMD="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+CFLOW_CMD=$ac_cv_path_CFLOW_CMD
+if test -n "$CFLOW_CMD"; then
+ { echo "$as_me:$LINENO: result: $CFLOW_CMD" >&5
+echo "${ECHO_T}$CFLOW_CMD" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+# Extract the first word of "cscope", so it can be a program name with args.
+set dummy cscope; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_CSCOPE_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $CSCOPE_CMD in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_CSCOPE_CMD="$CSCOPE_CMD" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_CSCOPE_CMD="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+CSCOPE_CMD=$ac_cv_path_CSCOPE_CMD
+if test -n "$CSCOPE_CMD"; then
+ { echo "$as_me:$LINENO: result: $CSCOPE_CMD" >&5
+echo "${ECHO_T}$CSCOPE_CMD" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+
################################################################################
@@ -3982,6 +4098,73 @@
fi
+{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; }
+if test "${ac_cv_header_sys_wait_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+int
+main ()
+{
+ int s;
+ wait (&s);
+ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_sys_wait_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_sys_wait_h=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }
+if test $ac_cv_header_sys_wait_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SYS_WAIT_H 1
+_ACEOF
+
+fi
+
{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
if test "${ac_cv_header_time+set}" = set; then
@@ -4129,7 +4312,9 @@
-for ac_header in ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h sys/types.h unistd.h
+for ac_header in ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \
+ stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \
+ sys/types.h unistd.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -4274,7 +4459,6 @@
-
for ac_header in termios.h sys/statvfs.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -4414,6 +4598,7 @@
done
+
################################################################################
{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
@@ -4938,22 +5123,9 @@
fi
-
-################################################################################
-
-
-
-
-
-
-
-
-for ac_func in memset mkdir rmdir strchr strdup strerror strrchr uname
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+{ echo "$as_me:$LINENO: checking for mode_t" >&5
+echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_mode_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
@@ -4962,53 +5134,27 @@
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
+$ac_includes_default
+typedef mode_t ac__type_new_;
int
main ()
{
-return $ac_func ();
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
@@ -5017,42 +5163,34 @@
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_mode_t=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- eval "$as_ac_var=no"
+ ac_cv_type_mode_t=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+{ echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
+echo "${ECHO_T}$ac_cv_type_mode_t" >&6; }
+if test $ac_cv_type_mode_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define mode_t int
_ACEOF
-else
- { { echo "$as_me:$LINENO: error: bailing out" >&5
-echo "$as_me: error: bailing out" >&2;}
- { (exit 1); exit 1; }; }
fi
-done
-{ echo "$as_me:$LINENO: checking whether closedir returns void" >&5
-echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6; }
-if test "${ac_cv_func_closedir_void+set}" = set; then
+{ echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5
+echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6; }
+if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test "$cross_compiling" = yes; then
- ac_cv_func_closedir_void=yes
-else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -5060,20 +5198,1525 @@
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <$ac_header_dirent>
-#ifndef __cplusplus
-int closedir ();
-#endif
-
int
main ()
{
-return closedir (opendir (".")) != 0;
+static struct stat ac_aggr;
+if (ac_aggr.st_rdev)
+return 0;
;
return 0;
}
_ACEOF
-rm -f conftest$ac_exeext
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_rdev=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_rdev)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_member_struct_stat_st_rdev=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_member_struct_stat_st_rdev=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5
+echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6; }
+if test $ac_cv_member_struct_stat_st_rdev = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_RDEV 1
+_ACEOF
+
+
+fi
+
+{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
+echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; }
+if test "${ac_cv_struct_tm+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <time.h>
+
+int
+main ()
+{
+struct tm tm;
+ int *p = &tm.tm_sec;
+ return !p;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_struct_tm=time.h
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_struct_tm=sys/time.h
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
+echo "${ECHO_T}$ac_cv_struct_tm" >&6; }
+if test $ac_cv_struct_tm = sys/time.h; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TM_IN_SYS_TIME 1
+_ACEOF
+
+fi
+
+
+################################################################################
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in gethostname getpagesize memset mkdir rmdir munmap setlocale \
+ strcasecmp strchr strdup strncasecmp strerror strrchr strstr strtol strtoul \
+ uname
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+ { { echo "$as_me:$LINENO: error: bailing out" >&5
+echo "$as_me: error: bailing out" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+done
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+{ echo "$as_me:$LINENO: checking for working alloca.h" >&5
+echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; }
+if test "${ac_cv_working_alloca_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <alloca.h>
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+ if (p) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_working_alloca_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_working_alloca_h=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; }
+if test $ac_cv_working_alloca_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALLOCA_H 1
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking for alloca" >&5
+echo $ECHO_N "checking for alloca... $ECHO_C" >&6; }
+if test "${ac_cv_func_alloca_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+# endif
+# endif
+# endif
+# endif
+#endif
+
+int
+main ()
+{
+char *p = (char *) alloca (1);
+ if (p) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_func_alloca_works=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_alloca_works=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
+echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; }
+
+if test $ac_cv_func_alloca_works = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALLOCA 1
+_ACEOF
+
+else
+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble. Some versions do not even contain alloca or
+# contain a buggy version. If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
+
+cat >>confdefs.h <<\_ACEOF
+#define C_ALLOCA 1
+_ACEOF
+
+
+{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
+echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; }
+if test "${ac_cv_os_cray+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#if defined CRAY && ! defined CRAY2
+webecray
+#else
+wenotbecray
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "webecray" >/dev/null 2>&1; then
+ ac_cv_os_cray=yes
+else
+ ac_cv_os_cray=no
+fi
+rm -f conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&6; }
+if test $ac_cv_os_cray = yes; then
+ for ac_func in _getb67 GETB67 getb67; do
+ as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
+_ACEOF
+
+ break
+fi
+
+ done
+fi
+
+{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; }
+if test "${ac_cv_c_stack_direction+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_c_stack_direction=0
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+find_stack_direction ()
+{
+ static char *addr = 0;
+ auto char dummy;
+ if (addr == 0)
+ {
+ addr = &dummy;
+ return find_stack_direction ();
+ }
+ else
+ return (&dummy > addr) ? 1 : -1;
+}
+
+int
+main ()
+{
+ return find_stack_direction () < 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_stack_direction=1
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+_ACEOF
+
+
+fi
+
+{ echo "$as_me:$LINENO: checking whether closedir returns void" >&5
+echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6; }
+if test "${ac_cv_func_closedir_void+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_closedir_void=yes
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header_dirent>
+#ifndef __cplusplus
+int closedir ();
+#endif
+
+int
+main ()
+{
+return closedir (opendir (".")) != 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_closedir_void=no
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_closedir_void=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
+echo "${ECHO_T}$ac_cv_func_closedir_void" >&6; }
+if test $ac_cv_func_closedir_void = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define CLOSEDIR_VOID 1
+_ACEOF
+
+fi
+
+
+for ac_header in vfork.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_func in fork vfork
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+if test "x$ac_cv_func_fork" = xyes; then
+ { echo "$as_me:$LINENO: checking for working fork" >&5
+echo $ECHO_N "checking for working fork... $ECHO_C" >&6; }
+if test "${ac_cv_func_fork_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_fork_works=cross
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* By Ruediger Kuhlmann. */
+ return fork () < 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_fork_works=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_fork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
+echo "${ECHO_T}$ac_cv_func_fork_works" >&6; }
+
+else
+ ac_cv_func_fork_works=$ac_cv_func_fork
+fi
+if test "x$ac_cv_func_fork_works" = xcross; then
+ case $host in
+ *-*-amigaos* | *-*-msdosdjgpp*)
+ # Override, as these systems have only a dummy fork() stub
+ ac_cv_func_fork_works=no
+ ;;
+ *)
+ ac_cv_func_fork_works=yes
+ ;;
+ esac
+ { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
+echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
+fi
+ac_cv_func_vfork_works=$ac_cv_func_vfork
+if test "x$ac_cv_func_vfork" = xyes; then
+ { echo "$as_me:$LINENO: checking for working vfork" >&5
+echo $ECHO_N "checking for working vfork... $ECHO_C" >&6; }
+if test "${ac_cv_func_vfork_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_vfork_works=cross
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Thanks to Paul Eggert for this test. */
+$ac_includes_default
+#include <sys/wait.h>
+#ifdef HAVE_VFORK_H
+# include <vfork.h>
+#endif
+/* On some sparc systems, changes by the child to local and incoming
+ argument registers are propagated back to the parent. The compiler
+ is told about this with #include <vfork.h>, but some compilers
+ (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
+ static variable whose address is put into a register that is
+ clobbered by the vfork. */
+static void
+#ifdef __cplusplus
+sparc_address_test (int arg)
+# else
+sparc_address_test (arg) int arg;
+#endif
+{
+ static pid_t child;
+ if (!child) {
+ child = vfork ();
+ if (child < 0) {
+ perror ("vfork");
+ _exit(2);
+ }
+ if (!child) {
+ arg = getpid();
+ write(-1, "", 0);
+ _exit (arg);
+ }
+ }
+}
+
+int
+main ()
+{
+ pid_t parent = getpid ();
+ pid_t child;
+
+ sparc_address_test (0);
+
+ child = vfork ();
+
+ if (child == 0) {
+ /* Here is another test for sparc vfork register problems. This
+ test uses lots of local variables, at least as many local
+ variables as main has allocated so far including compiler
+ temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
+ 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
+ reuse the register of parent for one of the local variables,
+ since it will think that parent can't possibly be used any more
+ in this routine. Assigning to the local variable will thus
+ munge parent in the parent process. */
+ pid_t
+ p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
+ p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
+ /* Convince the compiler that p..p7 are live; otherwise, it might
+ use the same hardware register for all 8 local variables. */
+ if (p != p1 || p != p2 || p != p3 || p != p4
+ || p != p5 || p != p6 || p != p7)
+ _exit(1);
+
+ /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
+ from child file descriptors. If the child closes a descriptor
+ before it execs or exits, this munges the parent's descriptor
+ as well. Test for this by closing stdout in the child. */
+ _exit(close(fileno(stdout)) != 0);
+ } else {
+ int status;
+ struct stat st;
+
+ while (wait(&status) != child)
+ ;
+ return (
+ /* Was there some problem with vforking? */
+ child < 0
+
+ /* Did the child fail? (This shouldn't happen.) */
+ || status
+
+ /* Did the vfork/compiler bug occur? */
+ || parent != getpid()
+
+ /* Did the file descriptor bug occur? */
+ || fstat(fileno(stdout), &st) != 0
+ );
+ }
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_vfork_works=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_vfork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
+echo "${ECHO_T}$ac_cv_func_vfork_works" >&6; }
+
+fi;
+if test "x$ac_cv_func_fork_works" = xcross; then
+ ac_cv_func_vfork_works=$ac_cv_func_vfork
+ { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
+echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
+fi
+
+if test "x$ac_cv_func_vfork_works" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WORKING_VFORK 1
+_ACEOF
+
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define vfork fork
+_ACEOF
+
+fi
+if test "x$ac_cv_func_fork_works" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WORKING_FORK 1
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5
+echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6; }
+if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ rm -f conftest.sym conftest.file
+echo >conftest.file
+if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_lstat_dereferences_slashed_symlink=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+struct stat sbuf;
+ /* Linux will dereference the symlink and fail.
+ That is better in the sense that it means we will not
+ have to compile and use the lstat wrapper. */
+ return lstat ("conftest.sym/", &sbuf) == 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_lstat_dereferences_slashed_symlink=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_lstat_dereferences_slashed_symlink=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+else
+ # If the `ln -s' command failed, then we probably don't even
+ # have an lstat function.
+ ac_cv_func_lstat_dereferences_slashed_symlink=no
+fi
+rm -f conftest.sym conftest.file
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
+echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
+
+test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
+
+cat >>confdefs.h <<_ACEOF
+#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
+_ACEOF
+
+
+if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
+ case " $LIBOBJS " in
+ *" lstat.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS lstat.$ac_objext"
+ ;;
+esac
+
+fi
+
+{ echo "$as_me:$LINENO: checking whether lstat accepts an empty string" >&5
+echo $ECHO_N "checking whether lstat accepts an empty string... $ECHO_C" >&6; }
+if test "${ac_cv_func_lstat_empty_string_bug+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_lstat_empty_string_bug=yes
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+struct stat sbuf;
+ return lstat ("", &sbuf) == 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_lstat_empty_string_bug=no
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_lstat_empty_string_bug=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_lstat_empty_string_bug" >&5
+echo "${ECHO_T}$ac_cv_func_lstat_empty_string_bug" >&6; }
+if test $ac_cv_func_lstat_empty_string_bug = yes; then
+ case " $LIBOBJS " in
+ *" lstat.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS lstat.$ac_objext"
+ ;;
+esac
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LSTAT_EMPTY_STRING_BUG 1
+_ACEOF
+
+fi
+
+
+for ac_header in stdlib.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5
+echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; }
+if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_malloc_0_nonnull=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *malloc ();
+#endif
+
+int
+main ()
+{
+return ! malloc (0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
@@ -5093,32 +6736,141 @@
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_func_closedir_void=no
+ ac_cv_func_malloc_0_nonnull=yes
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
-ac_cv_func_closedir_void=yes
+ac_cv_func_malloc_0_nonnull=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
-echo "${ECHO_T}$ac_cv_func_closedir_void" >&6; }
-if test $ac_cv_func_closedir_void = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5
+echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; }
+if test $ac_cv_func_malloc_0_nonnull = yes; then
cat >>confdefs.h <<\_ACEOF
-#define CLOSEDIR_VOID 1
+#define HAVE_MALLOC 1
+_ACEOF
+
+else
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_MALLOC 0
+_ACEOF
+
+ case " $LIBOBJS " in
+ *" malloc.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
+ ;;
+esac
+
+
+cat >>confdefs.h <<\_ACEOF
+#define malloc rpl_malloc
_ACEOF
fi
-for ac_header in stdlib.h
+
+{ echo "$as_me:$LINENO: checking for working memcmp" >&5
+echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6; }
+if test "${ac_cv_func_memcmp_working+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_memcmp_working=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Some versions of memcmp are not 8-bit clean. */
+ char c0 = '\100', c1 = '\200', c2 = '\201';
+ if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
+ return 1;
+
+ /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
+ or more and with at least one buffer not starting on a 4-byte boundary.
+ William Lewis provided this test program. */
+ {
+ char foo[21];
+ char bar[21];
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ char *a = foo + i;
+ char *b = bar + i;
+ strcpy (a, "--------01111111");
+ strcpy (b, "--------10000000");
+ if (memcmp (a, b, 16) >= 0)
+ return 1;
+ }
+ return 0;
+ }
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_memcmp_working=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_memcmp_working=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
+echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6; }
+test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
+ *" memcmp.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
+ ;;
+esac
+
+
+
+
+for ac_header in stdlib.h unistd.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -5243,27 +6995,121 @@
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_func in getpagesize
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
-
done
-{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5
-echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; }
-if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then
+{ echo "$as_me:$LINENO: checking for working mmap" >&5
+echo $ECHO_N "checking for working mmap... $ECHO_C" >&6; }
+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
- ac_cv_func_malloc_0_nonnull=no
+ ac_cv_func_mmap_fixed_mapped=no
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -5271,17 +7117,130 @@
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#else
+$ac_includes_default
+/* malloc might have been renamed as rpl_malloc. */
+#undef malloc
+
+/* Thanks to Mike Haertel and Jim Avera for this test.
+ Here is a matrix of mmap possibilities:
+ mmap private not fixed
+ mmap private fixed at somewhere currently unmapped
+ mmap private fixed at somewhere already mapped
+ mmap shared not fixed
+ mmap shared fixed at somewhere currently unmapped
+ mmap shared fixed at somewhere already mapped
+ For private mappings, we should verify that changes cannot be read()
+ back from the file, nor mmap's back from the file at a different
+ address. (There have been systems where private was not correctly
+ implemented like the infamous i386 svr4.0, and systems where the
+ VM page cache was not coherent with the file system buffer cache
+ like early versions of FreeBSD and possibly contemporary NetBSD.)
+ For shared mappings, we should conversely verify that changes get
+ propagated back to all the places they're supposed to be.
+
+ Grep wants private fixed already mapped.
+ The main things grep needs to know about mmap are:
+ * does it exist and is it safe to write into the mmap'd area
+ * how to use it (BSD variants) */
+
+#include <fcntl.h>
+#include <sys/mman.h>
+
+#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
char *malloc ();
#endif
+/* This mess was copied from the GNU getpagesize.h. */
+#ifndef HAVE_GETPAGESIZE
+/* Assume that all systems that can run configure have sys/param.h. */
+# ifndef HAVE_SYS_PARAM_H
+# define HAVE_SYS_PARAM_H 1
+# endif
+
+# ifdef _SC_PAGESIZE
+# define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+# ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# ifdef EXEC_PAGESIZE
+# define getpagesize() EXEC_PAGESIZE
+# else /* no EXEC_PAGESIZE */
+# ifdef NBPG
+# define getpagesize() NBPG * CLSIZE
+# ifndef CLSIZE
+# define CLSIZE 1
+# endif /* no CLSIZE */
+# else /* no NBPG */
+# ifdef NBPC
+# define getpagesize() NBPC
+# else /* no NBPC */
+# ifdef PAGESIZE
+# define getpagesize() PAGESIZE
+# endif /* PAGESIZE */
+# endif /* no NBPC */
+# endif /* no NBPG */
+# endif /* no EXEC_PAGESIZE */
+# else /* no HAVE_SYS_PARAM_H */
+# define getpagesize() 8192 /* punt totally */
+# endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
int
main ()
{
-return ! malloc (0);
- ;
+ char *data, *data2, *data3;
+ int i, pagesize;
+ int fd;
+
+ pagesize = getpagesize ();
+
+ /* First, make a file with some known garbage in it. */
+ data = (char *) malloc (pagesize);
+ if (!data)
+ return 1;
+ for (i = 0; i < pagesize; ++i)
+ *(data + i) = rand ();
+ umask (0);
+ fd = creat ("conftest.mmap", 0600);
+ if (fd < 0)
+ return 1;
+ if (write (fd, data, pagesize) != pagesize)
+ return 1;
+ close (fd);
+
+ /* Next, try to mmap the file at a fixed address which already has
+ something else allocated at it. If we can, also make sure that
+ we see the same garbage. */
+ fd = open ("conftest.mmap", O_RDWR);
+ if (fd < 0)
+ return 1;
+ data2 = (char *) malloc (2 * pagesize);
+ if (!data2)
+ return 1;
+ data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1);
+ if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_FIXED, fd, 0L))
+ return 1;
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data2 + i))
+ return 1;
+
+ /* Finally, make sure that changes to the mapped area do not
+ percolate back to the file as seen by read(). (This is a bug on
+ some variants of i386 svr4.0.) */
+ for (i = 0; i < pagesize; ++i)
+ *(data2 + i) = *(data2 + i) + 1;
+ data3 = (char *) malloc (pagesize);
+ if (!data3)
+ return 1;
+ if (read (fd, data3, pagesize) != pagesize)
+ return 1;
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data3 + i))
+ return 1;
+ close (fd);
return 0;
}
_ACEOF
@@ -5305,58 +7264,38 @@
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_func_malloc_0_nonnull=yes
+ ac_cv_func_mmap_fixed_mapped=yes
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
-ac_cv_func_malloc_0_nonnull=no
+ac_cv_func_mmap_fixed_mapped=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5
-echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; }
-if test $ac_cv_func_malloc_0_nonnull = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MALLOC 1
-_ACEOF
-
-else
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_MALLOC 0
-_ACEOF
-
- case " $LIBOBJS " in
- *" malloc.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
- ;;
-esac
-
+{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
+echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6; }
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
cat >>confdefs.h <<\_ACEOF
-#define malloc rpl_malloc
+#define HAVE_MMAP 1
_ACEOF
fi
+rm -f conftest.mmap
-
-
-{ echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5
-echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6; }
-if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then
+{ echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5
+echo $ECHO_N "checking whether stat accepts an empty string... $ECHO_C" >&6; }
+if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- rm -f conftest.sym conftest.file
-echo >conftest.file
-if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
if test "$cross_compiling" = yes; then
- ac_cv_func_lstat_dereferences_slashed_symlink=no
+ ac_cv_func_stat_empty_string_bug=yes
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -5369,10 +7308,7 @@
main ()
{
struct stat sbuf;
- /* Linux will dereference the symlink and fail.
- That is better in the sense that it means we will not
- have to compile and use the lstat wrapper. */
- return lstat ("conftest.sym/", &sbuf) == 0;
+ return stat ("", &sbuf) == 0;
;
return 0;
}
@@ -5397,53 +7333,43 @@
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_func_lstat_dereferences_slashed_symlink=yes
+ ac_cv_func_stat_empty_string_bug=no
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
-ac_cv_func_lstat_dereferences_slashed_symlink=no
+ac_cv_func_stat_empty_string_bug=yes
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-else
- # If the `ln -s' command failed, then we probably don't even
- # have an lstat function.
- ac_cv_func_lstat_dereferences_slashed_symlink=no
-fi
-rm -f conftest.sym conftest.file
-
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
-echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5
+echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6; }
+if test $ac_cv_func_stat_empty_string_bug = yes; then
+ case " $LIBOBJS " in
+ *" stat.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS stat.$ac_objext"
+ ;;
+esac
-test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
cat >>confdefs.h <<_ACEOF
-#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
+#define HAVE_STAT_EMPTY_STRING_BUG 1
_ACEOF
-
-if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
- case " $LIBOBJS " in
- *" lstat.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS lstat.$ac_objext"
- ;;
-esac
-
fi
-{ echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5
-echo $ECHO_N "checking whether stat accepts an empty string... $ECHO_C" >&6; }
-if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then
+{ echo "$as_me:$LINENO: checking for working strtod" >&5
+echo $ECHO_N "checking for working strtod... $ECHO_C" >&6; }
+if test "${ac_cv_func_strtod+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
- ac_cv_func_stat_empty_string_bug=yes
+ ac_cv_func_strtod=no
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -5451,15 +7377,36 @@
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+
$ac_includes_default
+#ifndef strtod
+double strtod ();
+#endif
int
-main ()
+main()
{
-struct stat sbuf;
- return stat ("", &sbuf) == 0;
- ;
+ {
+ /* Some versions of Linux strtod mis-parse strings with leading '+'. */
+ char *string = " +69";
+ char *term;
+ double value;
+ value = strtod (string, &term);
+ if (value != 69 || term != (string + 4))
+ return 1;
+ }
+
+ {
+ /* Under Solaris 2.4, strtod returns the wrong value for the
+ terminating character under some conditions. */
+ char *string = "NaN";
+ char *term;
+ strtod (string, &term);
+ if (term != string && *(term - 1) == 0)
+ return 1;
+ }
return 0;
}
+
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
@@ -5481,33 +7428,181 @@
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_func_stat_empty_string_bug=no
+ ac_cv_func_strtod=yes
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
-ac_cv_func_stat_empty_string_bug=yes
+ac_cv_func_strtod=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5
-echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6; }
-if test $ac_cv_func_stat_empty_string_bug = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_func_strtod" >&5
+echo "${ECHO_T}$ac_cv_func_strtod" >&6; }
+if test $ac_cv_func_strtod = no; then
case " $LIBOBJS " in
- *" stat.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS stat.$ac_objext"
+ *" strtod.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strtod.$ac_objext"
;;
esac
+{ echo "$as_me:$LINENO: checking for pow" >&5
+echo $ECHO_N "checking for pow... $ECHO_C" >&6; }
+if test "${ac_cv_func_pow+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define pow to an innocuous variant, in case <limits.h> declares pow.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define pow innocuous_pow
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char pow (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef pow
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_pow || defined __stub___pow
+choke me
+#endif
+
+int
+main ()
+{
+return pow ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_func_pow=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_pow=no
+fi
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STAT_EMPTY_STRING_BUG 1
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_pow" >&5
+echo "${ECHO_T}$ac_cv_func_pow" >&6; }
+
+if test $ac_cv_func_pow = no; then
+ { echo "$as_me:$LINENO: checking for pow in -lm" >&5
+echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6; }
+if test "${ac_cv_lib_m_pow+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+int
+main ()
+{
+return pow ();
+ ;
+ return 0;
+}
_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_m_pow=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_m_pow=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5
+echo "${ECHO_T}$ac_cv_lib_m_pow" >&6; }
+if test $ac_cv_lib_m_pow = yes; then
+ POW_LIB=-lm
+else
+ { echo "$as_me:$LINENO: WARNING: cannot find library containing definition of pow" >&5
+echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;}
+fi
+
+fi
fi
@@ -5700,13 +7795,6 @@
################################################################################
-# Check whether --enable-jobs was given.
-if test "${enable_jobs+set}" = set; then
- enableval=$enable_jobs; JOBS=-j$enableval
-fi
-
-
-################################################################################
{ echo "$as_me:$LINENO: checking file owner" >&5
echo $ECHO_N "checking file owner... $ECHO_C" >&6; }
OWNER="root"
@@ -5801,6 +7889,8 @@
if test x$DEBUG = xyes; then
COPTIMISE_FLAG=
+else
+ CSCOPE_CMD=
fi
################################################################################
@@ -5850,20 +7940,10 @@
################################################################################
-# Check whether --enable-static_link was given.
-if test "${enable_static_link+set}" = set; then
- enableval=$enable_static_link; STATIC_LINK=$enableval
-else
- STATIC_LINK=no
-fi
-
-
-################################################################################
if [ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ];
then exec_prefix="";
fi;
-
################################################################################
{ echo "$as_me:$LINENO: checking for getline in -lc" >&5
@@ -6009,6 +8089,19 @@
################################################################################
+{ echo "$as_me:$LINENO: checking whether to use static linking" >&5
+echo $ECHO_N "checking whether to use static linking... $ECHO_C" >&6; }
+# Check whether --enable-static_link was given.
+if test "${enable_static_link+set}" = set; then
+ enableval=$enable_static_link; STATIC_LINK=$enableval
+else
+ STATIC_LINK=no
+fi
+
+{ echo "$as_me:$LINENO: result: $STATIC_LINK" >&5
+echo "${ECHO_T}$STATIC_LINK" >&6; }
+
+################################################################################
{ echo "$as_me:$LINENO: checking whether to enable selinux support" >&5
echo $ECHO_N "checking whether to enable selinux support... $ECHO_C" >&6; }
# Check whether --enable-selinux was given.
@@ -6178,11 +8271,11 @@
echo "$as_me: WARNING: Disabling selinux" >&2;}
fi
- # With --enable-static_link and selinux enabled, linking dmsetup
+ # With --enable-static_link and selinux enabled, linking
# fails on at least Debian unstable due to unsatisfied references
# to pthread_mutex_lock and _unlock. See if we need -lpthread.
if test "$STATIC_LINK-$HAVE_SELINUX" = yes-yes; then
- dm_saved_libs=$LIBS
+ lvm_saved_libs=$LIBS
LIBS="$LIBS -static"
{ echo "$as_me:$LINENO: checking for library containing pthread_mutex_lock" >&5
echo $ECHO_N "checking for library containing pthread_mutex_lock... $ECHO_C" >&6; }
@@ -6268,7 +8361,7 @@
LIB_PTHREAD=-lpthread
fi
- LIBS=$dm_saved_libs
+ LIBS=$lvm_saved_libs
fi
fi
@@ -6419,6 +8512,187 @@
################################################################################
+if test x$READLINE = xyes; then
+
+{ echo "$as_me:$LINENO: checking for readline in -lreadline" >&5
+echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6; }
+if test "${ac_cv_lib_readline_readline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lreadline $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char readline ();
+int
+main ()
+{
+return readline ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_readline_readline=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_readline_readline=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5
+echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6; }
+if test $ac_cv_lib_readline_readline = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBREADLINE 1
+_ACEOF
+
+ LIBS="-lreadline $LIBS"
+
+else
+ { { echo "$as_me:$LINENO: error: GNU Readline could not be found which is required for the
+--enable-readline option (which is enabled by default). Either disable readline
+support with --disable-readline or download and install readline from:
+ ftp.gnu.org/gnu/readline
+Note: if you are using precompiled packages you will also need the development
+package as well (which may be called readline-devel or something similar).
+" >&5
+echo "$as_me: error: GNU Readline could not be found which is required for the
+--enable-readline option (which is enabled by default). Either disable readline
+support with --disable-readline or download and install readline from:
+ ftp.gnu.org/gnu/readline
+Note: if you are using precompiled packages you will also need the development
+package as well (which may be called readline-devel or something similar).
+" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+
+ { echo "$as_me:$LINENO: checking for rl_completion_matches" >&5
+echo $ECHO_N "checking for rl_completion_matches... $ECHO_C" >&6; }
+if test "${ac_cv_func_rl_completion_matches+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define rl_completion_matches to an innocuous variant, in case <limits.h> declares rl_completion_matches.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define rl_completion_matches innocuous_rl_completion_matches
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char rl_completion_matches (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef rl_completion_matches
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char rl_completion_matches ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_rl_completion_matches || defined __stub___rl_completion_matches
+choke me
+#endif
+
+int
+main ()
+{
+return rl_completion_matches ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_func_rl_completion_matches=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_rl_completion_matches=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_rl_completion_matches" >&5
+echo "${ECHO_T}$ac_cv_func_rl_completion_matches" >&6; }
+if test $ac_cv_func_rl_completion_matches = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_RL_COMPLETION_MATCHES 1
+_ACEOF
+
+fi
+
+fi
+
+################################################################################
{ echo "$as_me:$LINENO: checking whether to enable internationalisation" >&5
echo $ECHO_N "checking whether to enable internationalisation... $ECHO_C" >&6; }
# Check whether --enable-nls was given.
@@ -6491,7 +8765,6 @@
fi
-
################################################################################
{ echo "$as_me:$LINENO: checking for kernel directory" >&5
echo $ECHO_N "checking for kernel directory... $ECHO_C" >&6; }
@@ -6595,11 +8868,7 @@
{ echo "$as_me:$LINENO: result: $interface" >&5
echo "${ECHO_T}$interface" >&6; }
-if test "-f VERSION" ; then
- DM_LIB_VERSION="\"`cat VERSION|sed -e \"s/([0-9.]*)/\0-$interface/\"`\""
-else
- DM_LIB_VERSION="Unknown version ($interface)"
-fi
+DM_LIB_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\""
cat >>confdefs.h <<_ACEOF
@@ -6652,6 +8921,7 @@
fi
fi
+
################################################################################
@@ -6684,6 +8954,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
################################################################################
ac_config_files="$ac_config_files Makefile make.tmpl include/Makefile dmsetup/Makefile lib/Makefile lib/libdevmapper.pc dmeventd/Makefile dmeventd/libdevmapper-event.pc kernel/Makefile man/Makefile po/Makefile"
@@ -7379,39 +9670,103 @@
LN_S!$LN_S$ac_delim
SET_MAKE!$SET_MAKE$ac_delim
RANLIB!$RANLIB$ac_delim
+CFLOW_CMD!$CFLOW_CMD$ac_delim
+CSCOPE_CMD!$CSCOPE_CMD$ac_delim
+ALLOCA!$ALLOCA$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
+POW_LIB!$POW_LIB$ac_delim
MSGFMT!$MSGFMT$ac_delim
-usrlibdir!$usrlibdir$ac_delim
-JOBS!$JOBS$ac_delim
-STATIC_LINK!$STATIC_LINK$ac_delim
-OWNER!$OWNER$ac_delim
-GROUP!$GROUP$ac_delim
-interface!$interface$ac_delim
-kerneldir!$kerneldir$ac_delim
-missingkernel!$missingkernel$ac_delim
-kernelvsn!$kernelvsn$ac_delim
-tmpdir!$tmpdir$ac_delim
-COPTIMISE_FLAG!$COPTIMISE_FLAG$ac_delim
CLDFLAGS!$CLDFLAGS$ac_delim
-LDDEPS!$LDDEPS$ac_delim
-LIB_SUFFIX!$LIB_SUFFIX$ac_delim
-DEBUG!$DEBUG$ac_delim
-DM_LIB_VERSION!$DM_LIB_VERSION$ac_delim
+CLDNOWHOLEARCHIVE!$CLDNOWHOLEARCHIVE$ac_delim
+CLDWHOLEARCHIVE!$CLDWHOLEARCHIVE$ac_delim
+CLUSTER!$CLUSTER$ac_delim
+CLVMD!$CLVMD$ac_delim
+CMDLIB!$CMDLIB$ac_delim
COMPAT!$COMPAT$ac_delim
-DMIOCTLS!$DMIOCTLS$ac_delim
-LOCALEDIR!$LOCALEDIR$ac_delim
-INTL_PACKAGE!$INTL_PACKAGE$ac_delim
-INTL!$INTL$ac_delim
-DEVICE_UID!$DEVICE_UID$ac_delim
+CONFDIR!$CONFDIR$ac_delim
+COPTIMISE_FLAG!$COPTIMISE_FLAG$ac_delim
+DEBUG!$DEBUG$ac_delim
DEVICE_GID!$DEVICE_GID$ac_delim
DEVICE_MODE!$DEVICE_MODE$ac_delim
+DEVICE_UID!$DEVICE_UID$ac_delim
+DEVMAPPER!$DEVMAPPER$ac_delim
+DMDIR!$DMDIR$ac_delim
DMEVENTD!$DMEVENTD$ac_delim
+DMIOCTLS!$DMIOCTLS$ac_delim
+DM_LIB_VERSION!$DM_LIB_VERSION$ac_delim
+FSADM!$FSADM$ac_delim
+GROUP!$GROUP$ac_delim
+HAVE_LIBDL!$HAVE_LIBDL$ac_delim
+HAVE_REALTIME!$HAVE_REALTIME$ac_delim
+HAVE_SELINUX!$HAVE_SELINUX$ac_delim
+INTL!$INTL$ac_delim
+INTL_PACKAGE!$INTL_PACKAGE$ac_delim
+_ACEOF
+
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+ break
+ elif $ac_last_try; then
+ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+ ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+ ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ cat >conf$$subs.sed <<_ACEOF
+JOBS!$JOBS$ac_delim
+LDDEPS!$LDDEPS$ac_delim
+LIB_SUFFIX!$LIB_SUFFIX$ac_delim
+LOCALEDIR!$LOCALEDIR$ac_delim
+LVM1!$LVM1$ac_delim
+LVM1_FALLBACK!$LVM1_FALLBACK$ac_delim
+LVM_VERSION!$LVM_VERSION$ac_delim
+MIRRORS!$MIRRORS$ac_delim
+OWNER!$OWNER$ac_delim
PKGCONFIG!$PKGCONFIG$ac_delim
+POOL!$POOL$ac_delim
+SNAPSHOTS!$SNAPSHOTS$ac_delim
+STATICDIR!$STATICDIR$ac_delim
+STATIC_LINK!$STATIC_LINK$ac_delim
LIB_PTHREAD!$LIB_PTHREAD$ac_delim
+interface!$interface$ac_delim
+kerneldir!$kerneldir$ac_delim
+missingkernel!$missingkernel$ac_delim
+kernelvsn!$kernelvsn$ac_delim
+tmpdir!$tmpdir$ac_delim
+usrlibdir!$usrlibdir$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 22; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -7429,8 +9784,8 @@
fi
cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
_ACEOF
sed '
s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
@@ -7443,6 +9798,8 @@
' >>$CONFIG_STATUS <conf$$subs.sed
rm -f conf$$subs.sed
cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
CEOF$ac_eof
_ACEOF
@@ -7690,7 +10047,7 @@
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
--- device-mapper/configure.in 2007/10/10 00:02:03 1.47
+++ device-mapper/configure.in 2008/06/06 20:33:13 1.48
@@ -1,6 +1,6 @@
###############################################################################
## Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
-## Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
##
## This file is part of the device-mapper userspace tools.
##
@@ -11,7 +11,6 @@
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-## MA 02111-1307, USA
################################################################################
AC_PREREQ(2.57)
@@ -19,13 +18,11 @@
dnl -- Process this file with autoconf to produce a configure script.
AC_INIT
AC_CONFIG_SRCDIR([lib/libdevmapper.h])
-
-################################################################################
AC_CONFIG_HEADERS(include/configure.h)
################################################################################
dnl -- Setup the directory where autoconf has auxilary files
-AC_CONFIG_AUX_DIR(autoconf)
+AC_CONFIG_AUX_DIR(autoconf)
################################################################################
dnl -- Get system type
@@ -33,21 +30,35 @@
case "$host_os" in
linux*)
- CFLAGS="$CFLAGS"
COPTIMISE_FLAG="-O2"
CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
+ CLDWHOLEARCHIVE="-Wl,-whole-archive"
+ CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
LDDEPS="$LDDEPS .export.sym"
- LIB_SUFFIX="so"
- DMIOCTLS="yes"
- SELINUX="yes" ;;
+ LIB_SUFFIX=so
+ DEVMAPPER=yes
+ ODIRECT=yes
+ DMIOCTLS=yes
+ SELINUX=yes
+ REALTIME=yes
+ CLUSTER=internal
+ FSADM=no
+ ;;
darwin*)
CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
COPTIMISE_FLAG="-O2"
CLDFLAGS="$CLDFLAGS"
- LDDEPS="$LDDEPS"
- LIB_SUFFIX="dylib"
- DMIOCTLS="no"
- SELINUX="no" ;;
+ CLDWHOLEARCHIVE="-all_load"
+ CLDNOWHOLEARCHIVE=
+ LIB_SUFFIX=dylib
+ DEVMAPPER=yes
+ ODIRECT=no
+ DMIOCTLS=no
+ SELINUX=no
+ REALTIME=no
+ CLUSTER=none
+ FSADM=no
+ ;;
esac
################################################################################
@@ -55,26 +66,34 @@
usrlibdir='${prefix}/lib'
################################################################################
-dnl -- Checks for programs.
+dnl -- Check for programs.
AC_PROG_AWK
AC_PROG_CC
+
+dnl probably no longer needed in 2008, but...
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
+AC_PATH_PROG(CFLOW_CMD, cflow)
+AC_PATH_PROG(CSCOPE_CMD, cscope)
+
################################################################################
-dnl -- Checks for header files.
+dnl -- Check for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
AC_HEADER_TIME
-AC_CHECK_HEADERS(ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h sys/types.h unistd.h,,AC_MSG_ERROR(bailing out))
-
+AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \
+ stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \
+ sys/types.h unistd.h], , [AC_MSG_ERROR(bailing out)])
AC_CHECK_HEADERS(termios.h sys/statvfs.h)
+
################################################################################
-dnl -- Checks for typedefs, structures, and compiler characteristics.
+dnl -- Check for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_CHECK_MEMBERS([struct stat.st_rdev])
@@ -82,13 +101,24 @@
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
+AC_TYPE_MODE_T
+AC_CHECK_MEMBERS([struct stat.st_rdev])
+AC_STRUCT_TM
################################################################################
-dnl -- Checks for functions
-AC_CHECK_FUNCS(memset mkdir rmdir strchr strdup strerror strrchr uname,,AC_MSG_ERROR(bailing out))
+dnl -- Check for functions
+AC_CHECK_FUNCS([gethostname getpagesize memset mkdir rmdir munmap setlocale \
+ strcasecmp strchr strdup strncasecmp strerror strrchr strstr strtol strtoul \
+ uname], , [AC_MSG_ERROR(bailing out)])
+AC_FUNC_ALLOCA
AC_FUNC_CLOSEDIR_VOID
+AC_FUNC_FORK
+AC_FUNC_LSTAT
AC_FUNC_MALLOC
+AC_FUNC_MEMCMP
+AC_FUNC_MMAP
AC_FUNC_STAT
+AC_FUNC_STRTOD
AC_FUNC_VPRINTF
################################################################################
@@ -96,10 +126,6 @@
AC_PREFIX_DEFAULT(/usr)
################################################################################
-dnl -- Parallel make jobs?
-AC_ARG_ENABLE(jobs, [ --enable-jobs=NUM Number of jobs to run simultaneously], JOBS=-j$enableval)
-
-################################################################################
dnl -- Setup the ownership of the files
AC_MSG_CHECKING(file owner)
OWNER="root"
@@ -154,15 +180,17 @@
AC_MSG_RESULT($DEVICE_MODE)
################################################################################
-dnl -- Enable Debugging
+dnl -- Enable debugging
AC_MSG_CHECKING(whether to enable debugging)
AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging],
-DEBUG=$enableval, DEBUG=no)
+ DEBUG=$enableval, DEBUG=no)
AC_MSG_RESULT($DEBUG)
dnl -- Normally turn off optimisation for debug builds
if test x$DEBUG = xyes; then
COPTIMISE_FLAG=
+else
+ CSCOPE_CMD=
fi
################################################################################
@@ -174,29 +202,24 @@
AC_MSG_RESULT($COPTIMISE_FLAG)
################################################################################
-dnl -- Disable Compatibility mode
+dnl -- Compatibility mode
AC_ARG_ENABLE(compat, [ --enable-compat Enable support for old device-mapper versions],
-COMPAT=$enableval, COMPAT=no)
+ COMPAT=$enableval, COMPAT=no)
################################################################################
dnl -- Disable ioctl
AC_ARG_ENABLE(ioctl, [ --disable-driver Disable calls to device-mapper in the kernel],
-DMIOCTLS=$enableval)
+ DMIOCTLS=$enableval)
################################################################################
dnl -- Enable dmeventd
AC_ARG_ENABLE(dmeventd, [ --enable-dmeventd Build the new event daemon],
-DMEVENTD=$enableval, DMEVENTD=no)
+ DMEVENTD=$enableval, DMEVENTD=no)
################################################################################
dnl -- Enable pkg-config
AC_ARG_ENABLE(pkgconfig, [ --enable-pkgconfig Install pkgconfig support],
-PKGCONFIG=$enableval, PKGCONFIG=no)
-
-################################################################################
-dnl -- Enables staticly-linked tools
-AC_ARG_ENABLE(static_link, [ --enable-static_link Use this to link the tools to their libraries
- statically. Default is dynamic linking], STATIC_LINK=$enableval, STATIC_LINK=no)
+ PKGCONFIG=$enableval, PKGCONFIG=no)
################################################################################
dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
@@ -204,53 +227,65 @@
then exec_prefix="";
fi;
-
################################################################################
dnl -- getline included in recent libc
-AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1, [Define to 1 if getline is available.]))
+AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1,
+ [Define to 1 if getline is available.]))
################################################################################
dnl -- canonicalize_file_name included in recent libc
-AC_CHECK_LIB(c, canonicalize_file_name, AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1, [Define to 1 if canonicalize_file_name is available.]))
+AC_CHECK_LIB(c, canonicalize_file_name,
+ AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1,
+ [Define to 1 if canonicalize_file_name is available.]))
+
+################################################################################
+dnl -- Enables statically-linked tools
+AC_MSG_CHECKING(whether to use static linking)
+AC_ARG_ENABLE(static_link,
+ [ --enable-static_link Use this to link the tools to their libraries
+ statically. Default is dynamic linking],
+ STATIC_LINK=$enableval, STATIC_LINK=no)
+AC_MSG_RESULT($STATIC_LINK)
################################################################################
dnl -- Disable selinux
AC_MSG_CHECKING(whether to enable selinux support)
AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support],
-SELINUX=$enableval)
+ SELINUX=$enableval)
AC_MSG_RESULT($SELINUX)
-
+
################################################################################
dnl -- Check for selinux
if test x$SELINUX = xyes; then
AC_CHECK_LIB(sepol, sepol_check_context, HAVE_SEPOL=yes, HAVE_SEPOL=no)
if test x$HAVE_SEPOL = xyes; then
- AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
+ AC_DEFINE([HAVE_SEPOL], 1,
+ [Define to 1 if sepol_check_context is available.])
LIBS="-lsepol $LIBS"
fi
AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no)
if test x$HAVE_SELINUX = xyes; then
- AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 if selinux is available.])
+ AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
LIBS="-lselinux $LIBS"
else
AC_MSG_WARN(Disabling selinux)
fi
- # With --enable-static_link and selinux enabled, linking dmsetup
+ # With --enable-static_link and selinux enabled, linking
# fails on at least Debian unstable due to unsatisfied references
# to pthread_mutex_lock and _unlock. See if we need -lpthread.
if test "$STATIC_LINK-$HAVE_SELINUX" = yes-yes; then
- dm_saved_libs=$LIBS
+ lvm_saved_libs=$LIBS
LIBS="$LIBS -static"
AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
[test "$ac_cv_search_pthread_mutex_lock" = "none required" ||
LIB_PTHREAD=-lpthread])
- LIBS=$dm_saved_libs
+ LIBS=$lvm_saved_libs
fi
fi
@@ -259,6 +294,22 @@
AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
################################################################################
+dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
+if test x$READLINE = xyes; then
+ AC_CHECK_LIB(readline, readline, ,
+ AC_MSG_ERROR(
+GNU Readline could not be found which is required for the
+--enable-readline option (which is enabled by default). Either disable readline
+support with --disable-readline or download and install readline from:
+ ftp.gnu.org/gnu/readline
+Note: if you are using precompiled packages you will also need the development
+package as well (which may be called readline-devel or something similar).
+)
+ )
+ AC_CHECK_FUNC(rl_completion_matches, AC_DEFINE([HAVE_RL_COMPLETION_MATCHES], 1, [Define to 1 if rl_completion_matches() is available.]))
+fi
+
+################################################################################
dnl -- Internationalisation stuff
AC_MSG_CHECKING(whether to enable internationalisation)
AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support],
@@ -275,12 +326,11 @@
fi;
AC_ARG_WITH(localedir,
- [ --with-localedir=DIR Translation files in DIR [[PREFIX/share/locale]] ],
- [ LOCALEDIR="$withval" ],
- [ LOCALEDIR='${prefix}/share/locale' ])
+ [ --with-localedir=DIR Translation files in DIR [[PREFIX/share/locale]] ],
+ [ LOCALEDIR="$withval" ],
+ [ LOCALEDIR='${prefix}/share/locale' ])
fi
-
################################################################################
dnl -- Where the linux src tree is
AC_MSG_CHECKING(for kernel directory)
@@ -330,7 +380,7 @@
fi
if test "x${kernelvsn}" = x; then
- if test "x${missingkernel}" = "x"; then
+ if test "x${missingkernel}" = "x"; then
kernelvsn=`awk -F ' = ' '/^VERSION/ {v=$2} /^PATCH/ {p=$2} /^SUBLEVEL/ {s=$2} /^EXTRAVERSION/ {e=$2} END {printf "%d.%d.%d%s",v,p,s,e}' $kerneldir/Makefile`
else
kernelvsn="UNKNOWN"
@@ -364,11 +414,7 @@
fi
AC_MSG_RESULT($interface)
-if test "-f VERSION" ; then
- DM_LIB_VERSION="\"`cat VERSION|sed -e \"s/([[0-9.]]*)/\0-$interface/\"`\""
-else
- DM_LIB_VERSION="Unknown version ($interface)"
-fi
+DM_LIB_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\""
AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version])
@@ -377,9 +423,9 @@
AH_TEMPLATE(DMEVENTD_PIDFILE, [Path to dmeventd pidfile.])
if test "$DMEVENTD" = yes; then
AC_ARG_WITH(dmeventd-pidfile,
- [ --with-dmeventd-pidfile=PATH dmeventd pidfile [[/var/run/dmeventd.pid]] ],
- [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"$withval") ],
- [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"/var/run/dmeventd.pid") ])
+ [ --with-dmeventd-pidfile=PATH dmeventd pidfile [[/var/run/dmeventd.pid]] ],
+ [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"$withval") ],
+ [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"/var/run/dmeventd.pid") ])
fi
AH_TEMPLATE(DMEVENTD_PATH, [Path to dmeventd binary.])
@@ -392,53 +438,75 @@
dmeventd_prefix=""
fi
AC_ARG_WITH(dmeventd-path,
- [ --with-dmeventd-path=PATH dmeventd path [[${exec_prefix}/sbin/dmeventd]] ],
- [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$withval") ],
- [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$dmeventd_prefix/sbin/dmeventd") ])
+ [ --with-dmeventd-path=PATH dmeventd path [[${exec_prefix}/sbin/dmeventd]] ],
+ [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$withval") ],
+ [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$dmeventd_prefix/sbin/dmeventd") ])
fi
+
################################################################################
-AC_SUBST(usrlibdir)
-AC_SUBST(JOBS)
-AC_SUBST(STATIC_LINK)
-AC_SUBST(OWNER)
-AC_SUBST(GROUP)
-AC_SUBST(LIBS)
-AC_SUBST(interface)
-AC_SUBST(kerneldir)
-AC_SUBST(missingkernel)
-AC_SUBST(kernelvsn)
-AC_SUBST(tmpdir)
AC_SUBST(CFLAGS)
-AC_SUBST(COPTIMISE_FLAG)
+AC_SUBST(CFLOW_CMD)
AC_SUBST(CLDFLAGS)
-AC_SUBST(LDDEPS)
-AC_SUBST(LIB_SUFFIX)
-AC_SUBST(DEBUG)
-AC_SUBST(DM_LIB_VERSION)
+AC_SUBST(CLDNOWHOLEARCHIVE)
+AC_SUBST(CLDWHOLEARCHIVE)
+AC_SUBST(CLUSTER)
+AC_SUBST(CLVMD)
+AC_SUBST(CMDLIB)
AC_SUBST(COMPAT)
-AC_SUBST(DMIOCTLS)
-AC_SUBST(MSGFMT)
-AC_SUBST(LOCALEDIR)
-AC_SUBST(INTL_PACKAGE)
-AC_SUBST(INTL)
-AC_SUBST(DEVICE_UID)
+AC_SUBST(CONFDIR)
+AC_SUBST(COPTIMISE_FLAG)
+AC_SUBST(CSCOPE_CMD)
+AC_SUBST(DEBUG)
AC_SUBST(DEVICE_GID)
AC_SUBST(DEVICE_MODE)
+AC_SUBST(DEVICE_UID)
+AC_SUBST(DEVMAPPER)
+AC_SUBST(DMDIR)
AC_SUBST(DMEVENTD)
+AC_SUBST(DMIOCTLS)
+AC_SUBST(DM_LIB_VERSION)
+AC_SUBST(FSADM)
+AC_SUBST(GROUP)
+AC_SUBST(HAVE_LIBDL)
+AC_SUBST(HAVE_REALTIME)
+AC_SUBST(HAVE_SELINUX)
+AC_SUBST(INTL)
+AC_SUBST(INTL_PACKAGE)
+AC_SUBST(JOBS)
+AC_SUBST(LDDEPS)
+AC_SUBST(LIBS)
+AC_SUBST(LIB_SUFFIX)
+AC_SUBST(LOCALEDIR)
+AC_SUBST(LVM1)
+AC_SUBST(LVM1_FALLBACK)
+AC_SUBST(LVM_VERSION)
+AC_SUBST(MIRRORS)
+AC_SUBST(MSGFMT)
+AC_SUBST(OWNER)
AC_SUBST(PKGCONFIG)
+AC_SUBST(POOL)
+AC_SUBST(SNAPSHOTS)
+AC_SUBST(STATICDIR)
+AC_SUBST(STATIC_LINK)
AC_SUBST([LIB_PTHREAD])
+AC_SUBST(interface)
+AC_SUBST(kerneldir)
+AC_SUBST(missingkernel)
+AC_SUBST(kernelvsn)
+AC_SUBST(tmpdir)
+AC_SUBST(usrlibdir)
################################################################################
-dnl -- First and last lines should not contain files to generate in order to
+dnl -- First and last lines should not contain files to generate in order to
dnl -- keep utility scripts running properly
AC_CONFIG_FILES([\
Makefile \
make.tmpl \
include/Makefile \
dmsetup/Makefile \
-lib/Makefile \
+lib/Makefile \
lib/libdevmapper.pc \
-dmeventd/Makefile \
+dmeventd/Makefile \
dmeventd/libdevmapper-event.pc \
kernel/Makefile \
man/Makefile \
--- device-mapper/include/configure.h.in 2007/08/14 19:11:31 1.6
+++ device-mapper/include/configure.h.in 2008/06/06 20:33:14 1.7
@@ -3,6 +3,14 @@
/* Define to 1 if the `closedir' function returns void instead of `int'. */
#undef CLOSEDIR_VOID
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
/* Path to dmeventd binary. */
#undef DMEVENTD_PATH
@@ -12,6 +20,13 @@
/* Library version */
#undef DM_LIB_VERSION
+/* Define to 1 if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+#undef HAVE_ALLOCA_H
+
/* Define to 1 if canonicalize_file_name is available. */
#undef HAVE_CANONICALIZE_FILE_NAME
@@ -30,6 +45,12 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define to 1 if you have the `gethostname' function. */
+#undef HAVE_GETHOSTNAME
+
/* Define to 1 if getline is available. */
#undef HAVE_GETLINE
@@ -39,12 +60,22 @@
/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the `readline' library (-lreadline). */
+#undef HAVE_LIBREADLINE
+
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
+/* Define to 1 if `lstat' has the bug that it succeeds when given the
+ zero-length file name argument. */
+#undef HAVE_LSTAT_EMPTY_STRING_BUG
+
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#undef HAVE_MALLOC
@@ -58,18 +89,30 @@
/* Define to 1 if you have the `mkdir' function. */
#undef HAVE_MKDIR
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the `munmap' function. */
+#undef HAVE_MUNMAP
+
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
+/* Define to 1 if rl_completion_matches() is available. */
+#undef HAVE_RL_COMPLETION_MATCHES
+
/* Define to 1 if you have the `rmdir' function. */
#undef HAVE_RMDIR
-/* Define to 1 if selinux is available. */
+/* Define to 1 to include support for selinux. */
#undef HAVE_SELINUX
/* Define to 1 if sepol_check_context is available. */
#undef HAVE_SEPOL
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
/* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG
@@ -86,6 +129,9 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
@@ -101,9 +147,21 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the `strncasecmp' function. */
+#undef HAVE_STRNCASECMP
+
/* Define to 1 if you have the `strrchr' function. */
#undef HAVE_STRRCHR
+/* Define to 1 if you have the `strstr' function. */
+#undef HAVE_STRSTR
+
+/* Define to 1 if you have the `strtol' function. */
+#undef HAVE_STRTOL
+
+/* Define to 1 if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
+
/* Define to 1 if `st_rdev' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_RDEV
@@ -130,6 +188,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
/* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
@@ -139,9 +200,21 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
+
+/* Define to 1 if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
+
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
+/* Define to 1 if `fork' works. */
+#undef HAVE_WORKING_FORK
+
+/* Define to 1 if `vfork' works. */
+#undef HAVE_WORKING_VFORK
+
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
@@ -164,12 +237,23 @@
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
@@ -182,6 +266,9 @@
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc
+/* Define to `int' if <sys/types.h> does not define. */
+#undef mode_t
+
/* Define to `long int' if <sys/types.h> does not define. */
#undef off_t
@@ -190,3 +277,6 @@
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
+
+/* Define as `fork' if `vfork' does not work. */
+#undef vfork
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-06-06 20:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-12 15:42 device-mapper ./WHATS_NEW ./configure ./config agk
-- strict thread matches above, loose matches on Subject: below --
2007-01-11 21:54 agk
2007-01-19 15:53 agk
2007-08-21 20:32 meyering
2008-06-06 20:33 agk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.