AM_CPPFLAGS += -DWITHOUT_LZO
endif
+if HAVE_EXECINFO
+AM_CPPFLAGS += -DHAVE_EXECINFO
+endif
+
sbin_PROGRAMS =
sbin_SCRIPTS =
noinst_LIBRARIES =
[AM_CONDITIONAL([WITHOUT_LZO], [false])])
+AC_CHECK_HEADERS([execinfo.h], [execinfo_found=yes])
+AM_CONDITIONAL([HAVE_EXECINFO], [test "x$execinfo_found" == "xyes"])
+
PKG_CHECK_MODULES(ZLIB, [ zlib ])
PKG_CHECK_MODULES(UUID, [ uuid ])
--- /dev/null
+#ifndef LIBMISSING_H
+#define LIBMISSING_H
+
+#ifdef HAVE_EXECINFO
+#include <execinfo.h>
+#endif
+
+#ifndef HAVE_EXECINFO
+int backtrace(void **buffer, int size);
+char **backtrace_symbols(void *const *buffer, int size);
+void backtrace_symbols_fd(void *const *buffer, int size, int fd);
+#endif
+
+#endif /* LIBMISSING_H */
+
lib/libmtd_legacy.c \
lib/libmtd_int.h
-noinst_LIBRARIES += libmtd.a
+libmissing_a_SOURCES = \
+ lib/execinfo.c
+
+noinst_LIBRARIES += libmtd.a libmissing.a
--- /dev/null
+#include "libmissing.h"
+
+#ifndef HAVE_EXECINFO
+#define PROGRAM_NAME "libmissing"
+#include "common.h"
+
+int backtrace(void **buffer, int size)
+{
+ void *addr = __builtin_return_address(0);
+
+ errmsg("backtrace() is not implemented. Called from %p", addr);
+ return 0;
+}
+
+char **backtrace_symbols(void *const *buffer, int size)
+{
+ errmsg("backtrace_symbols() is not implemented");
+ return NULL;
+}
+
+void backtrace_symbols_fd(void *const *buffer, int size, int fd)
+{
+ errmsg("backtrace_symbols_fd() is not implemented");
+}
+#endif /* !HAVE_EXECINFO */
integck_LDADD = libubi.a
integck_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/ubi-utils/include
+if HAVE_EXECINFO
+else
+integck_LDADD += libmissing.a
+endif
+
test_1_SOURCES = tests/fs-tests/simple/test_1.c tests/fs-tests/lib/tests.c
test_1_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/tests/fs-tests/lib
#include <getopt.h>
#include <assert.h>
#include <mntent.h>
-#include <execinfo.h>
#include <sys/mman.h>
#include <sys/vfs.h>
#include <sys/mount.h>
#define PROGRAM_NAME "integck"
#include "common.h"
#include "libubi.h"
+#include "libmissing.h"
/*
* WARNING! This is a dirty hack! The symbols for static functions are not