1 ################################################################################
5 ################################################################################
8 NCURSES_SITE = $(BR2_GNU_MIRROR)/ncurses
9 NCURSES_INSTALL_STAGING = YES
10 NCURSES_DEPENDENCIES = host-ncurses
11 HOST_NCURSES_DEPENDENCIES =
12 NCURSES_PROGS = clear infocmp tabs tic toe tput tset
13 NCURSES_LICENSE = MIT with advertising clause
14 NCURSES_LICENSE_FILES = README
15 NCURSES_CONFIG_SCRIPTS = ncurses$(NCURSES_LIB_SUFFIX)5-config
18 $(if $(BR2_STATIC_LIBS),--without-shared,--with-shared) \
20 --without-cxx-binding \
26 --disable-rpath-hack \
31 $(if $(BR2_PACKAGE_NCURSES_TARGET_PROGS),,--without-progs) \
34 # Install after busybox for the full-blown versions
35 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
36 NCURSES_DEPENDENCIES += busybox
39 ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
40 NCURSES_CONF_OPTS += --enable-widec
41 NCURSES_LIB_SUFFIX = w
43 ifeq ($(BR2_STATIC_LIBS),y)
44 define NCURSES_LINK_LIBS
45 for lib in $(NCURSES_LIBS-y); do \
46 ln -sf $${lib}$(NCURSES_LIB_SUFFIX).a \
47 $(1)/usr/lib/$${lib}.a; \
49 ln -sf libncurses$(NCURSES_LIB_SUFFIX).a \
50 $(1)/usr/lib/libcurses.a
53 define NCURSES_LINK_LIBS
54 for lib in $(NCURSES_LIBS-y); do \
55 ln -sf $${lib}$(NCURSES_LIB_SUFFIX).a \
56 $(1)/usr/lib/$${lib}.a; \
57 ln -sf $${lib}$(NCURSES_LIB_SUFFIX).so \
58 $(1)/usr/lib/$${lib}.so; \
60 ln -sf libncurses$(NCURSES_LIB_SUFFIX).a \
61 $(1)/usr/lib/libcurses.a
62 ln -sf libncurses$(NCURSES_LIB_SUFFIX).so \
63 $(1)/usr/lib/libcurses.so
67 NCURSES_LINK_TARGET_LIBS = $(call NCURSES_LINK_LIBS, $(TARGET_DIR))
68 NCURSES_LINK_STAGING_LIBS = $(call NCURSES_LINK_LIBS, $(STAGING_DIR))
70 NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_LINK_STAGING_LIBS
74 NCURSES_LIBS-y = libncurses
75 NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_MENU) += libmenu
76 NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_PANEL) += libpanel
77 NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_FORM) += libform
79 ifneq ($(BR2_ENABLE_DEBUG),y)
80 NCURSES_CONF_OPTS += --without-debug
83 # ncurses breaks with parallel build, but takes quite a while to
84 # build single threaded. Work around it similar to how Gentoo does
85 define NCURSES_BUILD_CMDS
86 $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR) sources
87 rm -rf $(@D)/misc/pc-files
88 $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR)
91 ifneq ($(BR2_STATIC_LIBS),y)
92 define NCURSES_INSTALL_TARGET_LIBS
93 for lib in $(NCURSES_LIBS-y); do \
94 cp -dpf $(NCURSES_DIR)/lib/$${lib}$(NCURSES_LIB_SUFFIX).so* \
95 $(TARGET_DIR)/usr/lib/; \
100 ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PROGS),y)
101 define NCURSES_INSTALL_TARGET_PROGS
102 for x in $(NCURSES_PROGS); do \
103 $(INSTALL) -m 0755 $(NCURSES_DIR)/progs/$$x \
104 $(TARGET_DIR)/usr/bin/$$x; \
106 ln -sf tset $(TARGET_DIR)/usr/bin/reset
110 define NCURSES_INSTALL_TARGET_CMDS
111 mkdir -p $(TARGET_DIR)/usr/lib
112 $(NCURSES_INSTALL_TARGET_LIBS)
113 $(NCURSES_LINK_TARGET_LIBS)
114 $(NCURSES_INSTALL_TARGET_PROGS)
115 ln -snf /usr/share/terminfo $(TARGET_DIR)/usr/lib/terminfo
116 mkdir -p $(TARGET_DIR)/usr/share/terminfo/x
117 cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm $(TARGET_DIR)/usr/share/terminfo/x
118 cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm-color $(TARGET_DIR)/usr/share/terminfo/x
119 cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm-xfree86 $(TARGET_DIR)/usr/share/terminfo/x
120 mkdir -p $(TARGET_DIR)/usr/share/terminfo/v
121 cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt100 $(TARGET_DIR)/usr/share/terminfo/v
122 cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt102 $(TARGET_DIR)/usr/share/terminfo/v
123 cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt200 $(TARGET_DIR)/usr/share/terminfo/v
124 cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt220 $(TARGET_DIR)/usr/share/terminfo/v
125 mkdir -p $(TARGET_DIR)/usr/share/terminfo/a
126 cp -dpf $(STAGING_DIR)/usr/share/terminfo/a/ansi $(TARGET_DIR)/usr/share/terminfo/a
127 mkdir -p $(TARGET_DIR)/usr/share/terminfo/l
128 cp -dpf $(STAGING_DIR)/usr/share/terminfo/l/linux $(TARGET_DIR)/usr/share/terminfo/l
129 mkdir -p $(TARGET_DIR)/usr/share/terminfo/s
130 cp -dpf $(STAGING_DIR)/usr/share/terminfo/s/screen $(TARGET_DIR)/usr/share/terminfo/s
131 endef # NCURSES_INSTALL_TARGET_CMDS
134 # On systems with an older version of tic, the installation of ncurses hangs
135 # forever. To resolve the problem, build a static version of tic on host
136 # ourselves, and use that during installation.
138 define HOST_NCURSES_BUILD_CMDS
139 $(MAKE1) -C $(@D) sources
140 $(MAKE) -C $(@D)/progs tic
143 HOST_NCURSES_CONF_OPTS = \
144 --with-shared --without-gpm \
147 --without-cxx-binding \
150 $(eval $(autotools-package))
151 $(eval $(host-autotools-package))