From 3360d0c79e98cf6b7f30b2d84f117aea0a28595d Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Fri, 24 Nov 2006 13:24:05 -0800 Subject: [PATCH 1/7] NetBSD doesn't have AI_ADDRCONFIG: use it only if it's available. --- src/xcb_util.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xcb_util.c b/src/xcb_util.c index bd9f2b5..eeee1dd 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -176,7 +176,10 @@ static int _xcb_open_decnet(const char *host, const unsigned short port) static int _xcb_open_tcp(char *host, const unsigned short port) { int fd = -1; - struct addrinfo hints = { AI_ADDRCONFIG + struct addrinfo hints = { 0 +#ifdef AI_ADDRCONFIG + | AI_ADDRCONFIG +#endif #ifdef AI_NUMERICSERV | AI_NUMERICSERV #endif From 05d23a724d4dde42b11d6e9dec9ccaf5a516e287 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Fri, 24 Nov 2006 16:22:13 -0800 Subject: [PATCH 2/7] libXau didn't have a correct pkg-config file until 0.99.2: fail if an older version is found. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b400f03..cd682ff 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ AC_SUBST(HTML_CHECK_RESULT) # Checks for pkg-config packages PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 1.0) -NEEDED="xau pthread-stubs" +NEEDED="pthread-stubs xau >= 0.99.2" PKG_CHECK_MODULES(NEEDED, $NEEDED) PKG_CHECK_MODULES(XDMCP, xdmcp, From e74cdcd02e6814222a76c0a237efca16c423bb26 Mon Sep 17 00:00:00 2001 From: Ian Osgood Date: Sat, 25 Nov 2006 11:00:14 -0800 Subject: [PATCH 3/7] Bug #9119: test xcb_popcount --- tests/check_public.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/check_public.c b/tests/check_public.c index a28fb49..e222221 100644 --- a/tests/check_public.c +++ b/tests/check_public.c @@ -3,6 +3,7 @@ #include #include "check_suites.h" #include "xcb.h" +#include "xcbext.h" /* xcb_parse_display tests {{{ */ @@ -179,6 +180,28 @@ END_TEST /* }}} */ +static void popcount_eq(uint32_t bits, int count) +{ + fail_unless(xcb_popcount(bits) == count, "unexpected popcount(%08x) != %d", bits, count); +} + +START_TEST(popcount) +{ + uint32_t mask; + int count; + + for (mask = 0xffffffff, count = 32; count >= 0; mask >>= 1, --count) { + popcount_eq(mask, count); + } + for (mask = 0x80000000; mask; mask >>= 1) { + popcount_eq(mask, 1); + } + for (mask = 0x80000000; mask > 1; mask >>= 1) { + popcount_eq(mask | 1, 2); + } +} +END_TEST + Suite *public_suite(void) { Suite *s = suite_create("Public API"); @@ -189,5 +212,6 @@ Suite *public_suite(void) suite_add_test(s, parse_display_ipv6, "xcb_parse_display ipv6"); suite_add_test(s, parse_display_decnet, "xcb_parse_display decnet"); suite_add_test(s, parse_display_negative, "xcb_parse_display negative"); + suite_add_test(s, popcount, "xcb_popcount"); return s; } From 98e2a5617ef1c9955b3b5553224c34f55c7c5d29 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 25 Nov 2006 22:27:33 -0800 Subject: [PATCH 4/7] Use substitition variables in xcb-xinerama.pc.in, not instances of their values xcb-xinerama.pc.in looked more like a generated .pc file; replace specific instances of values provided by an invocation of configure with the general substitution variables configure replaces. --- xcb-xinerama.pc.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xcb-xinerama.pc.in b/xcb-xinerama.pc.in index 93c35a3..c4775f9 100644 --- a/xcb-xinerama.pc.in +++ b/xcb-xinerama.pc.in @@ -1,11 +1,11 @@ -prefix=/opt/fdo/ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ Name: XCB Xinerama Description: XCB Xinerama Extension -Version: 0.9.92 +Version: @PACKAGE_VERSION@ Requires: xcb Libs: -L${libdir} -lxcb-xinerama Cflags: -I${includedir} From 19dfaf93ac1b5e9d3ce09b1f8e2338e53a5d7324 Mon Sep 17 00:00:00 2001 From: Ian Osgood Date: Sun, 26 Nov 2006 09:26:32 -0800 Subject: [PATCH 5/7] Fix unit tests for FreeBSD putenv() string must contain '=' environment failure test is invalid if argument is NULL --- tests/check_public.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/check_public.c b/tests/check_public.c index e222221..2094bfe 100644 --- a/tests/check_public.c +++ b/tests/check_public.c @@ -25,7 +25,7 @@ static void parse_display_pass(const char *name, const char *host, const int dis if(test_type == TEST_ARGUMENT) { argument = name; - putenv("DISPLAY"); + putenv("DISPLAY="); } else if(test_type == TEST_ENVIRONMENT) { @@ -50,7 +50,7 @@ static void parse_display_pass(const char *name, const char *host, const int dis fail_unless(strcmp(host, got_host) == 0, "screenless parse %sproduced unexpected hostname '%s' for '%s': expected '%s'", test_string[test_type], got_host, name, host); fail_unless(display == got_display, "screenless parse %sproduced unexpected display '%d' for '%s': expected '%d'", test_string[test_type], got_display, name, display); } - putenv("DISPLAY"); + putenv("DISPLAY="); } static void parse_display_fail(const char *name) @@ -66,10 +66,11 @@ static void parse_display_fail(const char *name) if(test_type == TEST_ARGUMENT) { argument = name; - putenv("DISPLAY"); + putenv("DISPLAY="); } else if(test_type == TEST_ENVIRONMENT) { + if (!name) break; argument = 0; setenv("DISPLAY", name, 1); } @@ -91,7 +92,7 @@ static void parse_display_fail(const char *name) fail_unless(got_host == (char *) -1, "host changed on parse failure %sfor '%s': got %p", test_string[test_type], name, got_host); fail_unless(got_display == -42, "display changed on parse failure %sfor '%s': got %d", test_string[test_type], name, got_display); } - putenv("DISPLAY"); + putenv("DISPLAY="); } START_TEST(parse_display_unix) @@ -205,7 +206,7 @@ END_TEST Suite *public_suite(void) { Suite *s = suite_create("Public API"); - putenv("DISPLAY"); + putenv("DISPLAY="); suite_add_test(s, parse_display_unix, "xcb_parse_display unix"); suite_add_test(s, parse_display_ip, "xcb_parse_display ip"); suite_add_test(s, parse_display_ipv4, "xcb_parse_display ipv4"); From 2e8e6debac39864450c0a69633086ad92459c25e Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Fri, 24 Nov 2006 15:43:39 +0100 Subject: [PATCH 6/7] Fixed evaluation of the disable-build-docs argument. Now at least enable_build_docs is set correctly. --- acinclude.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 186873c..e85ea5a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -44,7 +44,7 @@ AC_DEFUN([AM_CHECK_DOXYGEN], AC_HELP_STRING( [--disable-build-docs], [Disable the build of the documentation]), - [if test "${disable_build_docs}" = "yes" ; then + [if test x"$enableval" != x"yes" ; then enable_build_docs="no" else enable_build_docs="yes" From f486075fa093846c3f32b3e4b9624c039ea26ba4 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Fri, 24 Nov 2006 15:48:08 +0100 Subject: [PATCH 7/7] If enable_build_docs is "no", we don't even try to look for doxygen. Also set BUILD_DOCS in that branch. Now the disable-build-docs works as expected. --- acinclude.m4 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index e85ea5a..8b240ad 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -50,6 +50,10 @@ AC_DEFUN([AM_CHECK_DOXYGEN], enable_build_docs="yes" fi], [enable_build_docs="yes"]) + + if test "$enable_build_docs" = "no" ; then + BUILD_DOCS=no + else dnl dnl Get the prefix where doxygen is installed. dnl @@ -93,6 +97,7 @@ AC_DEFUN([AM_CHECK_DOXYGEN], AC_MSG_WARN( [Warning: no doxygen detected. Documentation will not be built]) fi]) + fi AC_MSG_CHECKING([whether documentation is built]) AC_MSG_RESULT([${BUILD_DOCS}]) dnl