From 5fa28dc2b871b11f93d4206bea2780262f85af5e Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Fri, 21 Dec 2018 05:23:58 +0100 Subject: wip --- configure.ac | 11 +++++------ src/blogc-runserver/httpd.c | 33 ++++++++++++++++++++++++++++----- 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 +#endif /* HAVE_CONFIG_H */ + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif /* HAVE_SYS_SOCKET_H */ + +#ifdef HAVE_NETINET_IN_H +#include +#endif /* HAVE_NETINET_IN_H */ + +#ifdef HAVE_ARPA_INET_H +#include +#endif /* HAVE_ARPA_INET_H */ + +#ifdef HAVE_NETDB_H +#include +#endif /* HAVE_NETDB_H */ + +#ifdef HAVE_PTHREAD +#include +#endif /* HAVE_PTHREAD */ + +#ifdef HAVE_WINSOCK2_H +#include +#endif /* HAVE_WINSOCK2_H */ + #include #include #include @@ -14,11 +42,6 @@ #include #include #include -#include -#include -#include -#include -#include #include "../common/error.h" #include "../common/file.h" #include "../common/thread.h" -- cgit v1.2.3-18-g5258