1 ################################################################################
5 ################################################################################
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
18 --without-cxx-binding \
24 --disable-rpath-hack \
29 $(if
$(BR2_PACKAGE_NCURSES_TARGET_PROGS
),,--without-progs
) \
32 # Install after busybox for the full-blown versions
33 ifeq ($(BR2_PACKAGE_BUSYBOX
),y
)
34 NCURSES_DEPENDENCIES
+= busybox
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
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
50 NCURSES_CONF_OPTS
+= --without-gpm
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
= \
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
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
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
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
+= \
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
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
)
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
/
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
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
176 HOST_NCURSES_CONF_OPTS
= \
181 --without-cxx-binding \
185 $(eval
$(autotools-package
))
186 $(eval
$(host-autotools-package
))