PATCH: fix some warnings during configure/compilation

Federico G. Schwindt fgsch at lodoss.net
Fri Nov 16 14:15:59 CET 2012


Hi,

The diff below fixes one warning during configure and two during compilation on OpenBSD (and maybe elsewhere):

checking pthread_np.h usability... no
checking pthread_np.h presence... yes
configure: WARNING: pthread_np.h: present but cannot be compiled
configure: WARNING: pthread_np.h:     check for missing prerequisite headers?
configure: WARNING: pthread_np.h: see the Autoconf documentation
configure: WARNING: pthread_np.h:     section "Present But Cannot Be Compiled"
configure: WARNING: pthread_np.h: proceeding with the compiler's result
configure: WARNING:     ## -------------------------------------------- ##
configure: WARNING:     ## Report this to varnish-dev at varnish-cache.org ##
configure: WARNING:     ## -------------------------------------------- ##

varnishadm.c:190: warning: implicit declaration of function 'add_history'

cache/cache_main.c:82: warning: implicit declaration of function 'pthread_set_name_np'

Comments? OK?

f.-

diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c
index 3dc7c79..3e47af2 100644
--- a/bin/varnishadm/varnishadm.c
+++ b/bin/varnishadm/varnishadm.c
@@ -41,6 +41,9 @@
 #  else
 #    include <editline/readline.h>
 #  endif
+#  ifdef HAVE_READLINE_HISTORY_H
+#    include <readline/history.h>
+#  endif
 #endif
 
 #include <errno.h>
diff --git a/configure.ac b/configure.ac
index 87fdaf6..003f682 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,6 +148,7 @@ PKG_CHECK_MODULES([LIBEDIT], [libedit],
 	[AC_DEFINE([HAVE_LIBEDIT], [1], [Define we have libedit])],
 	[AC_CHECK_HEADERS([readline/readline.h])
 	 AC_CHECK_HEADERS([edit/readline/readline.h])
+	 AC_CHECK_HEADERS([readline/history.h])
 	 AC_CHECK_LIB(edit, el_init,
 	        [ AC_DEFINE([HAVE_LIBEDIT], [1], [Define we have libedit])
 		  LIBEDIT_CFLAGS=""
@@ -171,7 +172,7 @@ AC_CHECK_HEADERS([sys/vfs.h])
 AC_CHECK_HEADERS([endian.h])
 AC_CHECK_HEADERS([execinfo.h])
 AC_CHECK_HEADERS([netinet/in.h])
-AC_CHECK_HEADERS([pthread_np.h])
+AC_CHECK_HEADERS([pthread_np.h], [], [], [#include <pthread.h>])
 AC_CHECK_HEADERS([stddef.h])
 AC_CHECK_HEADERS([stdlib.h])
 AC_CHECK_HEADERS([unistd.h])



More information about the varnish-dev mailing list