[smuxi: 16/37] autotools: use log4net binary bundling if macOS (Darwin)




commit bdbfb267d4bf66a8d0e59d0d85630379524797e6
Author: Andres G. Aragoneses <knocte gmail com>
Date:   Sat Apr 11 00:42:09 2020 +0800

    autotools: use log4net binary bundling if macOS (Darwin)

 configure.ac                         |  7 ++++++-
 src/Common/Makefile.am               | 12 ++++++++----
 src/Engine-IRC/Makefile.am           | 11 ++++++++---
 src/Engine-JabbR/Makefile.am         |  9 ++++++++-
 src/Engine-MessageBuffer/Makefile.am |  9 ++++++++-
 src/Engine-Twitter/Makefile.am       |  9 ++++++++-
 src/Engine-XMPP/Makefile.am          |  9 ++++++++-
 src/Engine/Makefile.am               | 11 ++++++++---
 src/Frontend-GNOME-IRC/Makefile.am   | 11 ++++++++---
 src/Frontend-GNOME/Makefile.am       |  9 ++++++++-
 src/Frontend/Makefile.am             | 11 ++++++++---
 src/Server/Makefile.am               | 11 ++++++++---
 12 files changed, 94 insertions(+), 25 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 78cf5c73..699a7f95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -242,7 +242,12 @@ fi
 AC_SUBST(XBUILD_FLAGS)
 
 # Required Libraries   
-PKG_CHECK_MODULES([LOG4NET], [log4net])
+if test "x$(uname)" != "xDarwin"; then
+       PKG_CHECK_MODULES([LOG4NET], [log4net])
+       AM_CONDITIONAL([BUNDLE_LOG4NET], false)
+else
+       AM_CONDITIONAL([BUNDLE_LOG4NET], true)
+fi
 PKG_CHECK_MODULES([NUNIT], [nunit])
 
 PKG_CHECK_EXISTS([nini-1.1], FOUND_NINI=yes, FOUND_NINI=no)
diff --git a/src/Common/Makefile.am b/src/Common/Makefile.am
index 38576da9..120d8cc5 100644
--- a/src/Common/Makefile.am
+++ b/src/Common/Makefile.am
@@ -13,8 +13,6 @@ COMPILE_TARGET = library
 PROJECT_REFERENCES = 
 BUILD_DIR = ../../bin/release
 
-LOG4NET_DLL_SOURCE=../../lib/log4net.dll
-
 endif
 
 if ENABLE_DEBUG
@@ -31,10 +29,16 @@ SMUXI_COMMON_DLL=$(ASSEMBLY)
 SMUXI_COMMON_DLL_SOURCE=$(ASSEMBLY)
 SMUXI_COMMON_DLL_MDB=$(ASSEMBLY_MDB)
 SMUXI_COMMON_DLL_MDB_SOURCE=$(ASSEMBLY_MDB)
-LOG4NET_DLL_SOURCE=../../lib/log4net.dll
 
 endif
 
+if BUNDLE_LOG4NET
+LOG4NET_DLL_SOURCE=../../lib/log4net.dll
+LOG4NET_REF_LIBS=-r:$(LOG4NET_DLL_SOURCE)
+else
+LOG4NET_REF_LIBS=$(LOG4NET_LIBS)
+endif
+
 AL=al2
 SATELLITE_ASSEMBLY_NAME=.resources.dll
 
@@ -104,7 +108,7 @@ $(build_resx_resources) : %.resources: %.resx
 
 $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) 
$(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list)
        mkdir -p $(dir $(ASSEMBLY))
-       $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) 
$(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_LIBS)
+       $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) 
$(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_REF_LIBS)
 
 generate-emojione:
        wget -O $(top_srcdir)/lib/emoji_raw.json 
https://raw.githubusercontent.com/emojione/emojione/2.2.7/emoji.json
diff --git a/src/Engine-IRC/Makefile.am b/src/Engine-IRC/Makefile.am
index 8ed53dda..b4fbc3ca 100644
--- a/src/Engine-IRC/Makefile.am
+++ b/src/Engine-IRC/Makefile.am
@@ -15,7 +15,6 @@ PROJECT_REFERENCES =  \
 BUILD_DIR = ../../bin/release
 
 SMUXI_ENGINE_DLL_MDB=
