diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h
index d78a83437dbf2a4c89d2085a408aaafeb352fed4..7f8d00eb69781b9c2efbf22c596b42ce5196bb03 100644
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -50,9 +50,9 @@
 
 #include <pthread.h>
 #include <sys/param.h>
-
+#ifdef HAVE_BKTR
 #include <execinfo.h>
-
+#endif
 #include "asterisk/logger.h"
 
 /* internal macro to profile mutexes. Only computes the delay on