From 342bb7fd4d4db8771626486bbb73abbc6e126c48 Mon Sep 17 00:00:00 2001 From: kgv Date: Fri, 23 Apr 2021 13:02:08 +0300 Subject: [PATCH] 0032323: Configuration - drop unused dependency from Xmu Removed unused header Aspect_XWD.hxx. Removed redundant includes of unused X11 extension headers. Added missing dependency on pthread to TKDraw. Added "-z defs" linker flag to qmake projects to detect missing library dependencies. Removed unused CSF_MotifLibs. --- adm/cmake/occt_csf.cmake | 6 +- adm/cmake/occt_toolkit.cmake | 2 +- adm/genproj.tcl | 3 +- adm/qmake/OccCppConfig.pri | 3 + adm/qmake/OccToolkit.pri | 3 +- dox/build/build_3rdparty/building_3rdparty.md | 4 +- src/Aspect/Aspect_DisplayConnection.cxx | 1 - src/Aspect/Aspect_XWD.hxx | 93 ------------------- src/Aspect/FILES | 1 - src/TKDraw/EXTERNLIB | 1 + src/Xw/Xw_Window.cxx | 1 - 11 files changed, 12 insertions(+), 106 deletions(-) delete mode 100644 src/Aspect/Aspect_XWD.hxx diff --git a/adm/cmake/occt_csf.cmake b/adm/cmake/occt_csf.cmake index e1b7b92798..6cf72317b4 100644 --- a/adm/cmake/occt_csf.cmake +++ b/adm/cmake/occt_csf.cmake @@ -110,8 +110,8 @@ else() set (CSF_OpenGlesLibs ${OpenGlesLibs_LIB}) OCCT_CHECK_AND_UNSET (OpenGlesLibs_LIB) elseif (USE_XLIB) - set (CSF_OpenGlLibs GL) - set (CSF_XwLibs "X11 Xext Xmu Xi") + set (CSF_OpenGlLibs "GL") + set (CSF_XwLibs "X11") else() find_library (OpenGlLibs_LIB NAMES OpenGL) set (CSF_OpenGlLibs ${OpenGlLibs_LIB}) @@ -130,7 +130,7 @@ else() set (CSF_ThreadLibs "pthread rt stdc++") if (USE_XLIB) set (CSF_OpenGlLibs "GL") - set (CSF_XwLibs "X11 Xext Xmu Xi") + set (CSF_XwLibs "X11") else() set (CSF_OpenGlLibs "GL EGL") endif() diff --git a/adm/cmake/occt_toolkit.cmake b/adm/cmake/occt_toolkit.cmake index 8f09fbeef4..a3826f3f9a 100644 --- a/adm/cmake/occt_toolkit.cmake +++ b/adm/cmake/occt_toolkit.cmake @@ -359,7 +359,7 @@ endforeach() if (APPLE) list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND) if (NOT ${IS_X11_FOUND} EQUAL -1) - find_package (X11 COMPONENTS X11 Xext Xmu Xi) + find_package (X11 COMPONENTS X11) if (NOT X11_FOUND) message (STATUS "Warning: X11 is not found. It's required to install The XQuartz project: http://www.xquartz.org") endif() diff --git a/adm/genproj.tcl b/adm/genproj.tcl index ab611805eb..29dacf6055 100644 --- a/adm/genproj.tcl +++ b/adm/genproj.tcl @@ -1530,8 +1530,7 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} { set aLibsMap(CSF_TclTkLibs) "tk8.6" } if { "$::HAVE_XLIB" == "true" } { - set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi" - set aLibsMap(CSF_MotifLibs) "X11" + set aLibsMap(CSF_XwLibs) "X11" } } } diff --git a/adm/qmake/OccCppConfig.pri b/adm/qmake/OccCppConfig.pri index 85c837f141..39b6fd004b 100644 --- a/adm/qmake/OccCppConfig.pri +++ b/adm/qmake/OccCppConfig.pri @@ -43,6 +43,9 @@ win32 { QMAKE_CXXFLAGS += -fexceptions QMAKE_CXXFLAGS += -fvisibility=default DEFINES += OCC_CONVERT_SIGNALS + gcc { + QMAKE_LFLAGS += -Wl,-z,defs + } mac { iphoneos { QMAKE_IOS_DEPLOYMENT_TARGET = 8.0 diff --git a/adm/qmake/OccToolkit.pri b/adm/qmake/OccToolkit.pri index c4b11d9d66..ca33ca051f 100644 --- a/adm/qmake/OccToolkit.pri +++ b/adm/qmake/OccToolkit.pri @@ -63,8 +63,7 @@ win32 { CSF_TclTkLibs = -ltk8.6 HAVE_XLIB { CSF_OpenGlLibs = -lGL - CSF_XwLibs = -lX11 -lXext -lXmu -lXi - CSF_MotifLibs = -lX11 + CSF_XwLibs = -lX11 } else { CSF_OpenGlLibs = -lGL -lEGL } diff --git a/dox/build/build_3rdparty/building_3rdparty.md b/dox/build/build_3rdparty/building_3rdparty.md index 8203062365..8bc15f6c5b 100644 --- a/dox/build/build_3rdparty/building_3rdparty.md +++ b/dox/build/build_3rdparty/building_3rdparty.md @@ -272,7 +272,7 @@ There are two types of third-party products, which are necessary to build OCCT: All 3rd-party products required for building of OCCT could be installed from official repositories. You may install them from console using apt-get utility: - sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libxt-dev libxmu-dev libxi-dev libgl1-mesa-dev libfreeimage-dev rapidjson-dev + sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libx11-dev libgl1-mesa-dev libfreeimage-dev rapidjson-dev Building is possible with C++ compliant compiler: @@ -624,4 +624,4 @@ in *FREEIMAGE_SRC_DIR* by the corrected file, which you can find in attachment t 5. Clean temporary files - make clean \ No newline at end of file + make clean diff --git a/src/Aspect/Aspect_DisplayConnection.cxx b/src/Aspect/Aspect_DisplayConnection.cxx index 3cadc205ba..288c067546 100755 --- a/src/Aspect/Aspect_DisplayConnection.cxx +++ b/src/Aspect/Aspect_DisplayConnection.cxx @@ -19,7 +19,6 @@ #if defined(HAVE_XLIB) #include #include - #include #endif IMPLEMENT_STANDARD_RTTIEXT(Aspect_DisplayConnection,Standard_Transient) diff --git a/src/Aspect/Aspect_XWD.hxx b/src/Aspect/Aspect_XWD.hxx deleted file mode 100644 index 060547195b..0000000000 --- a/src/Aspect/Aspect_XWD.hxx +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef __Aspect_WNTXWD_HXX -# define __Aspect_WNTXWD_HXX - -#if !defined(_WIN32) && (!defined(__APPLE__) || defined(HAVE_XLIB)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__) -# include -# else - -# ifdef WORD64 -# define B32 :32 -# else -# define B32 -# endif /* WORD64 */ - -# define XWD_FILE_VERSION 7 - -# define XYBitmap 0 -# define XYPixmap 1 -# define ZPixmap 2 - -# define LSBFirst 0 -# define MSBFirst 1 - -# define DoRed ( 1 << 0 ) -# define DoGreen ( 1 << 1 ) -# define DoBlue ( 1 << 2 ) - -# define StaticGray 0 -# define GrayScale 1 -# define StaticColor 2 -# define PseudoColor 3 -# define TrueColor 4 -# define DirectColor 5 - -typedef unsigned int CARD32; - -typedef struct _xwd_file_header { - - CARD32 header_size B32; - CARD32 file_version B32; - CARD32 pixmap_format B32; - CARD32 pixmap_depth B32; - CARD32 pixmap_width B32; - CARD32 pixmap_height B32; - CARD32 xoffset B32; - CARD32 byte_order B32; - CARD32 bitmap_unit B32; - CARD32 bitmap_bit_order B32; - CARD32 bitmap_pad B32; - CARD32 bits_per_pixel B32; - CARD32 bytes_per_line B32; - CARD32 visual_class B32; - CARD32 red_mask B32; - CARD32 green_mask B32; - CARD32 blue_mask B32; - CARD32 bits_per_rgb B32; - CARD32 colormap_entries B32; - CARD32 ncolors B32; - CARD32 window_width B32; - CARD32 window_height B32; - CARD32 window_x B32; - CARD32 window_y B32; - CARD32 window_bdrwidth B32; -# ifdef WORD64 - CARD32 header_end B32; -# endif /* WORD64 */ - } XWDFileHeader; - -typedef struct _xcolor { - - unsigned long pixel; - unsigned short red; - unsigned short green; - unsigned short blue; - char flags; - char pad; - - } XColor; - -# endif /* _WIN32 */ -#endif /* __Aspect_WNTXWD_HXX */ diff --git a/src/Aspect/FILES b/src/Aspect/FILES index 112a2d4207..e33a7c57d8 100755 --- a/src/Aspect/FILES +++ b/src/Aspect/FILES @@ -80,4 +80,3 @@ Aspect_XRPoseActionData.hxx Aspect_XRSession.cxx Aspect_XRSession.hxx Aspect_XRTrackedDeviceRole.hxx -Aspect_XWD.hxx diff --git a/src/TKDraw/EXTERNLIB b/src/TKDraw/EXTERNLIB index c3d2e4ce02..46fa6c978b 100755 --- a/src/TKDraw/EXTERNLIB +++ b/src/TKDraw/EXTERNLIB @@ -21,3 +21,4 @@ CSF_TBB CSF_objc CSF_Appkit CSF_IOKit +CSF_ThreadLibs diff --git a/src/Xw/Xw_Window.cxx b/src/Xw/Xw_Window.cxx index e7e5b05ce4..b3e538d0c8 100644 --- a/src/Xw/Xw_Window.cxx +++ b/src/Xw/Xw_Window.cxx @@ -26,7 +26,6 @@ #if defined(HAVE_XLIB) #include #include - #include //#include #endif