aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAndy Alt <andy5995@users.noreply.github.com>2021-06-10 14:50:05 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2021-06-11 01:03:34 +0300
commit53e4ca2456e6a2cd635fecb67615da4e37dae489 (patch)
tree54cdf47208e91e04709b9ba8ab55e0bf2a8cdf03 /docs
parent0accc3b72da75226deaea65ac0f4566d3f0ccc4a (diff)
downloadmeson-53e4ca2456e6a2cd635fecb67615da4e37dae489.zip
meson-53e4ca2456e6a2cd635fecb67615da4e37dae489.tar.gz
meson-53e4ca2456e6a2cd635fecb67615da4e37dae489.tar.bz2
add example for defining curses preprocessor symbols
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Dependencies.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/markdown/Dependencies.md b/docs/markdown/Dependencies.md
index c785e3c..28775cd 100644
--- a/docs/markdown/Dependencies.md
+++ b/docs/markdown/Dependencies.md
@@ -667,6 +667,29 @@ both `ncurses` (preferred) and other curses implementations.
*New in 0.56.0* The `config-tool` and `system` methods.
+To define some of the the preprocessor symbols mentioned in the
+[curses autoconf documentation](http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_with_curses.m4):
+
+```meson
+conf = configuration_data()
+check_headers = [
+ ['ncursesw/menu.h', 'HAVE_NCURSESW_MENU_H'],
+ ['ncurses/menu.h', 'HAVE_NCURSES_MENU_H'],
+ ['menu.h', 'HAVE_MENU_H'],
+ ['ncursesw/curses.h', 'HAVE_NCURSESW_CURSES_H'],
+ ['ncursesw.h', 'HAVE_NCURSESW_H'],
+ ['ncurses/curses.h', 'HAVE_NCURSES_CURSES_H'],
+ ['ncurses.h', 'HAVE_NCURSES_H'],
+ ['curses.h', 'HAVE_CURSES_H'],
+]
+
+foreach h : check_headers
+ if compiler.has_header(h.get(0))
+ conf.set(h.get(1), 1)
+ endif
+endforeach
+```
+
<hr>
<a name="footnote1">1</a>: They may appear to be case-insensitive, if the
underlying file system happens to be case-insensitive.