On certain architectures, the functionality of <fenv.h> may not be
available, which prevents building the pixman tests. In order to still
allow building pixman easily on such platforms, this commit adds two
new configure options, --disable-testprogs and --disable-demos, which
can be used to disable building the test and demo programs
respectively.

Of course, by default, tests and demo programs continue to be built,
so that the existing behavior is preserved.

Signed-off-by: Thomas Petazzoni <thomas.petazz...@free-electrons.com>
---
 Makefile.am  | 10 +++++++++-
 configure.ac | 18 ++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 5137c9e..cc29a75 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,12 @@
-SUBDIRS = pixman demos test
+SUBDIRS = pixman
+
+if DEMOS
+SUBDIRS += demos
+endif
+
+if TESTPROGS
+SUBDIRS += test
+endif
 
 pkgconfigdir=$(libdir)/pkgconfig
 pkgconfig_DATA=pixman-1.pc
diff --git a/configure.ac b/configure.ac
index 6b2134e..0e4d929 100644
--- a/configure.ac
+++ b/configure.ac
@@ -807,6 +807,24 @@ fi
 AM_CONDITIONAL(USE_GCC_INLINE_ASM, test $have_gcc_inline_asm = yes)
 
 dnl ==============================================
+dnl Demos
+AC_ARG_ENABLE(demos,
+  [AC_HELP_STRING([--disable-demos],
+                  [build demos [default=yes]])],
+  [enable_demos=$enableval], [enable_demos=yes])
+
+AM_CONDITIONAL(DEMOS, test $enable_demos = yes)
+
+dnl ==============================================
+dnl Test programs
+AC_ARG_ENABLE(testprogs,
+  [AC_HELP_STRING([--disable-testprogs],
+                  [build test programs [default=yes]])],
+  [enable_testprogs=$enableval], [enable_testprogs=yes])
+
+AM_CONDITIONAL(TESTPROGS, test $enable_testprogs = yes)
+
+dnl ==============================================
 dnl Static test programs
 
 AC_ARG_ENABLE(static-testprogs,
-- 
2.6.4

_______________________________________________
Pixman mailing list
Pixman@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pixman

Reply via email to