prefix = /usr/local
exec_prefix = ${prefix}
-bindir = ${exec_prefix}/bin
+bindir = ${exec_prefix}/bin
+udevdir = ../..
+klibcdir = $(udevdir)/klibc
+sysfsdir = $(udevdir)/libsysfs
CC = gcc
-CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc -I../../klibc/klibc/include -I../../klibc/klibc/include/bits32 -I/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.1/include -I../../klibc/linux/include -I../../libsysfs -I.
-LDFLAGS = -lsysfs -ldevmapper -ldlist
+GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
+CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
+ -I$(klibcdir)/klibc/include -I$(klibcdir)/klibc/include/bits32 \
+ -I$(GCCINCDIR) -I$(klibcdir)/linux/include -I$(sysfsdir) -I.
OBJS = main.o
CRT0 = ../../klibc/klibc/crt0.o
LIB = ../../klibc/klibc/libc.a
-LIBGCC = /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.1/libgcc.a
+LIBGCC := $(shell $(CC) -print-libgcc-file-name )
+
DMOBJS = libdevmapper/libdm-common.o libdevmapper/ioctl/libdevmapper.o
SYSFSOBJS = ../../libsysfs/dlist.o ../../libsysfs/sysfs_bus.o \
../../libsysfs/sysfs_class.o ../../libsysfs/sysfs_device.o \
# Copyright (C) 2003 Christophe Varoqui, <christophe.varoqui@free.fr>
CC = gcc
-CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc -I../../../klibc/klibc/include -I../../../klibc/klibc/include/bits32 -I/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.1/include -I../../../klibc/linux/include -I. -Iioctl
+udevdir = ../../..
+klibcdir = $(udevdir)/klibc
+
+CC = gcc
+GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
+CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
+ -I$(klibcdir)/klibc/include -I$(klibcdir)/klibc/include/bits32 \
+ -I$(GCCINCDIR) -I$(klibcdir)/linux/include -I. -Iioctl
OBJS = ioctl/libdevmapper.o libdm-common.o
sprintf(all_paths[k].sg_dev, "/dev/%s", buff);
strcpy(all_paths[k].dev, all_paths[k].sg_dev);
if ((sg_fd = open(all_paths[k].sg_dev, O_RDONLY)) < 0) {
+ if (conf->verbose)
+ fprintf(stderr, "can't open %s. mknod ?",
+ all_paths[k].sg_dev);
continue;
}
get_lun_strings(sg_fd, &all_paths[k]);
sprintf(buff, "%d", k);
strncat(file_name, buff, FILE_NAME_SIZE);
strcpy(all_paths[k].sg_dev, file_name);
- if ((sg_fd = open(file_name, O_RDONLY)) < 0)
+ if ((sg_fd = open(file_name, O_RDONLY)) < 0) {
+ if (conf->verbose)
+ fprintf(stderr, "can't open %s. mknod ?",
+ file_name);
continue;
+ }
get_lun_strings(sg_fd, &all_paths[k]);
get_unique_id(sg_fd, &all_paths[k]);
all_paths[k].state = do_tur(sg_fd);
} else
strcat(fname, "xxxx");
- if ((fd = open(fname, O_RDONLY)) < 0)
+ if ((fd = open(fname, O_RDONLY)) < 0) {
+ if (conf->verbose)
+ fprintf(stderr, "can't open %s. mknod ?",
+ fname);
continue;
+ }
res = ioctl(fd, SCSI_IOCTL_GET_IDLUN, &my_scsi_id);
if (res < 0) {
#define MX_ALLOC_LEN 255
#define BLKGETSIZE _IO(0x12,96)
#define DM_TARGET "striped"
+/*
+#define DM_TARGET "multipath"
+#define DM_POLL_INTERVAL 10
+#define DM_PATH_SELECTOR "latency"
+*/
#define PINDEX(x,y) mp[(x)].pindex[(y)]