public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-apps@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH setup 15/16] Put various shared subcomponents into a convenience library
Date: Fri,  8 Mar 2024 18:34:34 +0000	[thread overview]
Message-ID: <20240308183440.4263-16-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <20240308183440.4263-1-jon.turney@dronecode.org.uk>

* logging, settings, netio, iostream, decompressors, packagedb,
csu_util, hashes, signature checking, URL fetching, Exception class, ini
fetching and parsing, global state, version
---
 Makefile.am | 246 +++++++++++++++++++++++++++-------------------------
 1 file changed, 126 insertions(+), 120 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index def20a4..6ae5dd6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -37,6 +37,9 @@ iniparse_CXXFLAGS:=-Wno-free-nonheap-object
 
 noinst_PROGRAMS = @SETUP@$(EXEEXT) inilint
 
+noinst_LTLIBRARIES = \
+	libsetupcore.la
+
 EXTRA_DIST = \
 	CHANGES \
 	CONTRIBUTORS \
@@ -59,35 +62,15 @@ BUILT_SOURCES = \
 CLEANFILES = setup_version.c
 
 inilint_LDADD = \
-	libgetopt++/libgetopt++.la \
-	-lntdll -luuid
+	libsetupcore.la \
+	libgetopt++/libgetopt++.la
 
 inilint_SOURCES = \
-	filemanip.cc \
-	filemanip.h \
 	cli/CliParseFeedback.cc \
 	cli/CliGetUrlFeedback.cc \
 	cli/CliHashCheckFeedback.cc \
 	cli/CliFeedback.h \
-	LogSingleton.cc \
-	LogSingleton.h \
-	IniDBBuilder.h \
-	inilintmain.cc \
-	inilex.ll \
-	iniparse.yy \
-	io_stream.cc \
-	io_stream.h \
-	io_stream_file.cc \
-	io_stream_file.h \
-	mkdir.cc \
-	mkdir.h \
-	mklink2.cc \
-	mklink2.h \
-	PackageTrust.h \
-	String++.cc \
-	String++.h \
-	win32.cc \
-	win32.h
+	inilintmain.cc
 
 # Do not link directly with wininet, as it's vulnerable to sideloading/dll
 # hijacking. Instead we make and link with a delay-loading stub lib, so it's
@@ -116,19 +99,134 @@ WININET=wininet-delaylib.a
 EXTRA_@SETUP@_DEPENDENCIES=wininet-delaylib.a
 endif
 
-@SETUP@_LDADD = \
-	libgetopt++/libgetopt++.la \
+libsetupcore_la_SOURCES = \
+	ConnectionSetting.cc \
+	ConnectionSetting.h \
+	Exception.cc \
+	Exception.h \
+	IniDBBuilder.h \
+	IniDBBuilderPackage.cc \
+	IniDBBuilderPackage.h \
+	KeysSetting.cc \
+	KeysSetting.h \
+	LogFile.cc \
+	LogFile.h \
+	LogSingleton.cc \
+	LogSingleton.h \
+	PackageSpecification.cc \
+	PackageSpecification.h \
+	PackageTrust.h \
+	SiteSetting.cc \
+	SiteSetting.h \
+	SourceSetting.cc \
+	SourceSetting.h \
+	String++.cc \
+	String++.h \
+	UserSettings.cc \
+	UserSettings.h \
+	compactos.cc \
+	compactos.h \
+	compress.cc \
+	compress.h \
+	compress_bz.cc \
+	compress_bz.h \
+	compress_gz.cc \
+	compress_gz.h \
+	compress_xz.cc \
+	compress_xz.h \
+	compress_zstd.cc \
+	compress_zstd.h \
+	crypto.cc \
+	crypto.h \
+	csu_util/MD5Sum.cc \
+	csu_util/MD5Sum.h \
+	csu_util/rfc1738.cc \
+	csu_util/rfc1738.h \
+	csu_util/version_compare.cc \
+	csu_util/version_compare.h \
+	filemanip.cc \
+	filemanip.h \
+	geturl.cc \
+	geturl.h \
+	gpg-packet.cc \
+	gpg-packet.h \
+	ini.cc \
+	ini.h \
+	inilex.ll \
+	iniparse.yy \
+	io_stream.cc \
+	io_stream.h \
+	io_stream_memory.cc \
+	io_stream_memory.h \
+	libsolv.cc \
+	libsolv.h \
+	mkdir.cc \
+	mkdir.h \
+	mklink2.cc \
+	mklink2.h \
+	mount.cc \
+	netio.cc \
+	netio.h \
+	nio-ie5.cc \
+	nio-ie5.h \
+	package_db.cc \
+	package_db.h \
+	package_depends.cc \
+	package_depends.h \
+	package_meta.cc \
+	package_meta.h \
+	package_source.cc \
+	package_source.h \
+	package_version.h \
+	setup_version.c \
+	setup_version.h \
+	sha2.c \
+	sha2.h \
+	state.cc \
+	state.h \
+	win32.cc \
+	win32.h
+
+# warning: always link with mingwex (which gcc specs will cause us to link with
+# anyhow) before ntdll, to ensure we don't link with CRT functions (avaliable in
+# some versions of) the ntdll import lib which aren't available on XP.
+libsetupcore_la_LDFLAGS = \
 	$(LIBGCRYPT_LIBS) \
 	$(ZSTD_LIBS) \
 	$(LZMA_LIBS) \
 	$(BZ2_LIBS) \
 	$(ZLIB_LIBS) \
