[Pixman] [PATCH 1/3] A new configure option --enable-static-testprogs

Siarhei Siamashka siarhei.siamashka at gmail.com
Tue Jan 11 08:10:37 PST 2011


From: Siarhei Siamashka <siarhei.siamashka at nokia.com>

This option can be used for building fully static binaries of
the test programs so that they can be easily run using userspace
qemu. With binfmt-misc configured, 'make check' works fine for
crosscompiled pixman builds.
---
 configure.ac     |   14 ++++++++++++++
 test/Makefile.am |   21 +++++++++++++++++++++
 2 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2570c84..6552f12 100644
--- a/configure.ac
+++ b/configure.ac
@@ -566,6 +566,20 @@ fi
 AM_CONDITIONAL(USE_GCC_INLINE_ASM, test $have_gcc_inline_asm = yes)
 
 dnl ==============================================
+dnl Static test programs
+
+AC_ARG_ENABLE(static-testprogs,
+   [AC_HELP_STRING([--enable-static-testprogs],
+		   [build test programs as static binaries [default=no]])],
+   [enable_static_testprogs=$enableval], [enable_static_testprogs=no])
+
+TESTPROGS_EXTRA_LDFLAGS=
+if test "x$enable_static_testprogs" = "xyes" ; then
+   TESTPROGS_EXTRA_LDFLAGS="-all-static"
+fi
+AC_SUBST(TESTPROGS_EXTRA_LDFLAGS)
+
+dnl ==============================================
 dnl Timers
 
 AC_ARG_ENABLE(timers,
diff --git a/test/Makefile.am b/test/Makefile.am
index 19c4f80..71e5353 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -23,40 +23,61 @@ TESTPROGRAMS =			\
 	composite
 
 a1_trap_test_LDADD = $(TEST_LDADD)
+a1_trap_test_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
+
 fetch_test_LDADD = $(TEST_LDADD)
+fetch_test_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
+
 trap_crasher_LDADD = $(TEST_LDADD)
+trap_crasher_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
+
 oob_test_LDADD = $(TEST_LDADD)
+oob_test_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
+
 scaling_crash_test_LDADD = $(TEST_LDADD)
+scaling_crash_test_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
+
 region_translate_test_LDADD = $(TEST_LDADD)
+region_translate_test_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
 
 pdf_op_test_LDADD = $(TEST_LDADD)
+pdf_op_test_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
 pdf_op_test_SOURCES = pdf-op-test.c utils.c utils.h
 
 region_test_LDADD = $(TEST_LDADD)
+region_test_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
 region_test_SOURCES = region-test.c utils.c utils.h
 
 blitters_test_LDADD = $(TEST_LDADD)
+blitters_test_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
 blitters_test_SOURCES = blitters-test.c utils.c utils.h
 
 scaling_test_LDADD = $(TEST_LDADD)
+scaling_test_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
 scaling_test_SOURCES = scaling-test.c utils.c utils.h
 
 affine_test_LDADD = $(TEST_LDADD)
+affine_test_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
 affine_test_SOURCES = affine-test.c utils.c utils.h
 
 alphamap_LDADD = $(TEST_LDADD)
+alphamap_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
 alphamap_SOURCES = alphamap.c utils.c utils.h
 
 alpha_loop_LDADD = $(TEST_LDADD)
+alpha_loop_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
 alpha_loop_SOURCES = alpha-loop.c utils.c utils.h
 
 composite_LDADD = $(TEST_LDADD)
+composite_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
 composite_SOURCES = composite.c utils.c utils.h
 
 gradient_crash_test_LDADD = $(TEST_LDADD)
+gradient_crash_test_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
 gradient_crash_test_SOURCES = gradient-crash-test.c utils.c utils.h
 
 stress_test_LDADD = $(TEST_LDADD)
+stress_test_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
 stress_test_SOURCES = stress-test.c utils.c utils.h
 
 # GTK using test programs
-- 
1.7.2.2



More information about the Pixman mailing list