<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.32.2">
</HEAD>
<BODY>
On Wed, 2011-11-16 at 22:09 +0200, Mart Raudsepp wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
On K, 2011-11-16 at 14:58 -0500, Gaetan Nadon wrote:
&gt; Detect the presence of Video4Linux V2 and do not build if missing.
&gt; 
&gt; 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?
</PRE>
</BLOCKQUOTE>
Yes. There is only one tarball for all platforms.
<BLOCKQUOTE TYPE=CITE>
<PRE>
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.
</PRE>
</BLOCKQUOTE>
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.<BR>
<BR>
The goal is to have the same tarball produced regardless of the configure option at 'make dist' time&nbsp; 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.<BR>
<BR>
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.<BR>
<BR>
Thanks for checking.
<BLOCKQUOTE TYPE=CITE>
<PRE>
 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

&gt; Signed-off-by: Gaetan Nadon &lt;<A HREF="mailto:memsize@videotron.ca">memsize@videotron.ca</A>&gt;
&gt; ---
&gt;  configure.ac    |    4 ++++
&gt;  ztv/Makefile.am |    4 ++++
&gt;  2 files changed, 8 insertions(+), 0 deletions(-)
&gt; 
&gt; diff --git a/configure.ac b/configure.ac
&gt; index b93aa35..3c28bb0 100644
&gt; --- a/configure.ac
&gt; +++ b/configure.ac
&gt; @@ -110,6 +110,10 @@ if test &quot;x$XSERVER_LIBPCIACCESS&quot; = xyes; then
&gt;      XORG_CFLAGS=&quot;$XORG_CFLAGS $PCIACCESS_CFLAGS&quot;
&gt;  fi
&gt;  
&gt; +# Check for Video4Linux Version 2 (V4L2)
&gt; +AC_CHECK_HEADERS([linux/videodev2.h],[v4l2=yes])
&gt; +AM_CONDITIONAL(BUILD_ZTV, [test &quot;x$v4l2&quot; = xyes])
&gt; +
&gt;  AC_SUBST([XORG_CFLAGS])
&gt;  AC_SUBST([moduledir])
&gt;  AC_SUBST([AMD_CFLAGS])
&gt; diff --git a/ztv/Makefile.am b/ztv/Makefile.am
&gt; index 08902fc..9ce94d4 100644
&gt; --- a/ztv/Makefile.am
&gt; +++ b/ztv/Makefile.am
&gt; @@ -1,4 +1,6 @@
&gt;  
&gt; +if BUILD_ZTV
&gt; +
&gt;  AM_CFLAGS =                        \
&gt;          $(XORG_CFLAGS)                \
&gt;          $(AMD_CFLAGS)                \
&gt; @@ -13,3 +15,5 @@ ztv_drv_la_LDFLAGS = -module -avoid-version
&gt;  ztv_drv_ladir = $(moduledir)/drivers
&gt;  
&gt;  ztv_drv_la_SOURCES = z4l.c
&gt; +
&gt; +endif BUILD_ZTV


_______________________________________________
Xorg-driver-geode mailing list
<A HREF="mailto:Xorg-driver-geode@lists.x.org">Xorg-driver-geode@lists.x.org</A>
<A HREF="http://lists.x.org/mailman/listinfo/xorg-driver-geode">http://lists.x.org/mailman/listinfo/xorg-driver-geode</A>
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>