From e9785ee7aaad48b833c84b4b57a95d8ef83fb90f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 3 Mar 2013 20:52:07 +0100 Subject: Reapply commit 936d3cec inadvertently reverted in de7e5867 --- CMakeLists.txt | 2 ++ config.h.cmake | 1 + kdesktop/ConfigureChecks.cmake | 7 +++++++ kdesktop/lock/CMakeLists.txt | 9 +++++++-- kdesktop/lock/lockprocess.cc | 2 ++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9139a324..045ab441d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ set( VERSION "R14" ) include( FindPkgConfig ) include( CheckIncludeFile ) +include( CheckIncludeFiles ) include( CheckCSourceRuns ) include( CheckCXXSourceRuns ) include( CheckCXXSourceCompiles ) @@ -84,6 +85,7 @@ option( WITH_HAL "Enable HAL support" ${WITH_ALL_OPTIONS} ) option( WITH_TDEHWLIB "Enable TDE hardware library support" OFF ) option( WITH_UPOWER "Enable UPOWER support" ${WITH_ALL_OPTIONS} ) option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) +option( WITH_KDESKTOP_LOCK_BACKTRACE "Enable backtrace in kdesktop_lock exception handler" ${WITH_ALL_OPTIONS} ) ##### options comments ########################## diff --git a/config.h.cmake b/config.h.cmake index 1227b709c..a30f057eb 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -121,6 +121,7 @@ // kdesktop #cmakedefine KSCREENSAVER_PAM_SERVICE "@KSCREENSAVER_PAM_SERVICE@" +#cmakedefine WITH_KDESKTOP_LOCK_BACKTRACE 1 // tdm #cmakedefine XBINDIR "@XBINDIR@" diff --git a/kdesktop/ConfigureChecks.cmake b/kdesktop/ConfigureChecks.cmake index 87e2213ce..9e59185a4 100644 --- a/kdesktop/ConfigureChecks.cmake +++ b/kdesktop/ConfigureChecks.cmake @@ -14,3 +14,10 @@ if( WITH_PAM AND (NOT DEFINED KSCREENSAVER_PAM_SERVICE) ) set( KSCREENSAVER_PAM_SERVICE "kde" CACHE INTERNAL "" ) endif( ) + +if( WITH_KDESKTOP_LOCK_BACKTRACE ) + check_include_files( "bfd.h;demangle.h;libiberty.h" HAVE_BINUTILS_DEV ) + if( NOT HAVE_BINUTILS_DEV ) + tde_message_fatal( "binutils-dev are required, but not found on your system" ) + endif( ) +endif( ) diff --git a/kdesktop/lock/CMakeLists.txt b/kdesktop/lock/CMakeLists.txt index 80c2b2cdb..db5e930bc 100644 --- a/kdesktop/lock/CMakeLists.txt +++ b/kdesktop/lock/CMakeLists.txt @@ -32,11 +32,16 @@ set( target kdesktop_lock ) set( ${target}_SRCS lockprocess.cc lockdlg.cc infodlg.cc querydlg.cc sakdlg.cc - securedlg.cc autologout.cc main.cc backtrace_symbols.c + securedlg.cc autologout.cc main.cc ) +if( WITH_KDESKTOP_LOCK_BACKTRACE ) + list( APPEND ${target}_SRCS backtrace_symbols.c ) + set( BACKTRACE_LIBRARY bfd ) +endif( ) + tde_add_executable( ${target} AUTOMOC SOURCES ${${target}_SRCS} - LINK kdesktopsettings-static dmctl-static tdeio-shared Xext bfd ${GL_LIBRARY} "${LINKER_IMMEDIATE_BINDING_FLAGS}" + LINK kdesktopsettings-static dmctl-static tdeio-shared Xext ${BACKTRACE_LIBRARY} ${GL_LIBRARY} "${LINKER_IMMEDIATE_BINDING_FLAGS}" DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc index c08c4d424..288541ff9 100644 --- a/kdesktop/lock/lockprocess.cc +++ b/kdesktop/lock/lockprocess.cc @@ -137,6 +137,7 @@ static Atom gXA_SCREENSAVER_VERSION; void print_trace() { +#ifdef WITH_KDESKTOP_LOCK_BACKTRACE void *array[10]; size_t size; char **strings; @@ -152,6 +153,7 @@ void print_trace() } free (strings); +#endif } static void segv_handler(int) -- cgit v1.2.1