-	$(LIBSOLV_LIBS) -lregex \
+	$(LIBSOLV_LIBS) \
+	-lregex \
 	-lmingwex \
-	-lshlwapi -lcomctl32 -lole32 -lpsapi -luuid -lntdll $(WININET) -lws2_32 \
+	-lshlwapi \
+	-luuid \
+	-lntdll \
+	-lws2_32
+
+# because of a totally unnecessary "private registration" by static
+# constructors, these sources are completely unsuitable for putting in a library
+# (as the providers are not referenced and so aren't included in the final
+# link), so everything with needs them must include these objects
+IOSTREAM_PROVIDERS = \
+	io_stream_cygfile.cc \
+	io_stream_cygfile.h \
+	io_stream_file.cc \
+	io_stream_file.h
+
+@SETUP@_LDADD = \
+	libsetupcore.la \
+	libgetopt++/libgetopt++.la \
+	$(WININET) \
+	-lcomctl32 \
+	-lole32 \
+	-lpsapi \
 	-lmingw32 -lssp
+
 @SETUP@_LDFLAGS = -mwindows -Wc,-static -static-libtool-libs
+
 @SETUP@_SOURCES = \
+	$(IOSTREAM_PROVIDERS) \
 	actionlist.h \
 	AntiVirus.cc \
 	AntiVirus.h \
@@ -139,26 +237,10 @@ endif
 	archive_tar_file.cc \
 	choose.cc \
 	choose.h \
-	compactos.cc \
-	compactos.h \
-	compress.cc \
-	compress.h \
-	compress_bz.cc \
-	compress_bz.h \
-	compress_gz.cc \
-	compress_gz.h \
-	compress_xz.cc \
-	compress_xz.h \
-	compress_zstd.cc \
-	compress_zstd.h \
 	confirm.cc \
 	confirm.h \
-	ConnectionSetting.cc \
-	ConnectionSetting.h \
 	ControlAdjuster.cc \
 	ControlAdjuster.h \
-	crypto.cc \
-	crypto.h \
 	cyg-pubkey.h \
 	desktop.cc \
 	desktop.h \
@@ -168,83 +250,29 @@ endif
 	diskfull.h \
 	download.cc \
 	download.h \
-	Exception.cc \
-	Exception.h \
 	find.cc \
 	find.h \
 	FindVisitor.cc \
 	FindVisitor.h \
-	filemanip.cc \
-	filemanip.h \
 	fromcwd.cc \
 	Generic.h \
-	geturl.cc \
-	geturl.h \
-	gpg-packet.cc \
-	gpg-packet.h \
 	gui/GuiParseFeedback.cc \
 	gui/GuiGetNetAuth.cc \
 	gui/GuiGetNetAuth.h \
 	gui/GuiGetUrlFeedback.cc \
 	gui/GuiFeedback.h \
 	gui/GuiHashCheckFeedback.cc \
-	ini.cc \
-	ini.h \
-	IniDBBuilder.h \
-	IniDBBuilderPackage.cc \
-	IniDBBuilderPackage.h \
-	inilex.ll \
-	iniparse.yy \
 	Feedback.h \
 	install.cc \
