Like Android, Alpine linux does not ahve execinfo, too.
Determine whether to use execinfo or not based on
find_library results.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
* @bug No known bugs except for NYI items
*/
-#ifndef __ANDROID__
+#ifdef __ANDROID__
+#ifndef _NO_EXECINFO_
+#define _NO_EXECINFO_
+#endif
+#endif
+
+#ifndef _NO_EXECINFO_
/* Android does not have execinfo.h. It has unwind.h instead. */
#include <execinfo.h>
#endif
_backtrace_to_string (void)
{
char *retstr = NULL;
-#ifndef __ANDROID__
+#ifndef _NO_EXECINFO_
/* Android does not have execinfo.h. It has unwind.h instead. */
void *array[20];
char **strings;
endif
+# A few distros do not have execinfo.h
+if not cc.has_header('execinfo.h')
+ add_project_arguments('-D_NO_EXECINFO_', language: ['c', 'cpp'])
+endif
+
# See if src-iio can be built or not
gst18_dep = dependency('gstreamer-' + gst_api_verision, version : '>=1.8', required : false)
tensor_src_iio_build = false