-LOG4NET_DLL_SOURCE=../../lib/log4net.dll
 NINI_DLL_SOURCE=../../lib/Nini.dll
 SMUXI_ENGINE_DLL_SOURCE=../../bin/release/smuxi-engine.dll
 SMUXI_COMMON_DLL_SOURCE=../../bin/release/smuxi-common.dll
@@ -35,13 +34,19 @@ BUILD_DIR = ../../bin/debug
 
 SMUXI_ENGINE_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine.dll.mdb
 SMUXI_ENGINE_DLL_MDB=$(BUILD_DIR)/smuxi-engine.dll.mdb
-LOG4NET_DLL_SOURCE=../../lib/log4net.dll
 NINI_DLL_SOURCE=../../lib/Nini.dll
 SMUXI_ENGINE_DLL_SOURCE=../../bin/debug/smuxi-engine.dll
 SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll
 
 endif
 
+if BUNDLE_LOG4NET
+LOG4NET_DLL_SOURCE=../../lib/log4net.dll
+LOG4NET_REF_LIBS=-r:$(LOG4NET_DLL_SOURCE)
+else
+LOG4NET_REF_LIBS=$(LOG4NET_LIBS)
+endif
+
 AL=al2
 SATELLITE_ASSEMBLY_NAME=.resources.dll
 
@@ -80,7 +85,7 @@ REFERENCES =  \
        System \
        System.Core \
        Mono.Posix \
-       $(LOG4NET_LIBS)
+       $(LOG4NET_REF_LIBS)
 
 DLL_REFERENCES = \
     $(BUILD_DIR)/Meebey.SmartIrc4net.dll
diff --git a/src/Engine-JabbR/Makefile.am b/src/Engine-JabbR/Makefile.am
index 140958eb..7fd4b438 100644
--- a/src/Engine-JabbR/Makefile.am
+++ b/src/Engine-JabbR/Makefile.am
@@ -1,3 +1,10 @@
+if BUNDLE_LOG4NET
+LOG4NET_DLL_SOURCE=../../lib/log4net.dll
+LOG4NET_REF_LIBS=-r:$(LOG4NET_DLL_SOURCE)
+else
+LOG4NET_REF_LIBS=$(LOG4NET_LIBS)
+endif
+
 TARGET_DIR = $(top_builddir)/bin/$(PROFILE)
 ASSEMBLY_NAME = smuxi-engine-jabbr
 ASSEMBLY_FILENAME = $(ASSEMBLY_NAME).dll
@@ -13,7 +20,7 @@ REFERENCES = \
        System \
        System.Web \
        Mono.Posix \
-       $(LOG4NET_LIBS)
+       $(LOG4NET_REF_LIBS)
 
 DLL_REFERENCES = \
        $(TARGET_DIR)/smuxi-common.dll \
diff --git a/src/Engine-MessageBuffer/Makefile.am b/src/Engine-MessageBuffer/Makefile.am
index b378a534..61d0f48a 100644
--- a/src/Engine-MessageBuffer/Makefile.am
+++ b/src/Engine-MessageBuffer/Makefile.am
@@ -1,3 +1,10 @@
+if BUNDLE_LOG4NET
+LOG4NET_DLL_SOURCE=../../lib/log4net.dll
+LOG4NET_REF_LIBS=-r:$(LOG4NET_DLL_SOURCE)
+else
+LOG4NET_REF_LIBS=$(LOG4NET_LIBS)
+endif
+
 TARGET_DIR = $(top_builddir)/bin/$(PROFILE)
 BIN_WRAPPER = smuxi-message-buffer
 ASSEMBLY_NAME = smuxi-message-buffer
@@ -15,7 +22,7 @@ REFERENCES = \
        System \
        System.Core \
        Mono.Posix \
