Re: extending directory selection, --pkglibdir

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

 



* Tommi Mäkitalo wrote on Wed, Sep 06, 2006 at 10:59:30AM CEST:
> Am Mittwoch, 6. September 2006 10:18 schrieb Ralf Wildenhues:
> >
> >   AC_SUBST([pkglibdir], ['${libdir}/'$PACKAGE])

> I want to have a configure-switch, so the packager can decide, where to 
> install them. Something like:
> 
> ./configure --pkgdir=/usr/lib/some/where/else
> 
> Default will be $libdir/$PACKAGE.

So how about this in configure.ac, after AM_INIT_AUTOMAKE:
  pkglibdir='${libdir}/'$PACKAGE
  AC_ARG_ENABLE([pkglibdir],
    [AS_HELP_STRING([--enable-pkglibdir=DIR], [library modules directory])
    [case $enableval in
      yes|no) AC_MSG_ERROR([invalid pkglibdir `$enableval']) ;;
      *) pkglibdir=$enableval;;
     esac])
  AC_SUBST([pkglibdir])

(--with is supposed to be only for decisions about external software, see
<http://www.gnu.org/software/autoconf/manual/html_node/Package-Options.html>).

You could then add -DPKGLIBDIR="$(pkglibdir)" and
  lt_dlsetsearchpath (PKGLIBDIR);

in your code, before `lt_dlopen'ing the libraries.

Adding --pkglibdir support to Autoconf would be a possibility, but it
would require changing the GNU Coding Standards, which do not allow all
kinds of arbitrary options to configure scripts.  This is done so that
users can execute (possibly recursively) all kinds of configure scripts
and pass identical options to them: --with-* and --enable-* are ignored
for values not recognized in a specific configure script, whereas
arbitrary other options are not ignored.  (Not knowing whether those
took an argument or not prevents robust parsing of the command line in
that case.)

And changing the GCS is not a step done lightly.

Hope that helps.

Cheers,
Ralf


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux