aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadek Bartoň <radek.barton@microsoft.com>2025-06-21 22:56:58 +0200
committerJon Turney <jon.turney@dronecode.org.uk>2025-07-21 14:00:55 +0100
commit437d2d6862b47c6cf10c989706eddf55e5f41efd (patch)
treef73de4a6cb8684a7422dcc3c38195d82cdef3ca5
parente29e1cf75e9209bef7394402f817a050e101281d (diff)
downloadnewlib-437d2d6862b47c6cf10c989706eddf55e5f41efd.zip
newlib-437d2d6862b47c6cf10c989706eddf55e5f41efd.tar.gz
newlib-437d2d6862b47c6cf10c989706eddf55e5f41efd.tar.bz2
Cygwin: configure: add possibility to skip build of cygserver and utils
This patch adds configure options allowing to disable build of cygserver and Cygwin utilities. This is useful when one needs to build only cygwin1.dll and crt0.o with stage1 compiler that is not yet capable of linking executables as it is missing cygwin1.dll and crt0.o. Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
-rw-r--r--winsup/Makefile.am20
-rw-r--r--winsup/configure.ac12
-rw-r--r--winsup/cygserver/Makefile.am2
-rw-r--r--winsup/doc/faq-programming.xml17
4 files changed, 48 insertions, 3 deletions
diff --git a/winsup/Makefile.am b/winsup/Makefile.am
index 9efdd4c..877c4e6 100644
--- a/winsup/Makefile.am
+++ b/winsup/Makefile.am
@@ -14,10 +14,26 @@ cygdoc_DATA = \
CYGWIN_LICENSE \
COPYING
-SUBDIRS = cygwin cygserver utils testsuite
+SUBDIRS = cygwin testsuite
+
+if BUILD_CYGSERVER
+SUBDIRS += cygserver
+endif
+
+if BUILD_UTILS
+SUBDIRS += utils
+endif
if BUILD_DOC
SUBDIRS += doc
endif
-cygserver utils testsuite: cygwin
+testsuite: cygwin
+
+if BUILD_CYGSERVER
+cygserver: cygwin
+endif
+
+if BUILD_UTILS
+utils: cygwin
+endif
diff --git a/winsup/configure.ac b/winsup/configure.ac
index 18adf3d..e7ac814 100644
--- a/winsup/configure.ac
+++ b/winsup/configure.ac
@@ -83,6 +83,18 @@ AC_ARG_ENABLE(doc,
enable_doc=yes)
AM_CONDITIONAL(BUILD_DOC, [test $enable_doc != "no"])
+# Disabling build of cygserver and utils 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_ARG_ENABLE(utils,
+ [AS_HELP_STRING([--disable-utils], [do not build utils])],,
+ enable_utils=yes)
+AM_CONDITIONAL(BUILD_UTILS, [test $enable_utils != "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 ec7a622..efb578e 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 = \
diff --git a/winsup/doc/faq-programming.xml b/winsup/doc/faq-programming.xml
index 39610b9..ae9bdb8 100644
--- a/winsup/doc/faq-programming.xml
+++ b/winsup/doc/faq-programming.xml
@@ -698,8 +698,23 @@ Building these programs can be disabled with the <literal>--without-cross-bootst
option to <literal>configure</literal>.
</para>
+<para>
+Build of <literal>cygserver</literal> can be skipped with
+<literal>--disable-cygserver</literal> and build of other Cygwin utilities with
+<literal>--disable-utils</literal>.
+</para>
+
+<para>
+In combination, <literal>--disable-cygserver</literal>,
+<literal>--disable-dumper</literal>, <literal>--disable-utils</literal>
+and <literal>--without-cross-bootstrap</literal> allow building of just
+<literal>cygwin1.dll</literal> and <literal>crt0.o</literal> for a stage2
+compiler, when being built with stage1 compiler which does not support linking
+executables yet (because those files are missing).
+</para>
+
<!-- If you want to run the tests <literal>busybox</literal> and
- <literal>cygutils-extra<literal> are also required. -->
+ <literal>cygutils-extra</literal> are also required. -->
<para>
Building the documentation also requires the <literal>dblatex</literal>,