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