Make the linking of C++ ABI related code for exceptions optional. The default is to have it enabled. Signed-off-by: Arun Sharma diff --git a/configure.in b/configure.in index c2374c5..7f7aef8 100644 --- a/configure.in +++ b/configure.in @@ -116,6 +116,14 @@ AC_ARG_ENABLE(debug, [ --enable-debug turn on debug support (slows down execution)], [enable_debug=yes], []) +AC_ARG_ENABLE(cxx_exceptions, +[ --enable-cxx-exceptions use libunwind to handle C++ exceptions], +[enable_cxx_exceptions=$enableval], [enable_cxx_exceptions=yes]) +if test x$enable_cxx_exceptions = xyes; then + AC_MSG_NOTICE([Enabling C++ exception support]) +fi +AM_CONDITIONAL([SUPPORT_CXX_EXCEPTIONS], [test x$enable_cxx_exceptions = xyes]) + LIBUNWIND___THREAD save_LDFLAGS="$LDFLAGS" diff --git a/src/Makefile.am b/src/Makefile.am index ae113f4..7de3026 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -61,6 +61,7 @@ libunwind_la_SOURCES_generic = \ mi/Gget_fpreg.c mi/Gset_fpreg.c \ mi/Gset_caching_policy.c +if SUPPORT_CXX_EXCEPTIONS libunwind_la_SOURCES_local_unwind = \ unwind/Backtrace.c unwind/DeleteException.c \ unwind/FindEnclosingFunction.c unwind/ForcedUnwind.c \ @@ -69,6 +70,7 @@ libunwind_la_SOURCES_local_unwind = \ unwind/GetRegionStart.c unwind/GetTextRelBase.c \ unwind/RaiseException.c unwind/Resume.c \ unwind/Resume_or_Rethrow.c unwind/SetGR.c unwind/SetIP.c +endif # List of arch-independent files needed by local-only library (libunwind): libunwind_la_SOURCES_local_nounwind = \