[PATCH] util-macros: Addition of a meta data file xorg-macros.pc.in used by XORG_INSTALL

Dan Nicholson dbn.lists at gmail.com
Fri Nov 27 10:39:15 PST 2009


On Fri, Nov 27, 2009 at 9:54 AM, Gaetan Nadon <gaetan.nadon at videotron.ca> wrote:
> On Fri, 2009-11-27 at 09:26 -0800, Dan Nicholson wrote:
>
> On Thu, Nov 26, 2009 at 7:20 PM, Peter Hutterer
> <peter.hutterer at who-t.net> wrote:
>>> From 1e50b971bf7273f958e11cbcf3dc07a6fab04335 Mon Sep 17 00:00:00 2001
>>> From: Gaetan Nadon <memsize at videotron.ca>
>>> Date: Sat, 21 Nov 2009 17:28:32 -0500
>>> Subject: [PATCH] xorg-macros.pc.in: create a meta data file for
>>> util-macros
>>>
>>> This is motivated primarly by XORG_INSTALL who needs to locate
>>> the docdir when invoked from any module that may not be installed
>>> using same prefix (default or otherwise).
>>>
>>> There are other potential use for this file.
>>> ---
>>>  Makefile.am       |    5 +++++
>>>  configure.ac      |    1 +
>>>  xorg-macros.m4.in |    9 ++++++---
>>>  xorg-macros.pc.in |   14 ++++++++++++++
>>>  4 files changed, 26 insertions(+), 3 deletions(-)
>>>  create mode 100644 xorg-macros.pc.in
>>>
>>> diff --git a/Makefile.am b/Makefile.am
>>> index 49c2d17..1e07014 100644
>>> --- a/Makefile.am
>>> +++ b/Makefile.am
>>> @@ -29,6 +29,11 @@ dist_doc_DATA = INSTALL
>>>  install-data-hook:
>>>       rm -f $(DESTDIR)$(aclocaldir)/xorgversion.m4
>>>
>>> +pkgconfigdir = $(datadir)/pkgconfig
>>> +pkgconfig_DATA = xorg-macros.pc
>>> +
>>> +EXTRA_DIST = xorg-macros.pc.in
>>> +
>>>  .PHONY: ChangeLog
>>>
>>>  ChangeLog:
>>> diff --git a/configure.ac b/configure.ac
>>> index 8b1d450..4daec6a 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -40,5 +40,6 @@ m4_include([xorgversion.m4])
>>>  XORG_RELEASE_VERSION
>>>  XORG_CHANGELOG
>>>
>>> +AC_CONFIG_FILES([xorg-macros.pc])
>>>  AC_CONFIG_FILES([Makefile
>>> xorg-macros.m4:xorg-macros.m4.in:xorgversion.m4])
>>>  AC_OUTPUT
>>> diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
>>> index 336490a..6f9635f 100644
>>> --- a/xorg-macros.m4.in
>>> +++ b/xorg-macros.m4.in
>>> @@ -509,8 +509,11 @@ XORG_MANPAGE_SECTIONS
>>>  # INSTALL from $prefix/share/doc/util-macros.
>>>  #
>>>  AC_DEFUN([XORG_INSTALL], [
>>> -INSTALL_CMD="if test -f "$prefix/share/doc/util-macros/INSTALL"; then \
>>> -cp -f "$prefix/share/doc/util-macros/INSTALL" \$(top_srcdir); \
>>> -else echo '$prefix/share/doc/util-macros/INSTALL cannot be found.' >&2;
>>> fi "
>>> +AC_REQUIRE([PKG_PROG_PKG_CONFIG])
>>> +macros_docdir=$($PKG_CONFIG --print-errors --variable=docdir
>>> xorg-macros)
>
> Please don't use $( ) for shell command substitution. ` ` is more portable.
>
> Thanks! That's an area I need to learn more about. I picked this line from
> other .ac files. I'll make it a todo when I review those to make the
> correction. I did replace "pkg-config" with the libtool env var in the hope
> it would be more portable and/or safer.
>
> sdkdir=$(pkg-config --variable=sdkdir xorg-server)

This should be

sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`

1. The user may need to use a specific pkg-config or pass custom
arguments to it. Think multiarch or cross-compiling scenarios.

2. Backticks (``) are supported by all shells while $() command
substitution is for strictly POSIX conforming shells. We don't need to
limit ourselves to that subset.

--
Dan


More information about the xorg-devel mailing list