use $(TARGET_CPPFLAGS) & $(TARGET_LDFLAGS) instead of full -I... & -L...
[openwrt-10.03/.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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=@GNU/ncurses
18 PKG_MD5SUM:=b6593abe1089d6aab1551c105c9300e3
19 PKG_CAT:=zcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libncurses
26   SECTION:=libs
27   CATEGORY:=Libraries
28   TITLE:=Terminal handling library
29   DESCRIPTION:=Terminal handling library
30   URL:=http://www.gnu.org/software/ncurses/
31 endef
32
33 define Build/Configure
34 endef
35
36 define Build/Compile
37         rm -rf $(PKG_INSTALL_DIR)
38         mkdir -p $(PKG_INSTALL_DIR)
39         -$(MAKE) -C $(PKG_BUILD_DIR) distclean
40         (cd $(PKG_BUILD_DIR); rm -f config.cache; \
41                 CONFIG_SITE="" \
42                 ./configure \
43                         --target=$(GNU_HOST_NAME) \
44                         --host=$(GNU_HOST_NAME) \
45                         --build=$(GNU_HOST_NAME) \
46                         --program-prefix="" \
47                         --program-suffix="" \
48                         --prefix=/usr \
49                         --exec-prefix=/usr \
50                         --bindir=/usr/bin \
51                         --datadir=/usr/share \
52                         --includedir=/usr/include \
53                         --infodir=/usr/share/info \
54                         --libdir=/usr/lib \
55                         --libexecdir=/usr/lib \
56                         --localstatedir=/var \
57                         --mandir=/usr/share/man \
58                         --sbindir=/usr/sbin \
59                         --sysconfdir=/etc \
60                         $(DISABLE_NLS) \
61                         $(DISABLE_LARGEFILE) \
62                         --enable-echo \
63                         --enable-const \
64                         --enable-overwrite \
65                         --disable-rpath \
66                         --without-ada \
67                         --without-cxx \
68                         --without-cxx-binding \
69                         --without-debug \
70                         --without-profile \
71                         --with-progs \
72                         --with-normal \
73                         --without-shared \
74                         --with-terminfo-dirs=/usr/share/terminfo \
75                         --with-default-terminfo-dir=/usr/share/terminfo \
76         );
77         $(MAKE) -C $(PKG_BUILD_DIR) \
78                 DESTDIR="$(PKG_INSTALL_DIR)" \
79                 libs install.progs
80         (cd $(PKG_BUILD_DIR); rm -f config.cache; \
81                 $(TARGET_CONFIGURE_OPTS) \
82                 CFLAGS="$(TARGET_CFLAGS)" \
83                 CPPFLAGS="$(TARGET_CPPFLAGS)" \
84                 LDFLAGS="$(TARGET_LDFLAGS)" \
85                 ./configure \
86                         --target=$(GNU_TARGET_NAME) \
87                         --host=$(GNU_TARGET_NAME) \
88                         --build=$(GNU_HOST_NAME) \
89                         --program-prefix="" \
90                         --program-suffix="" \
91                         --prefix=/usr \
92                         --exec-prefix=/usr \
93                         --bindir=/usr/bin \
94                         --datadir=/usr/share \
95                         --includedir=/usr/include \
96                         --infodir=/usr/share/info \
97                         --libdir=/usr/lib \
98                         --libexecdir=/usr/lib \
99                         --localstatedir=/var \
100                         --mandir=/usr/share/man \
101                         --sbindir=/usr/sbin \
102                         --sysconfdir=/etc \
103                         $(DISABLE_NLS) \
104                         $(DISABLE_LARGEFILE) \
105                         --enable-echo \
106                         --enable-const \
107                         --enable-overwrite \
108                         --disable-rpath \
109                         --without-ada \
110                         --without-cxx \
111                         --without-cxx-binding \
112                         --without-debug \
113                         --without-profile \
114                         --without-progs \
115                         --with-normal \
116                         --with-shared \
117                         --with-terminfo-dirs=/usr/share/terminfo \
118                         --with-default-terminfo-dir=/usr/share/terminfo \
119         );
120         rm -f $(PKG_BUILD_DIR)/lib/lib*
121         $(MAKE) -C $(PKG_BUILD_DIR) \
122                 $(TARGET_CONFIGURE_OPTS) \
123                 BUILD_CC="$(TARGET_CC)" \
124                 HOSTCC="$(HOSTCC)" \
125                 HOSTCCFLAGS="" \
126                 DESTDIR="$(PKG_INSTALL_DIR)" \
127                 libs install.libs install.data
128 endef
129
130 define Package/libncurses/install
131         $(INSTALL_DIR) $(1)/usr/lib
132         $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}*.so.* $(1)/usr/lib/
133         $(INSTALL_DIR) $(1)/usr/share/terminfo
134         (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
135                 for dir in ??; do \
136                         [ -d "$$$$dir" ] || continue; \
137                         mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
138                 done \
139         )
140         for file in a/ansi d/dumb l/linux r/rxvt s/screen v/vt100 v/vt102 x/xterm x/xterm-color; do \
141                 $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
142                 $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
143                         $(1)/usr/share/terminfo/$$$$file; \
144         done
145 endef
146
147 define Build/InstallDev
148         mkdir -p $(STAGING_DIR)/usr/include
149         $(CP) $(PKG_INSTALL_DIR)/usr/include/curses.h $(STAGING_DIR)/usr/include/
150         $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses.h $(STAGING_DIR)/usr/include/
151         $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses_dll.h $(STAGING_DIR)/usr/include/
152         $(CP) $(PKG_INSTALL_DIR)/usr/include/menu.h $(STAGING_DIR)/usr/include/
153         $(CP) $(PKG_INSTALL_DIR)/usr/include/panel.h $(STAGING_DIR)/usr/include/
154         $(CP) $(PKG_INSTALL_DIR)/usr/include/term{,cap}.h $(STAGING_DIR)/usr/include/
155         $(CP) $(PKG_INSTALL_DIR)/usr/include/unctrl.h $(STAGING_DIR)/usr/include/
156         $(CP) $(PKG_INSTALL_DIR)/usr/include/form.h $(STAGING_DIR)/usr/include/
157         $(CP) $(PKG_INSTALL_DIR)/usr/include/eti.h $(STAGING_DIR)/usr/include/
158         mkdir -p $(STAGING_DIR)/usr/lib
159         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurses.so $(STAGING_DIR)/usr/lib/
160         $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}.{a,so*} $(STAGING_DIR)/usr/lib/
161 endef
162
163 define Build/UninstallDev
164         rm -rf \
165                 $(STAGING_DIR)/usr/include/curses.h \
166                 $(STAGING_DIR)/usr/include/ncurses.h \
167                 $(STAGING_DIR)/usr/include/ncurses_dll.h \
168                 $(STAGING_DIR)/usr/include/menu.h \
169                 $(STAGING_DIR)/usr/include/panel.h \
170                 $(STAGING_DIR)/usr/include/term{,cap}.h \
171                 $(STAGING_DIR)/usr/include/unctrl.h \
172                 $(STAGING_DIR)/usr/include/form.h \
173                 $(STAGING_DIR)/usr/include/eti.h \
174                 $(STAGING_DIR)/usr/lib/libcurses.so \
175                 $(STAGING_DIR)/usr/lib/lib{ncurses,panel,menu,form}.{a,so*}
176 endef
177
178 $(eval $(call BuildPackage,libncurses))