* 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

Reply via email to