aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2018-12-21 05:23:58 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2018-12-21 05:23:58 +0100
commit5fa28dc2b871b11f93d4206bea2780262f85af5e (patch)
treef5e770f8c4aa55dc0e70aa06f8118bf037559171
parent66cafc0bf6ef742661f2f8bbc8ac195c2ca8b4e4 (diff)
downloadblogc-5fa28dc2b871b11f93d4206bea2780262f85af5e.tar.gz
blogc-5fa28dc2b871b11f93d4206bea2780262f85af5e.tar.bz2
blogc-5fa28dc2b871b11f93d4206bea2780262f85af5e.zip
wip
-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"