summaryrefslogtreecommitdiffstats
path: root/rules/ncurses.make
blob: 2609604eac80d98e45f11ac4bcf292250e2deb4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# -*-makefile-*-
#
# Copyright (C) 2002-2009 by Pengutronix e.K., Hildesheim, Germany
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_NCURSES) += ncurses

#
# Paths and names
#
NCURSES_VERSION	:= 5.9
NCURSES_MD5	:= 8cb9c412e5f2d96bc6f459aa8c6282a1
NCURSES		:= ncurses-$(NCURSES_VERSION)
NCURSES_SUFFIX	:= tar.gz
NCURSES_URL	:= $(PTXCONF_SETUP_GNUMIRROR)/ncurses/$(NCURSES).$(NCURSES_SUFFIX)
NCURSES_SOURCE	:= $(SRCDIR)/$(NCURSES).$(NCURSES_SUFFIX)
NCURSES_DIR	:= $(BUILDDIR)/$(NCURSES)

# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

$(NCURSES_SOURCE):
	@$(call targetinfo)
	@$(call get, NCURSES)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

NCURSES_PATH	:= PATH=$(CROSS_PATH)
NCURSES_ENV 	:= $(CROSS_ENV)

NCURSES_AUTOCONF_SHARED := \
	--disable-echo \
	--disable-nls \
	--enable-const \
	--enable-overwrite \
	--libdir=/lib \
	--with-debug \
	--with-normal \
	--with-shared \
	--without-ada \
	--without-gpm \
	--without-manpages \
	--without-tests \
	--enable-mixed-case \
	--with-ticlib=yes \
	--disable-relink \
	--disable-big-strings \
	--disable-sp-funcs \
	--disable-term-driver \
	--disable-ext-mouse \
	--disable-interop \
	--disable-rpath \
	--disable-rpath-hack \
	--without-pthread \
	--disable-reentrant

# NOTE: reentrant enables opaque, which breaks other packages
# pthread enables reentrant, so don't enable it either

# enable wide char support on demand only
ifdef PTXCONF_NCURSES_WIDE_CHAR
NCURSES_AUTOCONF_SHARED += \
	--enable-widec \
	--enable-ext-colors
else
NCURSES_AUTOCONF_SHARED += \
	--disable-widec \
	--disable-ext-colors
endif

ifdef PTXCONF_NCURSES_BIG_CORE
NCURSES_AUTOCONF_SHARED += --enable-big-core
else
NCURSES_AUTOCONF_SHARED += --disable-big-core
endif

NCURSES_AUTOCONF := \
	$(CROSS_AUTOCONF_USR) \
	$(NCURSES_AUTOCONF_SHARED)

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

$(STATEDIR)/ncurses.compile:
	@$(call targetinfo)
	#cd $(NCURSES_DIR)/ncurses && make make_keys make_hash
	#cp $(PTXCONF_SYSROOT_HOST)/bin/make_hash $(NCURSES_DIR)/ncurses/
	@$(call compile, NCURSES)
	@$(call touch)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

ifdef PTXCONF_NCURSES_WIDE_CHAR
#
# we need a tweak, to force all programs to use the wide char
# library even if they request for the non wide char library
# Done by forcing the linker to use the right library instead
#
NCURSES_LIBRARY_LIST := curses ncurses

ifdef PTXCONF_NCURSES_FORM
NCURSES_LIBRARY_LIST += form
endif
ifdef PTXCONF_NCURSES_MENU
NCURSES_LIBRARY_LIST += menu
endif
ifdef PTXCONF_NCURSES_PANEL
NCURSES_LIBRARY_LIST += panel
endif

endif

$(STATEDIR)/ncurses.install.post:
	@$(call targetinfo)
	@$(call world/install.post, NCURSES)

	@cp -dp -- "$(NCURSES_PKGDIR)/usr/bin/"*config* "$(PTXCONF_SYSROOT_CROSS)/bin"

ifdef PTXCONF_NCURSES_WIDE_CHAR
# Note: This tweak only works if we build the application with these settings!
# Already built applications may continue to use the non wide library!
# For this, the links at runtime are required
#
	for lib in $(NCURSES_LIBRARY_LIST); do \
		echo "INPUT(-l$${lib}w)" > $(SYSROOT)/lib/lib$${lib}.so ; \
	done
	ln -sf libncurses++w.a $(SYSROOT)/lib/libncurses++.a
endif
	@$(call touch)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

ifdef PTXCONF_NCURSES_WIDE_CHAR
NCURSES_WIDE := w
endif
NCURSES_MAJOR := 6
NCURSES_MINOR := 0

