aboutsummaryrefslogtreecommitdiff
path: root/e2fsprogs
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-10-05 10:17:08 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-10-05 10:17:08 +0000
commit7d219aab70e6951ab82c27c202cac05016696723 (patch)
tree4c0679bfa391f71aee9b51505a5d3dc8f60a0cf7 /e2fsprogs
parent8f8f268cfdecb4cabeb2e649a73afc7a485aeff5 (diff)
downloadbusybox-w32-7d219aab70e6951ab82c27c202cac05016696723.tar.gz
busybox-w32-7d219aab70e6951ab82c27c202cac05016696723.tar.bz2
busybox-w32-7d219aab70e6951ab82c27c202cac05016696723.zip
build system overhaul
Diffstat (limited to 'e2fsprogs')
-rw-r--r--e2fsprogs/Config.in20
-rw-r--r--e2fsprogs/Kbuild27
-rw-r--r--e2fsprogs/Makefile22
-rw-r--r--e2fsprogs/Makefile.in86
-rw-r--r--e2fsprogs/blkid/Kbuild18
-rw-r--r--e2fsprogs/blkid/blkid_getsize.c2
-rw-r--r--e2fsprogs/blkid/devname.c2
-rw-r--r--e2fsprogs/blkid/devno.c2
-rw-r--r--e2fsprogs/e2p/Kbuild10
-rw-r--r--e2fsprogs/e2p/fgetsetflags.c2
-rw-r--r--e2fsprogs/ext2fs/Kbuild18
-rw-r--r--e2fsprogs/tune2fs.c2
-rw-r--r--e2fsprogs/uuid/Kbuild9
-rw-r--r--e2fsprogs/uuid/gen_uuid.c1
14 files changed, 94 insertions, 127 deletions
diff --git a/e2fsprogs/Config.in b/e2fsprogs/Config.in
index 91e873e3a..0062b2fe3 100644
--- a/e2fsprogs/Config.in
+++ b/e2fsprogs/Config.in
@@ -5,13 +5,13 @@
5 5
6menu "Linux Ext2 FS Progs" 6menu "Linux Ext2 FS Progs"
7 7
8config CONFIG_CHATTR 8config CHATTR
9 bool "chattr" 9 bool "chattr"
10 default n 10 default n
11 help 11 help
12 chattr changes the file attributes on a second extended file system. 12 chattr changes the file attributes on a second extended file system.
13 13
14config CONFIG_E2FSCK 14config E2FSCK
15 bool "e2fsck" 15 bool "e2fsck"
16 default n 16 default n
17 help 17 help
@@ -20,7 +20,7 @@ config CONFIG_E2FSCK
20 The normal compat symlinks 'fsck.ext2' and 'fsck.ext3' are also 20 The normal compat symlinks 'fsck.ext2' and 'fsck.ext3' are also
21 provided. 21 provided.
22 22
23config CONFIG_FSCK 23config FSCK
24 bool "fsck" 24 bool "fsck"
25 default n 25 default n
26 help 26 help
@@ -28,38 +28,38 @@ config CONFIG_FSCK
28 In actuality, fsck is simply a front-end for the various file system 28 In actuality, fsck is simply a front-end for the various file system
29 checkers (fsck.fstype) available under Linux. 29 checkers (fsck.fstype) available under Linux.
30 30
31config CONFIG_LSATTR 31config LSATTR
32 bool "lsattr" 32 bool "lsattr"
33 default n 33 default n
34 help 34 help
35 lsattr lists the file attributes on a second extended file system. 35 lsattr lists the file attributes on a second extended file system.
36 36
37config CONFIG_MKE2FS 37config MKE2FS
38 bool "mke2fs" 38 bool "mke2fs"
39 default n 39 default n
40 help 40 help
41 mke2fs is used to create an ext2/ext3 filesystem. The normal compat 41 mke2fs is used to create an ext2/ext3 filesystem. The normal compat
42 symlinks 'mkfs.ext2' and 'mkfs.ext3' are also provided. 42 symlinks 'mkfs.ext2' and 'mkfs.ext3' are also provided.
43 43
44config CONFIG_TUNE2FS 44config TUNE2FS
45 bool "tune2fs" 45 bool "tune2fs"
46 default n 46 default n
47 help 47 help
48 tune2fs allows the system administrator to adjust various tunable 48 tune2fs allows the system administrator to adjust various tunable
49 filesystem parameters on Linux ext2/ext3 filesystems. 49 filesystem parameters on Linux ext2/ext3 filesystems.
50 50
51config CONFIG_E2LABEL 51config E2LABEL
52 bool "e2label" 52 bool "e2label"
53 default n 53 default n
54 depends on CONFIG_TUNE2FS 54 depends on TUNE2FS
55 help 55 help
56 e2label will display or change the filesystem label on the ext2 56 e2label will display or change the filesystem label on the ext2
57 filesystem located on device. 57 filesystem located on device.
58 58
59config CONFIG_FINDFS 59config FINDFS
60 bool "findfs" 60 bool "findfs"
61 default n 61 default n
62 depends on CONFIG_TUNE2FS 62 depends on TUNE2FS
63 help 63 help
64 findfs will search the disks in the system looking for a filesystem 64 findfs will search the disks in the system looking for a filesystem
65 which has a label matching label or a UUID equal to uuid. 65 which has a label matching label or a UUID equal to uuid.
diff --git a/e2fsprogs/Kbuild b/e2fsprogs/Kbuild
new file mode 100644
index 000000000..f35a1ae32
--- /dev/null
+++ b/e2fsprogs/Kbuild
@@ -0,0 +1,27 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6
7lib-y:=
8
9lib-$(CONFIG_CHATTR) += chattr.o
10libs-$(CONFIG_CHATTR) += e2p/
11
12lib-$(CONFIG_E2FSCK) += e2fsck.o util.o
13libs-$(CONFIG_E2FSCK) += blkid/ ext2fs/ uuid/
14
15lib-$(CONFIG_FSCK) += fsck.o util.o
16libs-$(CONFIG_FSCK) += blkid/ ext2fs/ uuid/
17
18lib-$(CONFIG_LSATTR) += lsattr.o
19libs-$(CONFIG_LSATTR) += e2p/
20
21lib-$(CONFIG_MKE2FS) += mke2fs.o util.o
22libs-$(CONFIG_MKE2FS) += e2p/ blkid/ ext2fs/ uuid/
23
24lib-$(CONFIG_TUNE2FS) += tune2fs.o util.o
25libs-$(CONFIG_TUNE2FS) += e2p/ blkid/ ext2fs/ uuid/
26
27CFLAGS += -include e2fsprogs/e2fsbb.h
diff --git a/e2fsprogs/Makefile b/e2fsprogs/Makefile
deleted file mode 100644
index 0efa9bb3b..000000000
--- a/e2fsprogs/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6
7ifndef top_srcdir
8top_srcdir=..
9endif
10ifndef top_builddir
11top_builddir=..
12endif
13srcdir=$(top_srcdir)/e2fsprogs
14E2FSPROGS_DIR:=./
15include $(top_builddir)/.config
16include $(top_srcdir)/Rules.mak
17include Makefile.in
18all: $(libraries-y)
19-include $(top_builddir)/.depend
20
21clean:
22 rm -f *.o *.a */*.o $(AR_TARGET)
diff --git a/e2fsprogs/Makefile.in b/e2fsprogs/Makefile.in
deleted file mode 100644
index 160271686..000000000
--- a/e2fsprogs/Makefile.in
+++ /dev/null
@@ -1,86 +0,0 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6
7E2FSPROGS_AR:=e2fsprogs.a
8
9E2FSPROGS_DIR:=$(top_builddir)/e2fsprogs
10E2FSPROGS_SRC:=$(top_srcdir)/e2fsprogs
11
12E2FSPROGS_CFLAGS := -include $(E2FSPROGS_SRC)/e2fsbb.h
13
14BLKID_SRC := cache.c dev.c devname.c devno.c blkid_getsize.c \
15 probe.c read.c resolve.c save.c tag.c list.c
16BLKID_SRCS := $(patsubst %,blkid/%, $(BLKID_SRC))
17BLKID_OBJS := $(patsubst %.c,%.o, $(BLKID_SRCS))
18
19E2P_SRC := fgetsetflags.c fgetsetversion.c pf.c iod.c mntopts.c \
20 feature.c ls.c uuid.c pe.c ostype.c ps.c hashstr.c \
21 parse_num.c
22E2P_SRCS := $(patsubst %,e2p/%, $(E2P_SRC))
23E2P_OBJS := $(patsubst %.c,%.o, $(E2P_SRCS))
24
25EXT2FS_SRC := gen_bitmap.c bitops.c ismounted.c mkjournal.c unix_io.c \
26 rw_bitmaps.c initialize.c bitmaps.c block.c \
27 ind_block.c inode.c freefs.c alloc_stats.c closefs.c \
28 openfs.c io_manager.c finddev.c read_bb.c alloc.c badblocks.c \
29 getsize.c getsectsize.c alloc_tables.c read_bb_file.c mkdir.c \
30 bb_inode.c newdir.c alloc_sb.c lookup.c dirblock.c expanddir.c \
31 dir_iterate.c link.c res_gdt.c icount.c get_pathname.c dblist.c \
32 dirhash.c version.c flushb.c unlink.c check_desc.c valid_blk.c \
33 ext_attr.c bmap.c dblist_dir.c ext2fs_inline.c swapfs.c
34EXT2FS_SRCS := $(patsubst %,ext2fs/%, $(EXT2FS_SRC))
35EXT2FS_OBJS := $(patsubst %.c,%.o, $(EXT2FS_SRCS))
36
37UUID_SRC := compare.c gen_uuid.c pack.c parse.c unpack.c unparse.c \
38 uuid_time.c
39UUID_SRCS := $(patsubst %,uuid/%, $(UUID_SRC))
40UUID_OBJS := $(patsubst %.c,%.o, $(UUID_SRCS))
41
42E2FSPROGS-y:=
43E2FSPROGS-$(CONFIG_CHATTR) += chattr.o $(E2P_OBJS)
44E2FSPROGS-$(CONFIG_E2FSCK) += e2fsck.o util.o $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
45E2FSPROGS-$(CONFIG_FSCK) += fsck.o util.o $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
46E2FSPROGS-$(CONFIG_LSATTR) += lsattr.o $(E2P_OBJS)
47E2FSPROGS-$(CONFIG_MKE2FS) += mke2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
48E2FSPROGS-$(CONFIG_TUNE2FS) += tune2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
49
50E2FSPROGS-y:=$(sort $(E2FSPROGS-y))
51
52ifneq ($(strip $(E2FSPROGS-y)),)
53libraries-y+=$(E2FSPROGS_DIR)/$(E2FSPROGS_AR)
54endif
55
56E2FSPROGS_SRC-y:=$(patsubst %.o,$(E2FSPROGS_SRC)/%.c,$(E2FSPROGS-y))
57E2FSPROGS_SRC-a:=$(wildcard $(E2FSPROGS_SRC)/*.c) $(patsubst %,$(E2FSPROGS_SRC)/%,$(BLKID_SRCS) $(E2P_SRCS) $(EXT2FS_SRCS) $(UUID_SRCS))
58APPLET_SRC-y+=$(E2FSPROGS_SRC-y)
59APPLET_SRC-a+=$(E2FSPROGS_SRC-a)
60
61# XXX: FIXME: change .c to include their stuff relative to $(E2FSPROGS_SRC)
62E2FSPROGS_TMP_KLUDGE:=$(patsubst %,-I$(E2FSPROGS_SRC)/%,blkid e2fsck e2p ext2fs uuid)
63
64APPLETS_DEFINE-y+=$(E2FSPROGS_CFLAGS) -I$(E2FSPROGS_SRC) $(E2FSPROGS_TMP_KLUDGE)
65APPLETS_DEFINE-a+=$(E2FSPROGS_CFLAGS) -I$(E2FSPROGS_SRC) $(E2FSPROGS_TMP_KLUDGE)
66
67$(E2FSPROGS_DIR)/$(E2FSPROGS_AR): $(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSPROGS-y))
68 $(do_ar)
69
70$(E2FSPROGS_DIR)/%.o: $(subst $(top_builddir),$(top_srcdir),$(E2FSPROGS_DIR)/%.c)
71 $(compile.c) $(E2FSPROGS_CFLAGS)
72
73# for building out-of-tree we need to make sure that the directories to hold
74# the object tree are created
75$(patsubst %,$(E2FSPROGS_DIR)/%, blkid e2fsck e2p ext2fs uuid):
76 @mkdir -p "$@"
77
78# make sure that the directories are order-only prerequisites. Otherwise we
79# may have object files created after the timestamp of the directory was
80# updated which would lead to spurious rebuilds (as some of the dentries
81# may be older than the dir itself).
82$(patsubst %,$(E2FSPROGS_DIR)/%, $(BLKID_OBJS)):|$(E2FSPROGS_DIR)/blkid
83$(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSCK_OBJS)):|$(E2FSPROGS_DIR)/e2fsck
84$(patsubst %,$(E2FSPROGS_DIR)/%, $(E2P_OBJS)):|$(E2FSPROGS_DIR)/e2p
85$(patsubst %,$(E2FSPROGS_DIR)/%, $(EXT2FS_OBJS)):|$(E2FSPROGS_DIR)/ext2fs
86$(patsubst %,$(E2FSPROGS_DIR)/%, $(UUID_OBJS)):|$(E2FSPROGS_DIR)/uuid
diff --git a/e2fsprogs/blkid/Kbuild b/e2fsprogs/blkid/Kbuild
new file mode 100644
index 000000000..ba0bee03d
--- /dev/null
+++ b/e2fsprogs/blkid/Kbuild
@@ -0,0 +1,18 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6
7lib-y:=
8lib-y += cache.o dev.o devname.o devno.o blkid_getsize.o \
9 probe.o read.o resolve.o save.o tag.o list.o
10
11CFLAGS_dev.o := -include include/busybox.h
12CFLAGS_devname.o := -include include/busybox.h
13CFLAGS_devno.o := -include include/busybox.h
14CFLAGS_blkid_getsize.o := -include include/busybox.h
15CFLAGS_probe.o := -include include/busybox.h
16CFLAGS_save.o := -include include/busybox.h
17CFLAGS_tag.o := -include include/busybox.h
18CFLAGS_list.o := -include include/busybox.h
diff --git a/e2fsprogs/blkid/blkid_getsize.c b/e2fsprogs/blkid/blkid_getsize.c
index 7a2133f0a..3c5ec5b76 100644
--- a/e2fsprogs/blkid/blkid_getsize.c
+++ b/e2fsprogs/blkid/blkid_getsize.c
@@ -14,9 +14,7 @@
14#include "blkidP.h" 14#include "blkidP.h"
15 15
16#include <stdio.h> 16#include <stdio.h>
17#if HAVE_UNISTD_H
18#include <unistd.h> 17#include <unistd.h>
19#endif
20#if HAVE_ERRNO_H 18#if HAVE_ERRNO_H
21#include <errno.h> 19#include <errno.h>
22#endif 20#endif
diff --git a/e2fsprogs/blkid/devname.c b/e2fsprogs/blkid/devname.c
index b5c1bc9a8..7606e400d 100644
--- a/e2fsprogs/blkid/devname.c
+++ b/e2fsprogs/blkid/devname.c
@@ -23,9 +23,7 @@
23#if HAVE_SYS_TYPES_H 23#if HAVE_SYS_TYPES_H
24#include <sys/types.h> 24#include <sys/types.h>
25#endif 25#endif
26#if HAVE_SYS_STAT_H
27#include <sys/stat.h> 26#include <sys/stat.h>
28#endif
29#if HAVE_ERRNO_H 27#if HAVE_ERRNO_H
30#include <errno.h> 28#include <errno.h>
31#endif 29#endif
diff --git a/e2fsprogs/blkid/devno.c b/e2fsprogs/blkid/devno.c
index 065761fb4..be93666be 100644
--- a/e2fsprogs/blkid/devno.c
+++ b/e2fsprogs/blkid/devno.c
@@ -21,9 +21,7 @@
21#if HAVE_SYS_TYPES_H 21#if HAVE_SYS_TYPES_H
22#include <sys/types.h> 22#include <sys/types.h>
23#endif 23#endif
24#if HAVE_SYS_STAT_H
25#include <sys/stat.h> 24#include <sys/stat.h>
26#endif
27#include <dirent.h> 25#include <dirent.h>
28#if HAVE_ERRNO_H 26#if HAVE_ERRNO_H
29#include <errno.h> 27#include <errno.h>
diff --git a/e2fsprogs/e2p/Kbuild b/e2fsprogs/e2p/Kbuild
new file mode 100644
index 000000000..24a692ea1
--- /dev/null
+++ b/e2fsprogs/e2p/Kbuild
@@ -0,0 +1,10 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6
7lib-y:=
8lib-y += fgetsetflags.o fgetsetversion.o pf.o iod.o mntopts.o \
9 feature.o ls.o uuid.o pe.o ostype.o ps.o hashstr.o \
10 parse_num.o
diff --git a/e2fsprogs/e2p/fgetsetflags.c b/e2fsprogs/e2p/fgetsetflags.c
index 86bf65d50..34e40551f 100644
--- a/e2fsprogs/e2p/fgetsetflags.c
+++ b/e2fsprogs/e2p/fgetsetflags.c
@@ -63,8 +63,8 @@ int fgetsetflags (const char * name, unsigned long * get_flags, unsigned long se
63 if (save_errno) 63 if (save_errno)
64 errno = save_errno; 64 errno = save_errno;
65 return r; 65 return r;
66#endif /* HAVE_EXT2_IOCTLS */
67notsupp: 66notsupp:
67#endif /* HAVE_EXT2_IOCTLS */
68 errno = EOPNOTSUPP; 68 errno = EOPNOTSUPP;
69 return -1; 69 return -1;
70} 70}
diff --git a/e2fsprogs/ext2fs/Kbuild b/e2fsprogs/ext2fs/Kbuild
new file mode 100644
index 000000000..dc499348d
--- /dev/null
+++ b/e2fsprogs/ext2fs/Kbuild
@@ -0,0 +1,18 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6
7lib-y:=
8lib-y += gen_bitmap.o bitops.o ismounted.o mkjournal.o unix_io.o \
9 rw_bitmaps.o initialize.o bitmaps.o block.o \
10 ind_block.o inode.o freefs.o alloc_stats.o closefs.o \
11 openfs.o io_manager.o finddev.o read_bb.o alloc.o badblocks.o \
12 getsize.o getsectsize.o alloc_tables.o read_bb_file.o mkdir.o \
13 bb_inode.o newdir.o alloc_sb.o lookup.o dirblock.o expanddir.o \
14 dir_iterate.o link.o res_gdt.o icount.o get_pathname.o dblist.o \
15 dirhash.o version.o flushb.o unlink.o check_desc.o valid_blk.o \
16 ext_attr.o bmap.o dblist_dir.o ext2fs_inline.o swapfs.o
17
18CFLAGS += -include e2fsprogs/e2fsbb.h
diff --git a/e2fsprogs/tune2fs.c b/e2fsprogs/tune2fs.c
index 9bd6f4c7e..01ba31c68 100644
--- a/e2fsprogs/tune2fs.c
+++ b/e2fsprogs/tune2fs.c
@@ -45,8 +45,6 @@
45#include "blkid/blkid.h" 45#include "blkid/blkid.h"
46 46
47#include "busybox.h" 47#include "busybox.h"
48#include "grp_.h"
49#include "pwd_.h"
50 48
51static char * device_name = NULL; 49static char * device_name = NULL;
52static char * new_label, *new_last_mounted, *new_UUID; 50static char * new_label, *new_last_mounted, *new_UUID;
diff --git a/e2fsprogs/uuid/Kbuild b/e2fsprogs/uuid/Kbuild
new file mode 100644
index 000000000..0ae74aed3
--- /dev/null
+++ b/e2fsprogs/uuid/Kbuild
@@ -0,0 +1,9 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6
7lib-y:=
8lib-y += compare.o gen_uuid.o pack.o parse.o unpack.o unparse.o \
9 uuid_time.o
diff --git a/e2fsprogs/uuid/gen_uuid.c b/e2fsprogs/uuid/gen_uuid.c
index e5c0f0d53..9d700a015 100644
--- a/e2fsprogs/uuid/gen_uuid.c
+++ b/e2fsprogs/uuid/gen_uuid.c
@@ -41,6 +41,7 @@
41#include <sys/types.h> 41#include <sys/types.h>
42#include <sys/stat.h> 42#include <sys/stat.h>
43#include <sys/file.h> 43#include <sys/file.h>
44#include <sys/time.h>
44#ifdef HAVE_SYS_IOCTL_H 45#ifdef HAVE_SYS_IOCTL_H
45#include <sys/ioctl.h> 46#include <sys/ioctl.h>
46#endif 47#endif