DESTDIR and pkg-config variables

Dan Nicholson dbn.lists at gmail.com
Mon Jan 12 09:50:46 PST 2009


On Mon, Jan 12, 2009 at 9:27 AM, Paulo César Pereira de Andrade
<pcpa at mandriva.com.br> wrote:
>  What is the proper way to correct make distcheck,
> when using pkg-config directory variables?
>
>  Sample case is appdefaultdir for Xt/Xaw based
> applications. That usually, in configure.ac is:
>
> PKG_CHECK_MODULES(APPDEFS, xt)
> appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
> AC_SUBST(appdefaultdir)
>
>  And for example, for xgc, in Makefile.am's it is:
>
> appdefaultdir = @appdefaultdir@
> dist_appdefault_DATA = \
>        app-defaults/Xgc
>
>
>  But it will fail for make distcheck, as appdefaultdir
> should have been specified as "$(datadir)/X11/app-defaults"
> and not "/usr/share/X11/app-defaults".
>
>  Is "hacking" xt.pc the proper way to correct the problem?
> Or change every package, possibly using an approach like
> the one used by all drivers, that is something like:
>
> AC_ARG_WITH(xorg-module-dir,
>            AC_HELP_STRING([--with-xorg-module-dir=DIR],
>                           [Default xorg module directory
> [[default=$libdir/xorg/modules]]]),
>            [moduledir="$withval"],
>            [moduledir="$libdir/xorg/modules"])

I think the right way to do this is 1) Keep taking the default from
pkg-config and 2) Pass in a value during distcheck with
DISTCHECK_CONFIGURE_FLAGS. That'd look something like this:

configure.ac:
AC_ARG_WITH([appdefaultdir],
    [AC_HELP_STRING([--with-appdefaultdir=DIR],
        [Xt app-defaults directory (default: from pkg-config)])],
    [appdefaultdir="$withval"],
    [appdefaultdir=`$PKG_CONFIG --variable=appdefaultdir xt`])

Makefile.am:
DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir='$${datadir}/X11/app-defaults'

I just tested that on xfontsel and it works.

--
Dan


More information about the xorg mailing list