Repository.mk                                     |    1 
 bin/check-elf-dynamic-objects                     |    2 
 bin/find-mergedlib-can-be-private.py              |   59 -----------------
 solenv/gbuild/CppunitTest.mk                      |    1 
 vcl/Library_desktop_detector.mk                   |   73 ----------------------
 vcl/Library_vcl.mk                                |    7 +-
 vcl/Module_vcl.mk                                 |    1 
 vcl/inc/unx/desktops.hxx                          |    2 
 vcl/inc/vclpluginapi.h                            |    6 -
 vcl/source/app/salplug.cxx                        |   21 ------
 vcl/unx/generic/desktopdetect/desktopdetector.cxx |    7 --
 11 files changed, 10 insertions(+), 170 deletions(-)

New commits:
commit 6361a9398584defe9ab8db1e3383e02912e3f24c
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Feb 20 11:31:12 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Feb 20 12:34:34 2024 +0100

    merge desktop_detector library into vcl library
    
    Noting that the main feature of using a separate library - avoiding
    linking against SM and ICE -  is no longer a thing, since we have not
    used those in some time.
    
    Change-Id: I9ecd6758e97f0fa19b224346aa577a04b46793b8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163638
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/Repository.mk b/Repository.mk
index bee0b6ce5bca..29e2b00e0d45 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -515,7 +515,6 @@ $(eval $(call 
gb_Helper_register_plugins_for_install,OOOLIBS,ooo, \
     acc \
     $(if $(ENABLE_CUSTOMTARGET_COMPONENTS),components) \
     cui \
-    $(if $(USING_X11),desktop_detector) \
     icg \
     sdui \
     $(if $(ENABLE_GEN),vclplug_gen) \
diff --git a/bin/check-elf-dynamic-objects b/bin/check-elf-dynamic-objects
index 415dea8f46ee..f636eadda1fa 100755
--- a/bin/check-elf-dynamic-objects
+++ b/bin/check-elf-dynamic-objects
@@ -165,7 +165,7 @@ local file="$1"
                     ${kf5allowlist}"
             fi
         ;;
-        */libdesktop_detectorlo.so|*/oosplash|*/gengal.bin)
+        */oosplash|*/gengal.bin)
             allowlist="${allowlist} ${x11allowlist}"
         ;;
         
*/libvclplug_genlo.so|*/libchartcorelo.so|*/libavmediaogl.so|*/libOGLTranslo.so|*/liboglcanvaslo.so)
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index adfcccce49fb..fc7351986b09 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -242,7 +242,6 @@ define gb_CppunitTest__use_vcl
 $(call gb_CppunitTest_get_target,$(1)) : VCL := $(true)
 $(call gb_CppunitTest_get_target,$(1)) : $(call 
gb_Library_get_target,vclbootstrapprotector)
 ifeq ($(USING_X11),TRUE)
-$(call gb_CppunitTest_get_target,$(1)) : $(call 
gb_Library_get_target,desktop_detector)
 $(call gb_CppunitTest_get_target,$(1)) : $(if $(filter $(2),$(true)),, \
     $(call gb_Library_get_target,vclplug_gen) \
         $(if $(ENABLE_GTK3),$(call gb_Library_get_target,vclplug_gtk3)) \
diff --git a/vcl/Library_desktop_detector.mk b/vcl/Library_desktop_detector.mk
deleted file mode 100644
index 2a2858fc4eae..000000000000
--- a/vcl/Library_desktop_detector.mk
+++ /dev/null
@@ -1,73 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-$(eval $(call gb_Library_Library,desktop_detector))
-
-$(eval $(call gb_Library_set_plugin_for,desktop_detector,vcl))
-
-$(eval $(call gb_Library_set_include,desktop_detector,\
-    $$(INCLUDE) \
-    -I$(SRCDIR)/vcl/inc \
-))
-
-$(eval $(call gb_Library_add_defs,desktop_detector,\
-    -DDESKTOP_DETECTOR_IMPLEMENTATION \
-))
-
-$(eval $(call gb_Library_use_sdk_api,desktop_detector))
-
-$(eval $(call gb_Library_use_libraries,desktop_detector,\
-    tl \
-    utl \
-    sot \
-    ucbhelper \
-    basegfx \
-    comphelper \
-    cppuhelper \
-    i18nlangtag \
-    i18nutil \
-    $(if $(ENABLE_JAVA), \
-        jvmaccess) \
-    cppu \
-    sal \
-))
-
-$(eval $(call gb_Library_use_externals,desktop_detector,\
-       boost_headers \
-       icuuc \
-))
-
-$(eval $(call gb_Library_add_libs,desktop_detector,\
-       -lX11 \
-       -lXext \
-       -lSM \
-       -lICE \
-))
-
-$(eval $(call gb_Library_add_exception_objects,desktop_detector,\
-    vcl/unx/generic/desktopdetect/desktopdetector \
-))
-
-ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
-$(eval $(call gb_Library_add_libs,desktop_detector,\
-       -lm $(UNIX_DLAPI_LIBS) \
-))
-endif
-
-# vim: set noet sw=4 ts=4:
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index d4c72bfe9c0d..1bdb0fa700e5 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -46,7 +46,6 @@ $(eval $(call gb_Library_add_defs,vcl,\
     -DVCL_DLLIMPLEMENTATION \
     -DDLLIMPLEMENTATION_UITEST \
     -DCUI_DLL_NAME=\"$(call gb_Library_get_runtime_filename,$(call 
gb_Library__get_name,cui))\" \
-    -DDESKTOP_DETECTOR_DLL_NAME=\"$(call 
gb_Library_get_runtime_filename,$(call 
gb_Library__get_name,desktop_detector))\" \
     -DTK_DLL_NAME=\"$(call gb_Library_get_runtime_filename,$(call 
