################################################################################
################################################################################
NCURSES_SITE = $(BR2_GNU_MIRROR)/ncurses
NCURSES_INSTALL_STAGING = YES
NCURSES_DEPENDENCIES = host-ncurses
HOST_NCURSES_DEPENDENCIES =
NCURSES_PROGS = clear infocmp tabs tic toe tput tset
NCURSES_LICENSE = MIT with advertising clause
NCURSES_LICENSE_FILES = README
NCURSES_CONFIG_SCRIPTS = ncurses$(NCURSES_LIB_SUFFIX)$(NCURSES_ABI_VERSION)-config
$(if $(BR2_PACKAGE_NCURSES_TARGET_PROGS),,--without-progs) \
# Install after busybox for the full-blown versions
ifeq ($(BR2_PACKAGE_BUSYBOX),y)
NCURSES_DEPENDENCIES += busybox
ifeq ($(BR2_STATIC_LIBS),y)
NCURSES_CONF_OPTS += --without-shared --with-normal
else ifeq ($(BR2_SHARED_LIBS),y)
NCURSES_CONF_OPTS += --with-shared --without-normal
else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
NCURSES_CONF_OPTS += --with-shared --with-normal
# configure can't find the soname for libgpm when cross compiling
ifeq ($(BR2_PACKAGE_GPM),y)
NCURSES_CONF_OPTS += --with-gpm=libgpm.so.2
NCURSES_DEPENDENCIES += gpm
NCURSES_CONF_OPTS += --without-gpm
NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_MENU) += menu
NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_PANEL) += panel
NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_FORM) += form
ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
NCURSES_CONF_OPTS += --enable-widec
define NCURSES_LINK_LIBS_STATIC
for lib in $(NCURSES_LIBS-y:%=lib%); do \
ln -sf $${lib}$(NCURSES_LIB_SUFFIX).a \
$(1)/usr/lib/$${lib}.a; \
ln -sf libncurses$(NCURSES_LIB_SUFFIX).a \
define NCURSES_LINK_LIBS_SHARED
for lib in $(NCURSES_LIBS-y:%=lib%); do \
ln -sf $${lib}$(NCURSES_LIB_SUFFIX).so \
$(1)/usr/lib/$${lib}.so; \
ln -sf libncurses$(NCURSES_LIB_SUFFIX).so \
$(1)/usr/lib/libcurses.so
for pc in $(NCURSES_LIBS-y); do \
ln -sf $${pc}$(NCURSES_LIB_SUFFIX).pc \
$(1)/usr/lib/pkgconfig/$${pc}.pc; \
NCURSES_LINK_TARGET_LIBS = \
$(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_STATIC,$(TARGET_DIR));) \
$(if $(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_SHARED,$(TARGET_DIR)))
NCURSES_LINK_STAGING_LIBS = \
$(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_STATIC,$(STAGING_DIR));) \