1 ################################################################################
5 ################################################################################
8 NCURSES_SITE
= $(BR2_GNU_MIRROR
)/ncurses
9 NCURSES_INSTALL_STAGING
= YES
10 NCURSES_DEPENDENCIES
= host-ncurses
11 NCURSES_LICENSE
= MIT with advertising clause
12 NCURSES_LICENSE_FILES
= README
13 NCURSES_CONFIG_SCRIPTS
= ncurses
$(NCURSES_LIB_SUFFIX
)$(NCURSES_ABI_VERSION
)-config
17 --without-cxx-binding \
23 --disable-rpath-hack \
28 $(if
$(BR2_PACKAGE_NCURSES_TARGET_PROGS
),,--without-progs
) \
31 # Install after busybox for the full-blown versions
32 ifeq ($(BR2_PACKAGE_BUSYBOX
),y
)
33 NCURSES_DEPENDENCIES
+= busybox
36 ifeq ($(BR2_STATIC_LIBS
),y
)
37 NCURSES_CONF_OPTS
+= --without-shared
--with-normal
38 else ifeq ($(BR2_SHARED_LIBS
),y
)
39 NCURSES_CONF_OPTS
+= --with-shared
--without-normal
40 else ifeq ($(BR2_SHARED_STATIC_LIBS
),y
)
41 NCURSES_CONF_OPTS
+= --with-shared
--with-normal
44 # configure can't find the soname for libgpm when cross compiling
45 ifeq ($(BR2_PACKAGE_GPM
),y
)
46 NCURSES_CONF_OPTS
+= --with-gpm
=libgpm.so
.2
47 NCURSES_DEPENDENCIES
+= gpm
49 NCURSES_CONF_OPTS
+= --without-gpm
52 NCURSES_TERMINFO_FILES
= \
67 ifeq ($(BR2_PACKAGE_NCURSES_WCHAR
),y
)
68 NCURSES_CONF_OPTS
+= --enable-widec
69 NCURSES_LIB_SUFFIX
= w
70 NCURSES_LIBS
= ncurses menu panel form
72 define NCURSES_LINK_LIBS_STATIC
73 $(foreach lib
,$(NCURSES_LIBS
:%=lib
%), \
74 ln
-sf
$(lib
)$(NCURSES_LIB_SUFFIX
).a
$(STAGING_DIR
)/usr
/lib
/$(lib
).a
76 ln
-sf libncurses
$(NCURSES_LIB_SUFFIX
).a \
77 $(STAGING_DIR
)/usr
/lib
/libcurses.a
80 define NCURSES_LINK_LIBS_SHARED
81 $(foreach lib
,$(NCURSES_LIBS
:%=lib
%), \
82 ln
-sf
$(lib
)$(NCURSES_LIB_SUFFIX
).so
$(STAGING_DIR
)/usr
/lib
/$(lib
).so
84 ln
-sf libncurses
$(NCURSES_LIB_SUFFIX
).so \
85 $(STAGING_DIR
)/usr
/lib
/libcurses.so
88 define NCURSES_LINK_PC
89 $(foreach pc,$(NCURSES_LIBS
), \
90 ln
-sf
$(pc)$(NCURSES_LIB_SUFFIX
).
pc \
91 $(STAGING_DIR
)/usr
/lib
/pkgconfig
/$(pc).
pc
95 NCURSES_LINK_STAGING_LIBS
= \
96 $(if
$(BR2_STATIC_LIBS
)$(BR2_SHARED_STATIC_LIBS
),$(call NCURSES_LINK_LIBS_STATIC
);) \
97 $(if
$(BR2_SHARED_LIBS
)$(BR2_SHARED_STATIC_LIBS
),$(call NCURSES_LINK_LIBS_SHARED
))
99 NCURSES_LINK_STAGING_PC
= $(call NCURSES_LINK_PC
)
101 NCURSES_CONF_OPTS
+= --enable-ext-colors
102 NCURSES_ABI_VERSION
= 6
103 NCURSES_TERMINFO_FILES
+= \
108 NCURSES_POST_INSTALL_STAGING_HOOKS
+= NCURSES_LINK_STAGING_LIBS
109 NCURSES_POST_INSTALL_STAGING_HOOKS
+= NCURSES_LINK_STAGING_PC
111 else # BR2_PACKAGE_NCURSES_WCHAR
112 NCURSES_ABI_VERSION
= 5
113 endif # BR2_PACKAGE_NCURSES_WCHAR
115 ifneq ($(BR2_ENABLE_DEBUG
),y
)
116 NCURSES_CONF_OPTS
+= --without-debug
119 # ncurses breaks with parallel build, but takes quite a while to
120 # build single threaded. Work around it similar to how Gentoo does
121 define NCURSES_BUILD_CMDS
122 $(TARGET_MAKE_ENV
) $(MAKE1
) -C
$(@D
) DESTDIR
=$(STAGING_DIR
) sources
123 rm -rf
$(@D
)/misc
/pc-files
124 $(TARGET_MAKE_ENV
) $(MAKE
) -C
$(@D
) DESTDIR
=$(STAGING_DIR
)
127 ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PROGS
),y
)
128 define NCURSES_TARGET_SYMLINK_RESET
129 ln
-sf tset
$(TARGET_DIR
)/usr
/bin
/reset
131 NCURSES_POST_INSTALL_TARGET_HOOKS
+= NCURSES_TARGET_SYMLINK_RESET
134 define NCURSES_TARGET_CLEANUP_TERMINFO
135 $(RM
) -rf
$(TARGET_DIR
)/usr
/share
/terminfo
$(TARGET_DIR
)/usr
/share
/tabset
136 $(foreach t
,$(NCURSES_TERMINFO_FILES
), \
137 $(INSTALL
) -D
-m
0644 $(STAGING_DIR
)/usr
/share
/terminfo
/$(t
) \
138 $(TARGET_DIR
)/usr
/share
/terminfo
/$(t
)
141 NCURSES_POST_INSTALL_TARGET_HOOKS
+= NCURSES_TARGET_CLEANUP_TERMINFO
144 # On systems with an older version of tic, the installation of ncurses hangs
145 # forever. To resolve the problem, build a static version of tic on host
146 # ourselves, and use that during installation.
148 define HOST_NCURSES_BUILD_CMDS
149 $(HOST_MAKE_ENV
) $(MAKE1
) -C
$(@D
) sources
150 $(HOST_MAKE_ENV
) $(MAKE
) -C
$(@D
)/progs tic
153 HOST_NCURSES_CONF_OPTS
= \
158 --without-cxx-binding \
162 $(eval
$(autotools-package
))
163 $(eval
$(host-autotools-package
))