[package] ncurses: Add libncursesw package
[openwrt/svn-archive/archive.git] / package / ncurses / Makefile
1 #
2 # Copyright (C) 2006-2010 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:=3
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
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/libncurses
24 SECTION:=libs
25 CATEGORY:=Libraries
26 TITLE:=Terminal handling library
27 URL:=http://www.gnu.org/software/ncurses/
28 VARIANT:=libncurses
29 endef
30
31 define Package/libncursesw
32 SECTION:=libs
33 CATEGORY:=Libraries
34 TITLE:=Terminal handling library (Unicode)
35 URL:=http://www.gnu.org/software/ncurses/
36 DEPENDS:=libncurses
37 VARIANT:=libncursesw
38 endef
39
40 TARGET_CFLAGS += $(FPIC)
41
42 CONFIGURE_ARGS += \
43 --enable-echo \
44 --enable-const \
45 --enable-overwrite \
46 --disable-rpath \
47 --without-ada \
48 --without-cxx \
49 --without-cxx-binding \
50 --without-debug \
51 --without-profile \
52 --without-progs \
53 --with-normal \
54 --with-shared \
55 --with-terminfo-dirs=/usr/share/terminfo \
56 --with-default-terminfo-dir=/usr/share/terminfo
57
58 ifeq ($(BUILD_VARIANT),libncursesw)
59 CONFIGURE_ARGS += \
60 --enable-widec \
61 --with-build-cppflags=-D_GNU_SOURCE
62 endif
63
64 MAKE_FLAGS += \
65 BUILD_CC="$(HOSTCC)" \
66 HOSTCC="$(HOSTCC)" \
67 HOSTCCFLAGS="" \
68 libs
69
70 define Build/Install/Default
71 $(MAKE_VARS) \
72 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
73 $(MAKE_INSTALL_FLAGS) \
74 $(1) install.libs install.data;
75 endef
76
77 define Package/libncurses/install
78 $(INSTALL_DIR) $(1)/usr/lib
79 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{curses,ncurses,panel,menu,form}.so* $(1)/usr/lib/
80 $(INSTALL_DIR) $(1)/usr/share/terminfo
81 (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
82 for dir in ??; do \
83 [ -d "$$$$dir" ] || continue; \
84 mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
85 done \
86 )
87 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 \
88 $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
89 $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
90 $(1)/usr/share/terminfo/$$$$file; \
91 done
92 endef
93
94 define Package/libncursesw/install
95 $(INSTALL_DIR) $(1)/usr/lib
96 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}w.so* $(1)/usr/lib/
97 endef
98
99 ifeq ($(BUILD_VARIANT),libncursesw)
100 define Build/InstallDev
101 $(INSTALL_DIR) $(1)/usr/include/ncursesw/
102 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ncursesw/
103
104 $(INSTALL_DIR) $(1)/usr/lib
105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}w.{a,so*} $(1)/usr/lib/
106 endef
107 else
108 define Build/InstallDev
109 $(INSTALL_DIR) $(1)/usr/include
110 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
111
112 $(INSTALL_DIR) $(1)/usr/lib
113 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{curses,ncurses,panel,menu,form}.{a,so*} $(1)/usr/lib/
114 endef
115 endif
116
117 $(eval $(call BuildPackage,libncurses))
118 $(eval $(call BuildPackage,libncursesw))