comp.lang.ada
 help / color / mirror / Atom feed
* Packaging and linking shared Ada libraries
@ 2011-03-07  5:32 R Tyler Croy
  2011-03-07  7:15 ` Simon Wright
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: R Tyler Croy @ 2011-03-07  5:32 UTC (permalink / raw)


I'm trying to figure out how to package up and use XML/Ada for openSUSE and I'm
having a bit of trouble trying to figure what actually needs to be packaged.

Right now I'm packaging up the .so and the .ads files and trying to use them
but to no avail:

    tyler@spinach:~/source> gnatmake -aI/usr/include/xmlada -aO/usr/lib64 test.adb -largs -lxmlada
    gnatmake: "dom-readers.adb" not found
    tyler@spinach:~/source> 

I've seen this post on SO, but it didn't help:
    <http://stackoverflow.com/questions/3902597/how-do-i-compile-and-link-using-gnatmake-with-an-ada-shared-library/3916834#3916834>


Any ideas? Thoughts/etc?

-- 
- R. Tyler Croy
--------------------------------------
    Code: http://github.com/rtyler



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Packaging and linking shared Ada libraries
  2011-03-07  5:32 Packaging and linking shared Ada libraries R Tyler Croy
@ 2011-03-07  7:15 ` Simon Wright
  2011-03-07 18:30   ` R Tyler Croy
  2011-03-07  9:55 ` Ludovic Brenta
  2011-03-07 13:27 ` Julian Leyh
  2 siblings, 1 reply; 7+ messages in thread
From: Simon Wright @ 2011-03-07  7:15 UTC (permalink / raw)


R Tyler Croy <tyler@linux.com> writes:

> I'm trying to figure out how to package up and use XML/Ada for
> openSUSE and I'm having a bit of trouble trying to figure what
> actually needs to be packaged.
>
> Right now I'm packaging up the .so and the .ads files and trying to
> use them but to no avail:
>
>     tyler@spinach:~/source> gnatmake -aI/usr/include/xmlada -aO/usr/lib64 test.adb -largs -lxmlada
>     gnatmake: "dom-readers.adb" not found
>     tyler@spinach:~/source> 

Tyler,

Is there any reason why you don't just
 ./configure
 make
 make install
?

I end up with (more or less) the following under $prefix:

- include/xmlada/<sources>
- lib/<various .so's>
- lib/gnat/<various .gpr's>
- lib/xmlada/relocatable/<shared binaries, .ali's>
- lib/xmlada/static/<debug binaries, .ali's>

and the GPRs are exactly where GNAT built for $prefix expects them.


I'm not sure of the exact rules for when the Ada source files in the
library require .adb's, but certainly they're needed for generics and
where the spec uses pragma Inline. I think you need to make sure the
corresponding .alis are read-only.

A good deal of the work is done by library gpr's, see
http://www.adacore.com/wp-content/files/auto_update/gprbuild-docs/html/gprbuild_ug.html#Library-Projects



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Packaging and linking shared Ada libraries
  2011-03-07  5:32 Packaging and linking shared Ada libraries R Tyler Croy
  2011-03-07  7:15 ` Simon Wright
