diff -urN guile-avahi-0.4.1/Makefile.am guile-avahi-0.4.1/Makefile.am
--- guile-avahi-0.4.1/Makefile.am	2023-01-15 17:29:00
+++ guile-avahi-0.4.1/Makefile.am	2026-03-08 10:22:35
@@ -37,6 +37,7 @@
 EXTRA_DIST +=								\
   src/make-enum-map.scm src/make-smob-types.scm				\
   src/make-enum-header.scm src/make-smob-header.scm			\
+  src/guile-static-main.c						\
   src/make-callback-header.scm src/make-callback-trampolines.scm
 
 # Files generated by (avahi build ...).
@@ -61,6 +62,11 @@
    src/common.c.x src/watch.c.x src/client.c.x		\
    src/errors.c.x src/publish.c.x src/lookup.c.x
 
+guile_avahi_common_cflags =				\
+  $(AVAHI_CFLAGS) $(GUILE_CFLAGS) $(AM_CFLAGS)
+
+if ENABLE_SHARED
+
 nobase_guileextension_LTLIBRARIES  = guile-avahi-v-0.la
 
 # Use '-module' to build a "dlopenable module", in Libtool terms.
@@ -72,11 +78,29 @@
   src/utils.c src/errors.c src/watch.c		\
   src/common.c src/client.c			\
   src/publish.c src/lookup.c
-guile_avahi_v_0_la_CFLAGS =			\
-  $(AVAHI_CFLAGS) $(GUILE_CFLAGS) $(AM_CFLAGS)
+guile_avahi_v_0_la_CFLAGS = $(guile_avahi_common_cflags)
+guile_avahi_v_0_la_DEPENDENCIES = $(BUILT_SOURCES)
 guile_avahi_v_0_la_LIBADD =			\
    $(AVAHI_LIBS) $(GUILE_LDFLAGS)
+else
+lib_LIBRARIES = libguile-avahi-static.a
+libguile_avahi_static_a_SOURCES =		\
+  src/utils.c src/errors.c src/watch.c		\
+  src/common.c src/client.c			\
+  src/publish.c src/lookup.c
+libguile_avahi_static_a_CPPFLAGS = $(AM_CPPFLAGS)
+libguile_avahi_static_a_CFLAGS = $(guile_avahi_common_cflags)
+libguile_avahi_static_a_DEPENDENCIES = $(BUILT_SOURCES)
 
+bin_PROGRAMS = guile
+guile_SOURCES = src/guile-static-main.c
+guile_CPPFLAGS = $(AM_CPPFLAGS)
+guile_CFLAGS = $(guile_avahi_common_cflags)
+guile_LDFLAGS = -static
+guile_LDADD = libguile-avahi-static.a $(GUILE_GNUTLS_STATIC_LIB) \
+  $(GUILE_LDFLAGS) $(AVAHI_LIBS) $(GNUTLS_LIBS) $(LIBS)
+endif
+
 AM_CFLAGS   = $(GCC_CFLAGS)
 AM_CPPFLAGS = -I$(builddir)/src -I$(srcdir)/src			\
 	      -I$(top_srcdir)/lib -I$(top_builddir)/lib
@@ -173,6 +196,8 @@
 gosubdir = $(godir)/avahi
 goclientdir = $(gosubdir)/client
 
+if ENABLE_SHARED
+
 nodist_go_DATA =				\
   modules/avahi.go
 nodist_gosub_DATA =				\
@@ -213,6 +238,7 @@
 SUFFIXES += .go
 
 CLEANFILES += $(GOBJECTS)
+endif ENABLE_SHARED
 
 
 #
diff -urN guile-avahi-0.4.1/configure.ac guile-avahi-0.4.1/configure.ac
--- guile-avahi-0.4.1/configure.ac	2023-01-15 17:30:33
+++ guile-avahi-0.4.1/configure.ac	2026-03-08 10:22:35
@@ -27,7 +27,8 @@
    
 # Libtool.
 LT_PREREQ([2.2.6])
-LT_INIT([disable-static dlopen])
+LT_INIT([dlopen])
+AM_CONDITIONAL([ENABLE_SHARED], [test "x$enable_shared" != "xno"])
 
 # Checks for programs.
 AC_PROG_CC
diff -urN guile-avahi-0.4.1/modules/avahi.in guile-avahi-0.4.1/modules/avahi.in
--- guile-avahi-0.4.1/modules/avahi.in	2023-01-15 16:21:01
+++ guile-avahi-0.4.1/modules/avahi.in	2026-03-08 10:22:35
@@ -110,7 +110,8 @@
         (string-append %libdir "/guile-avahi-v-0")
         "guile-avahi-v-0"))
 
