This file is indexed.

/usr/share/doc/gnat-gps/html/Scenarios-and-Configuration-Variables.html is in gnat-gps-doc 5.0-16.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 2002-2010 AdaCore.

This document is free; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This document is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, see http://www.gnu.org/licenses/.

A copy of the license is included in the section entitled
"GNU General Public License". -->
<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Using the GNAT Programming Studio: Scenarios and Configuration Variables</title>

<meta name="description" content="Using the GNAT Programming Studio: Scenarios and Configuration Variables">
<meta name="keywords" content="Using the GNAT Programming Studio: Scenarios and Configuration Variables">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Index-table.html#Index-table" rel="index" title="Index table">
<link href="Project-Handling.html#Project-Handling" rel="up" title="Project Handling">
<link href="Extending-Projects.html#Extending-Projects" rel="next" title="Extending Projects">
<link href="Supported-Languages.html#Supported-Languages" rel="previous" title="Supported Languages">
<style type="text/css">
<!--
   

a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
pre.smallexample {background-color:rgb(240,240,240);
                     font-family: courier new,courier,fixed;
                     font-size: 14px;
                     margin: 0px 40px 0px 40px;
                     border-width: 1px 2px 2px 1px;
                     border-top-style: dotted;
                     border-left-style: dotted;
                     border-right-style: solid;
                     border-bottom-style: solid;
                     border-color: black;}
   code             {color:black;
                     font-family: courier new,courier,fixed;
                     font-size: 14px;}
   body             {font-family: arial,helvetica,sans-serif;
                     font-size: 16px;
                     max-width: 800px;
                     text-align: justify}
   samp             {font-family: courier new,courier,fixed;
                     font-size: 14px}
                    

