[Top][All Lists]

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

Finding external programs relocatably

From: nash
Subject: Finding external programs relocatably
Date: Thu, 19 Oct 2006 11:27:42 -0400

I've got a Unix application that uses autoconf/automake. Several
binaries need to exec() other binaries that get installed in
$(prefix)/libexec/. Right now, we've just got paths hard-coded into
the app, which is obviously quite unsavory.

I checked the autoconf manual and section 19.5 gives a few different
ways that I could #define the location of the libexec directory where
this subordinate program lives. However, at the end of that section is
the following bullet item:

   Note that all the previous solutions hard wire the absolute
   name of these directories in the executables, which is not
   a good property. You may try to compute the names relative
   to prefix, and try to find prefix at runtime, this way your
   package is relocatable. Some macros are already available
   to address this issue: see adl_COMPUTE_RELATIVE_PATHS
   Autoconf Macro Archive.

This seems more or less reasonable except that these macros don't seem
to actually appear in the current version of the Macro Archive,

What's the current best (or common) practice in this case?

It seems like a pretty good behavior would be to have C code that
performs the same checks that AC_PREFIX_PROGRAM does and then falls
back on AC_PREFIX_DEFAULT, if nothing is found in PATH. Does anyone
happen to have such a thing handy?



reply via email to

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