[Xorg-driver-geode] [PATCH 2/3] Add conditional build for ztv

Gaetan Nadon memsize at videotron.ca
Wed Nov 16 13:25:25 PST 2011


On Wed, 2011-11-16 at 22:09 +0200, Mart Raudsepp wrote:

> On K, 2011-11-16 at 14:58 -0500, Gaetan Nadon wrote:
> > Detect the presence of Video4Linux V2 and do not build if missing.
> > 
> > The geode driver is no longer Linux only.
> 
> Does this kind of conditional handling still result in the code being
> included in a release tarball when it's disted on a non-linux machine?

Yes. There is only one tarball for all platforms.

> I know that conditional SUBDIR at toplevel Makefile.am would cause such
> problems without DISTCHECK_CONFIGURE_FLAGS or EXTRA_DISTs or such, but
> unsure here.

There are two ways to make SUBDIRS conditional. One using a variable and
one using AM_CONDITIONAL. The former will result in the problem you are
talking about while the latter will not. Automake knows about
AM_CONDITIONAL and will dist the code even when the package is
configured to not build.

The goal is to have the same tarball produced regardless of the
configure option at 'make dist' time  and regardless of the platform
where it is being generated. It could be created on Solaris for all we
care and it should be the same. It's the source code after all.

I prefer putting the condition in the Makefile because the reader may
not notice the parent makefile has a conditional SUBDIRS and waste time
trying to figure out why the stuff did not build. Invoking make from the
ztv subdir would try to build driver even if v4l2 is missing and waste
time there as well.

Thanks for checking.

>  Basically, has this case been thought of? (Sorry, I really
> should just test myself, but seems like stuff is flowing by quicker than
> I could take the time to test this myself)
> 
> Best,
> Mart
> 
> > Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
> > ---
> >  configure.ac    |    4 ++++
> >  ztv/Makefile.am |    4 ++++
> >  2 files changed, 8 insertions(+), 0 deletions(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index b93aa35..3c28bb0 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -110,6 +110,10 @@ if test "x$XSERVER_LIBPCIACCESS" = xyes; then
> >      XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
> >  fi
> >  
> > +# Check for Video4Linux Version 2 (V4L2)
> > +AC_CHECK_HEADERS([linux/videodev2.h],[v4l2=yes])
> > +AM_CONDITIONAL(BUILD_ZTV, [test "x$v4l2" = xyes])
> > +
> >  AC_SUBST([XORG_CFLAGS])
> >  AC_SUBST([moduledir])
> >  AC_SUBST([AMD_CFLAGS])
> > diff --git a/ztv/Makefile.am b/ztv/Makefile.am
> > index 08902fc..9ce94d4 100644
> > --- a/ztv/Makefile.am
> > +++ b/ztv/Makefile.am
> > @@ -1,4 +1,6 @@
> >  
> > +if BUILD_ZTV
> > +
> >  AM_CFLAGS =			\
> >  	$(XORG_CFLAGS)		\
> >  	$(AMD_CFLAGS)		\
> > @@ -13,3 +15,5 @@ ztv_drv_la_LDFLAGS = -module -avoid-version
> >  ztv_drv_ladir = $(moduledir)/drivers
> >  
> >  ztv_drv_la_SOURCES = z4l.c
> > +
> > +endif BUILD_ZTV
> 
> 
> _______________________________________________
> Xorg-driver-geode mailing list
> Xorg-driver-geode at lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-geode


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-driver-geode/attachments/20111116/7f1cc90d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-driver-geode/attachments/20111116/7f1cc90d/attachment.pgp>


More information about the Xorg-driver-geode mailing list