aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac11
-rw-r--r--src/blogc-runserver/httpd.c33
2 files changed, 33 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index 21e6549..3443956 100644
--- a/configure.ac
+++ b/configure.ac
@@ -134,12 +134,11 @@ RUNSERVER="disabled"
AC_ARG_ENABLE([runserver], AS_HELP_STRING([--enable-runserver],
[build blogc-runserver tool]))
AS_IF([test "x$enable_runserver" = "xyes"], [
- #AC_CHECK_HEADERS([signal.h limits.h fcntl.h unistd.h sys/stat.h sys/types.h sys/socket.h netinet/in.h arpa/inet.h],, [
- # AC_MSG_ERROR([blogc-runserver tool requested but required headers not found])
- #])
- #AX_PTHREAD([], [
- # AC_MSG_ERROR([blogc-runserver tool requested but pthread is not supported])
- #])
+ AC_CHECK_HEADERS([sys/socket.h netdb.h netinet/in.h arpa/inet.h winsock2.h])
+ AC_CHECK_HEADERS([signal.h limits.h fcntl.h unistd.h sys/stat.h sys/types.h],, [
+ AC_MSG_ERROR([blogc-runserver tool requested but required headers not found])
+ ])
+ # FIXME: check if some thread implementation is available
RUNSERVER="enabled"
have_runserver=yes
])
diff --git a/src/blogc-runserver/httpd.c b/src/blogc-runserver/httpd.c
index 1c27b3d..57bcec4 100644
--- a/src/blogc-runserver/httpd.c
+++ b/src/blogc-runserver/httpd.c
@@ -6,6 +6,34 @@
* See the file LICENSE.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif /* HAVE_SYS_SOCKET_H */
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif /* HAVE_NETINET_IN_H */
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif /* HAVE_ARPA_INET_H */
+
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif /* HAVE_NETDB_H */
+
+#ifdef HAVE_PTHREAD
+#include <pthread.h>
+#endif /* HAVE_PTHREAD */
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif /* HAVE_WINSOCK2_H */
+
#include <errno.h>
#include <stdio.h>
#include <stdbool.h>
@@ -14,11 +42,6 @@
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <pthread.h>
#include "../common/error.h"
#include "../common/file.h"
#include "../common/thread.h"