board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / e2fsprogs / e2fsprogs.mk
blob6659c167dbc5fd524ecccc6379edc693b4349268
1 ################################################################################
3 # e2fsprogs
5 ################################################################################
7 E2FSPROGS_VERSION = 1.43.4
8 E2FSPROGS_SOURCE = e2fsprogs-$(E2FSPROGS_VERSION).tar.xz
9 E2FSPROGS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/people/tytso/e2fsprogs/v$(E2FSPROGS_VERSION)
10 E2FSPROGS_LICENSE = GPLv2, BSD-3c (libuuid), MIT-like with advertising clause (libss and libet)
11 E2FSPROGS_LICENSE_FILES = NOTICE lib/uuid/COPYING lib/ss/mit-sipb-copyright.h lib/et/internal.h
12 E2FSPROGS_INSTALL_STAGING = YES
13 E2FSPROGS_DEPENDENCIES = host-pkgconf util-linux
14 # we don't have a host-util-linux
15 HOST_E2FSPROGS_DEPENDENCIES = host-pkgconf
17 # e4defrag doesn't build on older systems like RHEL5.x, and we don't
18 # need it on the host anyway.
19 # Disable fuse2fs as well to avoid carrying over deps, and it's unused
20 HOST_E2FSPROGS_CONF_OPTS += --disable-defrag --disable-fuse2fs
22 E2FSPROGS_CONF_OPTS = \
23 $(if $(BR2_STATIC_LIBS),,--enable-elf-shlibs) \
24 $(if $(BR2_PACKAGE_E2FSPROGS_DEBUGFS),,--disable-debugfs) \
25 $(if $(BR2_PACKAGE_E2FSPROGS_E2IMAGE),,--disable-imager) \
26 $(if $(BR2_PACKAGE_E2FSPROGS_E4DEFRAG),,--disable-defrag) \
27 $(if $(BR2_PACKAGE_E2FSPROGS_RESIZE2FS),,--disable-resizer) \
28 --disable-uuidd \
29 --disable-libblkid \
30 --disable-libuuid \
31 --enable-fsck \
32 --disable-e2initrd-helper \
33 --disable-testio-debug \
34 --disable-rpath
36 ifeq ($(BR2_PACKAGE_E2FSPROGS_FUSE2FS),y)
37 E2FSPROGS_CONF_OPTS += --enable-fuse2fs
38 E2FSPROGS_DEPENDENCIES += libfuse
39 else
40 E2FSPROGS_CONF_OPTS += --disable-fuse2fs
41 endif
43 ifeq ($(BR2_nios2),y)
44 E2FSPROGS_CONF_ENV += ac_cv_func_fallocate=no
45 endif
47 # Some programs are built for the host, but use definitions guessed by
48 # the configure script (i.e with the cross-compiler). Help them by
49 # saying that <sys/stat.h> is available on the host, which is needed
50 # for util/subst.c to build properly.
51 E2FSPROGS_CONF_ENV += BUILD_CFLAGS="-DHAVE_SYS_STAT_H"
53 # Disable use of the host magic.h, as on older hosts (e.g. RHEL 5)
54 # it doesn't provide definitions expected by e2fsprogs support lib.
55 HOST_E2FSPROGS_CONF_ENV += \
56 ac_cv_header_magic_h=no \
57 ac_cv_lib_magic_magic_file=no
59 ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
60 # util-linux libuuid pulls in libintl if needed, so ensure we also
61 # link against it, otherwise static linking fails
62 E2FSPROGS_CONF_ENV += LIBS=-lintl
63 endif
65 E2FSPROGS_MAKE_OPTS = LDCONFIG=true
66 E2FSPROGS_INSTALL_STAGING_OPTS = \
67 DESTDIR=$(STAGING_DIR) \
68 LDCONFIG=true \
69 install-libs
70 E2FSPROGS_INSTALL_TARGET_OPTS = \
71 DESTDIR=$(TARGET_DIR) \
72 LDCONFIG=true \
73 install
75 define HOST_E2FSPROGS_INSTALL_CMDS
76 $(HOST_MAKE_ENV) $(MAKE) -C $(@D) install install-libs
77 endef
79 # binaries to keep or remove
80 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_BADBLOCKS) += usr/sbin/badblocks
81 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_CHATTR) += usr/bin/chattr
82 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_DUMPE2FS) += usr/sbin/dumpe2fs
83 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_E2FREEFRAG) += usr/sbin/e2freefrag
84 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_E2FSCK) += usr/sbin/e2fsck
85 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_E2LABEL) += usr/sbin/e2label
86 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_E2UNDO) += usr/sbin/e2undo
87 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_E4DEFRAG) += usr/sbin/e4defrag
88 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_FILEFRAG) += usr/sbin/filefrag
89 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_FSCK) += usr/sbin/fsck
90 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_LOGSAVE) += usr/sbin/logsave
91 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_LSATTR) += usr/bin/lsattr
92 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_MKE2FS) += usr/sbin/mke2fs
93 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_MKLOSTFOUND) += usr/sbin/mklost+found
94 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_UUIDGEN) += usr/bin/uuidgen
96 # files to remove
97 E2FSPROGS_TXTTARGETS_ = \
98 usr/sbin/mkfs.ext[234] \
99 usr/sbin/mkfs.ext4dev \
100 usr/sbin/fsck.ext[234] \
101 usr/sbin/fsck.ext4dev \
102 usr/sbin/tune2fs
104 define E2FSPROGS_TARGET_REMOVE_UNNEEDED
105 rm -f $(addprefix $(TARGET_DIR)/, $(E2FSPROGS_BINTARGETS_))
106 rm -f $(addprefix $(TARGET_DIR)/, $(E2FSPROGS_TXTTARGETS_))
107 endef
109 E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_REMOVE_UNNEEDED
111 define E2FSPROGS_TARGET_MKE2FS_SYMLINKS
112 ln -sf mke2fs $(TARGET_DIR)/usr/sbin/mkfs.ext2
113 ln -sf mke2fs $(TARGET_DIR)/usr/sbin/mkfs.ext3
114 ln -sf mke2fs $(TARGET_DIR)/usr/sbin/mkfs.ext4
115 ln -sf mke2fs $(TARGET_DIR)/usr/sbin/mkfs.ext4dev
116 endef
118 ifeq ($(BR2_PACKAGE_E2FSPROGS_MKE2FS),y)
119 E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_MKE2FS_SYMLINKS
120 endif
122 define E2FSPROGS_TARGET_E2FSCK_SYMLINKS
123 ln -sf e2fsck $(TARGET_DIR)/usr/sbin/fsck.ext2
124 ln -sf e2fsck $(TARGET_DIR)/usr/sbin/fsck.ext3
125 ln -sf e2fsck $(TARGET_DIR)/usr/sbin/fsck.ext4
126 ln -sf e2fsck $(TARGET_DIR)/usr/sbin/fsck.ext4dev
127 endef
129 ifeq ($(BR2_PACKAGE_E2FSPROGS_E2FSCK),y)
130 E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_E2FSCK_SYMLINKS
131 endif
133 # If BusyBox is included, its configuration may supply its own variant
134 # of ext2-related tools. Since Buildroot desires having full blown
135 # variants take precedence (in this case, e2fsprogs), we want to remove
136 # BusyBox's variant of e2fsprogs provided binaries. e2fsprogs targets
137 # /usr/{bin,sbin} where BusyBox targets /{bin,sbin}. We will attempt to
138 # remove BusyBox-generated ext2-related tools from /{bin,sbin}. We need
139 # to do this in the pre-install stage to ensure we do not accidentally
140 # remove e2fsprogs's binaries in usr-merged environments (ie. if they
141 # are removed, they would be re-installed in this package's install
142 # stage).
143 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
144 E2FSPROGS_DEPENDENCIES += busybox
146 define E2FSPROGS_REMOVE_BUSYBOX_APPLETS
147 $(RM) -f $(TARGET_DIR)/bin/chattr
148 $(RM) -f $(TARGET_DIR)/bin/lsattr
149 $(RM) -f $(TARGET_DIR)/sbin/fsck
150 $(RM) -f $(TARGET_DIR)/sbin/tune2fs
151 $(RM) -f $(TARGET_DIR)/sbin/e2label
152 endef
153 E2FSPROGS_PRE_INSTALL_TARGET_HOOKS += E2FSPROGS_REMOVE_BUSYBOX_APPLETS
154 endif
156 define E2FSPROGS_TARGET_TUNE2FS_SYMLINK
157 ln -sf e2label $(TARGET_DIR)/usr/sbin/tune2fs
158 endef
160 ifeq ($(BR2_PACKAGE_E2FSPROGS_TUNE2FS),y)
161 E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_TUNE2FS_SYMLINK
162 endif
164 $(eval $(autotools-package))
165 $(eval $(host-autotools-package))