aboutsummaryrefslogtreecommitdiff
path: root/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'libstore')
-rw-r--r--libstore/Makefile7
-rw-r--r--libstore/part.c7
2 files changed, 11 insertions, 3 deletions
diff --git a/libstore/Makefile b/libstore/Makefile
index f407ce61..56c1fdfd 100644
--- a/libstore/Makefile
+++ b/libstore/Makefile
@@ -28,6 +28,10 @@ SRCS = create.c derive.c make.c rdwr.c set.c \
open.c xinl.c typed.c map.c url.c unknown.c \
stripe.c $(filter-out ileave.c concat.c,$(store-types:=.c))
+# This has to be evaluated after config.make has been included;
+# as a consequence, using 'ifneq' or similar is not an option.
+maybe_part = $(and $(PARTED_LIBS),part)
+
store-types = \
bunzip2 \
concat \
@@ -40,11 +44,12 @@ store-types = \
module \
mvol \
nbd \
+ $(maybe_part) \
remap \
task \
zero
-libstore.so-LDLIBS += -ldl
+libstore.so-LDLIBS += $(PARTED_LIBS) -ldl
LCLHDRS=store.h
installhdrs=store.h
diff --git a/libstore/part.c b/libstore/part.c
index a1ddc5c0..439340be 100644
--- a/libstore/part.c
+++ b/libstore/part.c
@@ -25,11 +25,14 @@
#include <cthreads.h>
#include <parted/parted.h>
-#include <parted/device_gnu.h>
+/*#include <parted/device_gnu.h>*/
#include <string.h>
#include <error.h>
#define NEED_PARTED_VERSION "1.5.4"
+#ifndef PED_SECTOR_SIZE
+#define PED_SECTOR_SIZE PED_SECTOR_SIZE_DEFAULT
+#endif
/* Return a new store in STORE which contains a remap store of partition
PART from the contents of SOURCE; SOURCE is consumed. */
@@ -141,7 +144,7 @@ store_part_create (struct store *source, int index, int flags,
out_with_disk:
assert (ped_device_close (dev) != 0);
- assert (ped_disk_destroy (disk));
+ ped_disk_destroy (disk);
out_with_dev:
ped_device_destroy (dev);
out: