pax_global_header 0000666 0000000 0000000 00000000064 14700753734 0014524 g ustar 00root root 0000000 0000000 52 comment=3db10ae062c1a8f2a5eeb9c5abf91de6828a9f20
gprbuild-25.0.0/ 0000775 0000000 0000000 00000000000 14700753734 0013420 5 ustar 00root root 0000000 0000000 gprbuild-25.0.0/.gitattributes 0000664 0000000 0000000 00000000036 14700753734 0016312 0 ustar 00root root 0000000 0000000 install-sh no-precommit-check
gprbuild-25.0.0/.gitignore 0000664 0000000 0000000 00000005200 14700753734 0015405 0 ustar 00root root 0000000 0000000 *~
/*.ali
*.pyc
*.swp
/CVS
/gprclean
/gprconfig
/gprconfig.exe
/gprbuild
/gprbuild.exe
/gprmake
/gprmake.exe
/gprbind
/gprbind.exe
/gprinstall
/gprinstall.exe
/gprlib
/gprlib.exe
/gprslave
/gprslave.exe
/install
/create_ada_runtime_project
/create_ada_runtime_project.exe
/config.log
/config.status
/gnat.gpr
/gnat_src
/obj
/exe
/config/obj
/config/lib
/gpr/lib
/gpr/libobj
/share/gprconfig
makefile.setup
/doc/txt
/doc/html
/doc/info
/doc/pdf
/doc/build
/doc/projects_unw.texi
/doc/xgnatugn
/doc/xgnatugn.ali
/doc/xgnatugn.o
/gnat/projects.texi
/gnat/ug_words
/gnat/xgnatugn.adb
/gnat/*.ali
/gnat/ali.ad?
/gnat/ali-util.ad?
/gnat/alloc.ads
/gnat/aspects.ad?
/gnat/atree.ad?
/gnat/binderr.ad?
/gnat/butil.ad?
/gnat/casing.ad?
/gnat/clean.ad?
/gnat/csets.ad?
/gnat/debug.ad?
/gnat/einfo.ad?
/gnat/elists.ad?
/gnat/errout.ad?
/gnat/erroutc.ad?
/gnat/errutil.ad?
/gnat/err_vars.ads
/gnat/fmap.ad?
/gnat/fname.ad?
/gnat/fname-uf.ad?
/gnat/fname-sf.ads
/gnat/gnatcmd.ad?
/gnat/gnat_style.css
/gnat/gnatvsn.ad?
/gnat/hostparm.ads
/gnat/krunch.ad?
/gnat/lib.ad?
/gnat/lib-list.adb
/gnat/lib-sort.adb
/gnat/link.c
/gnat/makeutl.ad?
/gnat/make.ad?
/gnat/makeusg.ads
/gnat/mlib-prj.ads
/gnat/mlib.ad?
/gnat/mlib-fil.ad?
/gnat/mlib-tgt.ad?
/gnat/mlib-tgt-specific.ad?
/gnat/mlib-tgt-specific-linux.adb
/gnat/mlib-tgt-specific-vms-alpha.adb
/gnat/mlib-tgt-specific-vms-ia64.adb
/gnat/mlib-tgt-vms.ad?
/gnat/mlib-tgt-vms_common.ad?
/gnat/mlib-tgt-vms-alpha.adb
/gnat/mlib-tgt-vms-ia64.adb
/gnat/mlib-utl.ad?
/gnat/namet.ad?
/gnat/nlists.ad?
/gnat/*.o
/gnat/opt.ad?
/gnat/osint.ad?
/gnat/osint-m.ads
/gnat/output.ad?
/gnat/prj.ad?
/gnat/prj-attr.ad?
/gnat/prj-attr-pm.ad?
/gnat/prj-com.ads
/gnat/prj-conf.ad?
/gnat/prj-dect.ad?
/gnat/prj-env.ad?
/gnat/prj-err.ad?
/gnat/prj-ext.ad?
/gnat/prj-gnat-6.0.1.diff
/gnat/prj-nmsc.ad?
/gnat/prj-pars.ad?
/gnat/prj-part.ad?
/gnat/prj-pp.ad?
/gnat/prj-proc.ad?
/gnat/prj-strt.ad?
/gnat/prj-tree.ad?
/gnat/prj-util.ad?
/gnat/restrict.ad?
/gnat/rident.ads
/gnat/scans.ad?
/gnat/scng.ad?
/gnat/sdefault.ads
/gnat/sem_aux.ad?
/gnat/sfn_scan.ads
/gnat/sinfo.ad?
/gnat/sinput.ad?
/gnat/sinput-c.ad?
/gnat/sinput-p.ad?
/gnat/snames.ad?
/gnat/snames.adb-tmpl
/gnat/snames.ads-tmpl
/gnat/snames.h-tmpl
/gnat/snames.nb
/gnat/snames.nh
/gnat/snames.ns
/gnat/stand.ad?
/gnat/stringt.ad?
/gnat/style.ads
/gnat/styleg.ad?
/gnat/styleg-c.ad?
/gnat/stylesw.ad?
/gnat/switch-m.ads
/gnat/switch.ad?
/gnat/table.ad?
/gnat/targparm.ad?
/gnat/tempdir.ad?
/gnat/tree_io.ad?
/gnat/types.ad?
/gnat/uintp.ad?
/gnat/uname.ad?
/gnat/urealp.ad?
/gnat/xsnamest
/gnat/xsnamest.adb
/gnat/xutil.ad?
/gnat/widechar.ad?
/gnat/Make-generated.in
/gnat/bldtools/
/gnat/snames.h
/gnat/stamp-snames
gprbuild-25.0.0/.gitlab-ci.yml 0000664 0000000 0000000 00000002131 14700753734 0016051 0 ustar 00root root 0000000 0000000 include:
- project: eng/gpr/gpr-issues
file: /.gitlab/.gitlab-ci-shared.yml
stages:
- build
- test
build:
extends: .job_template
stage: build
script:
# Build using anod
- anod build gnat
# and save the gprbuild install
- tar czf $CI_PROJECT_DIR/gprbuild.tar.gz -C $SANDBOX/$HOST/gprbuild/ install/
artifacts:
paths:
- gprbuild.tar.gz
debug_build:
extends: .job_template
stage: build
script:
# build gprbuild in debug mode without rebuilding dependencies,
# so we can catch coding style errors.
- anod build gprbuild -Qdbg
test_gprbuild:
extends: .test_template
script:
- install_packages gnatall
- run_testsuite gprbuild "" test_gprbuild
artifacts:
when:
always
paths:
- testgprbuild_result.xml
reports:
junit: testgprbuild_result.xml
test_gpr2ls:
extends: .test_template
script:
- install_packages gnatall
- run_testsuite gprbuild "-Qcheck-gpr2ls" test_gpr2ls
artifacts:
when:
always
paths:
- testgpr2ls_result.xml
reports:
junit: testgpr2ls_result.xml
gprbuild-25.0.0/COPYING.RUNTIME 0000664 0000000 0000000 00000006373 14700753734 0015606 0 ustar 00root root 0000000 0000000 GCC RUNTIME LIBRARY EXCEPTION
Version 3.1, 31 March 2009
Copyright (c) 2009 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
This GCC Runtime Library Exception ("Exception") is an additional permission
under section 7 of the GNU General Public License, version 3 ("GPLv3"). It
applies to a given file (the "Runtime Library") that bears a notice placed
by the copyright holder of the file stating that the file is governed by
GPLv3 along with this Exception.
When you use GCC to compile a program, GCC may combine portions of certain
GCC header files and runtime libraries with the compiled program. The
purpose of this Exception is to allow compilation of non-GPL (including
proprietary) programs to use, in this way, the header files and runtime
libraries covered by this Exception.
0. Definitions.
A file is an "Independent Module" if it either requires the Runtime Library
for execution after a Compilation Process, or makes use of an interface
provided by the Runtime Library, but is not otherwise based on the Runtime
Library.
"GCC" means a version of the GNU Compiler Collection, with or without
modifications, governed by version 3 (or a specified later version) of the
GNU General Public License (GPL) with the option of using any subsequent
versions published by the FSF.
"GPL-compatible Software" is software whose conditions of propagation,
modification and use would permit combination with GCC in accord with the
license of GCC.
"Target Code" refers to output from any compiler for a real or virtual
target processor architecture, in executable form or suitable for input to
an assembler, loader, linker and/or execution phase. Notwithstanding that,
Target Code does not include data in any format that is used as a compiler
intermediate representation, or used for producing a compiler intermediate
representation.
The "Compilation Process" transforms code entirely represented in
non-intermediate languages designed for human-written code, and/or in Java
Virtual Machine byte code, into Target Code. Thus, for example, use of
source code generators and preprocessors need not be considered part of the
Compilation Process, since the Compilation Process can be understood as
starting with the output of the generators or preprocessors.
A Compilation Process is "Eligible" if it is done using GCC, alone or with
other GPL-compatible software, or if it is done without using any work based
on GCC. For example, using non-GPL-compatible Software to optimize any GCC
intermediate representations would not qualify as an Eligible Compilation
Process.
1. Grant of Additional Permission.
You have permission to propagate a work of Target Code formed by combining
the Runtime Library with Independent Modules, even if such propagation would
otherwise violate the terms of GPLv3, provided that all Target Code was
generated by Eligible Compilation Processes. You may then convey such a
combination under terms of your choice, consistent with the licensing of the
Independent Modules.
2. No Weakening of GCC Copyleft.
The availability of this Exception does not imply any general presumption
that third-party software is unaffected by the copyleft requirements of the
license of GCC.
gprbuild-25.0.0/COPYING3 0000664 0000000 0000000 00000104513 14700753734 0014542 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: 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 3 of the License, or
(at your option) any later version.
This program 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 .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
gprbuild-25.0.0/Makefile 0000664 0000000 0000000 00000014070 14700753734 0015062 0 ustar 00root root 0000000 0000000 # Makefile targets
# ----------------
#
# Setup: make [VAR=VALUE] setup (see below)
# Build gprbuild: make all
# Install gprbuild: make install
# Create gprbuild package: make distall
# Build tool : make
# Build libgpr: make libgpr.build
# Install libgpr: make libgpr.install
# (for libgpr you can add ".type" where type is static, static-pic or shared
# build a specific version of the lib. by default all supported variants are
# built).
# Variables which can be set:
#
# ENABLE_SHARED : yes / no (or empty)
# BUILD : debug production coverage profiling
# PROCESSORS : nb parallel compilations (0 to use all cores)
# TARGET : target triplet for cross-compilation
#
# Out-of-tree build:
#
# $ make -f /Makefile setup
# $ make -f /Makefile
HOST := $(shell gcc -dumpmachine)
TARGET := $(shell gcc -dumpmachine)
prefix := $(dir $(shell which gnatls))..
BUILD = production
PROCESSORS = 0
BUILD_DIR =
SOURCE_DIR := $(shell dirname "$(MAKEFILE_LIST)")
LIB_DIR = lib/
# Load current setup if any
-include makefile.setup
# target options for cross-build
ifeq ($(HOST),$(TARGET))
GTARGET=
# INSTALLER=exe/$(BUILD)/$(LIB_INSTALLER)
else
GTARGET=--target=$(TARGET)
endif
INSTALLER=$(LIB_INSTALLER)
EXEC_INSTALLER=$(INSTALLER) -XBUILD=${BUILD}
# check for out-of-tree build
ifeq ($(SOURCE_DIR),.)
RBD=
GPRBUILD_GPR=gprbuild.gpr
GPR_GPR=gpr/gpr.gpr
MAKEPREFIX=
else
RBD=--relocate-build-tree
GPRBUILD_GPR=$(SOURCE_DIR)/gprbuild.gpr
GPR_GPR=$(SOURCE_DIR)/gpr/gpr.gpr
MAKEPREFIX=$(SOURCE_DIR)/
endif
ENABLE_SHARED := $(shell gprbuild $(GTARGET) -c -q -p \
-P$(MAKEPREFIX)config/test_shared 2>/dev/null && echo "yes")
ifeq ($(ENABLE_SHARED), yes)
LIBGPR_TYPES=static shared static-pic
else
LIBGPR_TYPES=static
endif
# Make sure Windows's "OS" environment variable does not cause
# confusion for cross-Linux builds.
LIBGPR_OS = $(if $(findstring linux,$(TARGET)),-XOS=UNIX)
# Used to pass extra options to GPRBUILD, like -d for instance
GPRBUILD_OPTIONS=
BUILDER=gprbuild -p -m $(GTARGET) $(RBD) -j${PROCESSORS} -XBUILD=${BUILD} ${GPRBUILD_OPTIONS}
LIB_INSTALLER=gprinstall -p -f --target=$(TARGET) $(RBD) "--prefix=${prefix}"
CLEANER=gprclean -q $(RBD)
GPRBUILD_BUILDER=$(BUILDER) $(GPRBUILD_GPR) \
-XLIBRARY_TYPE=static -XXMLADA_BUILD=static
LIBGPR_BUILDER=$(BUILDER) $(GPR_GPR) $(LIBGPR_OS)
LIBGPR_INSTALLER=$(LIB_INSTALLER) $(GPR_GPR) $(LIBGPR_OS) -XBUILD=${BUILD} \
--install-name=gpr \
--build-var=LIBRARY_TYPE --build-var=GPR_BUILD $(GTARGET)
LIBGPR_UNINSTALLER=$(LIB_INSTALLER) $(GPR_GPR) $(LIBGPR_OS) --install-name=gpr --uninstall
#########
# build #
#########
.PHONY: all distall gprbuild gprconfig gprclean gprinstall gprname gprls
build all:
$(GPRBUILD_BUILDER)
distall: all install
gprbuild:
$(GPRBUILD_BUILDER) gprbuild-main.adb
gprinstall:
$(GPRBUILD_BUILDER) gprinstall-main.adb
gprclean:
$(GPRBUILD_BUILDER) gprclean-main.adb
gprconfig:
$(GPRBUILD_BUILDER) gprconfig-main.adb
gprname:
$(GPRBUILD_BUILDER) gprname-main.adb
gprls:
$(GPRBUILD_BUILDER) gprls-main.adb
#################################
# Gprbuild installation targets #
#################################
.PHONY: install
install:
$(EXEC_INSTALLER) --mode=usage --install-name=gprbuild \
-XINSTALL_MODE=nointernal $(GPRBUILD_GPR)
$(EXEC_INSTALLER) --target=$(TARGET) --mode=usage --install-name=gprbuild \
-XINSTALL_MODE=internal $(GPRBUILD_GPR)
complete: all install libgpr.install.static
##########
# Libgpr #
##########
.PHONY: libgpr.build libgpr.build.static libgpr.build.shared libgpr.build.static-pic
.PHONY: libgpr.install libgpr.install.static libgpr.install.shared libgpr.install.static-pic
.PHONY: libgpr.uninstall
libgpr.build: $(foreach t, $(LIBGPR_TYPES), libgpr.build.$(t))
libgpr.build.shared:
${LIBGPR_BUILDER} -XLIBRARY_TYPE=relocatable \
-XXMLADA_BUILD=relocatable
libgpr.build.static:
${LIBGPR_BUILDER} -XLIBRARY_TYPE=static \
-XXMLADA_BUILD=static
libgpr.build.static-pic:
${LIBGPR_BUILDER} -XLIBRARY_TYPE=static-pic \
-XXMLADA_BUILD=static-pic
libgpr.install: libgpr.uninstall $(foreach t, $(LIBGPR_TYPES), libgpr.install.$(t))
libgpr.install.static:
$(LIBGPR_INSTALLER) \
-XLIBRARY_TYPE=static \
-XXMLADA_BUILD=static \
--lib-subdir=${LIB_DIR}/gpr/static \
--build-name=static
libgpr.install.static-pic:
$(LIBGPR_INSTALLER) \
-XLIBRARY_TYPE=static-pic \
-XXMLADA_BUILD=static-pic \
--lib-subdir=${LIB_DIR}/gpr/static-pic \
--build-name=static-pic
libgpr.install.shared:
$(LIBGPR_INSTALLER) \
-XLIBRARY_TYPE=relocatable \
-XXMLADA_BUILD=relocatable \
--lib-subdir=${LIB_DIR}/gpr/relocatable \
--build-name=relocatable
libgpr.uninstall:
-$(LIBGPR_UNINSTALLER)
libgpr.clean:
-$(CLEANER) -XLIBRARY_TYPE=relocatable $(GPR_GPR)
-$(CLEANER) -XLIBRARY_TYPE=static $(GPR_GPR)
-$(CLEANER) -XLIBRARY_TYPE=static-pic $(GPR_GPR)
rm -fr gpr/lib gpr/libobj
#########
# setup #
#########
.SILENT: setup
setup:
echo "prefix=$(prefix)" > makefile.setup
echo "ENABLE_SHARED=$(ENABLE_SHARED)" >> makefile.setup
echo "BUILD=$(BUILD)" >> makefile.setup
echo "PROCESSORS=$(PROCESSORS)" >> makefile.setup
echo "TARGET=$(TARGET)" >> makefile.setup
echo "SOURCE_DIR=$(SOURCE_DIR)" >> makefile.setup
###################
# Cleanup targets #
###################
.PHONY: clean
clean: libgpr.clean
-$(CLEANER) -r -Pgprbuild -XBUILD=$(BUILD)
-$(CLEANER) -r -XBUILD=${BUILD} \
-XLIBRARY_TYPE=static-pic $(GPR_GPR)
-$(CLEANER) -r -XBUILD=${BUILD} \
-XLIBRARY_TYPE=static $(GPR_GPR)
ifeq ($(ENABLE_SHARED), yes)
-$(CLEANER) -r -XBUILD=${BUILD} \
-XLIBRARY_TYPE=relocatable $(GPR_GPR)
-$(CLEANER) $(GPR_GPR) -XBUILD=$(BUILD) \
-XLIBRARY_TYPE=relocatable
endif
make -C $(MAKEPREFIX)doc clean
make -C $(MAKEPREFIX)examples clean
rm -fr obj exe makefile.setup
.PHONY: doc examples
doc:
make -C $(MAKEPREFIX)doc
examples: force
make -C $(MAKEPREFIX)examples
force:
# Let gprbuild handle parallelization. In general, we don't support parallel
# runs in this Makefile, as concurrent gprinstall processes may crash.
.NOTPARALLEL:
gprbuild-25.0.0/README.md 0000664 0000000 0000000 00000005012 14700753734 0014675 0 ustar 00root root 0000000 0000000 Preliminary note for Windows users
==================================
The build instructions for `gprbuild` may have a slight UNIX flavor but they can
be used on Windows platforms with a full Cygwin installation. The latter makes
it simpler to build `gprbuild` but is not required to use it.
Bootstrapping
=============
`gprbuild` needs `gprbuild` to build... So we also provide a way to
easily bootstrap if you don't already have `gprbuild`, provided you
already have installed GNAT.
Download XML/Ada sources (from https://github.com/AdaCore/xmlada), together
with the gprconfig knowledge base (from
https://github.com/AdaCore/gprconfig_kb).
Run the `bootstrap.sh` script (written for POSIX systems) specifying the
install location and the sources of `XML/Ada` and `gprconfig_kb`. The script
will build *and* install `gprbuild`.
For example, to build `gprbuild` and install it to `./bootstrap` in the current
working directory, run:
$ ./bootstrap.sh --with-xmlada=../xmlada --with-kb=../gprconfig_kb --prefix=./bootstrap
For maintainers, the environment `DESTDIR` is honoured for staged installs, see
`./bootstrap.sh -h` for more.
With this bootstrapped `gprbuild`, you can build XML/Ada and `gprbuild`
as documented below.
Configuring
===========
You should first configure the build like this (if you plan to build in
the source tree directly, you can omit setting the SOURCE_DIR variable):
$ make prefix=xxx SOURCE_DIR=/path/to/gprbuild/sources setup
Building and Installing
=======================
XML/Ada must be installed before building.
Building the main executables is done simply with:
$ make all
When compiling, you can choose whether you want to link statically with XML/Ada
(the default), or dynamically. To compile dynamically, you should run:
$ make LIBRARY_TYPE=relocatable all
instead of the above.
Installation is done with:
$ make install
To build and install LIBGPR libraries, you can use the make targets
libgpr.build and libgpr.install.
Doc & Examples
==============
The documentation is provided in various formats in the `doc` subdirectory. You
can also find it
[online](http://docs.adacore.com/gprbuild-docs/html/gprbuild_ug.html).
It refers to concrete examples that are to be found in the `examples`
subdirectory. Each example can be built easily using the simple attached
Makefile:
$ make all # build the example
$ make run # run the executable(s)
$ make clean # cleanup
All the examples can be `built/run/cleaned` using the same targets and the top
level examples Makefile.
gprbuild-25.0.0/bootstrap.sh 0000775 0000000 0000000 00000007204 14700753734 0015777 0 ustar 00root root 0000000 0000000 #!/bin/sh
# bootstrap.sh - a simple bootstrap for building gprbuild with xmlada
progname=bootstrap
prefix=/usr/local
bindir=/bin
datarootdir=/share
libexecdir=/libexec
srcdir=$PWD
xmlada_src=../xmlada
kb_src=../gprconfig_kb
CC=${CC:-cc}
GNATMAKE=${GNATMAKE:-gnatmake}
CFLAGS=${CFLAGS:-$CFLAGS}
GNATMAKEFLAGS=${GNATMAKEFLAGS:--j0}
usage() {
cat >&2 <&2
exit 1
}
while :; do
case $1 in
--prefix=?*) prefix=${1#*=} ;;
--bindir=?*) bindir=${1#*=} ;;
--libexecdir=?*) libexecdir=${1#*=} ;;
--datarootdir=?*) datarootdir=${1#*=} ;;
--srcdir=?*) srcdir=${1#*=} ;;
--with-xmlada=?*) xmlada_src=${1#*=} ;;
--with-kb=?*) kb_src=${1#*=} ;;
--build) MODE="build";;
--install) MODE="install";;
-h|-\?|--help) usage ;;
*=*) error '%s: Requires a value, try --help\n' "$1" ;;
-?*) error '%s: Unknown option, try --help\n' "$1" ;;
*) break # End of arguments.
esac
shift
done
set -e
inc_flags="-I$srcdir/src -I$srcdir/gpr/src -I$xmlada_src/sax -I$xmlada_src/dom \
-I$xmlada_src/schema -I$xmlada_src/unicode -I$xmlada_src/input_sources"
# Programs to build and install
bin_progs="gprbuild gprconfig gprclean gprinstall gprname gprls"
lib_progs="gprlib gprbind"
# Install the gprconfig knowledge base
rm -rf "$srcdir"/share/gprconfig
cp -r "$kb_src"/db "$srcdir"/share/gprconfig
# Windows and Unix differencies
UName=`uname | cut -b -5`
PutUsage=gpr/src/gpr-util-put_resource_usage
rm -f ${PutUsage}.adb
if [ "$UName" = "CYGWI" ] || [ "$UName" = "MINGW" ]
then
cp ${PutUsage}__null.adb ${PutUsage}.adb
else
ln -s $PWD/${PutUsage}__unix.adb ${PutUsage}.adb
fi
# Build
if [ "x"${MODE} = "x" ] || [ ${MODE} = "build" ];
then
command $CC -c $CFLAGS "$srcdir"/gpr/src/gpr_imports.c
for bin in $bin_progs; do
command $GNATMAKE $inc_flags "$bin"-main -o "$bin" $CFLAGS $GNATMAKEFLAGS -largs gpr_imports.o
done
for lib in $lib_progs; do
command $GNATMAKE $inc_flags "$lib" $CFLAGS $GNATMAKEFLAGS -largs gpr_imports.o
done
fi;
# Install
if [ "x"${MODE} = "x" ] || [ ${MODE} = "install" ];
then
mkdir -p "$DESTDIR$prefix$bindir"
mkdir -p "$DESTDIR$prefix$libexecdir"/gprbuild
mkdir -p "$DESTDIR$prefix$datarootdir"/gprconfig
mkdir -p "$DESTDIR$prefix$datarootdir"/gpr
install -m0755 $bin_progs "$DESTDIR$prefix$bindir"
install -m0755 $lib_progs "$DESTDIR$prefix$libexecdir"/gprbuild
install -m0644 "$srcdir"/share/gprconfig/*.xml "$DESTDIR$prefix$datarootdir"/gprconfig
install -m0644 "$srcdir"/share/gprconfig/*.ent "$DESTDIR$prefix$datarootdir"/gprconfig
install -m0644 "$srcdir"/share/_default.gpr "$DESTDIR$prefix$datarootdir"/gpr/_default.gpr
fi
gprbuild-25.0.0/config/ 0000775 0000000 0000000 00000000000 14700753734 0014665 5 ustar 00root root 0000000 0000000 gprbuild-25.0.0/config/foo.ads 0000664 0000000 0000000 00000002530 14700753734 0016141 0 ustar 00root root 0000000 0000000 ------------------------------------------------------------------------------
-- --
-- GPR TECHNOLOGY --
-- --
-- Copyright (C) 2016-2023, AdaCore --
-- --
-- This is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 distributed with GNAT; see file COPYING. If not, --
-- see . --
-- --
------------------------------------------------------------------------------
package Foo is
end Foo;
gprbuild-25.0.0/config/test_shared.gpr 0000664 0000000 0000000 00000003017 14700753734 0017705 0 ustar 00root root 0000000 0000000 ------------------------------------------------------------------------------
-- --
-- GPR TECHNOLOGY --
-- --
-- Copyright (C) 2004-2023, AdaCore --
-- --
-- This is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 distributed with GNAT; see file COPYING. If not, --
-- see . --
-- --
------------------------------------------------------------------------------
library project Test_Shared is
for Source_Dirs use (".");
for Object_Dir use "obj";
for Library_Dir use "lib";
for Library_Name use "lib";
for Library_Kind use "relocatable";
end Test_Shared;
gprbuild-25.0.0/debug.adc 0000664 0000000 0000000 00000000033 14700753734 0015153 0 ustar 00root root 0000000 0000000 pragma Initialize_Scalars;
gprbuild-25.0.0/doc/ 0000775 0000000 0000000 00000000000 14700753734 0014165 5 ustar 00root root 0000000 0000000 gprbuild-25.0.0/doc/Makefile 0000664 0000000 0000000 00000003235 14700753734 0015630 0 ustar 00root root 0000000 0000000 # Makefile for Sphinx documentation
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = .
SOURCEDIR = .
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) \
-c $(SOURCEDIR)/share \
-d $(BUILDDIR)/$*/doctrees \
$(SOURCEDIR)
FMT_LIST=html txt info pdf
DOC_NAME=gprbuild_ug
CP=cp
.PHONY: help clean
all: $(foreach fmt, $(FMT_LIST), $(fmt))
help:
@echo "Please use \`make ' where is one of"
@echo " html to make standalone HTML files"
@echo " pdf to make LaTeX files and run them through pdflatex"
@echo " txt to make text files"
@echo " texinfo to make Texinfo files"
@echo " info to make info files"
@echo " all to build documentation in all formats"
@echo ""
@echo "source and location can be overriden using SOURCEDIR and BUILDDIR variables"
clean:
-rm -rf $(BUILDDIR)/html \
$(BUILDDIR)/pdf \
$(BUILDDIR)/txt \
$(BUILDDIR)/info \
$(BUILDDIR)/doctrees \
share/__pycache__
html: force
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
pdf: force
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/pdf
$(MAKE) -C $(BUILDDIR)/pdf all-pdf LATEXOPTS="-interaction=nonstopmode"
txt: force
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/$*/txt
$(MAKE) -C $(BUILDDIR)/txt plaintext
info: force
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/$*/info
$(MAKE) -C $(BUILDDIR)/info info
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/$*/texinfo
force:
gprbuild-25.0.0/doc/gprbuild_gps.xml 0000664 0000000 0000000 00000000671 14700753734 0017374 0 ustar 00root root 0000000 0000000
share/doc/gprbuild/html
/Help/Gprbuild
gprbuild_ug.html
Gprbuild User's Guide
GNAT
gprbuild-25.0.0/doc/gprbuild_ug.rst 0000664 0000000 0000000 00000001400 14700753734 0017215 0 ustar 00root root 0000000 0000000 GPRbuild and GPR Companion Tools User's Guide
=============================================
| Version |version|
| Date: |today|
AdaCore
Permission is granted to copy, distribute and/or modify this document under the
terms of the GNU Free Documentation License, Version 1.3 or any later version
published by the Free Software Foundation; with no Invariant Sections, no
Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included
in the section entitled :ref:`gnu_fdl`.
.. toctree::
:numbered:
:maxdepth: 3
gprbuild_ug/introduction
gprbuild_ug/gnat_project_manager
gprbuild_ug/building_with_gprbuild
gprbuild_ug/companion_tools
.. raw:: latex
\appendix
.. toctree::
:maxdepth: 3
share/gnu_free_documentation_license
gprbuild-25.0.0/doc/gprbuild_ug/ 0000775 0000000 0000000 00000000000 14700753734 0016470 5 ustar 00root root 0000000 0000000 gprbuild-25.0.0/doc/gprbuild_ug/building_with_gprbuild.rst 0000664 0000000 0000000 00000130565 14700753734 0023754 0 ustar 00root root 0000000 0000000 .. _Building_with_GPRbuild:
**********************
Building with GPRbuild
**********************
.. _Building_with_GPRbuild_Introduction:
Introduction
============
`GPRbuild` is a generic build tool designed for the construction of
large multi-language systems organized into subsystems and libraries.
It is well-suited for compiled languages supporting separate compilation,
such as Ada, C, C++ and Fortran.
`GPRbuild` manages a three step build process.
* compilation phase:
Each compilation unit of each subsystem is examined in turn, checked for
consistency, and compiled or recompiled when necessary by the appropriate
compiler. The recompilation decision is based on dependency information
that is typically produced by a previous compilation.
* post-compilation phase (or binding):
Compiled units from a given language are passed to a language-specific
post-compilation tool if any. Also during this phase
objects are grouped into static or dynamic libraries as specified.
* linking phase:
All units or libraries from all subsystems are passed to a linker tool
specific to the set of toolchains being used.
The tool is generic in that it provides, when possible, equivalent
build capabilities for all supported languages. For this, it uses a
configuration file :file:`.cgpr` that has a syntax and structure very
similar to a project file, but which defines the characteristics
of the supported languages and toolchains. The configuration file contains
information such as:
* the default source naming conventions for each language,
* the compiler name, location and required options,
* how to compute inter-unit dependencies,
* how to build static or dynamic libraries,
* which post-compilation actions are needed,
* how to link together units from different languages.
On the other hand, `GPRbuild` is not a replacement for general-purpose
build tools such as `make` or `ant` which give the user a high
level of control over the build process itself. When building a system
requires complex actions that do not fit well in the three-phase process
described above, `GPRbuild` might not be sufficient.
In such situations, `GPRbuild` can still
be used to manage the appropriate part of the build. For
instance it can be called from within a Makefile.
.. _Command_Line:
Command Line
============
Three elements can optionally be specified on GPRbuild's command line:
* the main project file,
* the switches for GPRbuild itself or for the tools it
drives, and
* the main source files.
The general syntax is thus:
::
gprbuild [.gpr] [switches] [names]
{[-cargs opts] [-cargs:lang opts] [-largs opts] [-kargs opts]
[-gargs opts]}
GPRbuild requires a project file, which may be specified on the
command line either directly or through the :samp:`-P` switch. If not
specified, GPRbuild uses the project file :file:`default.gpr` if there
is one in the current working directory. Otherwise, if there is only
one project file in the current working directory, GPRbuild uses this
project file.
Main source files represent the sources to be used as the main
programs. If they are not specified on the command line, GPRbuild uses
the source files specified with the `Main` attribute in the project
file. If none exists, then no executable will be built.
It is also possible to specify absolute file names, or file names relative
to the current directory.
When source files are specified along with the option :samp:`-c`, then
recompilation will be considered only for those source files. In all
other cases, GPRbuild compiles or recompiles all sources in the
project tree that are not up to date, and builds or rebuilds libraries
that are not up to date.
If invoked without the :samp:`--config=` or
:samp:`--autoconf=` options, then GPRbuild will look for a configuration
project file. The file name or path name of this configuration project file
depends on the target, the runtime and environment variable `GPR_CONFIG`
See :ref:`Configuring_with_GPRconfig`. If there is no such file in the default
locations expected by GPRbuild (/share/gpr and the current
directory) then GPRbuild will invoke GPRconfig with
the languages from the project files, and create a configuration project
file :file:`auto.cgpr` in the object directory of the main project. The project
:file:`auto.cgpr` will be rebuilt at each GPRbuild invocation unless you use
the switch :samp:`--autoconf=path/auto.cgpr`, which will use the configuration
project file if it exists and create it otherwise.
Options given on the GPRbuild command line may be passed along to
individual tools by preceding them with one of the "command line separators"
shown below. Options following the separator, up to the
next separator (or end of the command line), are passed along. The
different command line separators are:
* :samp:`-cargs`
The arguments that follow up to the next command line separator are
options for all compilers for all languages.
Example: :samp:`-cargs` :samp:`-g`
* :samp:`-cargs:{language name}`
The arguments that follow up to the next command line separator are
options for the compiler of the specific language.
Examples:
* :samp:`-cargs:Ada -gnatf`
* :samp:`-cargs:C -E`
* :samp:`-bargs`
The arguments that follow up to the next command line separator are
options for all binder drivers.
* :samp:`-bargs:{language name}`
The arguments that follow up to the next command line separators are
options for the binder driver of the specific language.
Examples:
* :samp:`-bargs:Ada binder_prefix=ppc-elf`
* :samp:`-bargs:C++ c_compiler_name=ccppc`
* :samp:`-largs`
The arguments that follow up to the next command line separator are
options for the linker, when linking an executable.
* :samp:`-kargs`
The arguments that follow up to the next command line separator are
options for gprconfig when performing auto-configuration.
* :samp:`-gargs`
The arguments that follow up to the next command line separator are
options for GPRbuild itself. Usually :samp:`-gargs` is specified after one or
several other command line separators.
* :samp:`-margs`
Equivalent to :samp:`-gargs`, provided for compatibility with
*gnatmake*.
.. _Switches:
Switches
========
GPRbuild takes into account switches that may be specified on the command
line or in attributes Switches() or Default_Switches
() in package Builder of the main project.
When there are a single main (specified on the command line or in
attribute Main in the main project), the switches that are taken into account
in package Builder of the main project are Switches (), if declared, or
Switches (), if declared.
When there are several mains, if there are sources of the same language, then
Switches () is taken into account, if specified.
When there are no main specified, if there is only one compiled language
(that is a language with a non empty Compiler Driver), then
Switches () is taken into account, if specified.
The switches that are interpreted directly by GPRbuild are listed below.
First, the switches that may be specified only on the command line, but not in
package Builder of the main project:
* :samp:`--build-script=`
This switch is not compatible with :samp:`--distributed=`.
When this switch is specified, a shell script is created.
Provided that the temporary files created by gprbuild are not deleted,
running this script should perform the same build as the invocation of
gprbuild, with the same sources.
* :samp:`--no-project`
This switch cannot be used if a project file is specified on the command
line.
When this switch is specified, it indicates to gprbuild that the project
files in the current directory should not be considered and that the default
project file in /share/gpr is to be used.
It is usually used with one or several mains specified on the command line.
* :samp:`--no-complete-output`
Synonym: :samp:`-n`.
By default, gprbuild redirects the standard output and the standard error of
the compilations to different text files. This allows to inspect the results
afterwards, and also ensures that parallel processes do not clobber each
other's output. When this switch is specified, these files are not created
and individual compilations output directly to common standard streams.
* :samp:`--complete-output`
This switch is not compatible with :samp:`--distributed=`.
When this switch is specified, if a source is up to date and compilation
log files exist, their contents are sent to standard output
and standard error. This allows to redisplay any warning or info from the
last invocation of gprbuild.
* :samp:`--distributed[={slave1}[,{slave2}]]`
This switch is not compatible with :samp:`--complete-output`, or with
:samp:`--build-script=`.
Activate the distributed compilation on the listed slaves nodes (IP or
name). Or if no slave are specified they are search in `GPR_SLAVES` or
`GPR_SLAVES_FILE` environment variables.
see :ref:`Distributed_compilation`.
* :samp:`--hash={string}`
Specify an hash string. This is just a value which is checked against the
GPRslave hash value. If GPRslave has a hash value specified this string
must match, otherwise it is ignored. For example:
::
$ gprbuild --hash=$(echo $ADA_PROJECT_PATH | shasum) --distributed=...
* :samp:`--slave-env={name}`
Use name as the slave's environment directory instead of the default one.
This options is only used in distributed mode.
* :samp:`--version`
Display information about GPRbuild: version, origin and legal status, then
exit successfully, ignoring other options.
* :samp:`--help`
Display GPRbuild usage, then exit successfully, ignoring other options.
* :samp:`--display-paths`
Display two lines: the configuration project file search path and the user
project file search path, then exit successfully, ignoring other options.
* :samp:`--config={config project file name}`
This specifies the configuration project file name. By default, the
configuration project file name is :file:`default.cgpr`. Option :samp:`--config=`
cannot be specified more than once. The configuration project file specified
with :samp:`--config=` must exist.
* :samp:`--autoconf={config project file name}`
This specifies a configuration project file name that already exists
or will be created automatically. Option :samp:`--autoconf=` cannot
be specified more than once. If the configuration project file
specified with :samp:`--autoconf=` exists, then it is
used. Otherwise, GPRconfig is invoked to create it automatically.
* :samp:`--target={targetname}`
This specifies that the default configuration project file is
:file:`.cgpr`. If no configuration project file with this name
is found, then GPRconfig is invoked with option
:samp:`--target={targetname}` to create a configuration project file
:file:`auto.cgpr`.
Note: only one of :samp:`--config`, :samp:`--autoconf` or :samp:`--target=`
can be specified.
* :samp:`--implicit-with={project file name}`
Adds a given project as an implicit dependency to every project in the
build tree by creating an implicit "limited with" clause at the start of
each project. This switch can only appear once on the command line.
* :samp:`--subdirs={subdir}`
This indicates that the object, library and executable directories specified
in the project file will be suffixed with {subdir}. If needed, those
subdirectories are created except for externally built projects: in this case
if the subdirectories already exist they are used, otherwise the base
directories are used.
* :samp:`--src-subdirs={subdir}`
This adds the given subdirectory (relative to each object directory of the
project tree) to the list of source directories of the project, one directory
per object directory. This is useful for overriding temporarily some source
files for the purpose of e.g. source instrumentation such as source coverage
or preprocessing. This option may be combined with :samp:`--subdirs`.
* :samp:`--relocate-build-tree[={dir}]`
With this option it is possible to achieve out-of-tree build. That
is, real object, library or exec directories are relocated to the
current working directory or dir if specified.
* :samp:`--root-dir={dir}`
This option is to be used with --relocate-build-tree above and
cannot be specified alone. This option specifies the root directory
for artifacts for proper relocation. The default value is the main
project directory. This may not be suitable for relocation if for
example some artifact directories are in parent directory of the
main project. The specified directory must be a parent of all
artifact directories.
* :samp:`--unchecked-shared-lib-imports`
Allow shared library projects to import projects that are not shared
library projects.
* :samp:`--source-info={source info file}`
Specify a source info file. If the source info file is specified as a
relative path, then it is relative to the object directory of the main
project. If the source info file does not exist, then after the Project
Manager has successfully parsed and processed the project files and found
the sources, it creates the source info file. If the source info file
already exists and can be read successfully, then the Project Manager will
get all the needed information about the sources from the source info file
and will not look for them. This reduces the time to process the project
files, especially when looking for sources that take a long time. If the
source info file exists but cannot be parsed successfully, the Project
Manager will attempt to recreate it. If the Project Manager fails to create
the source info file, a message is issued, but GPRbuild does not fail.
* :samp:`--restricted-to-languages={list of language names}`
Restrict the sources to be compiled to one or several languages. Each
language name in the list is separated from the next by a comma, without any
space.
Example: :samp:`--restricted-to-languages=Ada,C`
When this switch is used, switches :samp:`-c`, :samp:`-b` and
:samp:`-l` are ignored. Only the compilation phase is performed and the
sources that are not in the list of restricted languages are not compiled,
including mains specified in package Builder of the main project.
* :samp:`--no-sal-binding`
Specify to GPRbuild to not rebind a Stand-Alone Library (SAL), but instead
to reuse the files created during a previous build of the SAL. GPRbuild
will fail if there are missing files. This option is unsafe and not
recommended, as it may result in incorrect binding of the SAL, for example
if sources have been added, removed or modified in a significant way related
to binding. It is only provided to improve performance, when it is known
that the resulting binding files will be the same as the previous ones.
* :samp:`-aP {dir}` (Add directory :file:`dir` to project search path)
Specify to GPRbuild to add directory :file:`dir` to the user project file search
path, before the default directory.
* :samp:`-d` (Display progress)
Display progress for each source, up to date or not, as a single
line *completed x out of y (zz%)...*. If the file needs to be compiled
this is displayed after the invocation of the compiler. These lines are
displayed even in quiet output mode (switch :samp:`-q`).
* :samp:`-I{nn}` (Index of main unit in multi-unit source file)
Indicate the index of the main unit in a multi-unit source file.
The index must be a positive number and there should be one and only
one main source file name on the command line.
* :samp:`-eL` (Follow symbolic links when processing project files)
By default, symbolic links on project files are not taken into account
when processing project files. Switch :samp:`-eL` changes this default
behavior.
* :samp:`-eS` (no effect)
This switch is only accepted for compatibility with gnatmake, but it has
no effect. For gnatmake, it means: echo commands to standard output instead
of standard error, but for gprbuild, commands are always echoed to standard
output.
* :samp:`-F` (Full project path name in brief error messages)
By default, in non verbose mode, when an error occurs while processing
a project file, only the simple name of the project file is displayed in the
error message. When switch :samp:`-F` is used, the full path of the project
file is used. This switch has no effect when switch :samp:`-v` is used.
* :samp:`-o {name}` (Choose an alternate executable name)
Specify the file name of the executable. Switch :samp:`-o` can
be used only if there is exactly one executable being built;
that is, there is exactly one main on the command line,
or there are no mains on the command line and exactly one
main in attribute `Main` of the main project.
* :samp:`-P {proj}` (use Project file *proj*)
Specify the path name of the main project file. The space between :samp:`-P`
and the project file name is optional. Specifying a project file name (with
suffix :file:`.gpr`) may be used in place of option :samp:`-P`. Exactly one main
project file can be specified.
* :samp:`-r` (Recursive)
This switch has an effect only when :samp:`-c` or :samp:`-u` is also
specified and there are no mains: it means that all sources of all projects
need to be compiled or recompiled.
* :samp:`-u` (Unique compilation, only compile the given files)
If there are sources specified on the command line, only compile these
sources. If there are no sources specified on the command line, compile
all the sources of the main project.
In both cases, do not attempt the binding and the linking phases.
* :samp:`-U` (Compile all sources of all projects)
If there are sources specified on the command line, only compile these
sources. If there are no sources specified on the command line, compile
all the sources of all the projects in the project tree.
In both cases, do not attempt the binding and the linking phases.
* :samp:`-vP{x}` (Specify verbosity when parsing Project Files)
By default, GPRbuild does not display anything when processing project files,
except when there are errors. This default behavior is obtained with switch
:samp:`-vP0`. Switches :samp:`-vP1` and :samp:`-vP2` yield increasingly
detailed output.
* :samp:`-Xnm={val}` (Specify an external reference for Project Files)
Specify an external reference that may be queried inside the project files
using built-in function `external`. For example, with
:samp:`-XBUILD=DEBUG`,
`external("BUILD")` inside a project file will have the value
`"DEBUG"`.
* :samp:`--compiler-subst={lang},{tool}` (Specify alternative compiler)
Use *tool* for compiling files in language *lang*,
instead of the normal compiler. For example, if
:samp:`--compiler-subst=ada,my-compiler` is given, then Ada files
will be compiled with *my-compiler* instead of the usual
*gcc*. This and :samp:`--compiler-pkg-subst` are intended
primarily for use by ASIS tools using :samp:`--incremental` mode.
* :samp:`--compiler-pkg-subst={pkg}` (Specify alternative package)
Use the switches in project-file package *pkg* when running
the compiler, instead of the ones in package Compiler.
Then, the switches that may be specified on the command line as well as in
package Builder of the main project (attribute Switches):
* :samp:`--keep-temp-files`
Normally, GPRbuild delete the temporary files that it creates.
When this switch is used, the temporary files that GPRbuild creates are
not deleted.
* :samp:`--create-map-file`
When linking an executable, if supported by the platform, create a map file
with the same name as the executable, but with suffix :file:`.map`.
* :samp:`--create-map-file={map file}`
When linking an executable, if supported by the platform, create a map file
with file name :file:`map file`.
* :samp:`--gnu-make-jobserver`
Specify to GPRbuild that it should attempt to connect to GNU make jobserver
in order to be instructed when it is allowed to spawn another simultaneous
compilation jobs.
This option should be used when GNU make contains :samp:`-j{num}` switch when
invoking GPRbuild to ensure correct ressources allocation.
If :samp:`-j{num}` is set alongside :samp:`--gnu-make-jobserver`
the former will be ignored.
* :samp:`--no-indirect-imports`
This indicates that sources of a project should import only sources or
header files from directly imported projects, that is those projects mentioned
in a with clause and the projects they extend directly or indirectly.
A check is done in the compilation phase, after a successful compilation, that
the sources follow these restrictions. For Ada sources, the check is fully
enforced. For non Ada sources, the check is partial, as in the dependency
file there is no distinction between header files directly included and those
indirectly included. The check will fail if there is no possibility that a
header file in a non directly imported project could have been indirectly
imported. If the check fails, the compilation artifacts (dependency file,
object file, switches file) are deleted.
* :samp:`--indirect-imports`
This indicates that sources of a project can import sources or header files
from directly or indirectly imported projects. This is the default behavior.
This switch is provided to cancel a previous switch
:samp:`--no-indirect-imports` on the command line.
* :samp:`--no-object-check`
Do not check if an object has been created after compilation.
* :samp:`--no-split-units`
Forbid the sources of the same Ada unit to be in different projects.
* :samp:`--single-compile-per-obj-dir`
Disallow several simultaneous compilations for the same object directory.
* :samp:`-b` (Bind only)
Specify to GPRbuild that the post-compilation (or binding) phase is to be
performed, but not the other phases unless they are specified by appropriate
switches.
* :samp:`-c` (Compile only)
Specify to GPRbuild that the compilation phase is to be performed, but not
the other phases unless they are specified by appropriate switches.
* :samp:`-f` (Force recompilations)
Force the complete processing of all phases (or of those explicitly specified)
even when up to date.
* :samp:`-j{num}` (use *num* simultaneous compilation jobs)
By default, GPRbuild invokes one compiler at a time. With switch :samp:`-j`,
it is possible to instruct GPRbuild to spawn several simultaneous compilation
jobs if needed. For example, :samp:`-j2` for two simultaneous compilation
jobs or :samp:`-j4` for four. On a multi-processor system,
:samp:`-j{num}` can greatly speed up the build process. If :samp:`-j0` is
used, then the maximum number of simultaneous compilation jobs is the number
of core processors on the platform.
Switch :samp:`-j{num}` is also used to spawned several simultaneous binding
processes and several simultaneous linking processes when there are several
mains to be bound and/or linked.
Note: if :samp:`--gnu-make-jobserver` is set, then :samp:`-j{num}` will
simply be ignored.
* :samp:`-k` (Keep going after compilation errors)
By default, GPRbuild stops spawning new compilation jobs at the first
compilation failure. Using switch :samp:`-k`, it is possible to attempt to
compile/recompile all the sources that are not up to date, even when some
compilations failed. The post-compilation phase and the linking phase are never
attempted if there are compilation failures, even when switch :samp:`-k` is
used.
* :samp:`-l` (Link only)
Specify to GPRbuild that the linking phase is to be performed, but not
the other phases unless they are specified by appropriate switches.
* :samp:`-m` (Minimum Ada recompilation)
Do not recompile Ada code if timestamps are different but checksums are the
same. Note that for the case when source code contains preprocessing
directives, this switch has no effect.
* :samp:`-m2` (Checksum based recompilation)
Recompile Ada code even if timestamps are the same, but checksums are
different. Note that for the case when source code contains preprocessing
directives, this switch has the same effect as -f.
* :samp:`-p` or :samp:`--create-missing-dirs` (Create missing object, library and exec directories)
By default, GPRbuild checks that the object, library and exec directories
specified in project files exist. GPRbuild automatically creates any of these
directories which is specified relatively to the project dir, for instance
:samp:`for Object_Dir use "obj/"`. The :samp:`-p` switch instructs GPRbuild
to attempt to create missing directories that are specified as absolute paths
as well. Note that these switches may be specified in package Builder of the
main project, but they are not useful there as either the directories already
exist or the processing of the project files has failed before the evaluation
of the Builder switches, because there is at least one missing directory.
* :samp:`-q` (Quiet output)
Do not display anything except errors and progress (switch :samp:`-d`).
Cancel any previous switch :samp:`-v`.
* :samp:`-R` (no run path option)
Do not use a run path option to link executables or shared libraries,
even when attribute Run_Path_Option is specified.
* :samp:`-s` (recompile if compilation switches have changed)
By default, GPRbuild will not recompile a source if all dependencies are
satisfied. Switch :samp:`-s` instructs GPRbuild to recompile sources when a
different set of compilation switches has been used in the previous
compilation, even if all dependencies are satisfied. Each time GPRbuild
invokes a compiler, it writes a text file that lists the switches used in the
invocation of the compiler, so that it can retrieve these switches if
:samp:`-s` is used later.
* :samp:`-v` (Verbose output)
Same as switch :samp:`-vl`.
* :samp:`-vl` (Verbose output, low level)
Display full paths, all options used in spawned processes, as well as
creations of missing directories and changes of current working directories.
* :samp:`-vm` (Verbose output, medium level)
Not significantly different from switch :samp:`-vh`.
* :samp:`-vh` (Verbose output, high level)
In addition to what is displayed with switch :samp:`vl`, displayed internal
behavior of gprbuild and reasons why the spawned processes are invoked.
* :samp:`-we` (Treat all warnings as errors)
When :samp:`-we` is used, any warning during the processing of the project
files becomes an error and GPRbuild does not attempt any of the phases.
* :samp:`-wn` (Treat warnings as warnings)
Switch :samp:`-wn` may be used to restore the default after :samp:`-we` or
:samp:`-ws`.
* :samp:`-ws` (Suppress all warnings)
Do not generate any warnings while processing the project files.
Note that this switch is only for warnings generated by gprbuild,
not for warnings generated by the compiler.
Use the compiler switch :samp:`-gnatws` to suppress warnings generated by
the GNAT front end, and the compiler switch :samp:`-w` to suppress warnings
generated by the gcc back end.
* :samp:`-x` (Create include path file)
Create the include path file for the Ada compiler.
This switch is often necessary when Ada sources are compiled with switch
:samp:`-gnatep=`.
Switches that are accepted for compatibility with gnatmake, either on the
command line or in the Builder Ada switches in the main project file:
* :samp:`-nostdinc`
* :samp:`-nostdlib`
* :samp:`-fstack-check`
* :samp:`-fno-inline`
* :samp:`-g{*}` Any switch starting with :samp:`-g`
* :samp:`-O{*}` Any switch starting with :samp:`-O`
These switches are passed to the Ada compiler.
.. _Initialization:
Initialization
==============
Before performing one or several of its three phases, GPRbuild has to read the
command line, obtain its configuration, and process the project files.
If GPRbuild is invoked with an invalid switch or without any project file on
the command line, it will fail immediately.
Examples:
::
$ gprbuild -P
gprbuild: project file name missing after -P
$ gprbuild -P c_main.gpr -WW
gprbuild: illegal option "-WW"
GPRbuild looks for the configuration project file first in the current
working directory, then in the default configuration project directory.
If the GPRbuild executable is located in a subdirectory :file:`/bin`,
then
the default configuration project directory is :file:`/share/gpr`,
otherwise there is no default configuration project directory.
When it has found its configuration project path, GPRbuild needs to obtain its
configuration. By default, the file name of the main configuration project
is :file:`default.cgpr`. This default may be modified using the switch
:samp:`--config=...`
Example:
::
$ gprbuild --config=my_standard.cgpr -P my_project.gpr
If GPRbuild cannot find the main configuration project on the configuration
project path, then it will look for all the languages specified in the user
project tree and invoke GPRconfig to create a temporary configuration project
file. This file is located in the directory computed by the following sequence:
* Look for a valid absolute path in the environment variables TMPDIR, TEMP, and
TMP.
* If this fails, check some predefined platform-specific temp dirs (e.g. /tmp
for linux).
* Finally if none is accessible we fall back onto the current working
directory.
The invocation of GPRconfig will take into account the target, if specified
either by switch --target= on the command line or by attribute Target in the
main project. Also, if Ada is one of the languages, it will take into account
the Ada runtime directory, specified either by switches --RTS= or --RTS:ada= on
the command line or by attribute Runtime ("Ada") in the main project file. If
the Ada runtime is specified as a relative path, gprbuild will try to locate
the Ada runtime directory as a subdirectory of the main project directory, or
if environment variable GPR_RUNTIME_PATH is defined in the path specified
by GPR_RUNTIME_PATH.
Once it has found the configuration project, GPRbuild will process its
configuration: if a single string attribute is specified in the configuration
project and is not specified in a user project, then the attribute is added
to the user project. If a string list attribute is specified in the
configuration project then its value is prepended to the corresponding
attribute in the user project.
After GPRbuild has processed its configuration, it will
process the user project file or files. If these user project files are
incorrect then GPRbuild will fail with the appropriate error messages:
::
$ gprbuild -P my_project.gpr
ada_main.gpr:3:26: "src" is not a valid directory
gprbuild: "my_project.gpr" processing failed
Once the user project files have been dealt with successfully, GPRbuild
will start its processing.
.. _Compilation_of_one_or_several_sources:
Compilation of one or several sources
=====================================
If GPRbuild is invoked with :samp:`-u` or :samp:`-U` and there are one or
several source file names specified on the command line, GPRbuild will compile
or recompile these sources, if they are not up to date or if :samp:`-f` is
also specified. Then GPRbuild will stop its execution.
The options/switches used to compile these sources are described in section
:ref:`Compilation_Phase`.
If GPRbuild is invoked with :samp:`-u` and no source file name is specified
on the command line, GPRbuild will compile or recompile all the sources of the
*main* project and then stop.
In contrast, if GPRbuild is invoked with :samp:`-U`, and again no source file name is specified
on the command line, GPRbuild will compile or recompile all the sources of
*all the projects in the project tree* and then stop.
.. _Compilation_Phase:
Compilation Phase
=================
When switch :samp:`-c` is used or when switches :samp:`-b` or :samp:`-l`
are not used, GPRbuild will first compile or recompile the sources that
are not up to date in all the projects in the project tree. The sources
considered are:
* all the sources in languages other than Ada
* if there are no main specified, all the Ada sources
* if there is a non Ada main, but no attribute `Roots` specified for
this main, all the Ada sources
* if there is a main with an attribute `Roots` specified, all
the Ada sources in the closures of these Roots.
* if there is an Ada main specified, all the Ada sources in the closure
of the main
Attribute Roots takes as an index a main and a string list value. Each string
in the list is the name of an Ada library unit.
Example:
::
for Roots ("main.c") use ("pkga", "pkgb");
Package PkgA and PkgB will be considered, and all the Ada units in their
closure will also be considered.
GPRbuild will first consider each source and decide if it needs to be
(re)compiled.
A source needs to be compiled in the following cases:
* Switch :samp:`-f` (force recompilations) is used
* The object file does not exist
* The source is more recent than the object file
* The dependency file does not exist
* The source is more recent than the dependency file
* When :samp:`-s` is used: the switch file does not exist
* When :samp:`-s` is used: the source is more recent than the switch file
* The dependency file cannot be read
* The dependency file is empty
* The dependency file has a wrong format
* A source listed in the dependency file does not exist
* A source listed in the dependency file has an incompatible time stamp
* A source listed in the dependency file has been replaced
* Switch :samp:`-s` is used and the source has been compiled with
different switches or with the same switches in a different order
When a source is successfully compiled, the following files are normally
created in the object directory of the project of the source:
* An object file
* A dependency file, except when the dependency kind for the language
is `none`
* A switch file if switch :samp:`-s` is used
The compiler for the language corresponding to the source file name is invoked with the following
switches/options:
* The required compilation switches for the language
* The compilation switches coming from package `Compiler` of the
project of the source
* The compilation switches specified on the command line for all compilers,
after :samp:`-cargs`
* The compilation switches for the language of the source, specified
after :samp:`-cargs:{language}`
* Various other options including a switch to create the dependency file
while compiling, a switch to specify a configuration file, a switch
to specify a mapping file, and switches to indicate where to look for
other source or header files that are needed to compile the source.
If compilation is needed, then all the options/switches, except those
described as 'Various other options' are written to the switch file.
The switch file is a text file. Its file name is obtained by replacing
the suffix of the source with :file:`.cswi`. For example, the switch file
for source :file:`main.adb` is :file:`main.cswi` and for
:file:`toto.c` it is :file:`toto.cswi`.
If the compilation is successful, then if the creation of the dependency
file is not done during compilation but after (see configuration attribute
`Compute_Dependency`), then the process to create the dependency file is
invoked.
For each project file, attribute Interfaces may be declared. Its value is a
list of sources or header files of the project file. For a project file
extending another one, directly or indirectly, inherited sources may be in
the list. When Interfaces is not declared, all sources or header files are
part of the interface of the project. When Interfaces is declared, only those
sources or header files are part of the interface of the project file. After
a successful compilation, gprbuild checks that all imported or included sources
or header files that are from an imported project are part of the interface of
the imported project. If this check fails, the compilation is invalidated and
the compilation artifacts (dependency, object and switches files) are deleted.
Example:
::
project Prj is
for Languages use ("Ada", "C");
for Interfaces use ("pkg.ads", "toto.h");
end Prj;
If a source from a project importing project Prj imports sources from Prj other
than package Pkg or includes header files from Prj other than "toto.h", then
its compilation will be invalidated.
.. _Simultaneous_compilation:
Simultaneous compilation
========================
If GPRbuild is invoked with a switch :samp:`-j` specifying more than one
compilation process, then several compilation processes for several sources of
possibly different languages are spawned concurrently.
Furthermore, GPRbuild is GNU make jobserver compatible when using the switch
:samp:`--gnu-make-jobserver`. This means if GPRbuild is embedded in a GNU make
recursive invocation and :samp:`--gnu-make-jobserver` is set, then GPRbuild
will only spawn an additionnal compilation process if GNU make's jobserver
allows it. This is particularly useful to ensure that GPRbuild comply to the
ressource management of GNU make.
Example:
::
build1:
+gprbuild -P prjA/prj.gpr --gnu-make-jobserver
build2:
+gprbuild -P prjB/prj.gpr --gnu-make-jobserver
build_all:
+make build1 build2
calling :samp:`make build_all -j4` will spawn two GPRbuild processes, resulting in
two remaining and available slots for both GPRbuild compilation phase.
Note: If :samp:`--gnu-make-jobserver` is set, then any :samp:`-j{num}` will simply
be ignored by GPRbuild and a warning will be issued.
.. _Post-Compilation_Phase:
Post-Compilation Phase
======================
The post-compilation phase has two parts: library building and program binding.
If there are libraries that need to be built or rebuilt, *gprbuild* will
call the library builder, specified by attribute `Library_Builder`.
This is generally the tool *gprlib*, provided with GPRbuild. If gprbuild
can determine that a library is already up to date, then the library builder
will not be called.
If there are mains specified, and for these mains there are sources of
languages with a binder driver (specified by attribute Binder'Driver
(), then the binder driver is called for each such main, but only
if it needs to.
For Ada, the binder driver is normally *gprbind*, which will call
the appropriate version of *gnatbind*, that either the one in the same
directory as the Ada compiler or the fist one found on the path.
When neither of those is appropriate, it is possible to specify to
*gprbind* the full path of *gnatbind*, using the Binder switch
`--gnatbind_path=`.
Example:
::
package Binder is
for Switches ("Ada") use ("--gnatbind_path=/toto/gnatbind");
end Binder;
If GPRbuild can determine that the artifacts from a previous
post-compilation phase are already up to date, the binder driver is not called.
If there are no libraries and no binder drivers, then the post-compilation
phase is empty.
.. _Linking_Phase:
Linking Phase
=============
When there are mains specified, either in attribute Main or on the command
line, and these mains are not up to date, the linker is invoked for each main,
with all the specified or implied options, including the object files generated
during the post-compilation phase by the binder drivers.
If switch :samp:`-j{nnn}` is used, with `nnn` other than 1, gprbuild will attempt to link
simultaneously up to `nnn` executables.
.. _Distributed_compilation:
Distributed compilation
=======================
.. _Introduction_to_distributed_compilation:
Introduction to distributed compilation
---------------------------------------
For large projects the compilation time can become a limitation in
the development cycle. To cope with that, GPRbuild supports
distributed compilation.
In the distributed mode, the local machine (called the build master)
compiles locally but also sends compilation requests to remote
machines (called the build slaves). The compilation process can use
one or more build slaves. Once the compilation phase is done, the
build master will conduct the binding and linking phases locally.
.. _Setup_build_environments:
Setup build environments
------------------------
The configuration process to be able to use the distributed compilation
support is the following:
* Optionally add a Remote package in the main project file
This Remote package is to be placed into the project file that is passed
to GPRbuild to build the application.
The Root_Dir default value is the project's directory. This attribute
designates the sources root directory. That is, the directory from which
all the sources are to be found to build the application. If the project
passed to GPRbuild to build the application is not at the top-level
directory but in a direct sub-directory the Remote package should be:
.. code-block:: gpr
package Remote is
for Root_Dir use "..";
end Remote;
* Launch a slave driver on each build slave
The build master will communicate with each build slave with a specific driver
in charge of running the compilation process and returning statuses. This
driver is *gprslave*, :ref:`GPRslave`.
The requirement for the slaves are:
* The same build environment must be setup (same compiler version).
* The same libraries must be installed. That is, if the GNAT
project makes use of external libraries the corresponding C headers or
Ada units must be installed on the remote slaves.
When all the requirement are set, just launch the slave driver:
::
$ gprslave
When all this is done, the remote compilation can be used simply by
running GPRbuild in distributed mode from the build master:
::
$ gprbuild --distributed=comp1.xyz.com,comp2.xyz.com prj.gpr
Alternatively the slaves can be set using the `GPR_SLAVES` environment
variable. So the following command is equivalent to the above:
::
$ export GPR_SLAVES=comp1.xyz.com,comp2.xyz.com
$ gprbuild --distributed prj.gpr
A third alternative is proposed using a list of slaves in a file (one
per line). In this case the `GPR_SLAVES_FILE` environment variable
must contain the path name to this file:
::
$ export GPR_SLAVES_FILE=$HOME/slave-list.txt
$ gprbuild --distributed prj.gpr
Finally note that the search for the slaves are in this specific
order. First the command line values, then `GPR_SLAVES` if set and
finally `GPR_SLAVES_FILES`.
The build slaves are specified with the following form:
::
[:port]
.. _GPRslave:
GPRslave
--------
This is the slave driver in charge of running the compilation
jobs as requested by the build master. One instance of this tool must be
launched in each build slave referenced in the project file.
Compilations for a specific project are conducted under a sub-directory
from where the slave is launched by default. This can be overridden
with the `-d` option below.
The current options are:
* :samp:`-v, --verbose`
Activate the verbose mode
* :samp:`-vv`, :samp:`--debug`
Activate the debug mode (very verbose)
* :samp:`-h`, :samp:`--help`
Display the usage
* :samp:`-d`, :samp:`--directory=`
Set the work directory for the
slave. This is where the sources will be copied and where the
compilation will take place. A sub-directory will be created for each
root project built.
* :samp:`-s`, :samp:`--hash={string}`
Specify an hash string. This is just a value which is checked against the
GPRbuild hash value. If set, GPRbuild hash value must match, otherwise the
connection with the slave is aborted. For example:
::
$ gprslave --hash=$(echo $ADA_PROJECT_PATH | shasum)
* :samp:`-j{N}`, :samp:`--jobs={N}`
Set the maximum simultaneous compilation.
The default for `N` is the number of cores.
* :samp:`-p`, :samp:`--port={N}`
Set the port the slave will listen to.
The default value is 8484. The same port must be specified for the
build slaves on `GPRbuild` command line.
* :samp:`-r`, :samp:`--response-handler={N}`
Set maximum number of simultaneous responses.
With this option it is possible to control the number of simultaneous
responses (sending back object code and ALI files) supported. The
value must be between 1 and the maximum number of simultaneous
compilations.
Note that a slave can be pinged to see if it is running and in
response a set of information are delivered. The ping command has the
following format:
::
PG
When and are 32bits binary values for the
PG string command. As an example here is how to send a ping command
from a UNIX shell using the echo command:
::
echo -e "\x01\x00\x00\x00\x02\x00\x00\x00PG" | nc 8484
The answer from the ping command has the following format:
::
OK[ASCII.GS][ASCII.GS]
The ASCII.GS is the Group Separator character whose code is 29.
gprbuild-25.0.0/doc/gprbuild_ug/companion_tools.rst 0000664 0000000 0000000 00000265124 14700753734 0022437 0 ustar 00root root 0000000 0000000 .. _GPRbuild_Companion_Tools:
************************
GPRbuild Companion Tools
************************
This chapter describes the various tools that can be used in conjunction with GPRbuild.
.. _Configuring_with_GPRconfig:
Configuring with GPRconfig
==========================
.. _Configuration:
Configuration
-------------
GPRbuild requires one configuration file describing the languages and
toolchains to be used, and project files describing the
characteristics of the user project. Typically the configuration
file can be created automatically by `GPRbuild` based on the languages
defined in your projects and the compilers on your path. In more
involved situations --- such as cross compilation, or
environments with several compilers for the same language ---
you may need to control more precisely the generation of
the desired configuration of toolsets. A tool, GPRconfig, described in
:ref:`Configuring_with_GPRconfig`), offers this capability. In this
chapter most of the examples can use autoconfiguration.
GPRbuild will start its build process by trying to locate a configuration
file, using the following rules.
* If either `--config` or `--autoconf` switches are specified, the argument
of this switch is used as configuration file.
* If neither switch is specified, and both target and rts are explicitly
specified in the project or on the command line, then configuration file
is called `-.cgpr`; if only target or only rts is specified, it
is called `.cgpr` respectively; if neither
is specified, it is called `default.cgpr`. This file is looked for in the
current directory.
* If the environment variable `GPR_CONFIG` is specified, the above rule is
modified as follows: if this variable designates a directory, then this
directory is searched for the configuration file instead of the current
directory; otherwise, the value of this variable is used as a configuration
file name (absolute or relative).
GPRbuild assumes that there are known compilers on your path for each of
the necessary languages. A user can manually generate a
configuration file (and reference it using `--config` switch); this is
especially useful when:
* using cross compilers (in which case you need to use gprconfig's
:samp:`--target=`) option;
* using a specific Ada runtime (e.g. :samp:`--RTS=sjlj`);
* working with compilers not in the path or not first in the path;
* autoconfiguration does not give the expected results;
* autoconfiguration perceptively delays the build.
GPRconfig provides several ways of generating configuration files. By
default, a simple interactive mode lists all the known compilers for all
known languages. You can then select a compiler for each of the languages;
once a compiler has been selected, only compatible compilers for other
languages are proposed. Here are a few examples of GPRconfig
invocation:
* The following command triggers interactive mode. The configuration will be
generated in GPRbuild's default location, `./default.cgpr)`, unless
:samp:`-o` is used.
::
gprconfig
* The first command below also triggers interactive mode, but the resulting
configuration
file has the name and path selected by the user. The second command shows
how GPRbuild can make use of this specific configuration file instead of
the default one.
::
gprconfig -o path/my_config.cgpr
gprbuild --config=path/my_config.cgpr
* The following command again triggers interactive mode, and only the
relevant cross compilers for target ppc-elf will be proposed.
::
gprconfig --target=ppc-elf
* The next command triggers batch mode and generates at the default location
a configuration file using the first native Ada and C compilers on
the path.
::
gprconfig --config=Ada --config=C --batch
* The next command, a combination of the previous examples, creates in
batch mode a configuration file named :file:`x.cgpr` for cross-compiling
Ada with a run-time called `hi` and using C for the LEON
processor.
::
gprconfig --target=leon-elf --config=Ada,,hi --config=C --batch -o x.cgpr
.. _Using_GPRconfig:
Using GPRconfig
---------------
Description
^^^^^^^^^^^
The GPRconfig tool helps you generate the configuration
files for GPRbuild. It automatically detects the available compilers
on your system and, after you have selected the one needed for your
application, it generates the proper configuration file.
.. note::
In general, you will not launch GPRconfig
explicitly. Instead, it is used implicitly by GPRbuild through the use
of `--config` and `--autoconf` switches.
Command line arguments
^^^^^^^^^^^^^^^^^^^^^^
GPRconfig supports the following command line switches:
.. index:: --target (gprconfig)
:samp:`--target={platform}`
.. -- @TIPHTML{Use :samp:`--target` to specify on which machine your application will run}
This switch indicates the target computer on which your application will
be run. It is mostly useful for cross configurations. Examples include
:samp:`ppc-elf`, :samp:`ppc-vx6-windows`. It can also be used in native
configurations and is useful when the same machine can run different kind
of compilers such as mingw32 and cygwin on Windows or x86-32 and x86-64
on GNU Linux. Since different compilers will often return a different
name for those targets, GPRconfig has an extensive knowledge of which
targets are compatible, and will for example accept :samp:`x86-linux` as
an alias for :samp:`i686-pc-linux-gnu`.
The default target is the machine on which GPRconfig is run.
If you enter the special target :samp:`all`, then all compilers found on the
:envvar:`PATH` will be displayed.
.. index:: --show-target (gprconfig)
:samp:`--show-targets`
As mentioned above, GPRconfig knows which targets are compatible. You
can use this switch to find the list of targets that are compatible
with `--target`.
.. index:: --config (gprconfig)
:samp:`--config={language}[,{version}[,{runtime}[,{path}[,{name}]]]]`
.. -- @TIPHTML{Use :samp:`--config` to automatically select the first matching compiler}
The intent of this switch is to preselect one or more compilers directly
from the command line. This switch takes several optional arguments, which
you can omit simply by passing the empty string. When omitted, the arguments
will be computed automatically by GPRconfig.
In general, only *language* needs to be specified, and the first
compiler on the :envvar:`PATH` that can compile this language will be selected.
As an example, for a multi-language application programmed in C and Ada,
the command line would be:
::
--config=Ada --config=C
*path* is the directory that contains the compiler executable, for
instance :file:`/usr/bin` (and not the installation prefix :file:`/usr`).
*name* should be one of the compiler names defined in the GPRconfig
knowledge base. The list of supported names includes :samp:`GNAT`,
:samp:`GCC`,.... This name is
generally not needed, but can be used to distinguish among several compilers
that could match the other arguments of :samp:`--config`.
Another possible more frequent use of *name* is to specify the base
name of an executable. For instance, if you prefer to use a diab C compiler
(executable is called :file:`dcc`) instead of :file:`gcc`, even if the latter
appears first in the path, you could specify :file:`dcc` as the name parameter.
::
gprconfig --config Ada,,,/usr/bin # automatic parameters
gprconfig --config C,,,/usr/bin,GCC # automatic version
gprconfig --config C,,,/usr/bin,gcc # same as above, with exec name
This switch is also the only possibility to include in your project some
languages that are not associated with a compiler. This is sometimes useful
especially when you are using environments like GPS that support project files.
For instance, if you select "Project file" as a language, the files matching
the :file:`.gpr` extension will be shown in the editor, although they of course
play no role for gprbuild itself.
.. index:: --batch (gprconfig)
:samp:`--batch`
.. -- @TIPHTML{Use :samp:`--batch` to generate the configuration file with no user interaction}
If this switch is specified, GPRconfig automatically selects the first
compiler matching each of the `--config` switches, and generates the
configuration file immediately. It will not display an interactive menu.
.. index:: -o (gprconfig)
:samp:`-o {file}`
.. -- @TIPHTML{Use :samp:`-o` to specify the name of the configuration file to generate}
This specifies the name of the configuration file that will be generated.
If this switch is not specified, a default file is generated in the
installation directory of GPRbuild (assuming you have write access to
that directory), so that it is automatically picked up by GPRbuild later
on. If you select a different output file, you will need to specify it
to GPRbuild.
.. index:: --db (gprconfig)
:samp:`--db {directory}`, :samp:`--db-`
Indicates another directory that should be parsed for GPRconfig's knowledge
base. Most of the time this is only useful if you are creating your own
XML description files locally. Additional directories are always processed
after the default knowledge base. The second version of the switch prevents
GPRconfig from reading its default knowledge base.
.. index:: -h (gprconfig)
:samp:`-h`
Generates a brief help message listing all GPRconfig switches and the
default value for their arguments. This includes the location of the
knowledge base, the default target, etc.
Interactive use
^^^^^^^^^^^^^^^
When you launch GPRconfig, it first searches for all compilers it
can find on your :envvar:`PATH`, that match the target specified by
:samp:`--target`. It is recommended, although not
required, that you place the compilers that you expect to use for your
application in your :envvar:`PATH` before you launch *gprconfig*,
since that simplifies the setup.
.. -- @TIPHTML{The list of compilers is sorted so that the most likely compilers appear first}
GPRconfig then displays the list of all the compilers
it has found, along with the language they can compile, the run-time
they use (when applicable),.... It then waits for you to select
one of the compilers. This list is sorted by language, then by order
in the :envvar:`PATH` environment variable (so that compilers that you
are more likely to use appear first), then by run-time names and
finally by version of the compiler. Thus the first
compiler for any language is most likely the one you want to use.
You make a selection by entering the letter that appears on the line for
each compiler (be aware that this letter is case sensitive). If the compiler was
already selected, it is deselected.
.. -- @TIPHTML{The list of compilers is filtered, so that only compatible compilers can be selected}
A filtered list of compilers is then displayed:
only compilers that target the same platform as the selected
compiler are now shown. GPRconfig then checks whether it is
possible to link sources compiled with the selected compiler and each of
the remaining compilers; when linking is not possible, the compiler is not
displayed. Likewise, all compilers for the same language are hidden, so that
you can only select one compiler per language.
As an example, if you need to compile your application with several C compilers,
you should create another language, for instance called C2, for that purpose.
That will give you the flexibility to indicate in the project files which
compiler should be used for which sources.
The goal of this filtering is to make it more obvious whether you have
a good chance of being able to link. There is however no guarantee that
GPRconfig will know for certain how to link any combination of the
remaining compilers.
You can select as many compilers as are needed by your application. Once you
have finished selecting the compilers, select :kbd:`s`, and GPRconfig will
generate the configuration file.
.. _The_GPRconfig_knowledge_base:
The GPRconfig knowledge base
----------------------------
GPRconfig itself has no hard-coded knowledge of compilers. Thus there
is no need to recompile a new version of GPRconfig when a new compiler
is distributed.
.. note::
The role and format of the knowledge base are irrelevant for most users
of GPRconfig, and are only needed when you need to add support for new
compilers. You can skip this section if you only want to learn how to use
GPRconfig.
All knowledge of compilers is embedded in a set of XML files called the
*knowledge base*.
Users can easily contribute to this general knowledge base, and have
GPRconfig immediately take advantage of any new data.
The knowledge base contains various kinds of information:
* Compiler description
When it is run interactively, GPRconfig searches the user's
:envvar:`PATH` for known compilers, and tries to deduce their
configuration (version, supported languages, supported targets, run-times,
...). From the knowledge base GPRconfig knows how to extract the
relevant information about a compiler.
This step is optional, since a user can also enter all the information
manually. However, it is recommended that the knowledge base explicitly
list its known compilers, to make configuration easier for end users.
* Specific compilation switches
When a compiler is used, depending on its version, target, run-time,...,
some specific command line switches might have to be supplied. The
knowledge base is a good place to store such information.
For instance, with the GNAT compiler, using the soft-float runtime should
force *gprbuild* to use the :samp:`-msoft-float` compilation switch.
* Linker options
Linking a multi-language application often has some subtleties,
and typically requires specific linker switches.
These switches depend on the list of languages, the list
of compilers,....
* Unsupported compiler mix
It is sometimes not possible to link together code compiled with two
particular compilers. The knowledge base should store this information,
so that end users are informed immediately when attempting to
use such a compiler combination.
The end of this section will describe in more detail the format of this
knowledge base, so that you can add your own information
and have GPRconfig advantage of it.
.. _General_file_format:
General file format
^^^^^^^^^^^^^^^^^^^
The knowledge base is implemented as a set of XML files. None of these
files has a special name, nor a special role. Instead, the user can
freely create new files, and put them in the knowledge base directory,
to contribute new knowledge.
The location of the knowledge base is :file:`$prefix/share/gprconfig`,
where :file:`$prefix` is the directory in which GPRconfig was
installed. Any file with extension :file:`.xml` in this directory will
be parsed automatically by GPRconfig at startup after sorting
them alphabetically.
All files must have the following format:
::
...
The root tag must be ``.
The remaining sections in this chapter will list the valid XML tags that
can be used to replace the '...' code above. These tags can either all be
placed in a single XML file, or split across several files.
.. _Compiler_description:
Compiler description
^^^^^^^^^^^^^^^^^^^^
One of the XML tags that can be specified as a child of `` is
``. This node and its children describe one of
the compilers known to GPRconfig. The tool uses them when it
initially looks for all compilers known on the user's :envvar:`PATH`
environment variable.
This is optional information, but simplifies the use of GPRconfig,
since the user is then able to omit some parameters from the :samp:`--config`
command line argument, and have them automatically computed.
The `` node doesn't accept any XML
attribute. However, it accepts a number of child tags that explain
how to query the various attributes of the compiler. The child tags
are evaluated (if necessary) in the same order as they are documented below.
**
This tag contains a simple string, which is the name of the compiler.
This name must be unique across all the configuration files, and is used to
identify that `compiler_description` node.
::
GNAT
**
This tag contains a string, which is the name of an executable
to search for on the PATH. Examples are :samp:`gnatls`, :samp:`gcc`,...
In some cases, the tools have a common suffix, but a prefix that might depend
on the target. For instance, GNAT uses :samp:`gnatmake` for native platforms,
but :samp:`powerpc-wrs-vxworks-gnatmake` for cross-compilers to VxWorks.
Most of the compiler description is the same, however.
For such cases, the value of the `executable` node is considered as
beginning a regular expression. The tag also accepts an optional
attribute `prefix`,
which is an integer indicating the parenthesis group that contains the prefix.
In the following example, you obtain the version of the GNAT compiler by running
either *gnatls* or *powerpc-wrs-vxworks-gnatls*, depending on
the name of the executable that was found.
The regular expression needs to match the whole name of the file, i.e. it
contains an implicit '^' at the start, and an implicit '$' at the end.
Therefore if you specify :samp:`.*gnatmake` as the regexp, it will not match
:samp:`gnatmake-debug`.
A special case is when this node is empty (but it must be specified!). In
such a case, you must also specify the language (see below) as a
simple string. It is then assumed that the specified language does not
require a compiler. In the configurations file (:ref:`Configurations`),
you can test whether that language was specified on the command line by
using a filter such as
::
::
(powerpc-wrs-vxworks-)?gnatmake
${PREFIX}gnatls -v
GPRconfig searches in all directories listed on the PATH for such
an executable. When one is found, the rest of the ``
children are checked to know whether the compiler is valid. The directory
in which the executable was found becomes the 'current directory' for
the remaining XML children.
**
This node indicates how to query the target architecture for the compiler.
See :ref:`GPRconfig_external_values` for valid children.
If this isn't specified, the compiler will always be considered as matching
on the current target.
**
This tag contains any of the nodes defined in :ref:`GPRconfig_external_values` below.
It shows how to query the version number of the compiler. If the version
cannot be found, the executable will not be listed in the list of compilers.
**
This node will define a user variable which may be later referenced. The
variables are evaluated just after the version but before the languages
and the runtimes nodes. See :ref:`GPRconfig_external_values`
below for valid children of
this node. If the evaluation of this variable is empty then the compiler
is considered as invalid.
**
This node indicates how to query the list of languages. See
:ref:`GPRconfig_external_values`
below for valid children of this node.
The value returned by the system will be split into words. As a result, if
the returned value is 'ada,c,c++', there are three languages supported by the
compiler (and three entries are added to the menu when using GPRconfig
interactively).
If the value is a simple string, the words must be comma-separated, so that
you can specify languages whose names include spaces. However, if the actual
value is computed from the result of a command, the words can also be
space-separated, to be compatible with more tools.
**
This node indicates how to query the list of supported runtimes for the
compiler. See :ref:`GPRconfig_external_values`
below for valid children. The returned value
is split into words as for ``.
This node accepts one attribute, `"default"`, which contains a list
of comma-separated names of runtimes. It is used to sort the runtimes when
listing which compilers were found on the PATH.
As a special case, gprconfig will merge two runtimes if the XML nodes
refer to the same directories after normalization and resolution of
links. As such, on Unix systems, the "adalib" link to "rts-native/adalib"
(or similar) will be ignored and only the "native" runtime will be
displayed.
.. _GPRconfig_external_values:
GPRconfig external values
^^^^^^^^^^^^^^^^^^^^^^^^^
A number of the XML nodes described above can contain one or more children,
and specify how to query a value from an executable. Here is the list of
valid contents for these nodes. The `` and ``
children can be repeated multiple times, and the `` and
`` nodes will be applied to each of these. The final
value of the external value is the concatenation of the computation for each
of the `` and `` nodes.
.. index:: gprconfig external values
* A simple string
A simple string given in the node indicates a constant. For
instance, the list of supported languages might be defined as:
::
GNAT
gnatmake
Ada
for the GNAT compiler, since this is an Ada-only compiler.
Variables can be referenced in simple strings.
* ``
If the contents of the node is a `` child, the value of
the environment variable `variable` is returned. If the variable is
not defined, this is an error and the compiler is ignored.
::
GCC-WRS
cc(arm|pentium)
* `command`
If the contents of the node is an `` child, this indicates
that a command should be run on the system.
When the command is run, the current directory (i.e., the one that contains
the executable found through the `` node), is placed first
on the :envvar:`PATH`. The output of the command is returned and may be later
filtered. The command is not executed through a shell; therefore you cannot
use output redirection, pipes, or other advanced features.
For instance, extracting the target processor from *gcc* can be done
with:
::
gcc -dumpmachine
Since the :envvar:`PATH` has been modified, we know that the *gcc* command
that is executed is the one from the same directory as the ``
node.
Variables are substituted in `command`.
* ``
This node must come after the previously described ones. It is used to
further filter the output. The previous output is matched against the regular
expression `regexp` and the parenthesis group specified by
`group` is returned. By default, group is 0, which indicates the
whole output of the command.
For instance, extracting the version number from *gcc* can be done
with:
::
gcc -v
* `regexp`
If the contents of the node is a ` child, this
indicates that GPRconfig should find all the files matching the
regular expression. Regexp is a path relative to the directory that contains
the `` file, and should use Unix directory separators
(i.e. '/'), since the actual directory will be converted into this format
before the match, for system independence of the knowledge base.
The group attribute indicates which parenthesis group should be returned.
It defaults to 0 which indicates the whole matched path. If this attribute is
a string rather than an integer, then it is the value returned.
`regexp` can be any valid regular expression. This will only match
a directory or file name, not a subdirectory. Remember to quote special
characters, including '.', if you do not mean to use a regexp.
The optional attribute `contents` can be used to indicate that the
contents of the file should be read. The first line that matches the regular
expression given by `contents` will be used as a file path instead of
the file matched by `regexp`. This is in general used on platforms that
do not have symbolic links, and a file is used instead of a symbolic link.
In general, this will work better than `group` specifies a string rather
than a parenthesis group, since the latter will match the path matched by
`regexp`, not the one read in the file.
For instance, finding the list of supported runtimes for the GNAT compiler
is done with:
::
\.\./lib/gcc/${TARGET/.*/rts-(.*)/adainclude
\.\./lib/gcc/${TARGET}/.*/adainclude
}
Note the second node, which matches the default run-time, and displays it as
such.
* `value1,value2,...`
This node must come after one of the previously described ones. It is used to
further filter the output. The previous output is split into words (it is
considered as a comma-separated or space-separated list of words), and only
those words in :samp:`value1`, :samp:`value2`,... are kept.
For instance, the *gcc* compiler will return a variety of supported
languages, including 'ada'. If we do not want to use it as an Ada
compiler we can specify:
::
gcc -v
c,c++,fortran
* `regexp`
If this node is present, then the filtered output is compared with the
specified regular expression. If no match is found, then the executable
is not stored in the list of known compilers.
For instance, if you want to have a `` tag
specific to an older version of GCC, you could write:
::
gcc -v
2.8.1
Other versions of gcc will not match this ``
node.
.. _GPRconfig_variable_substitution:
GPRconfig variable substitution
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The various compiler attributes defined above are made available as
variables in the rest of the XML files. Each of these variables can be used
in the value of the various nodes (for instance in ``),
and in the configurations (:ref:`Configuration`).
A variable is referenced by `${name}` where `name` is either
a user variable or a predefined variable. An alternate reference is
`$name` where `name` is a sequence of alpha numeric characters or
underscores. Finally `$$` is replaced by a simple `$`.
User variables are defined by `` nodes and may override
predefined variables. To avoid a possible override use lower case names.
The variables are used in two contexts: either in a
`` node, in which case the variable refers to
the compiler we are describing, or within a `` node.
In the latter case, and since there might be several compilers selected,
you need to further specify the variable by adding in parenthesis the
language of the compiler you are interested in.
For instance, the following is invalid:
::
package Compiler is
for Driver ("Ada") use "${PATH}gcc"; -- Invalid !
end Compiler;
The trouble with the above is that if you are using multiple languages
like C and Ada, both compilers will match the "negate" part, and therefore
there is an ambiguity for the value of `${PATH}`. To prevent such
issues, you need to use the following syntax instead when inside a
`` node:
.. code-block:: gpr
for Driver ("Ada") use "${PATH(ada)}gcc"; -- Correct
Predefined variables are always in upper case. Here is the list of
predefined variables
* *EXEC*
is the name of the executable that was found through ``. It
only contains the basename, not the directory information.
* *HOST*
is replaced by the architecture of the host on which GPRconfig is
running. This name is hard-coded in GPRconfig itself, and is generated
by *configure* when GPRconfig was built.
* *TARGET*
is replaced by the target architecture of the compiler, as returned by the
`` node. This is of course not available when computing the
target itself.
This variable takes the language of the compiler as an optional index when
in a `` block: if the language is specified, the target
returned by that specific compiler is used; otherwise, the normalized target
common to all the selected compilers will be returned (target normalization
is also described in the knowledge base's XML files).
* *VERSION*
is replaced by the version of the compiler. This is not available when
computing the target or, of course, the version itself.
* *PREFIX*
is replaced by the prefix to the executable name, as defined by the
`` node.
* *PATH*
is the current directory, i.e. the one containing the executable found through
``. It always ends with a directory separator.
* *LANGUAGE*
is the language supported by the compiler, always folded to lower-case
* *RUNTIME*, *RUNTIME_DIR*
This string will always be substituted by the empty string when the
value of the external value is computed. These are special strings
used when substituting text in configuration chunks.
`RUNTIME_DIR` always end with a directory separator.
* *GPRCONFIG_PREFIX*
is the directory in which GPRconfig was installed (e.g
:file:`"/usr/local/"` if the executable is :file:`"/usr/local/bin/gprconfig"`.
This directory always ends with a directory separator.
This variable never takes a language in parameter, even within a
`` node.
If a variable is not defined, an error message is issued and the variable
is substituted by an empty string.
.. _Configurations:
Configurations
^^^^^^^^^^^^^^
The second type of information stored in the knowledge base are the chunks
of *gprbuild* configuration files.
Each of these chunks is also placed in an XML node that provides optional
filters. If all the filters match, then the chunk will be merged with other
similar chunks and placed in the final configuration file that is generated
by GPRconfig.
For instance, it is possible to indicate that a chunk should only be
included if the GNAT compiler with the soft-float runtime is used. Such
a chunk can for instance be used to ensure that Ada sources are always
compiled with the `-msoft-float` command line switch.
GPRconfig does not perform sophisticated merging of chunks. It simply
groups packages together. For example, if the two chunks are:
.. code-block:: gpr
chunk1:
package Language_Processing is
for Attr1 use ("foo");
end Language_Processing;
chunk2:
package Language_Processing is
for Attr1 use ("bar");
end Language_Processing;
Then the final configuration file will look like:
.. code-block:: gpr
package Language_Processing is
for Attr1 use ("foo");
for Attr1 use ("bar");
end Language_Processing;
As a result, to avoid conflicts, it is recommended that the chunks be
written so that they easily collaborate together. For instance,
to obtain something equivalent to
.. code-block:: gpr
package Language_Processing is
for Attr1 use ("foo", "bar");
end Language_Processing;
the two chunks above should be written as:
.. code-block:: gpr
chunk1:
package Language_Processing is
for Attr1 use Language_Processing'Attr1 & ("foo");
end Language_Processing;
chunk2:
package Language_Processing is
for Attr1 use Language_Processing'Attr1 & ("bar");
end Language_Processing;
The chunks are described in a `` XML node. The most
important child of such a node is ``, which contains the
chunk itself. For instance, you would write:
::
... list of filters, see below
package Language_Processing is
for Attr1 use Language_Processing'Attr1 & ("foo");
end Language_Processing;
If `` is an empty node (i.e., :samp:`` or
:samp:`` was used), then the combination of selected
compilers will be reported as invalid, in the sense that code
compiled with these compilers cannot be linked together. As a result,
GPRconfig will not create the configuration file.
The special variables (:ref:`GPRconfig_variable_substitution`) are also
substituted in the chunk. That allows you to compute some attributes of the
compiler (its path, the runtime,...), and use them when generating the
chunks.
The filters themselves are of course defined through XML tags, and can
be any of:
**
This filter contains a list of `` children. The
`` filter matches if any of its children match.
However, you can have several `` filters, in which
case they must all match. This can be used to include linker switches
chunks. For instance, the following code would be used to describe
the linker switches to use when GNAT 5.05 or 5.04 is used in addition to
g++ 3.4.1:
::
...
If the attribute `negate` is :samp:`true`, then the meaning of this
filter is inverted, and it will match if none of its children matches.
The format of the `` is the following:
::
The language attribute, when specified, matches
the corresponding attribute used in the ``
children. All other attributes are regular expressions, which are matched
against the corresponding selected compilers. Runtime attribute is matched
against the base name of corresponding compiler runtime if it is given
as a full path. When an attribute is not specified, it will always match.
Matching is done in a case-insensitive manner.
For instance, to check a GNAT compiler in the 5.x family, use:
::
**
This filter contains a list of `` children. It matches when
any of its children matches. You can specify only one ``
node.
The format of `` is a node with one mandatory attribute
`name`, which is a regexp matched against the architecture on
which GPRconfig is running, and one optional attribute `except`, which
is also a regexp, but a negative one. If both `name` and `except` match
the architecture, corresponding `` node is ignored.
The name of the architecture was
computed by `configure` when GPRconfig was built. Note that
the regexp might match a substring of the host name, so you might want
to surround it with "^" and "$" so that it only matches the whole host
name (for instance, "elf" would match "powerpc-elf", but "^elf$" would
not).
If the `negate` attribute is :samp:`true`, then the meaning of this
filter is inverted, and it will match when none of its children matches.
For instance, to activate a chunk only if the compiler is running on an
Intel Linux machine, use:
::
**
This filter contains a list of `` children. It behaves
exactly like ``, but matches against the architecture
targeted by the selected compilers. For instance, to activate a chunk
only when the code is targeted for linux, use:
If the `negate` attribute is :samp:`true`, then the meaning of this filter
is inverted, and it will match when none of its children matches.
::
.. _Configuration_File_Reference:
Configuration File Reference
============================
A text file using the project file syntax. It defines languages and
their characteristics as well as toolchains for those languages and their
characteristics.
GPRbuild needs to have a configuration file to know the different
characteristics of the toolchains that can be used to compile sources and
build libraries and executables.
A configuration file is a special kind of project file: it uses the same
syntax as a standard project file. Attributes in the configuration file
define the configuration. Some of these attributes have a special meaning
in the configuration.
The default name of the configuration file, when not specified to
GPRbuild by switches :samp:`--config=` or :samp:`--autoconf=` is
:file:`default.cgpr`. Although the name of the configuration file can
be any valid file name, it is recommended that its suffix be
:file:`.cgpr` (for Configuration GNAT Project), so that it cannot be
confused with a standard project file which has the suffix
:file:`.gpr`.
When :file:`default.cgpr` cannot be found in the configuration project path,
GPRbuild invokes GPRconfig to create a configuration file.
In the following description of the attributes, when an attribute is an
indexed attribute and its index is a language name, for example
`Spec_Suffix ()`, then the name of the language is case insensitive.
For example, both `C` and `c` are allowed.
Any attribute may appear in a configuration project file. All attributes in
a configuration project file are inherited by each user project file in the
project tree. However, usually only the attributes listed below make sense
in the configuration project file.
.. _Project_Level_Configuration_Attributes:
Project Level Configuration Attributes
--------------------------------------
.. _General_Attributes:
General Attributes
^^^^^^^^^^^^^^^^^^
* Default_Language
Specifies the name of the language of the immediate sources of a project when
attribute `Languages` is not declared in the project. If attribute
`Default_Language` is not declared in the configuration file, then each user
project file in the project tree must have an attribute `Languages` declared,
unless it extends another project. Example:
.. code-block:: gpr
for Default_Language use "ada";
* Run_Path_Option
Specifies a 'run path option'; i.e., an option to use when linking an
executable or a shared library to indicate the path (Rpath) where to look
for other libraries. The value of this attribute is a string list.
When linking an executable or a shared library, the search path is
concatenated with the last string in the list, which may be an empty string.
Example:
.. code-block:: gpr
for Run_Path_Option use ("-Wl,-rpath,");
* Run_Path_Origin
Specifies the string to be used in an Rpath to indicate the directory
of the executable, allowing then to have Rpaths specified as relative paths.
Example:
.. code-block:: gpr
for Run_Path_Origin use "$ORIGIN";
* Toolchain_Version ()
Specifies a version for a toolchain, as a single string. This toolchain
version is passed to the library builder. Example:
.. code-block:: gpr
for Toolchain_Version ("Ada") use "GNAT 6.1";
This attribute is used by GPRbind to decide on the names of the shared GNAT
runtime libraries.
* Toolchain_Description ()
Specifies as a single string a description of a toolchain. This attribute is
not directly used by GPRbuild or its auxiliary tools (GPRbind and GPRlib) but
may be used by other tools, for example GPS. Example:
.. code-block:: gpr
for Toolchain_Description ("C") use "gcc version 4.1.3 20070425";
.. _General_Library_Related_Attributes:
General Library Related Attributes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Library_Support
Specifies the level of support for library project. If this attribute is not
specified, then library projects are not supported. The only potential values
for this attribute are `none`, `static_only` and `full`. Example:
.. code-block:: gpr
for Library_Support use "full";
* Library_Builder
Specifies the name of the executable for the library builder. Example:
.. code-block:: gpr
for Library_Builder use "/.../gprlib";
.. _Archive_Related_Attributes:
Archive Related Attributes
^^^^^^^^^^^^^^^^^^^^^^^^^^
* Archive_Builder
Specifies the name of the executable of the archive builder with the minimum
options, if any. Example:
.. code-block:: gpr
for Archive_Builder use ("ar", "cr");
* Archive_Indexer
Specifies the name of the executable of the archive indexer with the minimum
options, if any. If this attribute is not specified, then there is no
archive indexer. Example:
.. code-block:: gpr
for Archive_Indexer use ("ranlib");
* Archive_Suffix
Specifies the suffix of the archives. If this attribute is not specified, then
the suffix of the archives is defaulted to :file:`.a`. Example:
.. code-block:: gpr
for Archive_Suffix use ".olb"; -- for VMS
* Library_Partial_Linker
Specifies the name of the executable of the partial linker with the options
to be used, if any. If this attribute is not specified, then there is no
partial linking. Example:
.. code-block:: gpr
for Library_Partial_Linker use ("gcc", "-nostdlib", "-Wl,-r", "-o");
.. _Shared_Library_Related_Attributes:
Shared Library Related Attributes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Shared_Library_Prefix
Specifies the prefix of the file names of shared libraries. When this attribute
is not specified, the prefix is `lib`. Example:
.. code-block:: gpr
for Shared_Library_Prefix use ""; -- for Windows, if needed
* Shared_Library_Suffix
Specifies the suffix of the file names of shared libraries. When this attribute
is not specified, the suffix is :file:`.so`. Example:
.. code-block:: gpr
for Shared_Library_Suffix use ".dll"; -- for Windows
* Symbolic_Link_Supported
Specifies if symbolic links are supported by the platforms. The possible values
of this attribute are `"false"` (the default) and `"true"`. When this attribute is
not specified, symbolic links are not supported.
.. code-block:: gpr
for Symbolic_Link_Supported use "true";
* Library_Major_Minor_ID_Supported
Specifies if major and minor IDs are supported for shared libraries.
The possible values of this attribute are `"false"` (the default) and `"true"`.
When this attribute is not specified, major and minor IDs are not supported.
.. code-block:: gpr
for Library_Major_Minor_ID_Supported use "True";
* Library_Auto_Init_Supported
Specifies if library auto initialization is supported. The possible values of
this attribute are `"false"` (the default) and `"true"`. When this attribute is not
specified, library auto initialization is not supported.
.. code-block:: gpr
for Library_Auto_Init_Supported use "true";
* Shared_Library_Minimum_Switches
Specifies the minimum options to be used when building a shared
library. These options are put in the appropriate section in the
library exchange file when the library builder is invoked. Example:
.. code-block:: gpr
for Shared_Library_Minimum_Switches use ("-shared");
* Library_Version_Switches
Specifies the option or options to be used when a library version is used.
These options are put in the appropriate section in the library exchange file
when the library builder is invoked. Example:
.. code-block:: gpr
for Library_Version_Switches use ("-Wl,-soname,");
* Runtime_Library_Dir ()
Specifies the directory for the runtime libraries for the language.
Example:
.. code-block:: gpr
for Runtime_Library_Dir ("Ada") use "/path/to/adalib";
This attribute is used by GPRlib to link shared libraries with Ada code.
* Object_Lister
Specifies the name of the executable of the object lister with the
minimum options, if any. This tool is used to list symbols out of
object code to create a list of the symbols to export. Example:
.. code-block:: gpr
for Object_Lister use ("nm", "-g", "--demangle");
* Object_Lister_Matcher
A regular expression pattern for matching symbols out of the output
of Object_Lister tool. Example:
.. code-block:: gpr
for Object_Lister_Matcher use " T (.*)";
* Export_File_Format
The export file format to generate, this is either DEF (Windows),
Flat or GNU. Example:
.. code-block:: gpr
for Export_File_Format use "GNU";
* Export_File_Switch
The required switch to pass the export file to the linker. Example:
.. code-block:: gpr
for Export_File_Switch use "-Wl,--version-script=";
.. _Package_Naming:
Package Naming
--------------
Attributes in package `Naming` of a configuration file specify defaults. These
attributes may be used in user project files to replace these defaults.
The following attributes usually appear in package `Naming` of a configuration
file:
* Spec_Suffix ()
Specifies the default suffix for a 'spec' or header file. Examples:
.. code-block:: gpr
for Spec_Suffix ("Ada") use ".ads";
for Spec_Suffix ("C") use ".h";
for Spec_Suffix ("C++") use ".hh";
* Body_Suffix ()
Specifies the default suffix for a 'body' or a source file. Examples:
.. code-block:: gpr
for Body_Suffix ("Ada") use ".adb";
for Body_Suffix ("C") use ".c";
for Body_Suffix ("C++") use ".cpp";
* Separate_Suffix
Specifies the suffix for a subunit source file (separate) in Ada. If attribute
`Separate_Suffix` is not specified, then the default suffix of subunit source
files is the same as the default suffix for body source files. Example:
.. code-block:: gpr
for Separate_Suffix use ".sep";
* Casing
Specifies the casing of spec and body files in a unit based language
(such as Ada) to know how to map a unit name to its file name. The values for
this attribute may only be `"lowercase"`, `"UPPERCASE"` and `"Mixedcase"`.
The default, when attribute `Casing` is not specified is lower case.
This attribute rarely needs to be specified, since on
platforms where file names are not case sensitive (such as Windows or VMS)
the default (lower case) will suffice.
* Dot_Replacement
Specifies the string to replace a dot ('.') in unit names of a unit based
language (such as Ada) to obtain its file name. If there is any unit based
language in the configuration, attribute `Dot_Replacement` must be declared.
Example:
.. code-block:: gpr
for Dot_Replacement use "-";
.. _Package_Builder:
Package Builder
---------------
* Executable_Suffix
Specifies the default executable suffix. If no attribute `Executable_Suffix` is
declared, then the default executable suffix for the host platform is used.
Example:
.. code-block:: gpr
for Executable_Suffix use ".exe";
.. _Package_Compiler:
Package Compiler
----------------
.. _General_Compilation_Attributes:
General Compilation Attributes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Driver ()
Specifies the name of the executable for the compiler of a language. The single
string value of this attribute may be an absolute path or a relative path. If
relative, then the execution path is searched. Specifying the empty string for
this attribute indicates that there is no compiler for the language.
Examples:
.. code-block:: gpr
for Driver ("C++") use "g++";
for Driver ("Ada") use "/.../bin/gcc";
for Driver ("Project file") use "";
* Required_Switches ()
Specifies the minimum options that must be used when invoking the compiler
of a language. Examples:
.. code-block:: gpr
for Required_Switches ("C") use ("-c", "-x", "c");
for Required_Switches ("Ada") use ("-c", "-x", "ada", "-gnatA");
* PIC_Option ()
Specifies the option or options that must be used when compiling a source of
a language to be put in a shared library. Example:
.. code-block:: gpr
for PIC_Option ("C") use ("-fPIC");
.. _Mapping_File_Related_Attributes:
Mapping File Related Attributes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Mapping_File_Switches ()
Specifies the switch or switches to be used to specify a mapping file to the
compiler. When attribute `Mapping_File_Switches` is not declared, then no
mapping file is specified to the compiler. The value of this attribute is a
string list. The path name of the mapping file is concatenated with the last
string in the string list, which may be empty. Example:
.. code-block:: gpr
for Mapping_File_Switches ("Ada") use ("-gnatem=");
* Mapping_Spec_Suffix ()
Specifies, for unit based languages that support mapping files, the suffix in
the mapping file that needs to be added to the unit name for specs. Example:
.. code-block:: gpr
for Mapping_Spec_Suffix ("Ada") use "%s";
* Mapping_Body_Suffix ()
Specifies, for unit based languages that support mapping files, the suffix in
the mapping file that needs to be added to the unit name for bodies. Example:
.. code-block:: gpr
for Mapping_Spec_Suffix ("Ada") use "%b";
.. _Config_File_Related_Attributes:
Config File Related Attributes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In the value of config file attributes defined below, there are some
placeholders that GPRbuild will replace. These placeholders are:
=========== =====================
Placeholder Interpretation
----------- ---------------------
:samp:`%u` unit name
:samp:`%f` source file name
:samp:`%s` spec suffix
:samp:`%b` body suffix
:samp:`%c` casing
:samp:`%d` dot replacement string
=========== =====================
Attributes:
* Config_File_Switches ()
Specifies the switch or switches to be used to specify a configuration file to
the compiler. When attribute `Config_File_Switches` is not declared, then no
config file is specified to the compiler. The value of this attribute is a
string list. The path name of the config file is concatenated with the last
string in the string list, which may be empty. Example:
.. code-block:: gpr
for Config_File_Switches ("Ada") use ("-gnatec=");
* Config_Body_File_Name ()
Specifies the line to be put in a config file to indicate the file name of a
body. Example:
.. code-block:: gpr
for Config_Body_File_Name ("Ada") use
"pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"");";
* Config_Spec_File_Name ()
Specifies the line to be put in a config file to indicate the file name of a
spec. Example:
.. code-block:: gpr
for Config_Spec_File_Name ("Ada") use
"pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"");";
* Config_Body_File_Name_Pattern ()
Specifies the line to be put in a config file to indicate a body file name
pattern. Example:
.. code-block:: gpr
for Config_Body_File_Name_Pattern ("Ada") use
"pragma Source_File_Name_Project " &
" (Body_File_Name => ""*%b""," &
" Casing => %c," &
" Dot_Replacement => ""%d"");";
* Config_Spec_File_Name_Pattern ()
Specifies the line to be put in a config file to indicate a spec file name
pattern. Example:
.. code-block:: gpr
for Config_Spec_File_Name_Pattern ("Ada") use
"pragma Source_File_Name_Project " &
" (Spec_File_Name => ""*%s""," &
" Casing => %c," &
" Dot_Replacement => ""%d"");";
* Config_File_Unique ()
Specifies, for languages that support config files, if several config files
may be indicated to the compiler, or not. This attribute may have only two
values: `"true"` or `"false"` (case insensitive). The default, when this attribute
is not specified, is `"false"`. When the value `"true"` is specified for this
attribute, GPRbuild will concatenate the config files, if there are more than
one. Example:
.. code-block:: gpr
for Config_File_Unique ("Ada") use "True";
.. _Dependency_Related_Attributes:
Dependency Related Attributes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There are two dependency-related attributes: `Dependency_Switches` and
`Dependency_Driver`. If neither of these two attributes are specified for
a language other than Ada, then the source needs to be (re)compiled if
the object file does not exist or the source file is more recent than
the object file or the switch file.
* Dependency_Switches ()
For languages other than Ada, attribute `Dependency_Switches` specifies
the option or options to add to the compiler invocation so that it creates
the dependency file at the same time. The value of attribute `Dependency_Option`
is a string list. The name of the dependency file is added to the last string
in the list, which may be empty. Example:
.. code-block:: gpr
for Dependency_Switches ("C") use ("-Wp,-MD,");
With these `Dependency_Switches`, when compiling :file:`file.c` the compiler will be
invoked with the option :samp:`-Wp,-MD,file.d`.
* Dependency_Driver ()
Specifies the command and options to create a dependency file for a source.
The full path name of the source is appended to the last string of the string
list value. Example:
.. code-block:: gpr
for Dependency_Driver ("C") use ("gcc", "-E", "-Wp,-M", "");
Usually, attributes `Dependency_Switches` and `Dependency_Driver` are not both
specified.
.. _Search_Path_Related_Attributes:
Search Path Related Attributes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Include_Switches ()
Specifies the option or options to use when invoking the compiler to indicate
that a directory is part of the source search path. The value of this
attribute is a string list. The full path name of the directory is concatenated
with the last string in the string list, which may be empty. Example:
.. code-block:: gpr
for Include_Switches ("C") use ("-I");
Attribute `Include_Switches` is ignored if either one of the attributes
`Include_Path` or `Include_Path_File` are specified.
* Include_Path ()
Specifies the name of an environment variable that is used by the compiler to
get the source search path. The value of the environment variable is the source
search path to be used by the compiler. Example:
.. code-block:: gpr
for Include_Path ("C") use "CPATH";
for Include_Path ("Ada") use "ADA_INCLUDE_PATH";
Attribute `Include_Path` is ignored if attribute `Include_Path_File` is declared
for the language.
* Include_Path_File ()
Specifies the name of an environment variable that is used by the compiler to
get the source search path. The value of the environment variable is the path
name of a text file that contains the path names of the directories of the
source search path. Example:
.. code-block:: gpr
for Include_Path_File ("Ada") use "ADA_PRJ_INCLUDE_FILE";
.. _Package_Binder:
Package Binder
--------------
* Driver ()
Specifies the name of the executable of the binder driver. When this attribute
is not specified, there is no binder for the language. Example:
.. code-block:: gpr
for Driver ("Ada") use "/.../gprbind";
* Required_Switches ()
Specifies the minimum options to be used when invoking the binder driver.
These options are put in the appropriate section in the binder exchange file,
one option per line. Example:
.. code-block:: gpr
for Required_Switches ("Ada") use ("--prefix=");
* Prefix ()
Specifies the prefix to be used in the name of the binder exchange file.
Example:
.. code-block:: gpr
for Prefix ("C++") use ("c__");
* Objects_Path ()
Specifies the name of an environment variable that is used by the compiler to
get the object search path. The value of the environment variable is the object
search path to be used by the compiler. Example:
.. code-block:: gpr
for Objects_Path ("Ada") use "ADA_OBJECTS_PATH";
* Objects_Path_File ()
Specifies the name of an environment variable that is used by the compiler to
get the object search path. The value of the environment variable is the path
name of a text file that contains the path names of the directories of the
object search path. Example:
.. code-block:: gpr
for Objects_Path_File ("Ada") use "ADA_PRJ_OBJECTS_FILE";
.. _Package_Linker:
Package Linker
--------------
* Driver
Specifies the name of the executable of the linker. Example:
.. code-block:: gpr
for Driver use "g++";
* Required_Switches
Specifies the minimum options to be used when invoking the linker. Those
options are happened at the end of the link command so that potentially
conflicting user options take precedence.
* Map_File_Option
Specifies the option to be used when the linker is asked to produce
a map file.
.. code-block:: gpr
for Map_File_Option use "-Wl,-Map,";
* Max_Command_Line_Length
Specifies the maximum length of the command line to invoke the linker.
If this maximum length is reached, a response file will be used to shorten
the length of the command line. This is only taken into account when
attribute Response_File_Format is specified.
.. code-block:: gpr
for Max_Command_Line_Length use "8000";
* Response_File_Format
Specifies the format of the response file to be generated when the maximum
length of the command line to invoke the linker is reached. This is only
taken into account when attribute Max_Command_Line_Length is specified.
The allowed case-insensitive values are:
* "GNU"
Used when the underlying linker is gnu ld.
* "Object_List"
Used when the response file is a list of object files, one per line.
* "GCC_GNU"
Used with recent version of gcc when the underlined linker is gnu ld.
* "GCC_Object_List"
Used with recent version of gcc when the underlying linker is not gnu ld.
.. code-block:: gpr
for Response_File_Format use "GCC_GNU";
* Response_File_Switches
Specifies the option(s) that must precede the response file name when
when invoking the linker. This is only taken into account when both
attributes Max_Command_Line_Length and Response_File_Format are specified.
.. code-block:: gpr
for Response_File_Switches use ("-Wl,-f,");
.. _Cleaning_up_with_GPRclean:
Cleaning up with GPRclean
=========================
The GPRclean tool removes the files created by GPRbuild.
At a minimum, to invoke GPRclean you must specify a main project file
in a command such as `gprclean proj.gpr` or `gprclean -P proj.gpr`.
Examples of invocation of GPRclean:
.. code-block:: gpr
gprclean -r prj1.gpr
gprclean -c -P prj2.gpr
.. _Switches_for_GPRclean:
Switches for GPRclean
---------------------
The switches for GPRclean are:
* :samp:`--no-project`
This switch cannot be used if a project file is specified on the command
line.
When this switch is specified, it indicates to gprclean that the project
files in the current directory should not be considered and that the default
project file in /share/gpr is to be used.
It is usually used with one or several mains specified on the command line.
* :samp:`--distributed`
Also clean-up the sources on build slaves,
see :ref:`Distributed_compilation`.
* :samp:`--slave-env={name}`
Use `name` as the slave's environment directory instead of the default one.
This options is only used in distributed mode.
* :samp:`--config={config project file name}`
Specify the configuration project file name.
* :samp:`--autoconf={config project file name}`
This specifies a configuration project file name that already exists or will
be created automatically. Option :samp:`--autoconf=`
cannot be specified more than once. If the configuration project file
specified with :samp:`--autoconf=` exists, then it is used. Otherwise,
GPRconfig is invoked to create it automatically.
* :samp:`--target={targetname}`
Specify a target for cross platforms.
* :samp:`--db {dir}`
Parse `dir` as an additional knowledge base.
* :samp:`--db-`
Do not parse the standard knowledge base.
* :samp:`--RTS={runtime}`
Use runtime `runtime` for language Ada.
* :samp:`--RTS:{lang}={runtime}`
Use runtime `runtime` for language `lang`.
* :samp:`--subdirs={dir}`
This indicates that the object, library and executable directories specified
in the project file will be suffixed with {subdir}. If needed, those
subdirectories are created except for externally built projects: in this case
if the subdirectories already exist they are used, otherwise the base
directories are used.
* :samp:`--src-subdirs={subdir}`
This adds the given subdirectory (relative to each object directory of the
project tree) to the list of source directories of the project, one directory
per object directory. GPRclean will remove the project source files found
in these subdirectories. This option may be combined with :samp:`--subdirs`.
* :samp:`--relocate-build-tree[={dir}]`
With this option it is possible to achieve out-of-tree build. That
is, real object, library or exec directories are relocated to the
current working directory or dir if specified.
* :samp:`--root-dir={dir}`
This option is to be used with --relocate-build-tree above and
cannot be specified alone. This option specifies the root directory
for artifacts for proper relocation. The default value is the main
project directory. This may not be suitable for relocation if for
example some artifact directories are in parent directory of the
main project. The specified directory must be a parent of all
artifact directories.
* :samp:`--unchecked-shared-lib-imports`
Shared library projects may import any project.
* :samp:`-aP{dir}`
Add directory `dir` to the project search path.
* :samp:`-c`
Only delete compiler-generated files. Do not delete
executables and libraries.
* :samp:`-eL`
Follow symbolic links when processing project files.
* :samp:`-f`
Force deletions of unwritable files.
* :samp:`-F`
Display full project path name in brief error messages.
* :samp:`-h`
Display the usage.
* :samp:`-n`
Do not delete files, only list files that would be deleted.
* :samp:`-P{proj}`
Use Project File `proj`.
* :samp:`-q`
Be quiet/terse. There is no output, except to report problems.
* :samp:`-r`
Recursive. Clean all projects referenced by the main
project directly or indirectly. Without this switch, GPRclean only
cleans the main project.
* :samp:`-v`
Verbose mode.
* :samp:`-vP{x}`
Specify verbosity when parsing Project Files.
`x` = 0 (default), 1 or 2.
* :samp:`-Xnm={val}`
Specify an external reference for Project Files.
.. _Installing_with_GPRinstall:
Installing with GPRinstall
==========================
The GPRinstall tool installs projects. With GPRinstall it is not
needed to create complex `makefiles` to install the components. This
also removes the need for OS specific commands (like `cp`,
`mkdir` on UNIXs) and so makes the installation process easier on
all supported platforms.
After building a project it is often necessary to install the project to
make it accessible to other projects. GPRinstall installs only what is
necessary and nothing more. That is, for a library project the library
itself is installed with the corresponding ALI files for Ada
sources, but the object code is not installed as it not needed. Also if
the Ada specs are installed the bodies are not, because they are not needed
in most cases. The cases where the bodies are required (if the spec has inline
routines or is a generic) are properly detected by GPRinstall.
Furthermore, we can note that GPRinstall handles the preprocessed
sources. So it installs the correct variant of the source after resolving
the preprocessing directives.
The parts of a project that can be installed are:
* sources of a project
* a static or shared library built from a library project
* objects built from a standard project
* executables built from a standard project
Moreover, GPRinstall will create, when needed, a project to use the installed
sources, objects or library. By default, this project file is installed in the
GPRbuild's default path location so that it can be "with"ed easily without
further configuration. The installation process keeps record of every file
installed for easy and safe removal.
GPRinstall supports all kinds of project:
* standard projects
The object files, executable and source files are considered for installation.
* library and aggregate library projects
The library itself and the source files are considered for installation.
* aggregate projects
All aggregated projects are considered for installation.
Projects that won't be installed are:
* Project explicitly disabled for installation
A project with the Active attribute set to False in the project's
Install package.
* Projects with no sources
Both abstract projects and standard projects without any sources
At a minimum, to invoke GPRinstall you must specify a main project file in a
command such as ``gprinstall proj.gpr`` or ``gprinstall -P proj.gpr`` (in
installing mode) or the install name (in uninstalling mode)
``gprinstall --uninstall proj``.
Examples of invocation of GPRinstall:
::
gprinstall prj1.gpr
gprinstall -r --prefix=/my/root/install -P prj2.gpr
GPRinstall will record the installation under the *install name* which is by
default the name of the project without the extension. That is above the
project install names are ``prj1`` and ``prj2``.
The installation name can be specified with the option ``--install-name``. This
makes it possible to record the installation of multiple projects under the
same name. This is handy if an application comes with a library and a set of
tools built with multiple projects. In this case we may want to record the
installation under the same name. The install name is also used as a suffix to
group include and library directories.
Examples of installation under the same name:
::
gprinstall --install-name=myapp lib.gpr
gprinstall --install-name=myapp --mode=usage tools/tools.gpr
Note the ``--mode=usage`` option above. This tells GPRinstall to only install
the executable built as part of the project.
It is possible to uninstall a project by using the ``--uninstall`` option. In
this case we just pass the install name to GPRinstall:
::
gprinstall --uninstall prj1
gprinstall --uninstall prj2
And both ``lib.gpr`` and ``tools.gpr`` above will be uninstalled with:
::
gprinstall --uninstall myapp
Note that GPRinstall does not deal with dependencies between projects. Also
GPRinstall in uninstall mode does not need nor use information in the installed
project. This is because the project may not be present anymore and many
different project scenario may have been installed. So when uninstalling
GPRinstall just use the manifest file (whose name is the install name)
information.
.. _Switches_for_GPRinstall:
Switches for GPRinstall
-----------------------
The switches for GPRinstall are:
* :samp:`--config={main config project file name}`
Specify the configuration project file name
* :samp:`--autoconf={config project file name}`
This specifies a configuration project file name that already exists or will
be created automatically. Option :samp:`--autoconf=`
cannot be specified more than once. If the configuration project file
specified with :samp:`--autoconf=` exists, then it is used. Otherwise,
GPRconfig is invoked to create it automatically.
* :samp:`--build-name`
Specify under which name the current
project build must be installed. The default value is
`default`. Using this option it is possible to install different
builds (using different configuration, options, etc...) of the same
project. The given name will be used by client to select which build
they want to use (link against).
* :samp:`--build-var`
Specify the name of the build variable in the installed project.
If this options is not used, the default build variable used is
``_BUILD``.
It is possible to specify multiple variables in --build-var
option. In this case, if the first build variable is not found, the
second one will be checked, and so on. This makes it possible to
have a project specific variable to select the corresponding build
and a more generic build variable shared by multiple projects.
::
$ gprinstall -Pproject1 \
--build-var=PROJECT1_BUILD,LIBRARY_TYPE
^
Scenario variable to control
specifically this project
^
Scenario variable to control
the default for a set of projects
$ gprinstall -Pproject2 \
--build-var=PROJECT2_BUILD,LIBRARY_TYPE
* :samp:`--no-build-var`
Specify that no build/scenario
variable should be generated. This option can be use for a project
where there is single configuration, so a single installation. This
option cannot be used with :samp:`--build-var`.
* :samp:`--dry-run`
Install nothing, just display the actions
that would have been done.
* :samp:`-a`
Install all the sources (default). Cannot be used with ``-m`` below.
* :samp:`-m`
Install only the interface sources (minimal set of sources). Cannot
be used with ``-a`` above.
* :samp:`-f`
Force overwriting of existing files
* :samp:`-h`
Display this message
* :samp:`--mode=[dev/usage]`
Specify the installation mode.
* dev
This is the default mode. The installation is done in developer
mode. All files to use the project are copied to install prefix. For a
library this means that the specs, the corresponding ALI files for
Ada units and the library itself (static or relocatable) are
installed. For a standard project the object files are installed
instead of the library.
* usage
The installation is done in usage mode. This means that only the
library or the executable is installed. In this installation mode
there is no project generated, nor specs or ALI files installed.
======== ================================================================
Mode Interpretation
-------- ----------------------------------------------------------------
`dev` For this mode the binaries (built libraries and
executable) are installed together with the sources to use them.
`usage` For this mode only the binaries are installed and no project are
created.
======== ================================================================
* :samp:`-p`, :samp:`--create-missing-dirs`
Create missing directories in the installation location.
* :samp:`-P{proj}`
Specify the project file to install.
* :samp:`--prefix={path}`
Specify the location of the installation.
If not specified, the default location for the current
compiler is used. That is, ``path`` corresponds to parent directory
where ``gprinstall`` is found.
* :samp:`--install-name={name}`
Specify the name to use for recording the installation.
The default is the project name without the extension. If set this
option is also used as include or library directories' suffix to
group all related installations under a common directory.
* :samp:`--sources-subdir={path}`
Specify the value for the sources installation directory if an absolute path.
Otherwise it is appended to the prefix above. The default is
``include/[.]``
* :samp:`--lib-subdir={path}`
Specify the value for the library and object installation
directory if an absolute path.
Otherwise it is appended to the prefix above. The default is
``lib/[.]``
* :samp:`--link-lib-subdir={path}`
Specify the value for the
library symlink directory if an absolute path. Otherwise it is
appended to the prefix above.
* :samp:`---exec-subdir={path}`
Specify the value for the
executables installation directory if an absolute path. Otherwise it is
appended to the prefix above. The default is ``bin``.
* :samp:`--project-subdir={path}`
Specify the value for the
project installation directory if an absolute path. Otherwise it is
appended to the prefix above. The default is ``share/gpr``.
* :samp:`--no-project`
Specify that no project is to be generated and installed.
* :samp:`--target={targetname}`
Specify a target for cross platforms.
* :samp:`--no-lib-link`
Disable copy of shared libraries into
the executable directory on Windows or creation of symlink in the lib
directory on UNIX. This is done by default to place the shared
libraries into a directory where application will look for them.
* :samp:`--sources-only`
Copy only sources part of the project,
the object, library or executable files are never copied. When this
switch is used the installed project is not set as externally built.
* :samp:`--side-debug`
Write debug symbols out of executables and libraries into a
separate file. The separate file is named after the main file with
an added ``.debug`` extension. That is, if the executable to be
installed is named ``main``, then a file ``main.debug`` is also created in
the same location, containing only the debug information. The
debug information is then removed from the ``main`` executable.
* :samp:`--subdirs={subdir}`
This indicates that the object, library and executable directories specified
in the project file will be suffixed with {subdir}. If needed, those
subdirectories are created except for externally built projects: in this case
if the subdirectories already exist they are used, otherwise the base
directories are used.
* :samp:`--relocate-build-tree[={dir}]`
With this option it is possible to achieve out-of-tree build. That
is, real object, library or exec directories are relocated to the
current working directory or dir if specified.
* :samp:`--root-dir={dir}`
This option is to be used with --relocate-build-tree above and
cannot be specified alone. This option specifies the root directory
for artifacts for proper relocation. The default value is the main
project directory. This may not be suitable for relocation if for
example some artifact directories are in parent directory of the
main project. The specified directory must be a parent of all
artifact directories.
* :samp:`-q`
Be quiet/terse. There is no output, except to report problems.
* :samp:`-r`
(Recursive.) Install all projects referenced by the main
project directly or indirectly. Without this switch, GPRinstall only
installs the main project.
* :samp:`--no-manifest`
Prevent the manifest file from being created. Note that using this
option will make it impossible to uninstall the project using
GPRinstall. See option `--uninstall`.
* :samp:`--uninstall`
Uninstall mode, files installed for a given project or install name
will be removed. A check is done that no manual changes have been
applied to the files before removing. Deletion of the files can be
forced in this case by using the :samp:`-f` option. Note that the
parameter in this case is not the project name but the install name which
corresponds to the manifest file.
* :samp:`--list`
List mode, displays all the installed packaged.
* :samp:`--stat`
Apply to list mode above, displays also some
statistics about the installed packages : number of files, total size
used on disk, and whether there is some files missing.
* :samp:`-v`
Verbose mode
* :samp:`-Xnm={val}`
Specify an external reference for Project Files.
.. _Specifying_a_Naming_Scheme_with_GPRname:
Specifying a Naming Scheme with GPRname
=======================================
When the Ada source file names do not follow a regular naming
scheme, the mapping of Ada units to source file names must be indicated
in package Naming with attributes Spec and Body.
To help maintain the correspondence between compilation unit names and
source file names within the compiler,
the tool `gprname` may be used to generate automatically these attributes.
.. _Running_gprname:
Running `gprname`
-----------------
The usual form of the `gprname` command is:
.. code-block:: sh
$ gprname [`switches`] `naming_pattern` [`naming_patterns`]
[--and [`switches`] `naming_pattern` [`naming_patterns`]]
Most of the arguments are optional: switch *-P* must be specified to indicate
the project file and at least one Naming Pattern.
`gprname` will attempt to
find all the compilation units in files that follow at least one of the
naming patterns. To find Ada compilation units,
`gprname` will use the GNAT compiler in syntax-check-only mode on all
regular files.
One or several Naming Patterns may be given as arguments to `gprname`.
Each Naming Pattern is enclosed between double quotes (or single
quotes on Windows).
A Naming Pattern is a regular expression similar to the wildcard patterns
used in file names by the Unix shells or the DOS prompt.
`gprname` may be called with several sections of directories/patterns.
Sections are separated by switch `--and`. In each section, there must be
at least one pattern. If no directory is specified in a section, the
project directory is implied.
The options other that the directory switches and the patterns apply globally
even if they are in different sections.
Examples of Naming Patterns are::
"*.[12].ada"
"*.ad[sb]*"
"body_*" "spec_*"
For a more complete description of the syntax of Naming Patterns,
see the second kind of regular expressions described in :file:`g-regexp.ads`
(the 'Glob' regular expressions).
.. _Switches_for_pgprname:
Switches for GPRname
---------------------
Switches for `gprname` must precede any specified Naming Pattern.
You may specify any of the following switches to `gprname`:
.. index:: --version (gprname)
* :samp:`--version`
Display Copyright and version, then exit disregarding all other options.
.. index:: --target= (gprname)
* :samp:`--target=`
Indicates the target of the GNAT compiler. This may be needed if there is
no native compiler available.
.. index:: --help (gprname)
* :samp:`--help`
If *--version* was not used, display usage, then exit disregarding
all other options.
* :samp:`--subdirs={dir}`
This indicates that the object, library and executable directories specified
in the project file will be suffixed with {subdir}. If needed, those
subdirectories are created except for externally built projects: in this case
if the subdirectories already exist they are used, otherwise the base
directories are used.
* :samp:`--no-backup`
Do not create a backup copy of the project file if it already exists.
* :samp:`--ignore-duplicate-files`
Ignore files with the same basename, and take the first one found into
account only. By default when encountering a duplicate file, a warning is
emitted, and duplicate entries in the `Naming` package will be generated,
needing manual editing to resolve the conflict. With this switch, gprname
assumes that only the first file should be used and others should be
ignored.
* :samp:`--ignore-predefined-units`
Ignore predefined units (children of System, Interfaces and Ada packages).
* :samp:`--and`
Start another section of directories/patterns.
.. index:: -d (gprname)
* :samp:`-d{dir}`
Look for source files in directory :file:`dir`. There may be zero, one or more
spaces between *-d* and :file:`dir`.
:file:`dir` may end with `/**`, that is it may be of the form
`root_dir/**`. In this case, the directory `root_dir` and all of its
subdirectories, recursively, have to be searched for sources.
When a switch *-d*
is specified, the current working directory will not be searched for source
files, unless it is explicitly specified with a *-d*
or *-D* switch.
Several switches *-d* may be specified.
If :file:`dir` is a relative path, it is relative to the directory of
the project file specified with switch *-P*. The directory
specified with switch *-d* must exist and be readable.
.. index:: -D (gprname)
* :samp:`-D{filename}`
Look for source files in all directories listed in text file :file:`filename`.
There may be zero, one or more spaces between *-D*
and :file:`filename`.
:file:`filename` must be an existing, readable text file.
Each nonempty line in :file:`filename` must be a directory.
Specifying switch *-D* is equivalent to specifying as many
switches *-d* as there are nonempty lines in
:file:`file`.
* :samp:`-eL`
Follow symbolic links when processing project files.
.. index:: -f (gprname)
* :samp:`-f{pattern}`
Foreign C language patterns. Using this switch, it is possible to add sources
of language C to the list of sources of a project file.
For example,
.. code-block:: sh
gprname -P prj.gpr -f"*.c" "*.ada" -f "*.clang"
will look for Ada units in all files with the :file:`.ada` extension,
and will add to the list of file for project :file:`prj.gpr` the C files
with extensions :file:`.c` and :file:`.clang`. Attribute Languages will be
declared with the list of languages with sources. In the above example,
it will be ("Ada", "C") if Ada and C sources have been found.
* :samp:`-f:{} {pattern}`
Foreign language {} patterns. Using this switch, it is possible to add
sources of language to the list of sources of a project file.
For example,
.. code-block:: sh
gprname -P prj.gpr "*.ada" -f:C++ "*.cpp" -f:C++ "*.CPP"
Files with extensions :file:`.cpp` and :file:`*.CPP` are C++ sources.
Attribute Languages will have value ("Ada", "C++") if Ada and C++ sources
are found.
.. index:: -h (gprname)
* :samp:`-h`
Output usage (help) information. The output is written to :file:`stdout`.
.. index:: -P (gprname)
* :samp:`-P{proj}`
Create or update project file :file:`proj`. There may be zero, one or more
space between *-P* and :file:`proj`. :file:`proj` may include directory
information. :file:`proj` must be writable.
There must be only one switch *-P*.
If switch *--no-backup* is not specified, a backup copy of the project file is created
in the project directory with file name .gpr.saved_x. 'x' is the first
non negative number that makes this backup copy a new file.
.. index:: -v (gprname)
* :samp:`-v`
Verbose mode. Output detailed explanation of behavior to :file:`stdout`.
This includes name of the file written, the name of the directories to search
and, for each file in those directories whose name matches at least one of
the Naming Patterns, an indication of whether the file contains a unit,
and if so the name of the unit.
.. index:: -v -v (gprname)
* :samp:`-v -v`
Very Verbose mode. In addition to the output produced in verbose mode,
for each file in the searched directories whose name matches none of
the Naming Patterns, an indication is given that there is no match.
.. index:: -x (gprname)
* :samp:`-x{pattern}`
Excluded patterns. Using this switch, it is possible to exclude some files
that would match the name patterns. For example,
.. code-block:: sh
gprname -P prj.gpr -x "*_nt.ada" "*.ada"
will look for Ada units in all files with the :file:`.ada` extension,
except those whose names end with :file:`_nt.ada`.
.. _Example_of_gprname_Usage:
Example of `gprname` Usage
--------------------------
.. code-block:: sh
$ gprname -P/home/me/proj.gpr -x "*_nt_body.ada"
-dsources -dsources/plus -Dcommon_dirs.txt "body_*" "spec_*"
Note that several switches *-d* may be used,
even in conjunction with one or several switches
*-D*. Several Naming Patterns and one excluded pattern
are used in this example.
.. _The_Library_Browser_gprls:
The Library Browser GPRls
=========================
.. index:: Library browser
.. index:: ! gprls
`gprls` is a tool that outputs information about compiled sources. It gives the
relationship between objects, unit names and source files. It can also be used
to check source dependencies as well as various characteristics.
.. _Running_gprls:
Running `gprls`
----------------
The `gprls` command has the form
::
$ gprls switches `object_or_dependency_files`
The main argument is the list of object files or :file:`ali` files for Ada
sources for which information is requested.
`gprls` uses a project file, either specified through a single switch -P,
or the default project file. If no `object_or_dependency_files` is specified
then all the object files corresponding to the sources of the project are
deemed to be specified. If `object_or_dependency_files` is specified for
an aggregate project and there is more than one such file in different
aggregated projects then the file found first is used to show the information.
In normal mode, without option other that -P , `gprls` produces
information for each object/dependency file: the full path of the object,
the name of the principal unit in this object if the source is in Ada,
the status of the source and the full path of the source.
Here is a simple example of use:
::
$ gprls -P prj.gpr
/my_path/obj/pkg.o
pkg
DIF pkg.adb
/my_path/obj/main.o
main
MOK main.adb
The first three lines can be interpreted as follows: the main unit which is
contained in
object file :file:`pkg.o` is pkg, whose main source is in
:file:`pkg.adb`. Furthermore, the version of the source used for the
compilation of pkg has been modified (DIF). Each source file has a status
qualifier which can be:
*OK (unchanged)*
The version of the source file used for the compilation of the
specified unit corresponds exactly to the actual source file.
*MOK (slightly modified)*
The version of the source file used for the compilation of the
specified unit differs from the actual source file but not enough to
require recompilation. If you use `gprbuild` with the qualifier
*-m (minimal recompilation)*, a file marked
MOK will not be recompiled.
*DIF (modified)*
The source used to build this object has been modified and need to be
recompiled.
*??? (dependency file not found)*
The object/dependency file cannot be found.
.. _Switches_for_gprls:
Switches for GPRls
------------------
`gprls` recognizes the following switches:
.. index:: --version (gprls)
:samp:`--version`
Display Copyright and version, then exit disregarding all other options.
.. index:: --help (gprls)
:samp:`--help`
If *--version* was not used, display usage, then exit disregarding
all other options.
.. index:: --closure (gprls)
:samp:`--closure`
Display the Ada closures of the mains specified on the command line or
in attribute Main of the main project. The absolute paths of the units in
the closures are listed, but no status is checked. If all the ALI files are
found, then the list is preceded with the line "Closure:" or "Closures:".
Otherwise, it is preceded with the line "Incomplete Closure:" or
"Incomplete closures:".
.. index:: -P (gprls)
:samp:`-P `
Use this project file. This switch may only be specified once.
.. index:: -a (gprls)
:samp:`-a`
Consider all units, including those of the predefined Ada library.
Especially useful with *-d*.
.. index:: -d (gprls)
:samp:`-d`
List sources from which specified units depend on.
.. index:: -h (gprls)
:samp:`-h`
Output the list of options.
.. index:: -o (gprls)
:samp:`-o`
Only output information about object files.
.. index:: -s (gprls)
:samp:`-s`
Only output information about source files.
.. index:: -u (gprls)
:samp:`-u`
Only output information about compilation units.
.. index:: -U (gprls)
:samp:`-U`
If no object/dependency file is specified, list information for the sources
of all the projects in the project tree.
.. index:: -files (gprls)
:samp:`-files={file}`
Take as arguments the files listed in text file `file`.
Text file `file` may contain empty lines that are ignored.
Each nonempty line should contain the name of an existing object/dependency
file.
Several such switches may be specified simultaneously.
.. index:: -aP (gprls)
:samp:`-aP{dir}`
Add `dir` at the beginning of the project search dir.
.. index:: --RTS (gprls)
:samp:`--RTS={rts-path}``
Specifies the default location of the Ada runtime library.
Same meaning as the equivalent *gprbuild* switch.
.. index:: -v (gprls)
:samp:`-v`
Verbose mode. Output the complete source, object and project paths.
For each Ada source, include special characteristics such as:
* *Preelaborable*: The unit is preelaborable in the Ada sense.
* *No_Elab_Code*: No elaboration code has been produced by the compiler for this unit.
* *Pure*: The unit is pure in the Ada sense.
* *Elaborate_Body*: The unit contains a pragma Elaborate_Body.
* *Remote_Types*: The unit contains a pragma Remote_Types.
* *Shared_Passive*: The unit contains a pragma Shared_Passive.
* *Predefined*: This unit is part of the predefined environment and cannot be modified
by the user.
* *Remote_Call_Interface*: The unit contains a pragma Remote_Call_Interface.
.. _Example_of_gprls_Usage:
Examples of `gprls` Usage
-------------------------
::
$ gprls -v -P prj.gpr
5 lines: No errors
gprconfig --batch -o /my_path/obj/auto.cgpr --target=x86_64-linux --config=ada,,
Creating configuration file: /my_path/obj/auto.cgpr
Checking configuration /my_path/obj/auto.cgpr
GPRLS Pro 17.0 (20161010) (x86_64-unknown-linux-gnu)
Copyright (C) 2015-2023, AdaCore
Source Search Path:
/my_path/local/lib/gcc/x86_64-pc-linux-gnu/4.9.4//adainclude/
Object Search Path:
/my_path/local/lib/gcc/x86_64-pc-linux-gnu/4.9.4//adalib/
Project Search Path:
/my_path/local/x86_64-unknown-linux-gnu/lib/gnat
/my_path/local/x86_64-unknown-linux-gnu/share/gpr
/my_path/local/share/gpr
/my_path/local/lib/gnat
/my_path/obj/pkg.o
Unit =>
Name => pkg
Kind => package body
Flags => No_Elab_Code
Source => pkg.adb unchanged
Unit =>
Name => pkg
Kind => package spec
Flags => No_Elab_Code
Source => pkg.ads unchanged
/my_path/obj/main.o
Unit =>
Name => main
Kind => subprogram body
Flags => No_Elab_Code
Source => main.adb slightly modified
$ gprls -d -P prj.gpr main.o
/my_path/obj/main.o
main
MOK main.adb
OK pkg.ads
$ gprls -s -P prj.gpr main.o
main
main.adb
gprbuild-25.0.0/doc/gprbuild_ug/figures_gnat_project_manager_6in_x_4in.pptx 0000664 0000000 0000000 00000223202 14700753734 0027160 0 ustar 00root root 0000000 0000000 PK ! Ì»~á' ) [Content_Types].xml ¢( ̘ÛrÛ †ï;“wÐp›±°Ó6I;–sÑÃU™Iò TZÛ´ÀnüöEø ¢Q*Û ±o