@ 2011-03-07  9:55 ` Ludovic Brenta
  2011-03-07 18:27   ` R Tyler Croy
  2011-03-07 13:27 ` Julian Leyh
  2 siblings, 1 reply; 7+ messages in thread
From: Ludovic Brenta @ 2011-03-07  9:55 UTC (permalink / raw)


R Tyler Croy wrote on comp.lang.ada:
> I'm trying to figure out how to package up and use XML/Ada for openSUSE and I'm
> having a bit of trouble trying to figure what actually needs to be packaged.
>
> Right now I'm packaging up the .so and the .ads files and trying to use them
> but to no avail:
>
>     tyler@spinach:~/source> gnatmake -aI/usr/include/xmlada -aO/usr/lib64 test.adb -largs -lxmlada
>     gnatmake: "dom-readers.adb" not found
>     tyler@spinach:~/source>
>
> I've seen this post on SO, but it didn't help:
>     <http://stackoverflow.com/questions/3902597/how-do-i-compile-and-link-...>
>
> Any ideas? Thoughts/etc?

There is a full discussion of this topic in the Debian Policy for Ada:

http://people.debian.org/~lbrenta/debian-ada-policy.html

In particular read the sections defining the contents of the -dev and
runtime library packages.

--
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Packaging and linking shared Ada libraries
  2011-03-07  5:32 Packaging and linking shared Ada libraries R Tyler Croy
  2011-03-07  7:15 ` Simon Wright
  2011-03-07  9:55 ` Ludovic Brenta
@ 2011-03-07 13:27 ` Julian Leyh
  2 siblings, 0 replies; 7+ messages in thread
From: Julian Leyh @ 2011-03-07 13:27 UTC (permalink / raw)


On 7 Mrz., 06:32, R Tyler Croy <ty...@linux.com> wrote:
> I'm trying to figure out how to package up and use XML/Ada for openSUSE and I'm
> having a bit of trouble trying to figure what actually needs to be packaged.
>
> Right now I'm packaging up the .so and the .ads files and trying to use them
> but to no avail:
>
>     tyler@spinach:~/source> gnatmake -aI/usr/include/xmlada -aO/usr/lib64 test.adb -largs -lxmlada
>     gnatmake: "dom-readers.adb" not found
>     tyler@spinach:~/source>
>
> I've seen this post on SO, but it didn't help:
>     <http://stackoverflow.com/questions/3902597/how-do-i-compile-and-link-...>
>
> Any ideas? Thoughts/etc?
>
> --
> - R. Tyler Croy
> --------------------------------------
>     Code:http://github.com/rtyler

Using project files makes it easier, but you forgot to tell gnat where
to look for the .ali files of xmlada (-aL...)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Packaging and linking shared Ada libraries
  2011-03-07  9:55 ` Ludovic Brenta
@ 2011-03-07 18:27   ` R Tyler Croy
  0 siblings, 0 replies; 7+ messages in thread
From: R Tyler Croy @ 2011-03-07 18:27 UTC (permalink / raw)


Ludovic Brenta <ludovic@ludovic-brenta.org> wrote:
> R Tyler Croy wrote on comp.lang.ada:
>> I'm trying to figure out how to package up and use XML/Ada for openSUSE and I'm
>> having a bit of trouble trying to figure what actually needs to be packaged.
>>
>> Right now I'm packaging up the .so and the .ads files and trying to use them
>> but to no avail:
>>
>>     tyler@spinach:~/source> gnatmake -aI/usr/include/xmlada -aO/usr/lib64 test.adb -largs -lxmlada
>>     gnatmake: "dom-readers.adb" not found
>>     tyler@spinach:~/source>
>>
>> I've seen this post on SO, but it didn't help:
>>     <http://stackoverflow.com/questions/3902597/how-do-i-compile-and-link-...>
>>
>> Any ideas? Thoughts/etc?
> 
> There is a full discussion of this topic in the Debian Policy for Ada:
> 
> http://people.debian.org/~lbrenta/debian-ada-policy.html
> 
> In particular read the sections defining the contents of the -dev and
> runtime library packages.

Ah, he speaks!

I'll read up more on it this weekend. I was basing a lot of my work, once I got
the rpm packaging basics down, off of your libxmlada3.2-5-dev package and
maybe this document is the missing link for explaining some of the things you
did :)


Cheers

