e2fsprogs: use -ffunction-sections, -fdata-sections, --gc-sections
[openwrt/svn-archive/archive.git] / package / utils / e2fsprogs / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 # Copyright 2010 Vertical Communications
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=e2fsprogs
11 PKG_VERSION:=1.42.4
12 PKG_MD5SUM:=b6e296f210d642361b7394437ff0f318
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/e2fsprogs
17
18 PKG_BUILD_DEPENDS:=util-linux
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/e2fsprogs/Default
24 URL:=http://e2fsprogs.sourceforge.net/
25 SUBMENU:=Filesystem
26 endef
27
28 define Package/e2fsprogs
29 $(call Package/e2fsprogs/Default)
30 SECTION:=utils
31 CATEGORY:=Utilities
32 TITLE:=Ext2/3/4 filesystem utilities
33 DEPENDS:=+libuuid +libext2fs
34 endef
35
36 define Package/e2fsprogs/description
37 This package contains essential ext2 filesystem utilities which consists of
38 e2fsck, mke2fs, tune2fs, and most of the other core ext2
39 filesystem utilities.
40 endef
41
42 define Package/libext2fs
43 $(call Package/e2fsprogs/Default)
44 DEPENDS:=+libcom_err
45 SECTION:=libs
46 CATEGORY:=Libraries
47 TITLE:=ext2/3/4 filesystem library
48 endef
49
50 define Package/libext2fs/description
51 libext2fs is a library which can access ext2, ext3 and ext4 filesystems.
52 endef
53
54 define Package/libcom_err
55 $(call Package/e2fsprogs/Default)
56 DEPENDS:=+libpthread
57 SECTION:=libs
58 CATEGORY:=Libraries
59 TITLE:=Common error description library
60 endef
61
62 define Package/libcom_err/description
63 libcom_err is a library providing common error descriptions
64 endef
65
66 define Package/tune2fs
67 $(call Package/e2fsprogs)
68 TITLE:=Ext2 Filesystem tune utility
69 DEPENDS:= +e2fsprogs
70 endef
71
72 define Package/resize2fs
73 $(call Package/e2fsprogs)
74 TITLE:=Ext2 Filesystem resize utility
75 DEPENDS:= +e2fsprogs
76 endef
77
78 define Package/badblocks
79 $(call Package/e2fsprogs)
80 TITLE:=Ext2 Filesystem badblocks utility
81 DEPENDS:= +e2fsprogs
82 endef
83
84 TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
85
86
87 CONFIGURE_ARGS += \
88 --enable-elf-shlibs \
89 --disable-libuuid \
90 --enable-libblkid \
91 --disable-uuidd \
92 --disable-tls \
93 --disable-nls \
94 --disable-rpath
95
96 define Build/Prepare
97 $(call Build/Prepare/Default)
98 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/config/
99 endef
100
101 define Build/Compile
102 $(MAKE) -C $(PKG_BUILD_DIR)/util \
103 BUILDCC="$(HOSTCC)" \
104 CFLAGS="" \
105 CPPFLAGS="" \
106 LDFLAGS="" \
107 subst
108 $(MAKE) -C $(PKG_BUILD_DIR) \
109 LDFLAGS=-Wl,--gc-sections \
110 BUILDCC="$(HOSTCC)" \
111 DESTDIR="$(PKG_INSTALL_DIR)" \
112 LIBBLKID="$(PKG_BUILD_DIR)/lib/libblkid.a -luuid" \
113 all
114 endef
115
116 define Build/InstallDev
117 $(MAKE) -C $(PKG_BUILD_DIR) \
118 BUILDCC="$(HOSTCC)" \
119 DESTDIR="$(1)" \
120 install-libs
121 $(MAKE) -C $(PKG_BUILD_DIR)/lib/ext2fs \
122 BUILDCC="$(HOSTCC)" \
123 DESTDIR="$(1)" \
124 install
125 endef
126
127 define Package/e2fsprogs/install
128 $(INSTALL_DIR) $(1)/usr/sbin
129 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2fsck $(1)/usr/sbin/
130 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mke2fs $(1)/usr/sbin/
131 ln -sf mke2fs $(1)/usr/sbin/mkfs.ext2
132 ln -sf mke2fs $(1)/usr/sbin/mkfs.ext3
133 ln -sf mke2fs $(1)/usr/sbin/mkfs.ext4
134 $(INSTALL_DIR) $(1)/usr/lib
135 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libe2p.so.* $(1)/usr/lib/
136 $(INSTALL_DIR) $(1)/etc/init.d
137 $(INSTALL_DIR) $(1)/lib/functions/fsck
138 $(INSTALL_DATA) ./files/e2fsck.sh $(1)/lib/functions/fsck/
139 $(INSTALL_DATA) ./files/e2fsck.conf $(1)/etc/e2fsck.conf
140 endef
141
142 define Package/libcom_err/install
143 $(INSTALL_DIR) $(1)/usr/lib
144 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcom_err.so.* $(1)/usr/lib/
145 endef
146
147 define Package/libext2fs/install
148 $(INSTALL_DIR) $(1)/usr/lib
149 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libext2fs.so.* $(1)/usr/lib/
150 endef
151
152 define Package/tune2fs/install
153 $(INSTALL_DIR) $(1)/usr/sbin
154 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tune2fs $(1)/usr/sbin/
155 endef
156
157 define Package/resize2fs/install
158 $(INSTALL_DIR) $(1)/usr/sbin
159 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/resize2fs $(1)/usr/sbin/
160 endef
161
162 define Package/badblocks/install
163 $(INSTALL_DIR) $(1)/usr/sbin
164 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/badblocks $(1)/usr/sbin/
165 endef
166
167 $(eval $(call BuildPackage,e2fsprogs))
168 $(eval $(call BuildPackage,libext2fs))
169 $(eval $(call BuildPackage,libcom_err))
170 $(eval $(call BuildPackage,tune2fs))
171 $(eval $(call BuildPackage,resize2fs))
172 $(eval $(call BuildPackage,badblocks))