[gtkada] improvements to the GtkAda build system
Björn Persson
bjorn at xn--rombobjrn-67a.se
Mon Feb 14 01:29:41 CET 2011
As I mentioned a week ago, I've been working on improvements to the GtkAda
build system that I need for cleaning up the GtkAda package in Fedora. The
patch I'm using in Fedora is made for GtkAda 2.14.1, and works as intended as
far as I've been able to test it. The patch in this message is intended to be
the equivalent patch for the current Subversion trunk, but it's not so well
tested. Testing is hampered by a compilation error that I don't have time to
investigate at the moment:
testcairo_printing.ads:51:07: not subtype conformant with operation inherited
at line 42
testcairo_printing.ads:51:07: type of "Op" does not match
The changes to Windows-only sections are untested.
When porting the patch to the trunk I had trouble figuring out the
subdirectories called "opengl" that have been added since 2.14.1. That change
seems incompletely implemented and will probably not work in its current form.
Was the intention to put only libgtkada_gl in the subdirectory, or should its
ALI files be there too? Was it meant to have effect only on Windows or on all
operating systems? What was the purpose of that change anyway?
These are the changes that this patch makes:
· In Fedora we package only shared libraries in most cases. Static libraries
are packaged only when they are needed for some specific reason. Therefore I
added the configuration options --enable-static and --disable-static, which
control the variable BUILD_STATIC in the makefiles. The default is to build
static libraries, like before.
· I need the libraries in /usr/lib and /usr/lib64 instead of
/usr/lib/gtkada/relocatable, so I added the configuration options --enable-
subdirs and --disable-subdirs. The default is to put shared and static
libraries in separate subdirectories, like before. When --disable-subdirs is
specified, libraries end up in ${libdir} and ALI files in ${libdir}/gtkada. This
is done with a set of variables with names like "libsubdir_static",
"alisubdir_shared" et cetera. This is where I need to understand the "opengl"
directories better in order to reconcile them with the --disable-subdirs
option.
· I replaced hard-coded directory names with the corresponding variables from
Autoconf, so that a user can change the value of bindir for example and get
the intended result. In Fedora this is used to put 64-bit libraries in
/usr/lib64.
· For the project files I defined the variable gprdir, which is set to
"${prefix}/lib/gnat". Setting it to "${libdir}/gnat" would be wrong because
Gnat looks for project files in /usr/lib/gnat, not in /usr/lib64/gnat.
· As I already mentioned, I added DESTDIR support. This is used in Fedora's
packaging system to install the files in a staging directory, where they are
picked up and assembled into an RPM package. This makes it possible to build
packages as an unpriviliged user, and also makes it much easier to ensure that
the right set of files are included in the package.
· I added a new build type, Debuginfo, which is just like Production except
that is uses -g so that debugging information gets included in the compiled
libraries. In Fedora's packaging system the debugging information is then
extracted and packaged together with the source code in a separate debuginfo
package. The result is that you get stripped binaries when you install the RPM
packages, but if you need to debug a program you can install the relevant
debuginfo packages and get access to function names, variable names, source
code lines et cetera in GDB.
The default build type is still Production of course.
· I changed the installation of shared libraries to use INSTALL_PROGRAM
instead of INSTALL_DATA, so that their executable bits don't get removed.
· The sublibraries (libgtkada_gl, libgtkada_glade and libgnomeada) depend on
the main library (libgtkada), but weren't correctly linked to it. To fix this I
added the variable GTKADA_LIBS to the makefiles. Something very similar has
been added in the trunk, but only for libgtkada_gl and only on Windows.
· Even though building of shared libraries was enabled by default, the value
of DEFAULT_LIBRARY_TYPE was "static", and was set to "relocatable" only when
--enable-shared was explicitly specified. I fixed it so that
DEFAULT_LIBRARY_TYPE is always "relocatable" when shared libraries are built,
and "static" when only static libraries are built.
The 2.14.1 version of the patch may be found here if anyone is interested:
http://pkgs.fedoraproject.org/gitweb/?p=GtkAda.git;a=blob_plain;f=GtkAda-2.14.1-
configuration-3.patch;hb=HEAD
Björn Persson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GtkAda-trunk-build_system.patch
Type: text/x-patch
Size: 25192 bytes
Desc: not available
Url : /pipermail/gtkada/attachments/20110214/344ab390/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : /pipermail/gtkada/attachments/20110214/344ab390/attachment.pgp
More information about the gtkada
mailing list