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