-- 
- R. Tyler Croy
--------------------------------------
    Code: http://github.com/rtyler



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Packaging and linking shared Ada libraries
  2011-03-07  7:15 ` Simon Wright
@ 2011-03-07 18:30   ` R Tyler Croy
  2011-03-08 10:48     ` Ludovic Brenta
  0 siblings, 1 reply; 7+ messages in thread
From: R Tyler Croy @ 2011-03-07 18:30 UTC (permalink / raw)


Simon Wright <simon@pushface.org> wrote:
> R Tyler Croy <tyler@linux.com> writes:
> 
>> I'm trying to figure out how to package up and use XML/Ada for
>> openSUSE and I'm having a bit of trouble trying to figure what
>> actually needs to be packaged.
>>
>> Right now I'm packaging up the .so and the .ads files and trying to
>> use them but to no avail:
>>
>>     tyler@spinach:~/source> gnatmake -aI/usr/include/xmlada -aO/usr/lib64 test.adb -largs -lxmlada
>>     gnatmake: "dom-readers.adb" not found
>>     tyler@spinach:~/source> 
> 
> Tyler,
> 
> Is there any reason why you don't just
> ./configure
> make
> make install
> ?
> 
> I end up with (more or less) the following under $prefix:
> 
> - include/xmlada/<sources>
> - lib/<various .so's>
> - lib/gnat/<various .gpr's>
> - lib/xmlada/relocatable/<shared binaries, .ali's>
> - lib/xmlada/static/<debug binaries, .ali's>
> 
> and the GPRs are exactly where GNAT built for $prefix expects them.

The problem is that the upstream (from AdaCore) packages don't "cooperate" with
overriding variables for building and installing.

openSUSE has some packaging guidelines that the build scripts for XML/Ada and
GPRbuild don't "fit" with unfortunately.

Looking at some of Ludovic's packages, he's actually defined a debian build
.gpr file and adds a Makefile to use that .gpr to build, then place the files
he needs in the appropriate directories. I'm following a similar approach.

> I'm not sure of the exact rules for when the Ada source files in the
> library require .adb's, but certainly they're needed for generics and
> where the spec uses pragma Inline. I think you need to make sure the
> corresponding .alis are read-only.
> 
> A good deal of the work is done by library gpr's, see
> http://www.adacore.com/wp-content/files/auto_update/gprbuild-docs/html/gprbuild_ug.html#Library-Projects

Thanks for the link, I hadn't seen it specifically, but some of the things it
mentions I've seen elsewhere on the interwebs :)


Cheers

-- 
- R. Tyler Croy
--------------------------------------
    Code: http://github.com/rtyler



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Packaging and linking shared Ada libraries
  2011-03-07 18:30   ` R Tyler Croy
@ 2011-03-08 10:48     ` Ludovic Brenta
  0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Brenta @ 2011-03-08 10:48 UTC (permalink / raw)


R Tyler Croy wrote on comp.lang.ada:
> Looking at some of Ludovic's packages, he's actually defined a debian build
> .gpr file and adds a Makefile to use that .gpr to build, then place the files
> he needs in the appropriate directories. I'm following a similar approach.

Right.  The Makefile is part of the Debian automated build
infrastructure and it is mandated by the (general, not Ada-specific)
Debian Policy.  The part about "plac[ing] the files [I] need in the
appropriate directories" deserves a bit more explanation.  Remember
that this is in the context of a binary distribution where the person
building the package (me) is not the same as the person who will later
use the package.

So, in this context, the "appropriate directories" are system-wide
(not in a user's home directory), under control of the package manager
(dpkg in the case of Debian) and not writable by the end user.

The solution suggested by Simon is only appropriate for a source
distribution where the end user is also a system administrator and has
write privileges in the compiler installation directories.

--
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-03-08 10:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-07  5:32 Packaging and linking shared Ada libraries R Tyler Croy
2011-03-07  7:15 ` Simon Wright
2011-03-07 18:30   ` R Tyler Croy
2011-03-08 10:48     ` Ludovic Brenta
2011-03-07  9:55 ` Ludovic Brenta
2011-03-07 18:27   ` R Tyler Croy
2011-03-07 13:27 ` Julian Leyh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox