summaryrefslogtreecommitdiffstats
path: root/rules/pre/ncurses.make
blob: d38bdebd358a7b9ec4fc702807156a810355e6d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*-makefile-*-

#
# ncurses-config handling
#
# add $(CROSS_ENV_AC_NCURSES) to your _ENV if ncurses should be detected
# use $(CROSS_ENV_AC_NO_NCURSES) if you ncurses should not be detected
#

# defaults
CROSS_ENV_AC_NCURSESW5_CONFIG	:= no
CROSS_ENV_AC_NCURSES5_CONFIG	:= no

# modify if ncurses is enabled
ifdef PTXCONF_NCURSES
ifdef PTXCONF_NCURSES_WIDE_CHAR
CROSS_ENV_AC_NCURSESW5_CONFIG	:= yes
endif
CROSS_ENV_AC_NCURSES5_CONFIG	:= yes
endif

CROSS_ENV_AC_NCURSES := \
	ac_cv_prog_ncurses5_config=$(CROSS_ENV_AC_NCURSES5_CONFIG) \
	ac_cv_prog_ncursesw5_config=$(CROSS_ENV_AC_NCURSESW5_CONFIG)

CROSS_ENV_AC_NO_NCURSES := \
	ac_cv_header_ncurses_h=no \
	ac_cv_header_ncurses_ncurses_h=no \
	ac_cv_lib_ncurses_initscr=no \
	ac_cv_prog_ncurses5_config=no \
	ac_cv_prog_ncursesw5_config=no

#
# $(call ptx/ncurses, PTXCONF_SYMBOL) returns env with ncurses hint or not
# depending on the symbol is defined or not
#
# $(call ptx/ncurses, PTXCONF_SYMBOL)
#                     $1
#
define ptx/ncurses
$(call ptx/ifdef, $(1), $(CROSS_ENV_AC_NCURSES), $(CROSS_ENV_AC_NO_NCURSES))
endef


# vim: syntax=make