]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/e2fsprogs/e2fsprogs.mk
Rename BR2_PREFER_STATIC_LIB to BR2_STATIC_LIBS
[coffee/buildroot.git] / package / e2fsprogs / e2fsprogs.mk
1 ################################################################################
2 #
3 # e2fsprogs
4 #
5 ################################################################################
6
7 E2FSPROGS_VERSION = 1.42.12
8 E2FSPROGS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/people/tytso/e2fsprogs/v$(E2FSPROGS_VERSION)
9 E2FSPROGS_LICENSE = GPLv2, libuuid BSD-3c, libss and libet MIT-like with advertising clause
10 E2FSPROGS_LICENSE_FILES = COPYING lib/uuid/COPYING lib/ss/mit-sipb-copyright.h lib/et/internal.h
11 E2FSPROGS_INSTALL_STAGING = YES
12 E2FSPROGS_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) install-libs
13
14 E2FSPROGS_CONF_OPTS = \
15         $(if $(BR2_STATIC_LIBS),,--enable-elf-shlibs) \
16         $(if $(BR2_PACKAGE_E2FSPROGS_DEBUGFS),,--disable-debugfs) \
17         $(if $(BR2_PACKAGE_E2FSPROGS_E2IMAGE),,--disable-imager) \
18         $(if $(BR2_PACKAGE_E2FSPROGS_E4DEFRAG),,--disable-defrag) \
19         $(if $(BR2_PACKAGE_E2FSPROGS_RESIZE2FS),,--disable-resizer) \
20         --disable-uuidd \
21         --disable-libblkid \
22         --disable-libuuid \
23         --enable-fsck \
24         --disable-e2initrd-helper \
25         --disable-testio-debug \
26         --disable-rpath
27
28 ifeq ($(BR2_nios2),y)
29 E2FSPROGS_CONF_ENV += ac_cv_func_fallocate=no
30 endif
31
32 ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
33 # util-linux libuuid pulls in libintl if needed, so ensure we also
34 # link against it, otherwise static linking fails
35 E2FSPROGS_CONF_ENV += LIBS=-lintl
36 endif
37
38 E2FSPROGS_DEPENDENCIES = host-pkgconf util-linux
39
40 E2FSPROGS_MAKE_OPTS = \
41         LDCONFIG=true
42
43 define HOST_E2FSPROGS_INSTALL_CMDS
44         $(HOST_MAKE_ENV) $(MAKE) -C $(@D) install install-libs
45 endef
46 # we don't have a host-util-linux
47 HOST_E2FSPROGS_DEPENDENCIES = host-pkgconf
48
49 # binaries to keep or remove
50 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_BADBLOCKS) += usr/sbin/badblocks
51 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_CHATTR) += usr/bin/chattr
52 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_DUMPE2FS) += usr/sbin/dumpe2fs
53 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_E2FREEFRAG) += usr/sbin/e2freefrag
54 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_E2FSCK) += usr/sbin/e2fsck
55 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_E2LABEL) += usr/sbin/e2label
56 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_E2UNDO) += usr/sbin/e2undo
57 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_E4DEFRAG) += usr/sbin/e4defrag
58 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_FILEFRAG) += usr/sbin/filefrag
59 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_FSCK) += usr/sbin/fsck
60 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_LOGSAVE) += usr/sbin/logsave
61 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_LSATTR) += usr/bin/lsattr
62 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_MKE2FS) += usr/sbin/mke2fs
63 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_MKLOSTFOUND) += usr/sbin/mklost+found
64 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_UUIDGEN) += usr/bin/uuidgen
65
66 # files to remove
67 E2FSPROGS_TXTTARGETS_ = \
68         usr/sbin/mkfs.ext[234] \
69         usr/sbin/mkfs.ext4dev \
70         usr/sbin/fsck.ext[234] \
71         usr/sbin/fsck.ext4dev \
72         usr/sbin/findfs \
73         usr/sbin/tune2fs
74
75 define E2FSPROGS_TARGET_REMOVE_UNNEEDED
76         rm -f $(addprefix $(TARGET_DIR)/, $(E2FSPROGS_BINTARGETS_))
77         rm -f $(addprefix $(TARGET_DIR)/, $(E2FSPROGS_TXTTARGETS_))
78 endef
79
80 E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_REMOVE_UNNEEDED
81
82 define E2FSPROGS_TARGET_MKE2FS_SYMLINKS
83         ln -sf mke2fs $(TARGET_DIR)/usr/sbin/mkfs.ext2
84         ln -sf mke2fs $(TARGET_DIR)/usr/sbin/mkfs.ext3
85         ln -sf mke2fs $(TARGET_DIR)/usr/sbin/mkfs.ext4
86         ln -sf mke2fs $(TARGET_DIR)/usr/sbin/mkfs.ext4dev
87 endef
88
89 ifeq ($(BR2_PACKAGE_E2FSPROGS_MKE2FS),y)
90 E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_MKE2FS_SYMLINKS
91 endif
92
93 define E2FSPROGS_TARGET_E2FSCK_SYMLINKS
94         ln -sf e2fsck $(TARGET_DIR)/usr/sbin/fsck.ext2
95         ln -sf e2fsck $(TARGET_DIR)/usr/sbin/fsck.ext3
96         ln -sf e2fsck $(TARGET_DIR)/usr/sbin/fsck.ext4
97         ln -sf e2fsck $(TARGET_DIR)/usr/sbin/fsck.ext4dev
98 endef
99
100 ifeq ($(BR2_PACKAGE_E2FSPROGS_E2FSCK),y)
101 E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_E2FSCK_SYMLINKS
102 endif
103
104 define E2FSPROGS_TARGET_TUNE2FS_SYMLINK
105         ln -sf e2label $(TARGET_DIR)/usr/sbin/tune2fs
106 endef
107
108 ifeq ($(BR2_PACKAGE_E2FSPROGS_TUNE2FS),y)
109 E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_TUNE2FS_SYMLINK
110 endif
111
112 define E2FSPROGS_TARGET_FINDFS_SYMLINK
113         ln -sf e2label $(TARGET_DIR)/usr/sbin/findfs
114 endef
115
116 ifeq ($(BR2_PACKAGE_E2FSPROGS_FINDFS),y)
117 E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_FINDFS_SYMLINK
118 endif
119
120 $(eval $(autotools-package))
121 $(eval $(host-autotools-package))