Previous: Search Paths for gnatbind, Up: Binding Using gnatbind
gnatbind
UsageThis section contains a number of examples of using the GNAT binding
utility gnatbind
.
gnatbind hello
Hello
(source program in hello.adb) is
bound using the standard switch settings. The generated main program is
b~hello.adb. This is the normal, default use of the binder.
gnatbind hello -o mainprog.adb
Hello
(source program in hello.adb) is
bound using the standard switch settings. The generated main program is
mainprog.adb with the associated spec in
mainprog.ads. Note that you must specify the body here not the
spec, in the case where the output is in Ada. Note that if this option
is used, then linking must be done manually, since gnatlink will not
be able to find the generated file.
gnatbind main -C -o mainprog.c -x
Main
(source program in
main.adb) is bound, excluding source files from the
consistency checking, generating
the file mainprog.c.
gnatbind -x main_program -C -o mainprog.c
gnatbind -n math dbase -C -o ada-control.c
Math
and Dbase
appear. This call
to gnatbind
generates the file ada-control.c containing
the adainit
and adafinal
routines to be called before and
after accessing the Ada units.