Index: nel/src/misc/dynloadlib.cpp =================================================================== --- nel/src/misc/dynloadlib.cpp (revision 2089) +++ nel/src/misc/dynloadlib.cpp (working copy) @@ -215,7 +215,7 @@ // MTR: some new error handling. Just logs if it couldn't load the handle. if(_LibHandle == NULL) { #ifdef NL_OS_UNIX - char *errormsg=dlerror(); + const char *errormsg=dlerror(); #else const char *errormsg="Verify DLL existence"; #endif Index: nel/src/misc/CMakeLists.txt =================================================================== --- nel/src/misc/CMakeLists.txt (revision 2089) +++ nel/src/misc/CMakeLists.txt (working copy) @@ -2,6 +2,18 @@ IF(NOT WIN32) ADD_LIBRARY(nelmisc SHARED ${SRC}) + # check for presence of execinfo.h, which contains the definitions + # of backtrace() and backtrace_symbols() + CHECK_INCLUDE_FILES(execinfo.h NL_HAVE_EXECINFO) + IF(NL_HAVE_EXECINFO) + # *BSD variants don't offer backtrace(), but there is a small + # library containing these functions. Add it to the library + # list for linking, if present + CHECK_LIBRARY_EXISTS(execinfo backtrace "" NL_HAVE_EXECINFO_LIB) + IF(NL_HAVE_EXECINFO_LIB) + TARGET_LINK_LIBRARIES(nelmisc execinfo) + ENDIF(NL_HAVE_EXECINFO_LIB) + ENDIF(NL_HAVE_EXECINFO) ELSE(NOT WIN32) ADD_LIBRARY(nelmisc STATIC ${SRC}) ENDIF(NOT WIN32) Index: nel/src/misc/debug.cpp =================================================================== --- nel/src/misc/debug.cpp (revision 2089) +++ nel/src/misc/debug.cpp (working copy) @@ -55,7 +55,7 @@ # include # include # define IsDebuggerPresent() false -# ifndef NL_OS_MAC +# ifdef NL_HAVE_EXECINFO # include # endif //# include @@ -606,7 +606,7 @@ } SymCleanup(getProcessHandle()); */ -#elif !defined(NL_OS_MAC) +#elif defined(NL_HAVE_EXECINFO) // Make place for stack frames and function names const uint MaxFrame=64; void *trace[MaxFrame]; @@ -1033,7 +1033,7 @@ { result += e.what(); } -#elif !defined(NL_OS_MAC) +#elif defined(NL_HAVE_EXECINFO) // Make place for stack frames and function names const uint MaxFrame=64; void *trace[MaxFrame];