-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Scenarios-and-Configuration-Variables"></a>
<div class="header">
<p>
Next: <a href="Extending-Projects.html#Extending-Projects" accesskey="n" rel="next">Extending Projects</a>, Previous: <a href="Supported-Languages.html#Supported-Languages" accesskey="p" rel="previous">Supported Languages</a>, Up: <a href="Project-Handling.html#Project-Handling" accesskey="u" rel="up">Project Handling</a> &nbsp; [<a href="Index-table.html#Index-table" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Scenarios-and-Configuration-Variables-1"></a>
<h3 class="section">7.3 Scenarios and Configuration Variables</h3>
<a name="index-configuration-variable-1"></a>
<a name="index-project-variable-1"></a>
<a name="index-variable-1"></a>

<p>The behavior of projects can be further tailored by the use of
scenarios.
</p>
<a name="index-project-attribute"></a>
<p>All the attributes of a project, except its list of imported projects,
can be chosen based on the value of external variables, whose value is
generally coming from the host computer environment, or directly set in
GPS. The interface to manipulate these scenarios is the scenario view, which
can be displayed by selecting the menu <code>Tools-&gt;Views-&gt;Scenario</code>.
It can be convenient to drag this window with your mouse, and drop it above
the project view, so that you can see both at the same time.
</p>
<p>This area allows you to select new values for the scenario variables defined
in your project, and thus change dynamically the view GPS has of your project
and your source files.
</p>
<a name="index-compile"></a>
<a name="index-debug"></a>
<p>This facility can for instance be used to compile all the sources either
in debug mode (so that the executables can be run in the debugger), or
in optimized mode (to reduce the space and increase the speed when
delivering the software).  In this configuration scenario, all the
attributes (source directories, tools, &hellip;) remain the same, except
for the compilation switches. It would be more difficult to maintain a
completely separate hierarchy of project, and it is much more efficient
to create a new configuration variable and edit the switches for the
appropriate scenario (<a href="The-Project-Properties-Editor.html#The-Project-Properties-Editor">The Project Properties Editor</a>).
</p>
<p>There is one limitation in what GPS can do with scenario variables: although
gnatmake and gprbuild have no problem dealing with scenario variables
whose default value is not a static string (for instance a concatenation, or
the value of another scenario variable), GPS will not be able to edit such
a project graphically. Such projects will load fine in GPS though.
</p>
<a name="Creating-new-configuration-variables"></a>
<h4 class="subsection">7.3.1 Creating new configuration variables</h4>
<a name="index-creating-configuration-variable"></a>

<p>Creating a new scenario variable is done through the contextual menu
(right-click) in the Project View or the Scenario View itself. Select the
menu <code>Project-&gt;Add Configuration Variable</code>. This opens the following
dialog:
</p>

<a name="index-screen-shot-17"></a>
<img src="scenarios.jpg" alt="scenarios">

<p>There are two main areas in this dialog: in the top line, you specify
the name of the variable. This name is used for two purposes:
</p>
<ul>
<li> It is displayed in the scenario view
<a name="index-scenario-view"></a>

</li><li> This is the name of the environment variable from which the
initial value is read. When GPS is started, all configuration
variables are initialized from the host computer environment, although
you can of course change its value later on inside GPS. Note that
selecting a new value for the scenario variable does not change the
actual value of the environment variable, which is only used to get the
default initial value of the scenario variable.

<p>When you spawn external tools like gnatmake for instance, you can
also specify the value they will use for the scenario variable by
using a command line switch, typically <code>-X</code>.
</p>
</li></ul>

<p>If you click on the arrow on the right of this name area, GPS will
display the list of all the environment variables that are currently
defined. However, you don&rsquo;t need to pick the name of an existing
variable, neither must the variable exist when GPS is started.
</p>
<p>The second part of this dialog is the list of authorized value for
this variable. Any other value will generate an error reported by
GPS, and the project won&rsquo;t be loaded as a result.
</p>
<p>One of these values is the default value (the one whose button in the
Default column is selected). This means that if the environment
variable doesn&rsquo;t exist when GPS is started, GPS will behave as if it
did exist with this default value.
</p>
<p>The list of possible values can be edited by right-clicking on the name
of the variable, and selecting one of <code>Edit properties</code> or
<code>Delete variable</code>.
</p>
<a name="Editing-existing-configuration-variables"></a>
<h4 class="subsection">7.3.2 Editing existing configuration variables</h4>
<a name="index-editing-configuration-variable"></a>

<p>If at least one configuration variable is defined in your project, the
scenario view will contain something similar to:
</p>

<a name="index-screen-shot-18"></a>
<img src="explorer-scenario.jpg" alt="explorer-scenario">

<a name="index-Unix"></a>
<p>This screen shot shows two configuration variables, named <code>Build</code>
and <code>OS</code>, with their current value (resp. <code>Debug</code> and
<code>Unix</code>).
</p>
<p>You can easily change the current value of any of these variables by
clicking on the arrow on the right of the value. This will display a
pop-up window with the list of possible values, from which you select
the one you wish to use.
</p>
<p>As soon as a new value is selected, GPS will recompute the project
view (in case source directories, object directories or list
of source files have changed). A number of things will also be updated
(like the list of executables in the <code>Compile</code>, <code>Run</code> and
<code>Debug</code> menus).
</p>
<a name="index-browsers-1"></a>
<a name="index-call-graph-3"></a>
<p>Currently, GPS will not recompute the contents of the various browsers
(call graph, dependencies, &hellip;) for this updated project. This would be too
expensive to do every time the value changes, and therefore you need
to explicitly request an update.
</p>

<p>You can change the list of possible values for a configuration
variable at any time by clicking on the button to the far left of the
variable&rsquo;s name. This will pop up the same dialog that is used to create
new variables. This dialog also allows you to change the name of the
scenario variable. This name is the same as the environment variable that
is used to set the initial value of the scenario variable.
</p>
<a name="index-removing-variable"></a>
<p>Removing a variable is done by clicking on the button immediately to
the left of the variable&rsquo;s name. GPS will then display a confirmation
dialog.
</p>
<p>If you confirm that you want to delete the variable, GPS will simply
remove the variable, and from now on act as if the variable always had
the value it had when it was deleted.
</p>
<hr>
<div class="header">
<p>
Next: <a href="Extending-Projects.html#Extending-Projects" accesskey="n" rel="next">Extending Projects</a>, Previous: <a href="Supported-Languages.html#Supported-Languages" accesskey="p" rel="previous">Supported Languages</a>, Up: <a href="Project-Handling.html#Project-Handling" accesskey="u" rel="up">Project Handling</a> &nbsp; [<a href="Index-table.html#Index-table" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>