[Clamav-devel] [PATCH 1/1] Only bring in <execinfo.h> if it's available

Bernd Kuhls bernd.kuhls at t-online.de
Mon Nov 3 13:55:34 EST 2014


Fixes uclibc build as uclibc does not include backtrace functionality.

Compile error was found by an autobuild server, part of the buildroot project:
http://autobuild.buildroot.net/results/2a6/2a68aa790b1e8d6fd4dc41f2ab724dfc03b3806d//build-end.log

Signed-off-by: Bernd Kuhls <bernd.kuhls at t-online.de>
---
 clamav-config.h.in           |    3 +++
 configure                    |    2 +-
 libclamav/mbox.c             |    2 ++
 m4/reorganization/headers.m4 |    2 +-
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/clamav-config.h.in b/clamav-config.h.in
index bc13504..1db5d2e 100644
--- a/clamav-config.h.in
+++ b/clamav-config.h.in
@@ -182,6 +182,9 @@
 /* Define to 1 if the system has the type `error_t'. */
 #undef HAVE_ERROR_T
 
+/* Define to 1 if you have the <execinfo.h> header file. */
+#undef HAVE_EXECINFO_H
+
 /* have working file descriptor passing support */
 #undef HAVE_FD_PASSING
 
diff --git a/configure b/configure
index b8cd3a9..0f7158e 100755
--- a/configure
+++ b/configure
@@ -14437,7 +14437,7 @@ esac
 
 
 
-for ac_header in stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h sys/inttypes.h sys/times.h memory.h ndir.h stdlib.h strings.h string.h sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h limits.h sys/filio.h sys/uio.h termios.h stdbool.h pwd.h grp.h sys/queue.h sys/cdefs.h
+for ac_header in stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h sys/inttypes.h sys/times.h memory.h ndir.h stdlib.h strings.h string.h sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h limits.h sys/filio.h sys/uio.h termios.h stdbool.h pwd.h grp.h sys/queue.h sys/cdefs.h execinfo.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff --git a/libclamav/mbox.c b/libclamav/mbox.c
index b0233ae..5d4e5cb 100644
--- a/libclamav/mbox.c
+++ b/libclamav/mbox.c
@@ -84,7 +84,9 @@
 #endif
 
 #ifdef HAVE_BACKTRACE
+#ifdef HAVE_EXECINFO_H
 #include <execinfo.h>
+#endif
 #include <syslog.h>
 
 static	void	sigsegv(int sig);
diff --git a/m4/reorganization/headers.m4 b/m4/reorganization/headers.m4
index 9b71f33..23016bc 100644
--- a/m4/reorganization/headers.m4
+++ b/m4/reorganization/headers.m4
@@ -1,4 +1,4 @@
-AC_CHECK_HEADERS([stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h sys/inttypes.h sys/times.h memory.h ndir.h stdlib.h strings.h string.h sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h limits.h sys/filio.h sys/uio.h termios.h stdbool.h pwd.h grp.h sys/queue.h sys/cdefs.h])
+AC_CHECK_HEADERS([stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h sys/inttypes.h sys/times.h memory.h ndir.h stdlib.h strings.h string.h sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h limits.h sys/filio.h sys/uio.h termios.h stdbool.h pwd.h grp.h sys/queue.h sys/cdefs.h execinfo.h])
 AC_CHECK_HEADER([syslog.h],AC_DEFINE([USE_SYSLOG],1,[use syslog]),)
 
 have_pthreads=no
-- 
1.7.10.4



More information about the clamav-devel mailing list