@@ -10,10 +10,6 @@ if WITHOUT_LZO
AM_CPPFLAGS += -DWITHOUT_LZO
endif
-if HAVE_EXECINFO
-AM_CPPFLAGS += -DHAVE_EXECINFO
-endif
-
sbin_PROGRAMS =
sbin_SCRIPTS =
noinst_LIBRARIES =
@@ -164,7 +164,7 @@ if test "x$need_cmocka" = "xyes"; then
PKG_CHECK_MODULES(CMOCKA, [cmocka], [], [cmocka_missing="yes"])
fi
-AC_CHECK_HEADERS([execinfo.h], [execinfo_found=yes])
+AC_CHECK_HEADERS([execinfo.h])
##### produce summary on dependencies #####
@@ -223,7 +223,6 @@ fi
AM_CONDITIONAL([WITHOUT_LZO], [test "x$need_lzo" != "xyes"])
AM_CONDITIONAL([WITHOUT_XATTR], [test "x$need_xattr" != "xyes"])
-AM_CONDITIONAL([HAVE_EXECINFO], [test "x$execinfo_found" == "xyes"])
AC_CHECK_SIZEOF([off_t])
AC_CHECK_SIZEOF([loff_t])
@@ -1,11 +1,13 @@
#ifndef LIBMISSING_H
#define LIBMISSING_H
-#ifdef HAVE_EXECINFO
+#include "config.h"
+
+#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#endif
-#ifndef HAVE_EXECINFO
+#ifndef HAVE_EXECINFO_H
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);
@@ -1,6 +1,6 @@
#include "libmissing.h"
-#ifndef HAVE_EXECINFO
+#ifndef HAVE_EXECINFO_H
#define PROGRAM_NAME "libmissing"
#include "common.h"
@@ -22,4 +22,4 @@ void backtrace_symbols_fd(void *const *buffer, int size, int fd)
{
errmsg("backtrace_symbols_fd() is not implemented");
}
-#endif /* !HAVE_EXECINFO */
+#endif /* !HAVE_EXECINFO_H */
@@ -1,12 +1,7 @@
integck_SOURCES = tests/fs-tests/integrity/integck.c
-integck_LDADD = libubi.a
+integck_LDADD = libubi.a libmissing.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
AC_CHECK_HEADERS already makes sure our config header contains a HAVE_$FOO_H macro if a header was found. There is no need to awkwardly set our own Automake conditionals and check for it all over the place in the Automake files. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at> --- Makefile.am | 4 ---- configure.ac | 3 +-- include/libmissing.h | 6 ++++-- lib/execinfo.c | 4 ++-- tests/fs-tests/Makemodule.am | 7 +------ 5 files changed, 8 insertions(+), 16 deletions(-)