[Libreoffice-commits] core.git: canvas/Executable_canvasdemo.mk desktop/CppunitTest_desktop_app.mk desktop/Library_sofficeapp.mk solenv/gbuild svx/Executable_gengal.mk vcl/Executable_icontest.mk vcl/Executable_mtfdemo.mk vcl/Executable_ui-previewer.mk vcl/Executable_vcldemo.mk vcl/Executable_visualbackendtest.mk

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Wed May 26 20:51:52 UTC 2021


 canvas/Executable_canvasdemo.mk     |   16 +---------------
 desktop/CppunitTest_desktop_app.mk  |   17 ++---------------
 desktop/Library_sofficeapp.mk       |   28 ++--------------------------
 solenv/gbuild/CppunitTest.mk        |    2 ++
 solenv/gbuild/Executable.mk         |    2 ++
 solenv/gbuild/Library.mk            |    2 ++
 solenv/gbuild/LinkTarget.mk         |   23 +++++++++++++++++++++++
 svx/Executable_gengal.mk            |   26 ++------------------------
 vcl/Executable_icontest.mk          |   19 ++-----------------
 vcl/Executable_mtfdemo.mk           |   18 ++----------------
 vcl/Executable_ui-previewer.mk      |   18 ++----------------
 vcl/Executable_vcldemo.mk           |   18 ++----------------
 vcl/Executable_visualbackendtest.mk |   19 ++-----------------
 13 files changed, 46 insertions(+), 162 deletions(-)

New commits:
commit c22f23556d03e1ac0c8be7a79597c822b7e29fc9
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Wed May 26 07:13:15 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Wed May 26 22:51:05 2021 +0200

    gbuild: Handle glxtest + vclmain usage via macros
    
    Use a macro to do the same checks for all Executable with glxtest
    or vclmain usage. Both are static libraries, so every user has the
    same dependencies. Introduces:
    
    * gb_Executable_use_vclmain
    * gb_Executable_use_glxtest
    
    Change-Id: Ib80b4e7c6f5078d47ad8f1ec5708a7174415f705
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116145
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/canvas/Executable_canvasdemo.mk b/canvas/Executable_canvasdemo.mk
index 8af599ff1760..e47ae11dd13f 100644
--- a/canvas/Executable_canvasdemo.mk
+++ b/canvas/Executable_canvasdemo.mk
@@ -31,26 +31,12 @@ $(eval $(call gb_Executable_use_libraries,canvasdemo,\
     tl \
     sal \
     salhelper \
-    vcl \
 ))
 
 $(eval $(call gb_Executable_add_exception_objects,canvasdemo,\
     canvas/workben/canvasdemo \
 ))
 
-$(eval $(call gb_Executable_use_static_libraries,canvasdemo,\
-    vclmain \
-))
-
-ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
-$(eval $(call gb_Executable_add_libs,canvasdemo,\
-    -lm $(DLOPEN_LIBS) \
-    -lX11 \
-))
-
-$(eval $(call gb_Executable_use_static_libraries,canvasdemo,\
-    glxtest \
-))
-endif
+$(eval $(call gb_Executable_use_vclmain,canvasdemo))
 
 # vim: set noet sw=4 ts=4:
diff --git a/desktop/CppunitTest_desktop_app.mk b/desktop/CppunitTest_desktop_app.mk
index 15b681cef048..ee5c1247cc91 100644
--- a/desktop/CppunitTest_desktop_app.mk
+++ b/desktop/CppunitTest_desktop_app.mk
@@ -47,9 +47,10 @@ $(eval $(call gb_CppunitTest_use_libraries,desktop_app, \
     tl \
     ucbhelper \
     utl \
-    vcl \
 ))
 
