summaryrefslogtreecommitdiffstats
path: root/tdeio
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2013-08-17 13:21:22 +0200
committerSlávek Banko <slavek.banko@axis.cz>2013-08-17 13:21:47 +0200
commit35748811a4b11b5947879f657a752e89d649ce06 (patch)
treead162303282412154ab2e31797ebde8f11398f25 /tdeio
parent18ba4a49ac445909a21897e1da90af618a3004ad (diff)
downloadtdelibs-35748811a4b11b5947879f657a752e89d649ce06.tar.gz
tdelibs-35748811a4b11b5947879f657a752e89d649ce06.zip
Added check the conditions for building backtrace handler
Diffstat (limited to 'tdeio')
-rw-r--r--tdeio/tdeio/CMakeLists.txt9
-rw-r--r--tdeio/tdeio/slavebase.cpp10
2 files changed, 11 insertions, 8 deletions
diff --git a/tdeio/tdeio/CMakeLists.txt b/tdeio/tdeio/CMakeLists.txt
index c1287dc82..cf5c272a9 100644
--- a/tdeio/tdeio/CMakeLists.txt
+++ b/tdeio/tdeio/CMakeLists.txt
@@ -81,13 +81,18 @@ set( ${target}_SRCS
kdirnotify.cpp kdirnotify.skel kdirnotify_stub.cpp
observer.cpp ../misc/uiserver.stub observer.skel tdeemailsettings.cpp
kprotocolinfo.cpp renamedlg.cpp skipdlg.cpp kremoteencoding.cpp
- kmimetypechooser.cpp backtrace_symbols.c
+ kmimetypechooser.cpp
)
+if( HAVE_BACKTRACE AND HAVE_DEMANGLE_H )
+ list( APPEND ${target}_SRCS backtrace_symbols.c )
+ set( BACKTRACE_LIBRARY bfd )
+endif( )
+
tde_add_library( ${target} STATIC_PIC AUTOMOC
SOURCES ${${target}_SRCS}
DEPENDENCIES dcopidl
- LINK bfd
+ LINK ${BACKTRACE_LIBRARY}
)
diff --git a/tdeio/tdeio/slavebase.cpp b/tdeio/tdeio/slavebase.cpp
index d4aa8ca26..83b2a9889 100644
--- a/tdeio/tdeio/slavebase.cpp
+++ b/tdeio/tdeio/slavebase.cpp
@@ -66,10 +66,10 @@
#endif
#endif
-#ifndef NDEBUG
-#ifdef HAVE_BACKTRACE
+#ifndef NDEBUG
void print_trace()
{
+#if defined(HAVE_BACKTRACE) && defined(HAVE_DEMANGLE_H)
void *array[10];
size_t size;
char **strings;
@@ -85,9 +85,9 @@ void print_trace()
}
free (strings);
+#endif // defined(HAVE_BACKTRACE) && defined(HAVE_DEMANGLE_H)
}
-#endif
-#endif
+#endif // NDEBUG
using namespace TDEIO;
@@ -765,10 +765,8 @@ void SlaveBase::sigsegv_handler(int sig)
snprintf(buffer, sizeof(buffer), "tdeioslave: ####### CRASH ###### protocol = %s pid = %d signal = %d\n", s_protocol, getpid(), sig);
write(2, buffer, strlen(buffer));
#ifndef NDEBUG
-#ifdef HAVE_BACKTRACE
print_trace();
#endif
-#endif
::exit(1);
#endif
}