$(STATEDIR)/ncurses.targetinstall:
	@$(call targetinfo)

	@$(call install_init, ncurses)
	@$(call install_fixup, ncurses,PRIORITY,optional)
	@$(call install_fixup, ncurses,SECTION,base)
	@$(call install_fixup, ncurses,AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
	@$(call install_fixup, ncurses,DESCRIPTION,missing)

	@$(call install_lib, ncurses, 0, 0, 0644, libncurses$(NCURSES_WIDE))

ifdef PTXCONF_NCURSES_BACKWARD_COMPATIBLE_NON_WIDE_CHAR
	@$(call install_link, ncurses, libncursesw.so.$(NCURSES_MAJOR).$(NCURSES_MINOR), \
		/lib/libncurses.so.$(NCURSES_MAJOR).$(NCURSES_MINOR))
	@$(call install_link, ncurses, libncursesw.so.$(NCURSES_MAJOR).$(NCURSES_MINOR), \
		/lib/libncurses.so.$(NCURSES_MAJOR))
	@$(call install_link, ncurses, libncursesw.so.$(NCURSES_MAJOR).$(NCURSES_MINOR), \
		/lib/libncurses.so)
endif

ifdef PTXCONF_NCURSES_FORM
	@$(call install_lib, ncurses, 0, 0, 0644, libform$(NCURSES_WIDE))
ifdef PTXCONF_NCURSES_BACKWARD_COMPATIBLE_NON_WIDE_CHAR
	@$(call install_link, ncurses, libformw.so.$(NCURSES_MAJOR).$(NCURSES_MINOR), \
		/lib/libform.so.$(NCURSES_MAJOR).$(NCURSES_MINOR))
	@$(call install_link, ncurses, libformw.so.$(NCURSES_MAJOR).$(NCURSES_MINOR), \
		/lib/libform.so.$(NCURSES_MAJOR))
	@$(call install_link, ncurses, libformw.so.$(NCURSES_MAJOR).$(NCURSES_MINOR), \
		/lib/libform.so)
endif
endif


ifdef PTXCONF_NCURSES_MENU
	@$(call install_lib, ncurses, 0, 0, 0644, libmenu$(NCURSES_WIDE))
ifdef PTXCONF_NCURSES_BACKWARD_COMPATIBLE_NON_WIDE_CHAR
	@$(call install_link, ncurses, libmenuw.so.$(NCURSES_MAJOR).$(NCURSES_MINOR), \
		/lib/libmenu.so.$(NCURSES_MAJOR).$(NCURSES_MINOR))
	@$(call install_link, ncurses, libmenuw.so.$(NCURSES_MAJOR).$(NCURSES_MINOR), \
		/lib/libmenu.so.$(NCURSES_MAJOR))
	@$(call install_link, ncurses, libmenuw.so.$(NCURSES_MAJOR).$(NCURSES_MINOR), \
		/lib/libmenu.so)
endif
endif


ifdef PTXCONF_NCURSES_PANEL
	@$(call install_lib, ncurses, 0, 0, 0644, libpanel$(NCURSES_WIDE))
ifdef PTXCONF_NCURSES_BACKWARD_COMPATIBLE_NON_WIDE_CHAR
	@$(call install_link, ncurses, libpanelw.so.$(NCURSES_MAJOR).$(NCURSES_MINOR), \
		/lib/libpanel.so.$(NCURSES_MAJOR).$(NCURSES_MINOR))
	@$(call install_link, ncurses, libpanelw.so.$(NCURSES_MAJOR).$(NCURSES_MINOR), \
		/lib/libpanel.so.$(NCURSES_MAJOR))
	@$(call install_link, ncurses, libpanelw.so.$(NCURSES_MAJOR).$(NCURSES_MINOR), \
		/lib/libpanel.so)
endif
endif


ifdef PTXCONF_NCURSES_TERMCAP
	@$(call install_copy, ncurses, 0, 0, 0644, -, /usr/share/terminfo/x/xterm, n);
	@$(call install_copy, ncurses, 0, 0, 0644, -, /usr/share/terminfo/x/xterm-color, n);
	@$(call install_copy, ncurses, 0, 0, 0644, -, /usr/share/terminfo/x/xterm-xfree86, n);
	@$(call install_copy, ncurses, 0, 0, 0644, -, /usr/share/terminfo/v/vt100, n);
	@$(call install_copy, ncurses, 0, 0, 0644, -, /usr/share/terminfo/v/vt102, n);
	@$(call install_copy, ncurses, 0, 0, 0644, -, /usr/share/terminfo/v/vt200, n);
	@$(call install_copy, ncurses, 0, 0, 0644, -, /usr/share/terminfo/a/ansi, n);
	@$(call install_copy, ncurses, 0, 0, 0644, -, /usr/share/terminfo/l/linux, n);
	@$(call install_copy, ncurses, 0, 0, 0644, -, /usr/share/terminfo/s/screen, n);
endif

	@$(call install_finish, ncurses)

	@$(call touch)

# vim: syntax=make