[ghemical-devel] pkg-config?

Tommi Hassinen thassine@messi.uku.fi
Fri, 11 Apr 2003 10:55:13 +0300 (WET)


On Thu, 10 Apr 2003, Michael Banck wrote:

> I had another look at libghemical. Some comments, I don't know if I
> wrote that earlier already:
>
> 1. You don't seem to build a shared library of libghemical. That would
>    be quite required I guess

The only problem is that I'm not really very familiar with either types of
libraries (static/shared). I assume that a shared library is made using
object files, in a similar way like a static library. Is there any extra
requirements that need to be considered?

> 2. Why do you include miniMOPAC? Wouldn't it be better to split that
>    off, perhaps as a slowly crawling sourceforge-project (or on
>    bioinformatics, I don't care)

A good idea. I'll start working on this.

In the app package, we also still have the built-in copy of OpenBabel. We
could use it as a library as well, once OB's library support is ready. Or
is it already?

> 3. Did you consider using automake?

Sorry, I'm not familiar with this either. Could you briefly explain what
would be the benefits of automake?

I'll shortly write an another mail as well where I explain some plans for
v2.00 since it might relate to this question.

> that pc file then gets installed in $(DESTDIR)$(libdir)/pkgconfig, so I
> guess that could be anywhere you like.

Yes, but it must be a place where pkg-config can find the file; I wondered
whether it looks both /usr/lib/pkgconfig and /usr/local/lib/pkgconfig.

> Well, gchemutils (gcu.pc) e.g. does it like you say above:
>
> prefix=@prefix@
> exec_prefix=@exec_prefix@
> libdir=@libdir@
> includedir=@includedir@
>
> Name: GtkPeriodic
> Description: A Mendeleiev table widget for GTK+-2.0
> Version: @VERSION@
> Requires: gtk+-2.0
> Libs: -L${libdir} @GCU_LIBS@ -lgtkperiodic -lgcu @gtkcrystalviewer@
> Cflags: -I${includedir}/gcu @GCU_CFLAGS@ @gl_flags@

Yep, the .pc files are short ones, about a dozen lines like the one above.

I thought that perhaps the .pc file could be written in the configure
script. I made a following test script:

	#! /bin/bash
	rm test.pc
	echo this is line 1 >> test.pc
	echo homedir = $HOME >> test.pc
	echo this is line 3 >> test.pc

The script makes a test.pc file:

	this is line 1
	homedir = /home/thassine
	this is line 3

And since the headers and libs already are stored in env variables in the
script, it would be easy to write out a .pc file that contains the
settings. It seems to be possible even to take the --enable-mpqc option
out of ghemical script, and only keep and maintain it in libghemical
script (at the moment there are still duplicates).

Regards,

	Tommi