+$(eval $(call gb_CppunitTest_use_glxtest,desktop_app,-lm))
+
 ifeq ($(OS),WNT)
 $(eval $(call gb_CppunitTest_use_static_libraries,desktop_app,\
     $(if $(ENABLE_ONLINE_UPDATE_MAR),\
@@ -57,20 +58,6 @@ $(eval $(call gb_CppunitTest_use_static_libraries,desktop_app,\
 ))
 endif
 
-
-ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
-ifeq ($(USING_X11),TRUE)
-$(eval $(call gb_CppunitTest_use_static_libraries,desktop_app,\
-    glxtest \
-))
-endif
-
-$(eval $(call gb_CppunitTest_add_libs,desktop_app,\
-	-lm $(DLOPEN_LIBS) \
-    -lX11 \
-))
-endif
-
 $(eval $(call gb_CppunitTest_use_library_objects,desktop_app, \
     sofficeapp \
 ))
diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index fd4dc5ccaa33..c9785eb059cf 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -16,12 +16,6 @@ $(eval $(call gb_Library_set_include,sofficeapp,\
     -I$(SRCDIR)/desktop/source/deployment/inc \
 ))
 
-$(eval $(call gb_Library_add_libs,sofficeapp,\
-    $(if $(filter LINUX %BSD SOLARIS, $(OS)), \
-        $(DLOPEN_LIBS) \
-    ) \
-))
-
 $(eval $(call gb_Library_use_externals,sofficeapp, \
 	$(if $(ENABLE_BREAKPAD),breakpad) \
 	$(if $(filter OPENCL,$(BUILD_TYPE)),clew) \
@@ -79,9 +73,10 @@ $(eval $(call gb_Library_use_libraries,sofficeapp,\
     tl \
     ucbhelper \
     utl \
-    vcl \
 ))
 
+$(eval $(call gb_Library_use_glxtest,sofficeapp,-lm))
+
 ifeq ($(OS),WNT)
 $(eval $(call gb_Library_use_static_libraries,sofficeapp,\
     $(if $(ENABLE_ONLINE_UPDATE_MAR),\
@@ -132,25 +127,6 @@ $(eval $(call gb_Library_add_exception_objects,sofficeapp,\
     desktop/source/migration/migration \
 ))
 
-ifeq ($(DISABLE_GUI),TRUE)
-$(eval $(call gb_Library_add_libs,sofficeapp,\
-	-lm $(DLOPEN_LIBS) \
-))
-else
-ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
-ifeq ($(USING_X11),TRUE)
-$(eval $(call gb_Library_use_static_libraries,sofficeapp,\
-    glxtest \
-))
-endif
-
-$(eval $(call gb_Library_add_libs,sofficeapp,\
-	-lm $(DLOPEN_LIBS) \
-    -lX11 \
-))
-endif
-endif
-
 # LibreOfficeKit bits
 ifneq ($(filter $(OS),ANDROID iOS MACOSX WNT),)
 $(eval $(call gb_Library_add_exception_objects,sofficeapp,\
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index 53a8831e2ff0..6877ec5ac792 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -495,5 +495,7 @@ gb_CppunitTest_set_external_code = $(call gb_CppunitTest__forward_to_Linktarget,
 gb_CppunitTest_set_generated_cxx_suffix = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
 gb_CppunitTest_use_clang = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
 gb_CppunitTest_set_clang_precompiled_header = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
+gb_CppunitTest_use_glxtest = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
+gb_CppunitTest_use_vclmain = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
 
 # vim: set noet sw=4:
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index 66b44e156904..70879bb9eb8c 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -152,6 +152,8 @@ gb_Executable_set_external_code = $(call gb_Executable__forward_to_Linktarget,$(
 gb_Executable_set_generated_cxx_suffix = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3))
 gb_Executable_use_clang = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3))
 gb_Executable_set_clang_precompiled_header = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3))
+gb_Executable_use_glxtest = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3))
+gb_Executable_use_vclmain = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3))
 
 # Run-time use
 
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 1973249f5db4..77b58c7e99db 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -238,5 +238,7 @@ gb_Library_set_external_code = $(call gb_Library__forward_to_Linktarget,$(0),$(1
 gb_Library_set_generated_cxx_suffix = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3))
 gb_Library_use_clang = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3))
 gb_Library_set_clang_precompiled_header = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3))
