From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from re-prd-fep-041.btinternet.com (mailomta20-re.btinternet.com [213.120.69.113]) by sourceware.org (Postfix) with ESMTPS id 908DD385E45E for ; Fri, 8 Mar 2024 18:36:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 908DD385E45E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dronecode.org.uk ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 908DD385E45E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=213.120.69.113 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709923006; cv=none; b=PWbwtBUQmJw+SG/XjaqfzE1HbAiVg1dZs/DQTa3iAtOXEjgC7q7Gax2gaHIRjrtFA4XRHN48vtt3tYS+F7BYL0usY67/XRrEbJ/2hK5UOKeCKTasl/qK6IJchbBwuNZi9p89GY2TvyWVX9qdzlmS/5LhaIwpXDm91uAkj5kINp4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709923006; c=relaxed/simple; bh=8pw1IRKoURpuGO8XSFn+Y44hPEwg+B3POiu7/eO3CF8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=dptJldPRysQVYW+PG8k6A1KUoIujJ9Y7n6JpWNysb+PsLqi8mDairCYCYgtcGCVK5bea53Iw0XQTbIroDJW91+XpaHYC+5I60cUXb44JBpLewxRKK7vexlevM3vSmju9Q+M+VgLj0QHxygZ77DeK0ZjsmZ3OJqd+UHzoHBq5wuY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from re-prd-rgout-004.btmx-prd.synchronoss.net ([10.2.54.7]) by re-prd-fep-041.btinternet.com with ESMTP id <20240308183643.UJQD21578.re-prd-fep-041.btinternet.com@re-prd-rgout-004.btmx-prd.synchronoss.net>; Fri, 8 Mar 2024 18:36:43 +0000 Authentication-Results: btinternet.com; none X-SNCR-Rigid: 6577B87C0AB06C68 X-Originating-IP: [81.153.98.185] X-OWM-Source-IP: 81.153.98.185 X-OWM-Env-Sender: jon.turney@dronecode.org.uk X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvledrieehgdduudegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecunecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheplfhonhcuvfhurhhnvgihuceojhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukheqnecuggftrfgrthhtvghrnhepleeitdejhfdtveekheeugeffgeevfedtjeejveefhfeiffefkedtvdetheehieejnecukfhppeekuddrudehfedrleekrddukeehnecuvehluhhsthgvrhfuihiivgepjeenucfrrghrrghmpehhvghloheplhhotggrlhhhohhsthdrlhhotggrlhguohhmrghinhdpihhnvghtpeekuddrudehfedrleekrddukeehpdhmrghilhhfrhhomhepjhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukhdpnhgspghrtghpthhtohepvddprhgtphhtthhopegthihgfihinhdqrghpphhssegthihgfihinhdrtghomhdprhgtphhtthhopehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkpdhrvghvkffrpehhohhsthekuddqudehfedqleekqddukeehrdhrrghnghgvkeduqdduheefrdgsthgtvghnthhrrghlphhluhhsrdgtohhmpdgruhhthhgpuhhsvghrpehjohhnthhurhhnvgihsegsthhinhhtvghrnhgvthdrtghomhdpghgvohfk rfepifeupdfovfetjfhoshhtpehrvgdqphhrugdqrhhgohhuthdqtddtge X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from localhost.localdomain (81.153.98.185) by re-prd-rgout-004.btmx-prd.synchronoss.net (authenticated as jonturney@btinternet.com) id 6577B87C0AB06C68; Fri, 8 Mar 2024 18:36:43 +0000 From: Jon Turney To: cygwin-apps@cygwin.com Cc: Jon Turney Subject: [PATCH setup 15/16] Put various shared subcomponents into a convenience library Date: Fri, 8 Mar 2024 18:34:34 +0000 Message-ID: <20240308183440.4263-16-jon.turney@dronecode.org.uk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240308183440.4263-1-jon.turney@dronecode.org.uk> References: <20240308183440.4263-1-jon.turney@dronecode.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * 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