Rebased from upstream / out of band repository.
[librecmc/librecmc.git] / package / boot / grub2 / Makefile
1 #
2 # Copyright (C) 2006-2015 OpenWrt.org
3 #
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 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=grub
12 PKG_CPE_ID:=cpe:/a:gnu:grub2
13 PKG_VERSION:=2.02
14 PKG_RELEASE:=3
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
17 PKG_SOURCE_URL:=@GNU/grub
18 PKG_HASH:=810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f
19
20 PKG_FIXUP:=autoreconf
21 HOST_BUILD_PARALLEL:=1
22 PKG_BUILD_DEPENDS:=grub2/host
23
24 PKG_SSP:=0
25
26 PKG_FLAGS:=nonshared
27
28 include $(INCLUDE_DIR)/host-build.mk
29 include $(INCLUDE_DIR)/package.mk
30
31 define Package/grub2
32   CATEGORY:=Boot Loaders
33   SECTION:=boot
34   TITLE:=GRand Unified Bootloader
35   URL:=http://www.gnu.org/software/grub/
36   DEPENDS:=@TARGET_x86||TARGET_x86_64
37 endef
38
39 define Package/grub2-editenv
40   CATEGORY:=Utilities
41   SECTION:=utils
42   SUBMENU:=Boot Loaders
43   TITLE:=Grub2 Environment editor
44   URL:=http://www.gnu.org/software/grub/
45   DEPENDS:=@TARGET_x86||TARGET_x86_64
46 endef
47
48 define Package/grub2-editenv/description
49         Edit grub2 environment files.
50 endef
51
52 HOST_BUILD_PREFIX := $(STAGING_DIR_HOST)
53
54 CONFIGURE_VARS += \
55         grub_build_mkfont_excuse="don't want fonts"
56
57 CONFIGURE_ARGS += \
58         --target=$(REAL_GNU_TARGET_NAME) \
59         --disable-werror \
60         --disable-nls \
61         --disable-device-mapper \
62         --disable-libzfs \
63         --disable-grub-mkfont \
64         --with-platform=none
65
66 HOST_CONFIGURE_VARS += \
67         grub_build_mkfont_excuse="don't want fonts"
68
69 HOST_CONFIGURE_ARGS += \
70         --disable-grub-mkfont \
71         --target=$(REAL_GNU_TARGET_NAME) \
72         --sbindir="$(STAGING_DIR_HOST)/bin" \
73         --disable-werror \
74         --disable-libzfs \
75         --disable-nls
76
77 HOST_MAKE_FLAGS += \
78         TARGET_RANLIB=$(TARGET_RANLIB) \
79         LIBLZMA=$(STAGING_DIR_HOST)/lib/liblzma.a
80
81 define Host/Configure
82         $(SED) 's,(RANLIB),(TARGET_RANLIB),' $(HOST_BUILD_DIR)/grub-core/Makefile.in
83         $(Host/Configure/Default)
84 endef
85
86 define Package/grub2-editenv/install
87         $(INSTALL_DIR) $(1)/usr/sbin
88         $(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
89 endef
90
91 $(eval $(call HostBuild))
92 $(eval $(call BuildPackage,grub2))
93 $(eval $(call BuildPackage,grub2-editenv))