Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ncurses and Ada

464 views
Skip to first unread message

Eilie

unread,
Mar 9, 2012, 9:40:00 AM3/9/12
to
Hello,
I started learn ada recently and mess with ncurses.
I know this is somewhat unrelated but maybe someone can help me here.
I build ncurses with Ada support,
Ada examples(rain and so on) has been built fine.
But i don't know how should i build mine programs that uses ncurses.
For example: I copy rain.adb from examples dir to some other dir,
How can i build it? What options of gnatmake should i pick to build it?

mockturtle

unread,
Mar 9, 2012, 9:56:16 AM3/9/12
to
Is ncurses related with curses? (I guess so) Ah, memories... I used curses _many_ years ago, when I was a student and I thought that the name was quite appropriate... :-/ Especially when the usual segmentation fault left your VT100 monitor [yes, I am that old!] in an unusable state, forcing you to logout and login again...

Seriously, since I never used ncurses, I cannot be of much help, but I can give you some general advice. Does the example dir has some project file (*.gpr)? If it has, I would start from that, taking an existing project file and modifying to my needs.

Hope this "bootstraps" you.

Riccardo

Eilie

unread,
Mar 9, 2012, 11:59:46 AM3/9/12
to
I'm tryng to make some simple CLI game.
I think that study GtkAda for this purpose would be overhead.
But if there is some more stable/usable lib for that purpose(CLI tools/games)
i will be happy to hear about it.

Shark8

unread,
Mar 9, 2012, 12:13:01 PM3/9/12
to
On Friday, March 9, 2012 10:59:46 AM UTC-6, Eilie wrote:
>
> I'm tryng to make some simple CLI game.
> I think that study GtkAda for this purpose would be overhead.
> But if there is some more stable/usable lib for that purpose(CLI tools/games)
> i will be happy to hear about it.

Inspired by Kroz?
http://en.wikipedia.org/wiki/Kroz_series

mockturtle

unread,
Mar 9, 2012, 12:35:42 PM3/9/12
to
On Friday, March 9, 2012 5:59:46 PM UTC+1, Eilie wrote:
Just to avoid any misunderstanding (with written exchange it may happens): I was not criticizing your choice, it just made me wonder (and smile) since it recalled to my memory my experience with "curses."
(BTW, I am smiling while I write this ;-)

Riccardo

Eilie

unread,
Mar 9, 2012, 12:44:09 PM3/9/12
to
Not really.
I'm just begginer it's too hard for me write rougelikes in Ada.
I need to start with a small steps.
Maybe some Sokoban or Sudoku with ncurses(i'm know these to games can be
easely implemented without ncurses but i want to study Ada ncurses too).

Ludovic Brenta

unread,
Mar 9, 2012, 12:57:03 PM3/9/12
to
Eilie writes on comp.lang.ada:
I don't know what platform you develop on but Debian is your friend :)
and Nicolas Boulenguez made sure it is as easy as possible for you to
use ncurses in your programs:

aptitude install libncursesada2-dev

then look in the file /usr/share/ada/adainclude/ncursesada.gpr.

--
Ludovic Brenta.

Eilie

unread,
Mar 9, 2012, 1:28:39 PM3/9/12
to
On 2012-03-09, Ludovic Brenta <lud...@ludovic-brenta.org> wrote:
>
> I don't know what platform you develop on but Debian is your friend :)
> and Nicolas Boulenguez made sure it is as easy as possible for you to
> use ncurses in your programs:
>
> aptitude install libncursesada2-dev
>
> then look in the file /usr/share/ada/adainclude/ncursesada.gpr.
>

I'm on Arch Linux and i have /usr/share/ada/adainclude but i don't have
/usr/share/ada/adainclude/ncursesada.gpr in it.

I already find out wich options should i use to compile my code with
ncurses. Anyway thank you for your attention.

Julian Leyh

unread,
Mar 12, 2012, 4:18:50 AM3/12/12
to
Am Freitag, 9. März 2012 19:28:39 UTC+1 schrieb Eilie:
> I'm on Arch Linux and i have /usr/share/ada/adainclude but i don't have
> /usr/share/ada/adainclude/ncursesada.gpr in it.
>
> I already find out wich options should i use to compile my code with
> ncurses. Anyway thank you for your attention.

I created a few Ada related PKGBUILDs for the AUR and will have a look at ncursesada.

BTW, where did you get /usr/share/ada/adainclude from? Normally, the Ada library packages should install to /usr/include/<foo> and /usr/lib/<foo> and their project files to /usr/lib/gnat.

You can identify the package owning a file by using pacman -Qo

Simon Wright

unread,
Mar 12, 2012, 4:42:19 AM3/12/12
to
Julian Leyh <jul...@vgai.de> writes:

> BTW, where did you get /usr/share/ada/adainclude from? Normally, the
> Ada library packages should install to /usr/include/<foo> and
> /usr/lib/<foo> and their project files to /usr/lib/gnat.

FSF GCC and GNAT GPL both use $prefix/lib/gnat to find GPR files, with
the rest of the layout as you say.

The /usr/share/ada/adainclude is Debian's layout. I don't know why it's
different (probably Ludovic needed a scheme before AdaCore had settled
on theirs) and I haven't so far worked out install scripts that will
work in either situation.

Eilie

unread,
Mar 12, 2012, 5:04:03 AM3/12/12
to
On 2012-03-12, Julian Leyh <jul...@vgai.de> wrote:
> I created a few Ada related PKGBUILDs for the AUR and will have a look at ncursesada.
>
> BTW, where did you get /usr/share/ada/adainclude from? Normally, the Ada library packages should install to /usr/include/<foo> and /usr/lib/<foo> and their project files to /usr/lib/gnat.
>
> You can identify the package owning a file by using pacman -Qo

/usr/share/ada/adainclude/terminal_interface-curses.adb is owned by
ncurses 5.9-3

I just build ncurses from ABS with ada support.

Ludovic Brenta

unread,
Mar 12, 2012, 6:20:23 AM3/12/12
to
Simon Wright wrote on comp.lang.ada:
> Julian Leyh writes:
>> BTW, where did you get /usr/share/ada/adainclude from? Normally, the
>> Ada library packages should install to /usr/include/<foo> and
>> /usr/lib/<foo> and their project files to /usr/lib/gnat.
>
> FSF GCC and GNAT GPL both use $prefix/lib/gnat to find GPR files, with
> the rest of the layout as you say.
>
> The /usr/share/ada/adainclude is Debian's layout. I don't know why it's
> different (probably Ludovic needed a scheme before AdaCore had settled
> on theirs)

Correct. I didn't invent this path myself though; Florian Weimer did,
when he made the very first proposal for a standard ("GNU Ada
Environment Specification") back in 2001 or so. IIRC, that
specification applied to the early .rpm packages for GNAT 3.13p
produced by the Ada for Linux Team. So, it is possible that
/usr/share/ada/adainclude still exists in distributions other than
Debian.

> and I haven't so far worked out install scripts that will
> work in either situation.

Sorry about that :/ but as I've said many times, packaging is
difficult; if you want to concentrate on writing your software,
your best bet is to leave packaging to specialists of each target
platform while making their job as easy as possible.

--
Ludovic Brenta.

Georg Bauhaus

unread,
Mar 12, 2012, 9:20:55 AM3/12/12
to
On 12.03.12 11:20, Ludovic Brenta wrote:
> Simon Wright wrote on comp.lang.ada:
>> Julian Leyh writes:
>>> BTW, where did you get /usr/share/ada/adainclude from? Normally, the
>>> Ada library packages should install to /usr/include/<foo> and
>>> /usr/lib/<foo> and their project files to /usr/lib/gnat.
>>
>> FSF GCC and GNAT GPL both use $prefix/lib/gnat to find GPR files, with
>> the rest of the layout as you say.
>>
>> The /usr/share/ada/adainclude is Debian's layout. I don't know why it's
>> different (probably Ludovic needed a scheme before AdaCore had settled
>> on theirs)
>
> Correct. I didn't invent this path myself though; Florian Weimer did,
> when he made the very first proposal for a standard ("GNU Ada
> Environment Specification") back in 2001 or so.

According to $(man hier), an Ada compiler's spec files
would not normally be counted among UNIX System Resources,
specifically not in /usr/include, and since /usr/share seems to be
the place for architecture independent files, the current paths seem
o.K. to me.

Simon Wright

unread,
Mar 12, 2012, 10:33:19 AM3/12/12
to
Georg Bauhaus <rm.dash...@futureapps.de> writes:

> According to $(man hier), an Ada compiler's spec files would not
> normally be counted among UNIX System Resources, specifically not in
> /usr/include, and since /usr/share seems to be the place for
> architecture independent files, the current paths seem o.K. to me.

I don't have a Linux box immediately to hand, but Apple seem to think
it's OK to include Tcl & Python (neither of which is mentioned in `man
hier`, any more than Ada is) in /usr/include.

Georg Bauhaus

unread,
Mar 12, 2012, 12:23:40 PM3/12/12
to
The header files seem to be mostly for interfacing to the language
(or library). Objective-C has its "objc" subdirectory, too. So do PHP
and some "system components".

Still, the bulk of what (I think) would correspond to the Ada RTS,
or AWS or Ada libraries in general lives in
/System/Library/Frameworks/{Tcl,Python}.framework/Versions,
alongside Cocoa, Ruby, IOKit, LDAP, ...

I'd nevertheless hope to find, in an "ada" subdirectory of /usr/include,
Ada related header files for cross language programming.
For example,if GNAT is a system compiler, one might then write

#include <ada/lifecycle.h>

and then the C compiler knows about functions (ultimately) named

void adainit (void);
void adafinal (void);

Thus, if other compilers have a comparable mechanism, the ARG could bless
names of functions controlling it, and programs that call Ada parts
from C parts would be made portable by including the system header.

Once Apple considers Ada part of the system, they will have done it
for us ;-)
0 new messages