]> www.infradead.org Git - mtd-utils.git/commitdiff
Use autoconf header detection correctly for libmissing
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Wed, 21 Jun 2017 08:27:47 +0000 (10:27 +0200)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Wed, 28 Jun 2017 08:27:19 +0000 (10:27 +0200)
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
configure.ac
include/libmissing.h
lib/execinfo.c
tests/fs-tests/Makemodule.am

index 31b21bc6f93b5c977b3afde9992274d2f5e72706..4c123f25abc0099058083a1ad08419417e7566e4 100644 (file)
@@ -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 =
index aedbb329e9d93a74998b90edea3fdcb85da2385c..8db281d40a9bc7b3000d3efbc84f0be2b943e600 100644 (file)
@@ -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])
index c765f6d84fe4881f464336a66edf6ea20373000b..01960330dab7081a241264b5c2f05fd5c91e4ca1 100644 (file)
@@ -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);
index a39df83349283b393fac105f070766e3a6af3714..a59f6a9e6af8423f66c93952937eb313a07c35b0 100644 (file)
@@ -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 */
index d3acaa5b3daf6263984cc4eaa482410a05c8f674..2eae860828e00b44a7422fc0e3eeeed88dc1176f 100644 (file)
@@ -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