blob: 6845897a9fd6c33069b2b24646ad1aa5d0e87b8a [file] [log] [blame]
Steve Kondikae271bc2015-11-15 02:50:53 +01001.\"***************************************************************************
2.\" Copyright (c) 2010-2011,2014 Free Software Foundation, Inc. *
3.\" *
4.\" Permission is hereby granted, free of charge, to any person obtaining a *
5.\" copy of this software and associated documentation files (the *
6.\" "Software"), to deal in the Software without restriction, including *
7.\" without limitation the rights to use, copy, modify, merge, publish, *
8.\" distribute, distribute with modifications, sublicense, and/or sell *
9.\" copies of the Software, and to permit persons to whom the Software is *
10.\" furnished to do so, subject to the following conditions: *
11.\" *
12.\" The above copyright notice and this permission notice shall be included *
13.\" in all copies or substantial portions of the Software. *
14.\" *
15.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
22.\" *
23.\" Except as contained in this notice, the name(s) of the above copyright *
24.\" holders shall not be used in advertising or otherwise to promote the *
25.\" sale, use or other dealings in this Software without prior written *
26.\" authorization. *
27.\"***************************************************************************
28.\"
29.\" $Id: MKada_config.in,v 1.8 2014/06/07 19:32:52 tom Exp $
30.TH ADACURSES "1" "" "" "User Commands"
31.SH NAME
32adacurses\-config \- helper script for AdaCurses libraries
33.SH SYNOPSIS
34.B adacurses\-config
35[\fIoptions\fR]
36.SH DESCRIPTION
37This is a shell script which simplifies configuring an application to use
38the AdaCurses library binding to ncurses.
39.SH OPTIONS
40.TP
41\fB\-\-cflags\fR
42echos the gnat (Ada compiler) flags needed to compile with AdaCurses.
43.TP
44\fB\-\-libs\fR
45echos the gnat libraries needed to link with AdaCurses.
46.TP
47\fB\-\-version\fR
48echos the release+patchdate version of the ncurses libraries used
49to configure and build AdaCurses.
50.TP
51\fB\-\-help\fR
52prints a list of the \fBadacurses\-config\fP script's options.
53.PP
54If no options are given, \fBadacurses\-config\fP prints the combination
55of
56\fB\-\-cflags\fR and
57\fB\-\-libs\fR
58that \fBgnatmake\fP expects (see example).
59.SH EXAMPLE
60.PP
61For example, supposing that you want to compile the "Hello World!"
62program for AdaCurses.
63Make a file named "hello.adb":
64.RS
65.nf
66.ft CW
67with Terminal_Interface.Curses; use Terminal_Interface.Curses;
68
69procedure Hello is
70
71 Visibility : Cursor_Visibility := Invisible;
72 done : Boolean := False;
73 c : Key_Code;
74
75begin
76
77 Init_Screen;
78 Set_Echo_Mode (False);
79
80 Set_Cursor_Visibility (Visibility);
81 Set_Timeout_Mode (Standard_Window, Non_Blocking, 0);
82
83 Move_Cursor (Line => Lines / 2, Column => (Columns - 12) / 2);
84 Add (Str => "Hello World!");
85
86 while not done loop
87
88 c := Get_Keystroke (Standard_Window);
89 case c is
90 when Character'Pos ('q') => done := True;
91 when others => null;
92 end case;
93
94 Nap_Milli_Seconds (50);
95 end loop;
96
97 End_Windows;
98
99end Hello;
100.fi
101.RE
102.PP
103Then, using
104.RS
105.ft CW
106gnatmake `adacurses-config --cflags` hello -largs `adacurses-config --libs`
107.ft
108.RE
109.PP
110or (simpler):
111.RS
112.ft CW
113gnatmake hello `adacurses-config`
114.ft
115.RE
116.PP
117you will compile and link the program.
118.SH "SEE ALSO"
119\fBcurses\fR(3X)
120.PP
121This describes \fBncurses\fR
122version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).