-	io_stream.cc \
-	io_stream.h \
-	io_stream_cygfile.cc \
-	io_stream_cygfile.h \
-	io_stream_file.cc \
-	io_stream_file.h \
-	io_stream_memory.cc \
-	io_stream_memory.h \
-	IOStreamProvider.h \
-	KeysSetting.cc \
-	KeysSetting.h \
-	libsolv.cc \
-	libsolv.h \
 	ListView.cc \
 	ListView.h \
 	localdir.cc \
 	localdir.h \
-	LogFile.cc \
-	LogFile.h \
-	LogSingleton.cc \
-	LogSingleton.h \
 	main.cc \
-	mkdir.cc \
-	mkdir.h \
-	mklink2.cc \
-	mklink2.h \
-	mount.cc \
-	mount.h \
 	msg.cc \
 	msg.h \
 	net.cc \
 	net.h \
-	netio.cc \
-	netio.h \
-	nio-ie5.cc \
-	nio-ie5.h \
-	package_db.cc \
-	package_db.h \
-	package_depends.h \
-	package_depends.cc \
-	package_meta.cc \
-	package_meta.h \
-	package_source.cc \
-	package_source.h \
-	package_version.h \
-	PackageSpecification.cc \
-	PackageSpecification.h \
-	PackageTrust.h \
 	PickCategoryLine.cc \
 	PickCategoryLine.h \
 	PickPackageLine.cc \
@@ -269,38 +297,16 @@ endif
 	root.h \
 	script.cc \
 	script.h \
-	setup_version.h \
-	setup_version.c \
-	sha2.h \
-	sha2.c \
 	gui/SitePage.cc \
 	gui/SitePage.h \
-	SiteSetting.cc \
-	SiteSetting.h \
 	source.cc \
 	source.h \
-	SourceSetting.cc \
-	SourceSetting.h \
 	splash.cc \
 	splash.h \
-	state.cc \
-	state.h \
-	String++.cc \
-	String++.h \
 	threebar.cc \
 	threebar.h \
-	UserSettings.cc \
-	UserSettings.h \
-	win32.cc \
-	win32.h \
 	window.cc \
-	window.h \
-	csu_util/MD5Sum.cc \
-	csu_util/MD5Sum.h \
-	csu_util/rfc1738.cc \
-	csu_util/rfc1738.h \
-	csu_util/version_compare.cc \
-	csu_util/version_compare.h
+	window.h
 
 GITVER := $(shell cd $(srcdir) && git describe --match release_\* --abbrev=6 --dirty || echo "N/A")
 VER := $(subst release_,,$(GITVER))
-- 
2.43.0


  parent reply	other threads:[~2024-03-08 18:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 18:34 [PATCH setup 00/16] Groundwork for a GUI-less installation tool Jon Turney
2024-03-08 18:34 ` [PATCH setup 01/16] Drop forward declaration of non-existent class IniState Jon Turney
2024-03-08 18:34 ` [PATCH setup 02/16] Move setup_exts[] to the only place it's used Jon Turney
2024-03-08 18:34 ` [PATCH setup 03/16] Split GuiParseFeedback out from ini fetcher Jon Turney
2024-03-08 18:34 ` [PATCH setup 04/16] Split out site into SiteSettings and SitePage Jon Turney
2024-03-08 18:34 ` [PATCH setup 05/16] Don't call Antivirus::AtExit() directly from Logger::exit() Jon Turney
2024-03-08 18:34 ` [PATCH setup 06/16] Simplify invocation of UserSettings::open_settings() Jon Turney
2024-03-08 18:34 ` [PATCH setup 07/16] Split out URL fetching progress reporting Jon Turney
2024-03-08 18:34 ` [PATCH setup 08/16] Instantiate found_ini_list in ini.cc Jon Turney
2024-03-08 18:34 ` [PATCH setup 09/16] Move is_64bit to state Jon Turney
2024-03-08 18:34 ` [PATCH setup 10/16] Move setup.ini pathame components to ini.cc Jon Turney
2024-03-08 18:34 ` [PATCH setup 11/16] Drop hinstance global Jon Turney
2024-03-08 18:34 ` [PATCH setup 12/16] Spit out GetNetAuth from NetIO Jon Turney
2024-03-08 18:34 ` [PATCH setup 13/16] Split out hash checking progress reporting Jon Turney
2024-03-08 18:34 ` [PATCH setup 14/16] Push check_for_cached into package_source Jon Turney
2024-03-08 18:34 ` Jon Turney [this message]
2024-03-08 18:34 ` [PATCH setup 16/16] Add beginnings of a command line installation tool Jon Turney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240308183440.4263-16-jon.turney@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).