[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-avahi-bugs] Fix build with Guile 3.
From: |
Mathieu Othacehe |
Subject: |
[Guile-avahi-bugs] Fix build with Guile 3. |
Date: |
Mon, 26 Oct 2020 12:38:36 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Hello,
Here are some patches to fix Guile-Avahi build. I removed gnulib
dependency that does not seem required anymore. I also removed the
custom allocator that causes issues and fixed the tests.
Thanks,
Mathieu
>From 818c07525b3e6adbd195b8742518e1c60669d1db Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe@gnu.org>
Date: Mon, 26 Oct 2020 10:53:51 +0100
Subject: [PATCH 1/4] Remove gnulib dependency.
* Makefile.am (SUBDIRS): Remove lib.
* configure.ac: Remove gnulib init.
* src/Makefile.am: Do not link with gnulib.
* src/utils.c: Remove HAVE_ARPA_INET_H conditionnals.
---
Makefile.am | 2 +-
configure.ac | 4 ----
src/Makefile.am | 2 +-
src/utils.c | 6 ------
4 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 0dc4596..1af17db 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,4 +19,4 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = modules lib src doc tests
+SUBDIRS = modules src doc tests
diff --git a/configure.ac b/configure.ac
index 843f8bf..32ed466 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,11 +25,8 @@ AC_ARG_WITH([guilemoduledir],
# Checks for programs.
AC_PROG_CC
AC_LANG_C
-gl_EARLY
AC_PROG_LIBTOOL
-# Gnulib
-gl_INIT
if test "x$GCC" = "xyes"; then
# Enable useful GCC compilation flags.
@@ -104,7 +101,6 @@ fi
AC_CONFIG_FILES([Makefile
modules/Makefile
doc/Makefile
- lib/Makefile
src/Makefile
tests/Makefile
pre-inst-guile])
diff --git a/src/Makefile.am b/src/Makefile.am
index 3fd5a8d..e9c8135 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -53,7 +53,7 @@ libguile_avahi_v_0_la_SOURCES = \
libguile_avahi_v_0_la_CFLAGS = \
$(AVAHI_CFLAGS) $(GUILE_CFLAGS) $(AM_CFLAGS)
libguile_avahi_v_0_la_LIBADD = \
- $(top_builddir)/lib/libgnu.la $(AVAHI_LIBS) $(GUILE_LDFLAGS)
+ $(AVAHI_LIBS) $(GUILE_LDFLAGS)
AM_CFLAGS = $(GCC_CFLAGS)
AM_CPPFLAGS = -I$(builddir) -I$(srcdir) \
diff --git a/src/utils.c b/src/utils.c
index 3a93998..a221f7e 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -24,9 +24,7 @@
# include <gmp.h>
#endif
-#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
-#endif
#ifdef HAVE_NET_IF_H
# include <net/if.h>
@@ -123,11 +121,9 @@ scm_from_avahi_address (const AvahiAddress *c_address)
switch (c_address->proto)
{
-#ifdef HAVE_ARPA_INET_H
case AVAHI_PROTO_INET:
result = scm_from_uint32 (ntohl (c_address->data.ipv4.address));
break;
-#endif
#ifdef HAVE_GMP_H
case AVAHI_PROTO_INET6:
@@ -271,11 +267,9 @@ scm_to_avahi_address (SCM address_protocol, SCM address,
switch (c_addrproto)
{
-#ifdef HAVE_ARPA_INET_H
case AVAHI_PROTO_INET:
c_address->data.ipv4.address = htonl (scm_to_uint32 (address));
break;
-#endif
#ifdef HAVE_GMP_H
case AVAHI_PROTO_INET6:
--
2.28.0
>From 018e45329887a61cc0139b8d8248aeae535f70ed Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe@gnu.org>
Date: Mon, 26 Oct 2020 11:00:50 +0100
Subject: [PATCH 2/4] Do not use a custom memory allocator.
* src/common.c: Remove the custom memory allocator.
---
src/common.c | 100 ---------------------------------------------------
1 file changed, 100 deletions(-)
diff --git a/src/common.c b/src/common.c
index abe79e9..79451c6 100644
--- a/src/common.c
+++ b/src/common.c
@@ -433,111 +433,11 @@ SCM_DEFINE (scm_avahi_unlock_threaded_poll,
"unlock-threaded-poll",
}
#undef FUNC_NAME
-
-
-/* Custom memory allocator. */
-
-/* Using our custom allocator allows to provide Guile's GC with more accurate
- information as to how much memory is being used. Consequently, it can
- make smarter decisions as to when to run the GC. */
-
-
-/* We end up rolling our own allocator data structure to keep track of buffer
- sizes. */
-typedef struct
-{
- size_t size;
- char data[0];
-} alloc_header_t;
-
-
-/* GC hint for all Guile-Avahi-related allocations. */
-static const char scm_avahi_gc_hint[] = "guile-avahi";
-
-static void *
-scm_avahi_malloc (size_t size)
-{
- alloc_header_t *header;
-
- header = scm_gc_malloc (size + sizeof (size_t), scm_avahi_gc_hint);
- header->size = size;
-
-#ifdef DEBUG
- printf ("allocated %u bytes at %p [header %p]\n",
- size, &header->data[0], header);
-#endif
-
- return (&header->data[0]);
-}
-
-static void
-scm_avahi_free (void *p)
-{
- alloc_header_t *header;
-
- header = (alloc_header_t *) (void *) ((char *) p - sizeof (size_t));
-
-#ifdef DEBUG
- printf ("freeing %u bytes at %p [header %p]\n",
- header->size, p, header);
-#endif
-
- scm_gc_free (header, header->size, scm_avahi_gc_hint);
-}
-
-static void *
-scm_avahi_realloc (void *p, size_t size)
-{
- alloc_header_t *header;
-
- if (p == NULL)
- return (scm_avahi_malloc (size));
-
- header = (alloc_header_t *) (void *) ((char *) p - sizeof (size_t));
-
- header = scm_gc_realloc (header,
- header->size + sizeof (size_t),
- size + sizeof (size_t),
- scm_avahi_gc_hint);
-#ifdef DEBUG
- printf ("reallocated %u -> %u bytes at %p [header %p]\n",
- header->size, size, p, header);
-#endif
-
- header->size = size;
-
- return (&header->data[0]);
-}
-
-static void *
-scm_avahi_calloc (size_t count, size_t element_size)
-{
- void *p;
- size_t total = count * element_size;
-
- p = scm_avahi_malloc (total);
- if (EXPECT_TRUE (p != NULL))
- memset (p, 0, total);
-
- return p;
-}
-
-static const AvahiAllocator scm_avahi_allocator =
- {
- scm_avahi_malloc,
- scm_avahi_free,
- scm_avahi_realloc,
- scm_avahi_calloc
- };
-
-
/* Initialization. */
void
scm_avahi_common_init (void)
{
- avahi_set_allocator (&scm_avahi_allocator);
-
#include "common.c.x"
scm_avahi_define_enums ();
--
2.28.0
>From 70c46856ef1296a75952c5a95702a5aa2c60737c Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe@gnu.org>
Date: Mon, 26 Oct 2020 10:55:21 +0100
Subject: [PATCH 3/4] Fix tests.
* modules/avahi/test.scm (assert-exit): New procedure.
* tests/errors.scm: Use assert-exit instead of exit.
* tests/guile-poll.scm: Ditto. Use 'none instead of _IONBF.
* tests/publish+browse.scm: Use assert-exit instead of exit.
* tests/publish+resolve.scm: Use assert-exit instead of exit. Use INADDR_ANY
instead of INADDR_LOOPBACK.
* tests/publish.scm: Ditto.
* tests/simple-poll.scm: Use assert-exit instead of exit.
* tests/threaded-poll.scm: Ditto.
---
modules/avahi/test.scm | 6 +++++-
tests/errors.scm | 6 +++---
tests/guile-poll.scm | 6 +++---
tests/publish+browse.scm | 4 ++--
tests/publish+resolve.scm | 6 +++---
tests/publish.scm | 8 ++++----
tests/simple-poll.scm | 5 +++--
tests/threaded-poll.scm | 6 ++----
8 files changed, 25 insertions(+), 22 deletions(-)
diff --git a/modules/avahi/test.scm b/modules/avahi/test.scm
index bc3ce90..8681f61 100644
--- a/modules/avahi/test.scm
+++ b/modules/avahi/test.scm
@@ -18,13 +18,17 @@
(define-module (avahi test)
:use-module (avahi)
- :export (%service-type make-service-name make-host-name
+ :export (assert-exit
+ %service-type make-service-name make-host-name
%timeout-sec iterate-simple-poll-until-true))
;;;
;;; Facilities for the test suite.
;;;
+(define (assert-exit x)
+ (primitive-exit (if x 0 1)))
+
(define %service-type
;; The default service type used for testing.
"_guile-avahi._tcp")
diff --git a/tests/errors.scm b/tests/errors.scm
index 69effcf..4562f01 100644
--- a/tests/errors.scm
+++ b/tests/errors.scm
@@ -49,17 +49,17 @@
(entry-group-state group)
;; not reached (normally)
- (exit #f)))
+ (assert-exit #f)))
(lambda (key err function . currently-unused)
;;(format #t "~a ~a ~a ~a~%"
;; key err function currently-unused)
- (exit (and (eq? key 'avahi-error)
+ (assert-exit (and (eq? key 'avahi-error)
(eq? err error/invalid-object)
(string? (error->string err))
(eq? function 'entry-group-state)))))))
(lambda ()
;; failure
- (exit 1)))
+ (assert-exit 1)))
;;; arch-tag: f5b90299-0cd8-4fae-8baf-27b456ceabcf
diff --git a/tests/guile-poll.scm b/tests/guile-poll.scm
index bd88d6c..184d219 100644
--- a/tests/guile-poll.scm
+++ b/tests/guile-poll.scm
@@ -318,9 +318,9 @@
1234 "scheme=yes" "java=no")
(commit-entry-group group))))
- (setvbuf (current-output-port) _IONBF)
+ (setvbuf (current-output-port) 'none)
- (exit (let-values (((client iterate)
+ (assert-exit (let-values (((client iterate)
(make-avahi-client-event-loop %client-flags
client-callback)))
(let loop ((seconds 0))
@@ -334,6 +334,6 @@
(lambda ()
;; failure.
- (exit 1)))
+ (assert-exit 1)))
;;; arch-tag: b7dc1451-607d-44ac-8d95-153eaef6a6a9
diff --git a/tests/publish+browse.scm b/tests/publish+browse.scm
index 1ca0e94..155281d 100644
--- a/tests/publish+browse.scm
+++ b/tests/publish+browse.scm
@@ -114,7 +114,7 @@
(commit-entry-group group))))))
- (exit (let* ((poll (make-simple-poll))
+ (assert-exit (let* ((poll (make-simple-poll))
(client (make-client (simple-poll poll)
(list
client-flag/ignore-user-config)
@@ -134,7 +134,7 @@
(lambda ()
;; failure.
- (exit 1)))
+ (assert-exit 1)))
;;; arch-tag: f173da7a-afde-4510-bf8b-f2d60148d1fd
diff --git a/tests/publish+resolve.scm b/tests/publish+resolve.scm
index e2d0a3c..c3b66f0 100644
--- a/tests/publish+resolve.scm
+++ b/tests/publish+resolve.scm
@@ -161,11 +161,11 @@
(add-entry-group-address! group interface/unspecified
protocol/unspecified '()
%host-name
- protocol/inet INADDR_LOOPBACK)
+ protocol/inet INADDR_ANY)
(commit-entry-group group))))))
- (exit (let* ((poll (make-simple-poll))
+ (assert-exit (let* ((poll (make-simple-poll))
(client (make-client (simple-poll poll)
(list
client-flag/ignore-user-config)
@@ -183,7 +183,7 @@
(lambda ()
;; failure.
- (exit 1)))
+ (assert-exit 1)))
;;; arch-tag: 640d4520-603b-45a0-9859-0d6e8fee2cfe
diff --git a/tests/publish.scm b/tests/publish.scm
index cc70f8f..ffd1d93 100644
--- a/tests/publish.scm
+++ b/tests/publish.scm
@@ -34,7 +34,7 @@
(define (group-callback group state)
;;(format #t "group-state: ~a~%" state)
(if (eq? state entry-group-state/established)
- (exit #t)))
+ (assert-exit #t)))
(define client-callback
(let ((group #f))
@@ -51,11 +51,11 @@
protocol/unspecified '()
(string-append (make-host-name)
".local")
- protocol/inet INADDR_LOOPBACK)
+ protocol/inet INADDR_ANY)
(commit-entry-group group))))))
- (exit (let* ((poll (make-simple-poll))
+ (assert-exit (let* ((poll (make-simple-poll))
(client (make-client (simple-poll poll)
(list
client-flag/ignore-user-config)
@@ -72,7 +72,7 @@
(lambda ()
;; failure.
- (exit 1)))
+ (assert-exit 1)))
;;; arch-tag: a6b7b096-b827-4b7b-b81d-9faef52b09b5
diff --git a/tests/simple-poll.scm b/tests/simple-poll.scm
index 06965a4..9fb4b0a 100644
--- a/tests/simple-poll.scm
+++ b/tests/simple-poll.scm
@@ -23,6 +23,7 @@
(use-modules (avahi)
(avahi client)
+ (avahi test)
(srfi srfi-1))
(dynamic-wind
@@ -35,7 +36,7 @@
(string? (client-state->string state))))
(throw 'failure)))
- (exit (and (simple-poll? (make-simple-poll))
+ (assert-exit (and (simple-poll? (make-simple-poll))
(every poll?
(let loop ((polls '())
(count 123))
@@ -66,7 +67,7 @@
(lambda ()
;; failure.
- (exit 1)))
+ (assert-exit 1)))
;;; arch-tag: b866efb9-235f-4005-b9ca-8b246e0c8f80
diff --git a/tests/threaded-poll.scm b/tests/threaded-poll.scm
index 8c5283c..1fd9a1b 100644
--- a/tests/threaded-poll.scm
+++ b/tests/threaded-poll.scm
@@ -39,7 +39,7 @@
(string? (client-state->string state))))
(throw 'failure)))
- (exit (let* ((poll (make-threaded-poll))
+ (assert-exit (let* ((poll (make-threaded-poll))
(client (make-client (threaded-poll poll)
(list
client-flag/ignore-user-config)
@@ -50,6 +50,4 @@
(lambda ()
;; failure.
- (exit 1)))
-
-
+ (assert-exit 1)))
--
2.28.0
>From cd8f34eb1b8ab8604d9fd6eadb9168e5488a89bb Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe@gnu.org>
Date: Mon, 26 Oct 2020 11:02:03 +0100
Subject: [PATCH 4/4] Fix make check.
* configure.ac: Remove AC_PREREQ and add color-tests to automake init list.
* tests/Makefile.am (SCM_TESTS, TEST_EXTENSIONS, AM_TESTS_ENVIRONMENT,
SCM_LOG_COMPILER, AM_SCM_LOG_FLAGS): New variables.
* build-aux/config.rpath: New file.
---
build-aux/config.rpath | 684 +++++++++++++++++++++++++++++++++++++++++
configure.ac | 4 +-
tests/Makefile.am | 30 +-
3 files changed, 710 insertions(+), 8 deletions(-)
create mode 100755 build-aux/config.rpath
diff --git a/build-aux/config.rpath b/build-aux/config.rpath
new file mode 100755
index 0000000..7a4952e
--- /dev/null
+++ b/build-aux/config.rpath
@@ -0,0 +1,684 @@
+#!/gnu/store/ykzwykkvr2c80rw4l1qh3mvfdkl7jibi-bash-4.3.42/bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2016 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's _LT_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ ecc*)
+ wl='-Wl,'
+ ;;
+ icc* | ifort*)
+ wl='-Wl,'
+ ;;
+ lf95*)
+ wl='-Wl,'
+ ;;
+ nagfor*)
+ wl='-Wl,-Wl,,'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ wl=
+ ;;
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ newsos6)
+ ;;
+ *nto* | *qnx*)
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ wl='-Qoption ld '
+ ;;
+ *)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ wl='-Wl,'
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ case "$host_os" in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ haiku*)
+ ;;
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null;
then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null;
then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo
${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ else
+ aix_use_runtimelinking=no
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+ fi
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File
Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File
Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; };
then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd2.[01]*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ *nto* | *qnx*)
+ ;;
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test
"$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they
lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* |
sco3.2v5.0.[024]*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo
${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec= # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ library_names_spec='$libname.a'
+ ;;
+ aix[4-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc*)
+ library_names_spec='$libname$shrext' ;;
+ m68k)
+ library_names_spec='$libname.a' ;;
+ esac
+ ;;
+ beos*)
+ library_names_spec='$libname$shrext'
+ ;;
+ bsdi[45]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ shrext=.dll
+ library_names_spec='$libname.dll.a $libname.lib'
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ library_names_spec='$libname$shrext'
+ ;;
+ dgux*)
+ library_names_spec='$libname$shrext'
+ ;;
+ freebsd[23].*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ freebsd* | dragonfly*)
+ library_names_spec='$libname$shrext'
+ ;;
+ gnu*)
+ library_names_spec='$libname$shrext'
+ ;;
+ haiku*)
+ library_names_spec='$libname$shrext'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ library_names_spec='$libname$shrext'
+ ;;
+ interix[3-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ library_names_spec='$libname$shrext'
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32
shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ knetbsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ netbsd*)
+ library_names_spec='$libname$shrext'
+ ;;
+ newsos6)
+ library_names_spec='$libname$shrext'
+ ;;
+ *nto* | *qnx*)
+ library_names_spec='$libname$shrext'
+ ;;
+ openbsd*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ library_names_spec='$libname.a'
+ ;;
+ osf3* | osf4* | osf5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sunos4*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ sysv4 | sysv4.3*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv4*MP*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ library_names_spec='$libname$shrext'
+ ;;
+ tpf*)
+ library_names_spec='$libname$shrext'
+ ;;
+ uts4*)
+ library_names_spec='$libname$shrext'
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e
"$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e
"$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e
's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/configure.ac b/configure.ac
index 32ed466..85a235d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,13 +1,11 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.61)
AC_INIT(guile-avahi, 0.3, guile-avahi-bugs@nongnu.org)
AC_CONFIG_AUX_DIR(build-aux)
AC_CONFIG_MACRO_DIR(m4)
-AM_INIT_AUTOMAKE([gnu check-news -Wall -Wno-portability])
-
+AM_INIT_AUTOMAKE([gnu check-news -Wall -Wno-portability color-tests])
AC_CONFIG_SRCDIR([src/common.c])
AC_CONFIG_HEADER([src/config.h])
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 29ddcfa..e99b71c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -16,10 +16,30 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-TESTS = simple-poll.scm threaded-poll.scm publish.scm \
- publish+browse.scm publish+resolve.scm \
- guile-poll.scm errors.scm
+SCM_TESTS = simple-poll.scm threaded-poll.scm publish.scm \
+ publish+browse.scm publish+resolve.scm \
+ guile-poll.scm errors.scm
-EXTRA_DIST = $(TESTS)
+TESTS = ${SCM_TESTS}
+
+TEST_EXTENSIONS = .scm
+
+AM_TESTS_ENVIRONMENT = \
+ abs_top_srcdir="$(abs_top_srcdir)"; export abs_top_srcdir; \
+ abs_top_builddir="$(abs_top_builddir)"; export abs_top_builddir; \
+ ORIGTERM=${TERM}; export ORIGTERM; \
+ TERM=xterm; export TERM; \
+ GUILE_WARN_DEPRECATED=no; export GUILE_WARN_DEPRECATED; \
+ GUILE_AUTO_COMPILE=0; export GUILE_AUTO_COMPILE;
-TESTS_ENVIRONMENT = GUILE_AUTO_COMPILE=0 $(top_builddir)/pre-inst-guile
+SCM_LOG_COMPILER = \
+ ${top_builddir}/libtool \
+ -dlopen ${top_builddir}/src/libguile-avahi-v-0.la \
+ --mode=execute $(GUILE)
+
+AM_SCM_LOG_FLAGS = \
+ -L "$(top_srcdir)" \
+ -L "$(top_srcdir)/modules" \
+ -s
+
+EXTRA_DIST = $(TESTS)
--
2.28.0
- [Guile-avahi-bugs] Fix build with Guile 3.,
Mathieu Othacehe <=