Hello.

Sending the same patch with more detailed commit message added.

Radek
---
>From e5507371498bc1dca7234ac25b45beb4b0f89f38 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Radek=20Barto=C5=88?= <[email protected]>
Date: Sat, 21 Jun 2025 22:56:58 +0200
Subject: [PATCH v2] Cygwin: cygserver: add possibility to skip cygserver build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This patch adds configure option allowing to disable build of cygserver. This
is useful when one needs to build only cygwin1.dll with stage1 compiler that is
not yet capable of linking executables as it's missing cygwin1.dll and crt0.o.

Signed-off-by: Radek BartoĊˆ <[email protected]>
---
 winsup/Makefile.am           | 12 ++++++++++--
 winsup/configure.ac          |  7 +++++++
 winsup/cygserver/Makefile.am |  2 ++
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/winsup/Makefile.am b/winsup/Makefile.am
index 9efdd4cb1..a8a82d4c8 100644
--- a/winsup/Makefile.am
+++ b/winsup/Makefile.am
@@ -14,10 +14,18 @@ cygdoc_DATA = \
        CYGWIN_LICENSE \
        COPYING
 
-SUBDIRS = cygwin cygserver utils testsuite
+SUBDIRS = cygwin utils testsuite
+
+if BUILD_CYGSERVER
+SUBDIRS += cygserver
+endif
 
 if BUILD_DOC
 SUBDIRS += doc
 endif
 
-cygserver utils testsuite: cygwin
+utils testsuite: cygwin
+
+if BUILD_CYGSERVER
+cygserver: cygwin
+endif
diff --git a/winsup/configure.ac b/winsup/configure.ac
index 18adf3d97..607f94710 100644
--- a/winsup/configure.ac
+++ b/winsup/configure.ac
@@ -83,6 +83,13 @@ AC_ARG_ENABLE(doc,
              enable_doc=yes)
 AM_CONDITIONAL(BUILD_DOC, [test $enable_doc != "no"])
 
+# Disabling build of cygserver is needed for zero-bootstrap build of stage 1
+# Cygwin toolchain where the linker is not able to produce executables yet.
+AC_ARG_ENABLE(cygserver,
+             [AS_HELP_STRING([--disable-cygserver], [do not build 
cygserver])],,
+             enable_cygserver=yes)
+AM_CONDITIONAL(BUILD_CYGSERVER, [test $enable_cygserver != "no"])
+
 AC_CHECK_PROGS([DOCBOOK2XTEXI], [docbook2x-texi db2x_docbook2texi])
 if test -z "$DOCBOOK2XTEXI" ; then
     if test "x$enable_doc" != "xno"; then
diff --git a/winsup/cygserver/Makefile.am b/winsup/cygserver/Makefile.am
index ec7a62240..efb578e53 100644
--- a/winsup/cygserver/Makefile.am
+++ b/winsup/cygserver/Makefile.am
@@ -12,7 +12,9 @@ cygserver_flags=$(cxxflags_common) -Wimplicit-fallthrough=5 
-Werror -DSYSCONFDIR
 AM_CXXFLAGS = $(CFLAGS)
 
 noinst_LIBRARIES = libcygserver.a
+if BUILD_CYGSERVER
 sbin_PROGRAMS = cygserver
+endif
 bin_SCRIPTS = cygserver-config
 
 cygserver_SOURCES = \
-- 
2.50.1.vfs.0.0

Attachment: v2-0001-Cygwin-cygserver-add-possibility-to-skip-cygserver-build.patch
Description: v2-0001-Cygwin-cygserver-add-possibility-to-skip-cygserver-build.patch

Reply via email to