clean up ncurses makefile based on new host build changes
[openwrt/svn-archive/archive.git] / package / ncurses / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=ncurses
12 PKG_VERSION:=5.6
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@GNU/ncurses
17 PKG_MD5SUM:=b6593abe1089d6aab1551c105c9300e3
18
19 PKG_BUILD_DEPENDS:=ncurses/host
20
21 include $(INCLUDE_DIR)/host-build.mk
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 endef
30
31 define Host/Compile
32 $(MAKE) -C $(HOST_BUILD_DIR) libs
33 endef
34
35 define Host/Install
36 $(MAKE) -C $(HOST_BUILD_DIR) install.progs
37 endef
38
39 TARGET_CFLAGS += $(FPIC)
40
41 CONFIGURE_ARGS += \
42 --enable-echo \
43 --enable-const \
44 --enable-overwrite \
45 --disable-rpath \
46 --without-ada \
47 --without-cxx \
48 --without-cxx-binding \
49 --without-debug \
50 --without-profile \
51 --without-progs \
52 --with-normal \
53 --with-shared \
54 --with-terminfo-dirs=/usr/share/terminfo \
55 --with-default-terminfo-dir=/usr/share/terminfo
56
57 define Build/Compile
58 cp \
59 $(HOST_BUILD_DIR)/ncurses/make_keys \
60 $(HOST_BUILD_DIR)/ncurses/make_hash \
61 $(PKG_BUILD_DIR)/ncurses/
62 $(MAKE) -C $(PKG_BUILD_DIR) \
63 $(TARGET_CONFIGURE_OPTS) \
64 BUILD_CC="$(TARGET_CC)" \
65 HOSTCC="$(HOSTCC)" \
66 HOSTCCFLAGS="" \
67 DESTDIR="$(PKG_INSTALL_DIR)" \
68 libs install.libs install.data
69 endef
70
71 define Package/libncurses/install
72 $(INSTALL_DIR) $(1)/usr/lib
73 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}*.so.* $(1)/usr/lib/
74 $(INSTALL_DIR) $(1)/usr/share/terminfo
75 (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
76 for dir in ??; do \
77 [ -d "$$$$dir" ] || continue; \
78 mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
79 done \
80 )
81 for file in a/ansi d/dumb l/linux r/rxvt s/screen v/vt100 v/vt102 x/xterm x/xterm-color; do \
82 $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
83 $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
84 $(1)/usr/share/terminfo/$$$$file; \
85 done
86 endef
87
88 define Build/InstallDev
89 mkdir -p $(1)/usr/include
90 $(CP) $(PKG_INSTALL_DIR)/usr/include/curses.h $(1)/usr/include/
91 $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses.h $(1)/usr/include/
92 $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses_dll.h $(1)/usr/include/
93 $(CP) $(PKG_INSTALL_DIR)/usr/include/menu.h $(1)/usr/include/
94 $(CP) $(PKG_INSTALL_DIR)/usr/include/panel.h $(1)/usr/include/
95 $(CP) $(PKG_INSTALL_DIR)/usr/include/term{,cap}.h $(1)/usr/include/
96 $(CP) $(PKG_INSTALL_DIR)/usr/include/unctrl.h $(1)/usr/include/
97 $(CP) $(PKG_INSTALL_DIR)/usr/include/form.h $(1)/usr/include/
98 $(CP) $(PKG_INSTALL_DIR)/usr/include/eti.h $(1)/usr/include/
99 mkdir -p $(1)/usr/lib
100 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurses.so $(1)/usr/lib/
101 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}.{a,so*} $(1)/usr/lib/
102 endef
103
104 $(eval $(call HostBuild))
105 $(eval $(call BuildPackage,libncurses))