[Top][All Lists]

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

Re: Autoconf and apt

From: Erik de Castro Lopo
Subject: Re: Autoconf and apt
Date: Tue, 19 Aug 2008 17:24:30 +1000

Robert Rehammar wrote:

> Well, what I mean is, what if a library libfoo is needed to build
> program bar. Autotools tries to find the library on the system
> (e.g.check /usr/lib, and so on). But if it is not found, then the
> program will not compile and configure gives an error, right. Now, if
> libfoo is not fond on the system, but the user is running an, say,
> apt-system, then chances are that libfoo resides in the repository of
> apt.

> So the next thing would then be for configure to ask apt to download and
> install libfoo, to meet the dependency.

To have the configure script automatically calling apt is actually a bad
idea. Apt requires root priviledges to run and you definitely don't want
to run the configure script as root.

> This way autotools would
> integrate with (e.g.) apt to make installations more smooth. This would
> save the user the work to download and install all packages that bar
> depends on and that exists in the apt repository.

A better idea would be to defined an M4 macro which wraps AC_CHECK_LIB
and the PKG_CHECK_* macros. The wrapper would be called with whatever
info is required to see if the library is installed plus the name of
the required debian package.

If the macro fails to find the lib using AC_CHECK_LIB/PKG_CHECK_* then
it would add the debian package name to a list. At the end of the config
process if the debian package name list is not empty, it would print
out something like:

  AC_MSG_ERROR([Missing packages. Please run 'apt-get install $deb_pkgs'.])

Erik de Castro Lopo
"A typical software project can present more opportunities to learn
from mistakes than some people get in a lifetime."
-- Steve McConnell (in Rapid Development)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]