-       $(LOG4NET_LIBS)
+       $(LOG4NET_REF_LIBS)
 
 DLL_REFERENCES = \
        $(TARGET_DIR)/smuxi-common.dll \
diff --git a/src/Engine-Twitter/Makefile.am b/src/Engine-Twitter/Makefile.am
index ee35f335..37a0231f 100644
--- a/src/Engine-Twitter/Makefile.am
+++ b/src/Engine-Twitter/Makefile.am
@@ -1,3 +1,10 @@
+if BUNDLE_LOG4NET
+LOG4NET_DLL_SOURCE=../../lib/log4net.dll
+LOG4NET_REF_LIBS=-r:$(LOG4NET_DLL_SOURCE)
+else
+LOG4NET_REF_LIBS=$(LOG4NET_LIBS)
+endif
+
 TARGET_DIR = $(top_builddir)/bin/$(PROFILE)
 ASSEMBLY_NAME = smuxi-engine-twitter
 ASSEMBLY_FILENAME = $(ASSEMBLY_NAME).dll
@@ -11,7 +18,7 @@ SOURCES = \
                Protocols/Twitter/TwitterMessageBuilder.cs \
                Protocols/Twitter/TwitterSearchStream.cs
 
-REFERENCES =           $(LOG4NET_LIBS) \
+REFERENCES =           $(LOG4NET_REF_LIBS) \
                        $(SMARTIRC4NET_LIBS) \
                        System.Web \
                        System.Core
diff --git a/src/Engine-XMPP/Makefile.am b/src/Engine-XMPP/Makefile.am
index f66ee977..3eb062c8 100644
--- a/src/Engine-XMPP/Makefile.am
+++ b/src/Engine-XMPP/Makefile.am
@@ -1,3 +1,10 @@
+if BUNDLE_LOG4NET
+LOG4NET_DLL_SOURCE=../../lib/log4net.dll
+LOG4NET_REF_LIBS=-r:$(LOG4NET_DLL_SOURCE)
+else
+LOG4NET_REF_LIBS=$(LOG4NET_LIBS)
+endif
+
 TARGET_DIR = $(top_builddir)/bin/$(PROFILE)
 ASSEMBLY_NAME = smuxi-engine-xmpp
 ASSEMBLY_FILENAME = $(ASSEMBLY_NAME).dll
@@ -15,7 +22,7 @@ REFERENCES = \
        System \
        System.Core \
        Mono.Posix \
-       $(LOG4NET_LIBS)
+       $(LOG4NET_REF_LIBS)
 
 DLL_REFERENCES = \
        $(TARGET_DIR)/smuxi-common.dll \
diff --git a/src/Engine/Makefile.am b/src/Engine/Makefile.am
index 2168cec2..b2e62bea 100644
--- a/src/Engine/Makefile.am
+++ b/src/Engine/Makefile.am
@@ -14,7 +14,6 @@ PROJECT_REFERENCES =  \
        ../../bin/release/smuxi-common.dll
 BUILD_DIR = ../../bin/release
 
-LOG4NET_DLL_SOURCE=../../lib/log4net.dll
 SMUXI_COMMON_DLL_SOURCE=../../bin/release/smuxi-common.dll
 
 endif
@@ -30,11 +29,17 @@ PROJECT_REFERENCES =  \
        ../../bin/debug/smuxi-common.dll
 BUILD_DIR = ../../bin/debug
 
-LOG4NET_DLL_SOURCE=../../lib/log4net.dll
 SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll
 
 endif
 
+if BUNDLE_LOG4NET
+LOG4NET_DLL_SOURCE=../../lib/log4net.dll
+LOG4NET_REF_LIBS=-r:$(LOG4NET_DLL_SOURCE)
+else
+LOG4NET_REF_LIBS=$(LOG4NET_LIBS)
+endif
+
 AL=al2
 SATELLITE_ASSEMBLY_NAME=.resources.dll
 
@@ -135,7 +140,7 @@ REFERENCES =  \
        Mono.Posix \
        Mono.Data.Sqlite \
        $(NINI_LIBS) \
-       $(LOG4NET_LIBS) \
+       $(LOG4NET_REF_LIBS) \
        $(DB4O_LIBS) \
        $(DB4O_INCLUDED_LIBS)
 
diff --git a/src/Frontend-GNOME-IRC/Makefile.am b/src/Frontend-GNOME-IRC/Makefile.am
index c0a777da..bc221297 100644
--- a/src/Frontend-GNOME-IRC/Makefile.am
+++ b/src/Frontend-GNOME-IRC/Makefile.am
@@ -27,7 +27,6 @@ SMUXI_ENGINE_DLL_MDB=
 SMUXI_FRONTEND_DLL_MDB=
 SMUXI_FRONTEND_GNOME_EXE_SOURCE=../../bin/release/smuxi-frontend-gnome.exe
 NINI_DLL_SOURCE=../../lib/Nini.dll
-LOG4NET_DLL_SOURCE=../../lib/log4net.dll
 SMUXI_ENGINE_DLL_SOURCE=../../bin/release/smuxi-engine.dll
 
 endif
@@ -60,11 +59,17 @@ SMUXI_FRONTEND_DLL_MDB_SOURCE=../../bin/debug/smuxi-frontend.dll.mdb
 SMUXI_FRONTEND_DLL_MDB=$(BUILD_DIR)/smuxi-frontend.dll.mdb
 SMUXI_FRONTEND_GNOME_EXE_SOURCE=../../bin/debug/smuxi-frontend-gnome.exe
 NINI_DLL_SOURCE=../../lib/Nini.dll
-LOG4NET_DLL_SOURCE=../../lib/log4net.dll
 SMUXI_ENGINE_DLL_SOURCE=../../bin/debug/smuxi-engine.dll
 
 endif
 
+if BUNDLE_LOG4NET
+LOG4NET_DLL_SOURCE=../../lib/log4net.dll
+LOG4NET_REF_LIBS=-r:$(LOG4NET_DLL_SOURCE)
+else
+LOG4NET_REF_LIBS=$(LOG4NET_LIBS)
+endif
+
 AL=al2
 SATELLITE_ASSEMBLY_NAME=.resources.dll
 
@@ -138,4 +143,4 @@ $(build_resx_resources) : %.resources: %.resx
 
 $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) 
$(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list)
        mkdir -p $(dir $(ASSEMBLY))
-       $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) 
$(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_LIBS)
+       $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) 
$(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_REF_LIBS)
diff --git a/src/Frontend-GNOME/Makefile.am b/src/Frontend-GNOME/Makefile.am
index ce03981c..2adf6862 100644
--- a/src/Frontend-GNOME/Makefile.am
+++ b/src/Frontend-GNOME/Makefile.am
@@ -70,6 +70,13 @@ PROJECT_REFERENCES =  \
 BUILD_DIR = ../../bin/debug
 
 LOG4NET_DLL_SOURCE=../../lib/log4net.dll
+
+if BUNDLE_LOG4NET
+LOG4NET_REF_LIBS=-r:$(LOG4NET_DLL_SOURCE)
+else
+LOG4NET_REF_LIBS=$(LOG4NET_LIBS)
+endif
+
 SMUXI_ENGINE_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine.dll.mdb
 SMUXI_ENGINE_DLL_MDB=$(BUILD_DIR)/smuxi-engine.dll.mdb
 NINI_DLL_SOURCE=../../lib/Nini.dll
@@ -242,7 +249,7 @@ REFERENCES =  \
        $(GLADE_SHARP_20_LIBS) \
        $(GTK_SHARP_20_LIBS) \
        $(GIO_SHARP_LIBS) \
-       $(LOG4NET_LIBS) \
+       $(LOG4NET_REF_LIBS) \
        $(INDICATE_SHARP_LIBS) \
        $(MESSAGINGMENU_SHARP_LIBS) \
        $(MESSAGINGMENU_SHARP_INCLUDED_LIBS) \
diff --git a/src/Frontend/Makefile.am b/src/Frontend/Makefile.am
index 788b278c..1ae4bf0e 100644
--- a/src/Frontend/Makefile.am
+++ b/src/Frontend/Makefile.am
@@ -14,7 +14,6 @@ PROJECT_REFERENCES =  \
        ../../bin/release/smuxi-common.dll
 BUILD_DIR = ../../bin/release
 
-LOG4NET_DLL_SOURCE=../../lib/log4net.dll
 SMUXI_ENGINE_DLL_MDB=
 NINI_DLL_SOURCE=../../lib/Nini.dll
 SMUXI_ENGINE_DLL_SOURCE=../../bin/release/smuxi-engine.dll
@@ -34,7 +33,6 @@ PROJECT_REFERENCES =  \
        ../../bin/debug/smuxi-common.dll
 BUILD_DIR = ../../bin/debug
 
-LOG4NET_DLL_SOURCE=../../lib/log4net.dll
 SMUXI_ENGINE_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine.dll.mdb
 SMUXI_ENGINE_DLL_MDB=$(BUILD_DIR)/smuxi-engine.dll.mdb
 NINI_DLL_SOURCE=../../lib/Nini.dll
@@ -43,6 +41,13 @@ SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll
 
 endif
 
+if BUNDLE_LOG4NET
+LOG4NET_DLL_SOURCE=../../lib/log4net.dll
+LOG4NET_REF_LIBS=-r:$(LOG4NET_DLL_SOURCE)
+else
+LOG4NET_REF_LIBS=$(LOG4NET_LIBS)
+endif
+
 AL=al2
 SATELLITE_ASSEMBLY_NAME=.resources.dll
 
@@ -112,4 +117,4 @@ $(build_resx_resources) : %.resources: %.resx
 
 $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) 
$(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list)
        mkdir -p $(dir $(ASSEMBLY))
-       $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) 
$(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_LIBS)
+       $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) 
$(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_REF_LIBS)
diff --git a/src/Server/Makefile.am b/src/Server/Makefile.am
index fc054d44..532f359c 100644
--- a/src/Server/Makefile.am
+++ b/src/Server/Makefile.am
@@ -19,7 +19,6 @@ PROJECT_REFERENCES =  \
        ../../bin/release/smuxi-engine.dll
 BUILD_DIR = ../../bin/release
 
-LOG4NET_DLL_SOURCE=../../lib/log4net.dll
 SMUXI_ENGINE_DLL_MDB=
 NINI_DLL_SOURCE=../../lib/Nini.dll
 SMUXI_ENGINE_DLL_SOURCE=../../bin/release/smuxi-engine.dll
@@ -40,7 +39,6 @@ PROJECT_REFERENCES =  \
        ../../bin/debug/smuxi-engine.dll
 BUILD_DIR = ../../bin/debug
 
-LOG4NET_DLL_SOURCE=../../lib/log4net.dll
 SMUXI_ENGINE_DLL_MDB_SOURCE=../../bin/debug/smuxi-engine.dll.mdb
 SMUXI_ENGINE_DLL_MDB=$(BUILD_DIR)/smuxi-engine.dll.mdb
 NINI_DLL_SOURCE=../../lib/Nini.dll
@@ -50,6 +48,13 @@ SMUXI_COMMON_DLL_SOURCE=../../bin/debug/smuxi-common.dll
 
 endif
 
+if BUNDLE_LOG4NET
+LOG4NET_DLL_SOURCE=../../lib/log4net.dll
+LOG4NET_REF_LIBS=-r:$(LOG4NET_DLL_SOURCE)
+else
+LOG4NET_REF_LIBS=$(LOG4NET_LIBS)
+endif
+
 AL=al2
 SATELLITE_ASSEMBLY_NAME=.resources.dll
 
@@ -112,4 +117,4 @@ $(build_resx_resources) : %.resources: %.resx
 
 $(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) 
$(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list)
        mkdir -p $(dir $(ASSEMBLY))
-       $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) 
$(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_LIBS)
+       $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) 
$(build_sources_embed) $(build_resources_embed) $(build_references_ref) $(LOG4NET_REF_LIBS)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]