[package] firewall:
[openwrt.git] / package / ncurses / Makefile
1 #
2 # Copyright (C) 2006-2011 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
10 PKG_NAME:=ncurses
11 PKG_VERSION:=5.7
12 PKG_RELEASE:=5
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@GNU/ncurses
17 PKG_MD5SUM:=cce05daf61a64501ef6cd8da1f727ec6
18
19 PKG_INSTALL:=1
20 PKG_BUILD_PARALLEL:=1
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/libncurses
25 SECTION:=libs
26 CATEGORY:=Libraries
27 TITLE:=Terminal handling library
28 URL:=http://www.gnu.org/software/ncurses/
29 DEPENDS:= +terminfo
30 VARIANT:=libncurses
31 endef
32
33 define Package/terminfo
34 SECTION:=libs
35 CATEGORY:=Libraries
36 TITLE:=Terminal Info Database (ncurses)
37 URL:=http://www.gnu.org/software/ncurses/
38 VARIANT:=libncurses
39 endef
40
41 define Package/libncursesw
42 SECTION:=libs
43 CATEGORY:=Libraries
44 TITLE:=Terminal handling library (Unicode)
45 URL:=http://www.gnu.org/software/ncurses/
46 DEPENDS:=libncurses
47 VARIANT:=libncursesw
48 endef
49
50 TARGET_CFLAGS += $(FPIC)
51
52 CONFIGURE_ARGS += \
53 --enable-echo \
54 --enable-const \
55 --enable-overwrite \
56 --disable-rpath \
57 --without-ada \
58 --without-debug \
59 --without-profile \
60 --without-progs \
61 --disable-big-core \
62 --disable-home-terminfo \
63 --with-normal \
64 --with-shared \
65 --with-terminfo-dirs=/usr/share/terminfo \
66 --with-default-terminfo-dir=/usr/share/terminfo
67
68 ifeq ($(HOST_OS),FreeBSD)
69 CONFIGURE_ARGS +=
70 --with-terminfo=/usr/share/terminfo.db
71 endif
72
73 ifeq ($(BUILD_VARIANT),libncursesw)
74 CONFIGURE_ARGS += \
75 --enable-widec \
76 --with-build-cppflags=-D_GNU_SOURCE
77 endif
78
79 MAKE_FLAGS += \
80 BUILD_CC="$(HOSTCC)" \
81 HOSTCC="$(HOSTCC)" \
82 HOSTCCFLAGS="" \
83 libs
84
85 define Build/Install/Default
86 $(MAKE_VARS) \
87 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
88 $(MAKE_INSTALL_FLAGS) \
89 $(1) install.libs install.data;
90 endef
91
92 define Package/terminfo/install
93 echo ""
94 ifneq ($(HOST_OS),FreeBSD)
95 $(INSTALL_DIR) $(1)/usr/share/terminfo
96 (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
97 for dir in ??; do \
98 [ -d "$$$$dir" ] || continue; \
99 mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
100 done \
101 )
102 for file in a/ansi d/dumb l/linux r/rxvt r/rxvt-unicode s/screen v/vt100 v/vt102 x/xterm x/xterm-color; do \
103 $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
104 $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
105 $(1)/usr/share/terminfo/$$$$file; \
106 done
107 endif
108 endef
109
110 define Package/libncurses/install
111 $(INSTALL_DIR) $(1)/usr/lib
112 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{curses,ncurses,panel,menu,form}.so* $(1)/usr/lib/
113 endef
114
115 define Package/libncursesw/install
116 $(INSTALL_DIR) $(1)/usr/lib
117 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}w.so* $(1)/usr/lib/
118 endef
119
120 ifeq ($(BUILD_VARIANT),libncursesw)
121 define Build/InstallDev
122 $(INSTALL_DIR) $(1)/usr/include/ncursesw/
123 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ncursesw/
124
125 $(INSTALL_DIR) $(1)/usr/lib
126 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}w.{a,so*} $(1)/usr/lib/
127
128 $(INSTALL_DIR) $(1)/usr/bin $(2)/bin
129 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ncursesw5-config $(2)/bin/
130 $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' -e 's/$$$$INCS //g' \
131 $(2)/bin/ncursesw5-config
132 ln -sf $(STAGING_DIR)/host/bin/ncursesw5-config $(1)/usr/bin/ncursesw5-config
133 endef
134 else
135 define Build/InstallDev
136 $(INSTALL_DIR) $(1)/usr/include
137 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
138
139 $(INSTALL_DIR) $(1)/usr/lib
140 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{curses,ncurses,panel,menu,form}.{a,so*} $(1)/usr/lib/
141
142 $(INSTALL_DIR) $(1)/usr/bin $(2)/bin
143 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ncurses5-config $(2)/bin/
144 $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
145 $(2)/bin/ncurses5-config
146 ln -sf $(STAGING_DIR)/host/bin/ncurses5-config $(1)/usr/bin/ncurses5-config
147 endef
148 endif
149
150 $(eval $(call BuildPackage,terminfo))
151 $(eval $(call BuildPackage,libncurses))
152 $(eval $(call BuildPackage,libncursesw))
This page took 0.052703 seconds and 5 git commands to generate.