-  (unless (getenv "AVAHI_GUILE_CROSS_COMPILING")
+  (unless (or (getenv "AVAHI_GUILE_CROSS_COMPILING")
+              (module-variable (current-module) 'watch?))
     (load-extension %avahi-extension "scm_avahi_common_init")))
 
 ;; Optional bindings, depending on the configuration.
diff -urN guile-avahi-0.4.1/modules/avahi/client/lookup.scm guile-avahi-0.4.1/modules/avahi/client/lookup.scm
--- guile-avahi-0.4.1/modules/avahi/client/lookup.scm	2023-01-15 16:21:14
+++ guile-avahi-0.4.1/modules/avahi/client/lookup.scm	2026-03-08 10:22:35
@@ -63,7 +63,8 @@
           resolver-event->string
           resolver-event/found resolver-event/failure))
 
-(unless (getenv "AVAHI_GUILE_CROSS_COMPILING")
-  (load-extension %avahi-extension "scm_avahi_lookup_init"))
+(unless (or (getenv "AVAHI_GUILE_CROSS_COMPILING")
+            (module-variable (current-module) 'domain-browser?))
+  (load-extension %avahi-extension "scm_avahi_lookup_init"))
 
 ;;; arch-tag: 9ab68bd4-4705-42e5-89c3-e02551be4d09
diff -urN guile-avahi-0.4.1/modules/avahi/client/publish.scm guile-avahi-0.4.1/modules/avahi/client/publish.scm
--- guile-avahi-0.4.1/modules/avahi/client/publish.scm	2023-01-15 16:21:20
+++ guile-avahi-0.4.1/modules/avahi/client/publish.scm	2026-03-08 10:22:35
@@ -39,7 +39,8 @@
            publish-flag/no-cookie publish-flag/update
            publish-flag/use-wide-area publish-flag/use-multicast))
 
-(unless (getenv "AVAHI_GUILE_CROSS_COMPILING")
-  (load-extension %avahi-extension "scm_avahi_publish_init"))
+(unless (or (getenv "AVAHI_GUILE_CROSS_COMPILING")
+            (module-variable (current-module) 'entry-group?))
+  (load-extension %avahi-extension "scm_avahi_publish_init"))
 
 ;;; arch-tag: 36180c98-3262-40a6-a90c-eb8f283e628e
diff -urN guile-avahi-0.4.1/modules/avahi/client.scm guile-avahi-0.4.1/modules/avahi/client.scm
--- guile-avahi-0.4.1/modules/avahi/client.scm	2023-01-15 16:21:09
+++ guile-avahi-0.4.1/modules/avahi/client.scm	2026-03-08 10:22:35
@@ -29,8 +29,9 @@
            client-flag->string
            client-flag/ignore-user-config client-flag/no-fail))
 
-(unless (getenv "AVAHI_GUILE_CROSS_COMPILING")
-  (load-extension %avahi-extension "scm_avahi_client_init"))
+(unless (or (getenv "AVAHI_GUILE_CROSS_COMPILING")
+            (module-variable (current-module) 'client?))
+  (load-extension %avahi-extension "scm_avahi_client_init"))
 
 ;; Optional bindings, depending on the configuration.
 (if (defined? 'set-client-host-name!) (export set-client-host-name!))
diff -urN guile-avahi-0.4.1/src/guile-static-main.c guile-avahi-0.4.1/src/guile-static-main.c
--- guile-avahi-0.4.1/src/guile-static-main.c	1969-12-31 19:00:00
+++ guile-avahi-0.4.1/src/guile-static-main.c	2026-03-08 10:22:35
@@ -0,0 +1,26 @@
+#include <libguile.h>
+
+void scm_init_gnutls(void);
+void scm_avahi_common_init(void);
+void scm_avahi_client_init(void);
+void scm_avahi_lookup_init(void);
+void scm_avahi_publish_init(void);
+
+static void
+inner_main(void *closure, int argc, char **argv)
+{
+  (void) closure;
+  scm_init_gnutls();
+  scm_avahi_common_init();
+  scm_avahi_client_init();
+  scm_avahi_lookup_init();
+  scm_avahi_publish_init();
+  scm_shell(argc, argv);
+}
+
+int
+main(int argc, char **argv)
+{
+  scm_boot_guile(argc, argv, inner_main, NULL);
+  return 0;
+}
