add buildroot (work in progress development)
[cmdllinux.git] / buildroot / _buildroot / b / ncurses / ncurses.mk
blob4dfb0f88827ecc6730388c419aa127d8bf679d52
1 ################################################################################
3 # ncurses
5 ################################################################################
7 NCURSES_VERSION = 6.0
8 NCURSES_SITE = $(BR2_GNU_MIRROR)/ncurses
9 NCURSES_INSTALL_STAGING = YES
10 NCURSES_DEPENDENCIES =
11 NCURSES_LICENSE = MIT with advertising clause
12 NCURSES_LICENSE_FILES = README
13 NCURSES_CONFIG_SCRIPTS = ncurses$(NCURSES_LIB_SUFFIX)6-config
15 NCURSES_CONF_OPTS = \
16 --without-cxx \
17 --without-cxx-binding \
18 --without-ada \
19 --without-tests \
20 --disable-big-core \
21 --without-profile \
22 --disable-rpath \
23 --disable-rpath-hack \
24 --enable-echo \
25 --enable-const \
26 --enable-overwrite \
27 --enable-pc-files \
28 --with-pkg-config-libdir="/usr/lib/pkgconfig" \
29 $(if $(BR2_PACKAGE_NCURSES_TARGET_PROGS),,--without-progs) \
30 --without-manpages
32 ifeq ($(BR2_STATIC_LIBS),y)
33 NCURSES_CONF_OPTS += --without-shared --with-normal
34 else ifeq ($(BR2_SHARED_LIBS),y)
35 NCURSES_CONF_OPTS += --with-shared --without-normal
36 else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
37 NCURSES_CONF_OPTS += --with-shared --with-normal
38 endif
40 # configure can't find the soname for libgpm when cross compiling
41 ifeq ($(BR2_PACKAGE_GPM),y)
42 NCURSES_CONF_OPTS += --with-gpm=libgpm.so.2
43 NCURSES_DEPENDENCIES += gpm
44 else
45 NCURSES_CONF_OPTS += --without-gpm
46 endif
48 NCURSES_TERMINFO_FILES = \
49 a/ansi \
50 l/linux \
51 p/putty \
52 p/putty-vt100 \
53 s/screen \
54 v/vt100 \
55 v/vt100-putty \
56 v/vt102 \
57 v/vt200 \
58 v/vt220 \
59 x/xterm \
60 x/xterm-color \
61 x/xterm-xfree86
63 ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
64 NCURSES_CONF_OPTS += --enable-widec
65 NCURSES_LIB_SUFFIX = w
66 NCURSES_LIBS = ncurses menu panel form
68 define NCURSES_LINK_LIBS_STATIC
69 $(foreach lib,$(NCURSES_LIBS:%=lib%), \
70 ln -sf $(lib)$(NCURSES_LIB_SUFFIX).a $(STAGING_DIR)/usr/lib/$(lib).a
72 ln -sf libncurses$(NCURSES_LIB_SUFFIX).a \
73 $(STAGING_DIR)/usr/lib/libcurses.a
74 endef
76 define NCURSES_LINK_LIBS_SHARED
77 $(foreach lib,$(NCURSES_LIBS:%=lib%), \
78 ln -sf $(lib)$(NCURSES_LIB_SUFFIX).so $(STAGING_DIR)/usr/lib/$(lib).so
80 ln -sf libncurses$(NCURSES_LIB_SUFFIX).so \
81 $(STAGING_DIR)/usr/lib/libcurses.so
82 endef
84 define NCURSES_LINK_LIBS_SHARED
85 ln -sf $(lib)$(NCURSES_LIB_SUFFIX).so $(TARGET_DIR)/usr/lib/$(lib).so \
86 ln -sf libncurses$(NCURSES_LIB_SUFFIX).so \
87 $(STAGING_DIR)/usr/lib/libcurses.so
88 $(foreach lib,$(NCURSES_LIBS:%=lib%), \
89 ln -sf $(lib)$(NCURSES_LIB_SUFFIX).so $(STAGING_DIR)/usr/lib/$(lib).so
91 ln -sf libncurses$(NCURSES_LIB_SUFFIX).so \
92 $(STAGING_DIR)/usr/lib/libcurses.so
93 endef
95 define NCURSES_LINK_PC
96 $(foreach pc,$(NCURSES_LIBS), \
97 ln -sf $(pc)$(NCURSES_LIB_SUFFIX).pc \
98 $(STAGING_DIR)/usr/lib/pkgconfig/$(pc).pc
100 endef
102 NCURSES_LINK_STAGING_LIBS = \
103 $(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_STATIC);) \
104 $(if $(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_SHARED))
106 NCURSES_LINK_STAGING_PC = $(call NCURSES_LINK_PC)
108 NCURSES_CONF_OPTS += --enable-ext-colors
109 NCURSES_TERMINFO_FILES += \
110 p/putty-256color \
111 x/xterm+256color \
112 x/xterm-256color
114 NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_LINK_STAGING_LIBS
115 NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_LINK_STAGING_PC
117 endif # BR2_PACKAGE_NCURSES_WCHAR
119 ifneq ($(BR2_ENABLE_DEBUG),y)
120 NCURSES_CONF_OPTS += --without-debug
121 endif
123 # ncurses breaks with parallel build, but takes quite a while to
124 # build single threaded. Work around it similar to how Gentoo does
125 define NCURSES_BUILD_CMDS
126 $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR) sources
127 rm -rf $(@D)/misc/pc-files
128 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR)
129 endef
131 ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PROGS),y)
132 define NCURSES_TARGET_SYMLINK_RESET
133 ln -sf tset $(TARGET_DIR)/usr/bin/reset
134 endef
135 NCURSES_POST_INSTALL_TARGET_HOOKS += NCURSES_TARGET_SYMLINK_RESET
136 endif
138 define NCURSES_TARGET_CLEANUP_TERMINFO
139 $(RM) -rf $(TARGET_DIR)/usr/share/terminfo $(TARGET_DIR)/usr/share/tabset
140 # $(foreach t,$(NCURSES_TERMINFO_FILES), \
141 # $(INSTALL) -D -m 0644 $(STAGING_DIR)/usr/share/terminfo/$(t) \
142 # $(TARGET_DIR)/usr/share/terminfo/$(t)
144 endef
145 NCURSES_POST_INSTALL_TARGET_HOOKS += NCURSES_TARGET_CLEANUP_TERMINFO
148 # On systems with an older version of tic, the installation of ncurses hangs
149 # forever. To resolve the problem, build a static version of tic on host
150 # ourselves, and use that during installation.
152 define HOST_NCURSES_BUILD_CMDS
153 $(HOST_MAKE_ENV) $(MAKE1) -C $(@D) sources
154 $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/progs tic
155 endef
157 HOST_NCURSES_CONF_OPTS = \
158 --with-shared \
159 --without-gpm \
160 --without-manpages \
161 --without-cxx \
162 --without-cxx-binding \
163 --without-ada \
164 --without-normal
166 $(eval $(autotools-package))
167 $(eval $(host-autotools-package))