[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

pkg-config needs a replacement?



Hi, I need some advice on the following problem.

I have a system which generates, compiles, and (possibly)
executes C/C++ code. The system can target both libraries
and executables and supports both static and dynamic linkage.
[The Debian package 'felix' is floating around unstable]

The core dynamic execution model generates user programs
as shared libraries, which are then dlopen()ed by a standard
driver executable.

This system has a tool which configures it to operate like
a scripting language such as Python or Perl: you just say

	flx program args

and it runs the program, recompiling and linking dependencies 
as required. [This is the REQUIREMENT]

To make this work, external resources are required, typically
C header files and libraries, and the system has to be able
to find these resources entirely automatically.

To make that work, the user must specify root dependencies
in the code in a platform independent way, I'm using
syntax like:

	requires package "packagename"

for this purpose. [This is an already implemented
part of a possible solution]

 A preprocessor finds all the explicitly
listed requirements and creates a resource requirements
file associated with the program.

The flx script then must read this file, and run the
system compiler, linker, and optionally the final
program, using the root resource list to supply
all the switches and environment the tools require.

One way to make this work is to use the program 'pkg-config'
and associated meta-data, since it is an established format,
and *.pc files are available for many libraries.

There are several problems with this solution. 

* it breaks completely unless the full closure of all 
  meta data dependencies is installed

* it generates redundant and possibly incorrect lists of
  libraries for systems running Elf dynamic linkers,
  which know how to find closure of shared library
  dependencies correctly -- this would be easily
  fixed if there were an option to ONLY list direct
  requirements for dynamic loading instead of the closure
  
  (maybe I should file a BUG report against pkg-config?)

* there is no provision for other than the limited set
  of resources (--cflags, --libs) that it supports

  User code often requires other resources such as:

  ** environment variables
  ** media files
  ** working services 
  ** authority

  ** I'm sure the list is as long as you like :)
  ** Remember not all 'code' is written C :))

So there are both pro's and con's for using pkg-config.
The BIG pro is simply compatibility. The BIG con is that
it doesn't work correctly, even at the limited set of 
tasks it is supposed to handle.

For Debian many libraries live in /usr/lib, but not all:
some installed libraries live in strange places anyhow,
and some libraries -- such as the ones my own tool
generates -- aren't installed, and even if they were they
would not be installed by Debian package manager
-- unless the component was so useful someone decided
to package it. Thus, Debian Standards help (a LOT!!)
but aren't enough (SDL doesn't come with pkg-config
meta data).

I see three options:

1. Use pkg-config anyhow. I will probably do this first
because it provides a solution in a few minutes.

2. Cobble together another inferior tool.

3. Build a good new tool. Requires a design committee and
development team (I'm a programmer not a politician)

Any advice, comments, hints, ideas or offers to write
the new tool appreciated!

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net



Reply to: