trousers: disable on ARC
[buildroot-gz.git] / package / ncurses / ncurses.mk
blob343909fe3f7110b3a365931f966ba87f6928a858
1 ################################################################################
3 # ncurses
5 ################################################################################
7 NCURSES_VERSION = 5.9
8 NCURSES_SITE = $(BR2_GNU_MIRROR)/ncurses
9 NCURSES_INSTALL_STAGING = YES
10 NCURSES_DEPENDENCIES = host-ncurses
11 NCURSES_PROGS = clear infocmp tabs tic toe tput tset
12 NCURSES_LICENSE = MIT with advertising clause
13 NCURSES_LICENSE_FILES = README
14 NCURSES_CONFIG_SCRIPTS = ncurses$(NCURSES_LIB_SUFFIX)$(NCURSES_ABI_VERSION)-config
16 NCURSES_CONF_OPTS = \
17 --without-cxx \
18 --without-cxx-binding \
19 --without-ada \
20 --without-tests \
21 --disable-big-core \
22 --without-profile \
23 --disable-rpath \
24 --disable-rpath-hack \
25 --enable-echo \
26 --enable-const \
27 --enable-overwrite \
28 --enable-pc-files \
29 $(if $(BR2_PACKAGE_NCURSES_TARGET_PROGS),,--without-progs) \
30 --without-manpages
32 # Install after busybox for the full-blown versions
33 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
34 NCURSES_DEPENDENCIES += busybox
35 endif
37 ifeq ($(BR2_STATIC_LIBS),y)
38 NCURSES_CONF_OPTS += --without-shared --with-normal
39 else ifeq ($(BR2_SHARED_LIBS),y)
40 NCURSES_CONF_OPTS += --with-shared --without-normal
41 else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
42 NCURSES_CONF_OPTS += --with-shared --with-normal
43 endif
45 # configure can't find the soname for libgpm when cross compiling
46 ifeq ($(BR2_PACKAGE_GPM),y)
47 NCURSES_CONF_OPTS += --with-gpm=libgpm.so.2
48 NCURSES_DEPENDENCIES += gpm
49 else
50 NCURSES_CONF_OPTS += --without-gpm
51 endif
53 NCURSES_LIBS-y = ncurses
54 NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_MENU) += menu
55 NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_PANEL) += panel
56 NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_FORM) += form
58 NCURSES_TERMINFO_FILES = \
59 a/ansi \
60 l/linux \
61 p/putty \
62 p/putty-vt100 \
63 s/screen \
64 v/vt100 \
65 v/vt100-putty \
66 v/vt102 \
67 v/vt200 \
68 v/vt220 \
69 x/xterm \
70 x/xterm-color \
71 x/xterm-xfree86 \
73 ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
74 NCURSES_CONF_OPTS += --enable-widec
75 NCURSES_LIB_SUFFIX = w
77 define NCURSES_LINK_LIBS_STATIC
78 $(foreach lib,$(NCURSES_LIBS-y:%=lib%), \
79 ln -sf $(lib)$(NCURSES_LIB_SUFFIX).a $(1)/usr/lib/$(lib).a
81 ln -sf libncurses$(NCURSES_LIB_SUFFIX).a \
82 $(1)/usr/lib/libcurses.a
83 endef
85 define NCURSES_LINK_LIBS_SHARED
86 $(foreach lib,$(NCURSES_LIBS-y:%=lib%), \
87 ln -sf $(lib)$(NCURSES_LIB_SUFFIX).so $(1)/usr/lib/$(lib).so
89 ln -sf libncurses$(NCURSES_LIB_SUFFIX).so \
90 $(1)/usr/lib/libcurses.so
91 endef
93 define NCURSES_LINK_PC
94 $(foreach pc,$(NCURSES_LIBS-y), \
95 ln -sf $(pc)$(NCURSES_LIB_SUFFIX).pc \
96 $(1)/usr/lib/pkgconfig/$(pc).pc
98 endef
100 NCURSES_LINK_TARGET_LIBS = \
101 $(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_STATIC,$(TARGET_DIR));) \
102 $(if $(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_SHARED,$(TARGET_DIR)))
103 NCURSES_LINK_STAGING_LIBS = \
104 $(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_STATIC,$(STAGING_DIR));) \
105 $(if $(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_SHARED,$(STAGING_DIR)))
107 NCURSES_LINK_STAGING_PC = $(call NCURSES_LINK_PC,$(STAGING_DIR))
109 NCURSES_CONF_OPTS += --enable-ext-colors
110 NCURSES_ABI_VERSION = 6
111 NCURSES_TERMINFO_FILES += \
112 p/putty-256color \
113 x/xterm+256color \
114 x/xterm-256color
116 NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_LINK_STAGING_LIBS
117 NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_LINK_STAGING_PC
119 else # BR2_PACKAGE_NCURSES_WCHAR
120 NCURSES_ABI_VERSION = 5
121 endif # BR2_PACKAGE_NCURSES_WCHAR
123 ifneq ($(BR2_ENABLE_DEBUG),y)
124 NCURSES_CONF_OPTS += --without-debug
125 endif
127 # ncurses breaks with parallel build, but takes quite a while to
128 # build single threaded. Work around it similar to how Gentoo does
129 define NCURSES_BUILD_CMDS
130 $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR) sources
131 rm -rf $(@D)/misc/pc-files
132 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR)
133 endef
135 ifneq ($(BR2_STATIC_LIBS),y)
136 define NCURSES_INSTALL_TARGET_LIBS
137 $(foreach lib,$(NCURSES_LIBS-y:%=lib%), \
138 cp -dpf $(NCURSES_DIR)/lib/$(lib)$(NCURSES_LIB_SUFFIX).so* \
139 $(TARGET_DIR)/usr/lib/
141 endef
142 endif
144 ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PROGS),y)
145 define NCURSES_INSTALL_TARGET_PROGS
146 $(foreach prog,$(NCURSES_PROGS), \
147 $(INSTALL) -m 0755 $(NCURSES_DIR)/progs/$(prog) \
148 $(TARGET_DIR)/usr/bin/$(prog)
150 ln -sf tset $(TARGET_DIR)/usr/bin/reset
151 endef
152 endif
154 define NCURSES_INSTALL_TARGET_CMDS
155 mkdir -p $(TARGET_DIR)/usr/lib
156 $(NCURSES_INSTALL_TARGET_LIBS)
157 $(NCURSES_LINK_TARGET_LIBS)
158 $(NCURSES_INSTALL_TARGET_PROGS)
159 ln -snf /usr/share/terminfo $(TARGET_DIR)/usr/lib/terminfo
160 $(foreach terminfo,$(NCURSES_TERMINFO_FILES),\
161 $(INSTALL) -D -m 0644 $(STAGING_DIR)/usr/share/terminfo/$(terminfo) \
162 $(TARGET_DIR)/usr/share/terminfo/$(terminfo)
164 endef # NCURSES_INSTALL_TARGET_CMDS
167 # On systems with an older version of tic, the installation of ncurses hangs
168 # forever. To resolve the problem, build a static version of tic on host
169 # ourselves, and use that during installation.
171 define HOST_NCURSES_BUILD_CMDS
172 $(HOST_MAKE_ENV) $(MAKE1) -C $(@D) sources
173 $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/progs tic
174 endef
176 HOST_NCURSES_CONF_OPTS = \
177 --with-shared \
178 --without-gpm \
179 --without-manpages \
180 --without-cxx \
181 --without-cxx-binding \
182 --without-ada \
183 --without-normal
185 $(eval $(autotools-package))
186 $(eval $(host-autotools-package))