Re: [PATCH v3 1/5] drm: Add config for detecting libdrm

Mike Frysinger
2015-07-23T11:02:03Z

[-- Attachment #1.1: Type: text/plain, Size: 1558 bytes --]

On 23 Jul 2015 13:44, Dmitry V. Levin wrote:
> On Thu, Jul 23, 2015 at 05:48:21AM -0400, Mike Frysinger wrote:
> > On 01 Jul 2015 14:52, Patrik Jakobsson wrote:
> > > Use pkg-config to try to find libdrm. If that fails use the standard
> > > include directory for kernel drm headers in /usr/include/drm.
> > >
> > > * configure.ac: Use pkg-config to find libdrm
> > >
> > > Signed-off-by: Patrik Jakobsson <patrik.jakobsson-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
> > > ---
> > > configure.ac | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/configure.ac b/configure.ac
> > > index bb8bf46..aa63af7 100644
> > > --- a/configure.ac
> > > +++ b/configure.ac
> > > @@ -844,6 +844,10 @@ fi
> > > AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes])
> > > AC_MSG_RESULT([$use_libunwind])
> > >
> > > +PKG_CHECK_MODULES([libdrm], [libdrm],
> > > + [CPPFLAGS="$CPPFLAGS $libdrm_CFLAGS"],
> > > + [CPPFLAGS="$CPPFLAGS -I/usr/include/drm"])
> >
> > yikes, no, this is a really really bad idea. it should read:
> > PKG_CHECK_MODULES([LIBDRM], [libdrm],
> > [CPPFLAGS="$CPPFLAGS $LIBDRM_CFLAGS"], [:])
>
> Why [:] ? Wouldn't [] suffice?

probably ... force of habit after being bitten by m4 macros that did not expect
to expand empty code and thus lead to shell errors (include macros by autotools
projects). i.e. if the m4 looked something like:
if ...check if pkg is available...; then
$3
else
$4
fi
then the generated configure script would have syntax errors.
-mike

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 79 bytes --]

------------------------------------------------------------------------------

[-- Attachment #3: Type: text/plain, Size: 195 bytes --]

_______________________________________________
Strace-devel mailing list
Strace-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org