+gb_Library_use_glxtest = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3))
+gb_Library_use_vclmain = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3))
 
 # vim: set noet sw=4:
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 6cd8719f91b7..d9d6d07a1349 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -1789,5 +1789,28 @@ $(call gb_LinkTarget_get_target,$(1)) : T_USE_LD := $(or $(CLANG_USE_LD),$(USE_L
 
 endef
 
+# call gb_LinkTarget_use_glxtest,linktarget,add_libs
+define gb_LinkTarget_use_glxtest
+$(call gb_LinkTarget_use_libraries,$(1),vcl)
+
+ifeq (,$(DISABLE_DYNLOADING))
+$(call gb_LinkTarget_add_libs,$(1),$(DLOPEN_LIBS))
+endif
+
+ifeq (,$(DISABLE_GUI))
+ifeq ($(USING_X11),TRUE)
+$(call gb_LinkTarget_add_libs,$(1),-lX11 $(2))
+$(call gb_LinkTarget_use_static_libraries,$(1),glxtest)
+endif
+endif
+
+endef # gb_LinkTarget_use_glxtest
+
+# call gb_LinkTarget_use_vclmain,linktarget,add_libs
+define gb_LinkTarget_use_vclmain
+$(call gb_LinkTarget_use_glxtest,$(1),$(2))
+$(call gb_LinkTarget_use_static_libraries,$(1),vclmain)
+
+endef # gb_LinkTarget_use_vclmain
 
 # vim: set noet sw=4:
diff --git a/svx/Executable_gengal.mk b/svx/Executable_gengal.mk
index 1ec8841c1ab3..fdf3eb3843bc 100644
--- a/svx/Executable_gengal.mk
+++ b/svx/Executable_gengal.mk
@@ -44,18 +44,15 @@ $(eval $(call gb_Executable_use_libraries,gengal,\
     cppu \
     cppuhelper \
     utl \
-    vcl \
     svxcore \
 ))
 
+$(eval $(call gb_Executable_use_vclmain,gengal))
+
 $(eval $(call gb_Executable_add_exception_objects,gengal,\
     svx/source/gengal/gengal \
 ))
 
-$(eval $(call gb_Executable_use_static_libraries,gengal,\
-    vclmain \
-))
-
 ifeq ($(OS),WNT)
 $(eval $(call gb_Executable_use_system_win32_libs,gengal,\
 	kernel32 \
@@ -65,25 +62,6 @@ $(eval $(call gb_Executable_use_system_win32_libs,gengal,\
 ))
 endif
 
-ifeq ($(DISABLE_GUI),TRUE)
-$(eval $(call gb_Executable_add_libs,gengal,\
-	$(DLOPEN_LIBS) \
-))
-else
-ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
-$(eval $(call gb_Executable_add_libs,gengal,\
-	$(DLOPEN_LIBS) \
-    -lX11 \
-))
-
-ifeq ($(USING_X11),TRUE)
-$(eval $(call gb_Executable_use_static_libraries,gengal,\
-	glxtest \
-))
-endif
-endif
-endif
-
 $(eval $(call gb_Executable_add_default_nativeres,gengal))
 
 # vim: set noet sw=4 ts=4:
diff --git a/vcl/Executable_icontest.mk b/vcl/Executable_icontest.mk
index 78a10ccc6c78..6fb4a4648614 100644
--- a/vcl/Executable_icontest.mk
+++ b/vcl/Executable_icontest.mk
@@ -34,22 +34,6 @@ $(eval $(call gb_Executable_use_api,icontest,\
     udkapi \
 ))
 
-$(eval $(call gb_Executable_use_static_libraries,icontest,\
-    vclmain \
-))
-
-ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
-$(eval $(call gb_Executable_add_libs,icontest,\
-	-lm $(DLOPEN_LIBS) \
-    -lX11 \
-))
-
-$(eval $(call gb_Executable_use_static_libraries,icontest,\
-	glxtest \
-))
-
-endif
-
 $(eval $(call gb_Executable_use_libraries,icontest,\
     comphelper \
     cppu \
@@ -57,9 +41,10 @@ $(eval $(call gb_Executable_use_libraries,icontest,\
     sal \
     tl \
     ucbhelper \
-    vcl \
 ))
 
+$(eval $(call gb_Executable_use_vclmain,icontest))
+
 $(eval $(call gb_Executable_add_exception_objects,icontest,\
     vcl/workben/icontest \
 ))
diff --git a/vcl/Executable_mtfdemo.mk b/vcl/Executable_mtfdemo.mk
index 5c4c45165535..a4d4d9354b20 100644
--- a/vcl/Executable_mtfdemo.mk
+++ b/vcl/Executable_mtfdemo.mk
@@ -26,29 +26,15 @@ $(eval $(call gb_Executable_use_libraries,mtfdemo,\
 	basegfx \
     tl \
     sal \
-    vcl \
     cppu \
     cppuhelper \
     comphelper \
 ))
 
+$(eval $(call gb_Executable_use_vclmain,mtfdemo))
+
 $(eval $(call gb_Executable_add_exception_objects,mtfdemo,\
     vcl/workben/mtfdemo \
 ))
 
-$(eval $(call gb_Executable_use_static_libraries,mtfdemo,\
-    vclmain \
-))
-
-ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
-$(eval $(call gb_Executable_add_libs,mtfdemo,\
-	-lm $(DLOPEN_LIBS) \
-    -lX11 \
-))
-
-$(eval $(call gb_Executable_use_static_libraries,mtfdemo,\
-	glxtest \
-))
-endif
-
 # vim: set noet sw=4 ts=4:
diff --git a/vcl/Executable_ui-previewer.mk b/vcl/Executable_ui-previewer.mk
index bee97cbac14b..6cabf4f6710b 100644
--- a/vcl/Executable_ui-previewer.mk
+++ b/vcl/Executable_ui-previewer.mk
@@ -16,10 +16,6 @@ $(eval $(call gb_Executable_use_api,ui-previewer,\
     udkapi \
 ))
 
-$(eval $(call gb_Executable_use_static_libraries,ui-previewer,\
-    vclmain \
-))
-
 $(eval $(call gb_Executable_use_libraries,ui-previewer,\
 	comphelper \
 	cppu \
@@ -27,9 +23,10 @@ $(eval $(call gb_Executable_use_libraries,ui-previewer,\
 	sal \
     tl \
     ucbhelper \
-    vcl \
 ))
 
+$(eval $(call gb_Executable_use_vclmain,ui-previewer))
+
 $(eval $(call gb_Executable_add_exception_objects,ui-previewer,\
     vcl/source/uipreviewer/previewer \
 ))
@@ -38,17 +35,6 @@ $(eval $(call gb_Executable_add_defs,ui-previewer,\
     -DVCL_INTERNALS \
 ))
 
-ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
-$(eval $(call gb_Executable_add_libs,ui-previewer,\
-	-lm $(DLOPEN_LIBS) \
-    -lX11 \
-))
-
-$(eval $(call gb_Executable_use_static_libraries,ui-previewer,\
-	glxtest \
-))
-endif
-
 $(eval $(call gb_Executable_add_default_nativeres,ui-previewer))
 
 # vim: set noet sw=4 ts=4:
diff --git a/vcl/Executable_vcldemo.mk b/vcl/Executable_vcldemo.mk
index a9a8d195fdc9..b4701dc7c0a6 100644
--- a/vcl/Executable_vcldemo.mk
+++ b/vcl/Executable_vcldemo.mk
@@ -43,26 +43,12 @@ $(eval $(call gb_Executable_use_libraries,vcldemo,\
     tl \
     sal \
 	salhelper \
-    vcl \
 ))
 
+$(eval $(call gb_Executable_use_vclmain,vcldemo))
+
 $(eval $(call gb_Executable_add_exception_objects,vcldemo,\
     vcl/workben/vcldemo \
 ))
 
-$(eval $(call gb_Executable_use_static_libraries,vcldemo,\
-    vclmain \
-))
-
-ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
-$(eval $(call gb_Executable_add_libs,vcldemo,\
-	-lm $(DLOPEN_LIBS) \
-    -lX11 \
-))
-
-$(eval $(call gb_Executable_use_static_libraries,vcldemo,\
-	glxtest \
-))
-endif
-
 # vim: set noet sw=4 ts=4:
diff --git a/vcl/Executable_visualbackendtest.mk b/vcl/Executable_visualbackendtest.mk
index c6c0d237018a..b8f44f33afcb 100644
--- a/vcl/Executable_visualbackendtest.mk
+++ b/vcl/Executable_visualbackendtest.mk
@@ -30,27 +30,12 @@ $(eval $(call gb_Executable_use_libraries,visualbackendtest,\
     tl \
     sal \
 	salhelper \
-    vcl \
 ))
 
+$(eval $(call gb_Executable_use_vclmain,visualbackendtest,-lm))
+
 $(eval $(call gb_Executable_add_exception_objects,visualbackendtest,\
     vcl/backendtest/VisualBackendTest \
 ))
 
-$(eval $(call gb_Executable_use_static_libraries,visualbackendtest,\
-    vclmain \
-))
-
-ifneq (, $(filter LINUX %BSD, $(OS)))
-$(eval $(call gb_Executable_add_libs,visualbackendtest,\
-	-lm \
-	$(DLOPEN_LIBS) \
-    -lX11 \
-))
-
-$(eval $(call gb_Executable_use_static_libraries,visualbackendtest,\
-	glxtest \
-))
-endif
-
 # vim: set noet sw=4 ts=4:


More information about the Libreoffice-commits mailing list