gb_Library__get_name,tk))\" \
     $(if $(SYSTEM_LIBFIXMATH),-DSYSTEM_LIBFIXMATH) \
 ))
@@ -571,6 +570,7 @@ endif
 
 ifeq ($(USING_X11),TRUE)
 $(eval $(call gb_Library_add_exception_objects,vcl,\
+    vcl/unx/generic/desktopdetect/desktopdetector \
     vcl/unx/generic/window/sessioninhibitor \
     vcl/unx/generic/printer/cpdmgr \
 ))
@@ -586,6 +586,11 @@ $(eval $(call gb_Library_add_libs,vcl,\
 ))
 endif # USING_X11
 
+ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
+$(eval $(call gb_Library_add_libs,vcl,\
+       -lm $(UNIX_DLAPI_LIBS) \
+))
+endif
 
 ifeq ($(DISABLE_GUI),TRUE)
 $(eval $(call gb_Library_add_exception_objects,vcl,\
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index cc8667cad420..31d751a6e332 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -72,7 +72,6 @@ $(eval $(call gb_Module_add_l10n_targets,vcl,\
 ifeq ($(USING_X11),TRUE)
 $(eval $(call gb_Module_add_targets,vcl,\
     $(if $(ENABLE_GEN),Library_vclplug_gen) \
-    Library_desktop_detector \
     Package_fontunxppds \
     Package_fontunxpsprint \
 ))
diff --git a/vcl/inc/unx/desktops.hxx b/vcl/inc/unx/desktops.hxx
index b40004230f91..bf2c9bbc9279 100644
--- a/vcl/inc/unx/desktops.hxx
+++ b/vcl/inc/unx/desktops.hxx
@@ -36,4 +36,6 @@ enum SAL_DLLPUBLIC_RTTI DesktopType
     DESKTOP_LXQT
 }; // keep in sync with desktop_strings[] in salplug.cxx
 
+DesktopType get_desktop_environment();
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vclpluginapi.h b/vcl/inc/vclpluginapi.h
index 4211a581c979..88545ba9cef3 100644
--- a/vcl/inc/vclpluginapi.h
+++ b/vcl/inc/vclpluginapi.h
@@ -65,12 +65,6 @@
 #define VCLPLUG_WIN_PUBLIC SAL_DLLPUBLIC_IMPORT
 #endif
 
-#if defined DESKTOP_DETECTOR_IMPLEMENTATION
-#define DESKTOP_DETECTOR_PUBLIC SAL_DLLPUBLIC_EXPORT
-#else
-#define DESKTOP_DETECTOR_PUBLIC SAL_DLLPUBLIC_IMPORT
-#endif
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/salplug.cxx b/vcl/source/app/salplug.cxx
index 026867e99bf2..feb31dea77d4 100644
--- a/vcl/source/app/salplug.cxx
+++ b/vcl/source/app/salplug.cxx
@@ -168,32 +168,11 @@ SalInstance* tryInstance( const OUString& rModuleBase, 
bool bForce = false )
 #endif // !STATIC_SAL_INSTANCE
 
 #if UNIX_DESKTOP_DETECT
-#ifndef DISABLE_DYNLOADING
-extern "C" typedef DesktopType Fn_get_desktop_environment();
-#else
-extern "C" DesktopType get_desktop_environment();
-#endif
 
 DesktopType lcl_get_desktop_environment()
 {
     DesktopType ret = DESKTOP_UNKNOWN;
-#ifdef DISABLE_DYNLOADING
     ret = get_desktop_environment();
-#else
-    OUString aModule(DESKTOP_DETECTOR_DLL_NAME);
-    oslModule aMod = osl_loadModuleRelative(
-        reinterpret_cast< oslGenericFunction >( &tryInstance ), aModule.pData,
-        SAL_LOADMODULE_DEFAULT );
-    if( aMod )
-    {
-        Fn_get_desktop_environment * pSym
-            = reinterpret_cast<Fn_get_desktop_environment *>(
-                osl_getAsciiFunctionSymbol(aMod, "get_desktop_environment"));
-        if( pSym )
-            ret = pSym();
-    }
-    osl_unloadModule( aMod );
-#endif
     return ret;
 }
 
diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx 
b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
index 8baeb303feed..a159c134b821 100644
--- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx
+++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
@@ -124,10 +124,7 @@ static bool is_plasma6_desktop()
     return pFullVersion && pSessionVersion && (0 == strcmp(pSessionVersion, 
"6"));
 }
 
-extern "C"
-{
-
-DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment()
+DesktopType get_desktop_environment()
 {
     static const char *pOverride = getenv( "OOO_FORCE_DESKTOP" );
 
@@ -259,6 +256,4 @@ DESKTOP_DETECTOR_PUBLIC DesktopType 
get_desktop_environment()
     return ret;
 }
 
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 864e752d9e876d29c54aba3b8fd57e4f71a02955
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Feb 20 12:15:34 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Feb 20 12:34:23 2024 +0100

    simplify this python script
    
    I dont need to exclude the .so files that have been merged, they exist,
    but they contain only a dummy string
    
    Change-Id: I3b008859f4c3d4831025c082dd589e55c46ef078
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163639
    Tested-by: Noel Grandin <[email protected]>
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/bin/find-mergedlib-can-be-private.py 
b/bin/find-mergedlib-can-be-private.py
index 19082a0ee5e9..b879ba260cbe 100755
--- a/bin/find-mergedlib-can-be-private.py
+++ b/bin/find-mergedlib-can-be-private.py
@@ -13,64 +13,6 @@ exported_symbols = set()
 imported_symbols = set()
 
 
-# Copied from solenv/gbuild/extensions/pre_MergedLibsList.mk
-# TODO there has to be a way to run gmake and get it to dump this list for me
-merged_libs = { \
-    "avmedia" \
-    ,"basctl" \
-    ,"basprov" \
-    ,"basegfx" \
-    ,"canvasfactory" \
-    ,"canvastools" \
-    ,"comphelper" \
-    ,"configmgr" \
-    ,"cppcanvas" \
-    ,"crashreport)" \
-    ,"dbtools" \
-    ,"deployment" \
-    ,"deploymentmisc" \
-    ,"desktopbe1)" \
-    ,"desktop_detector)" \
-    ,"drawinglayer" \
-    ,"editeng" \
-    ,"filterconfig" \
-    ,"fsstorage" \
-    ,"fwk" \
-    ,"helplinker)" \
-    ,"i18npool" \
-    ,"i18nutil" \
-    ,"lng" \
-    ,"localebe1" \
-    ,"msfilter" \
-    ,"mtfrenderer" \
-    ,"opencl" \
-    ,"package2" \
-    ,"sax" \
-    ,"sb" \
-    ,"simplecanvas" \
-    ,"sfx" \
-    ,"sofficeapp" \
-    ,"sot" \
-    ,"spl" \
-    ,"stringresource" \
-    ,"svl" \
-    ,"svt" \
-    ,"svx" \
-    ,"svxcore" \
-    ,"tk" \
-    ,"tl" \
-    ,"ucb1" \
-    ,"ucbhelper" \
-    ,"ucpexpand1" \
-    ,"ucpfile1" \
-    ,"unoxml" \
-    ,"utl" \
-    ,"uui" \
-    ,"vcl" \
-    ,"xmlscript" \
-    ,"xo" \
-    ,"xstor" }
-
 # look for symbols exported by libmerged
 subprocess_nm = subprocess.Popen("nm -D instdir/program/libmergedlo.so", 
stdout=subprocess.PIPE, shell=True)
 with subprocess_nm.stdout as txt:
@@ -90,7 +32,6 @@ with subprocess_find.stdout as txt:
     for line in txt:
         sharedlib = line.strip().decode("utf-8")
         s = sharedlib[sharedlib.find("/lib") + 4 : len(sharedlib) - 3]
-        if s in merged_libs: continue
         # look for imported symbols
         subprocess_objdump = subprocess.Popen("objdump -T " + sharedlib, 
stdout=subprocess.PIPE, shell=True)
         with subprocess_objdump.stdout as txt2:

Reply via email to