From 1efe6686fcf715bf07b18676c6348fd311d497d7 Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Wed, 19 Oct 2016 16:27:20 +1030 Subject: [PATCH] Use config.h instead of -DHAVE_FOO=1 swiftc(1) requires every -D option to be prefixed with -Xcc, which is not easy to achieve using autoconf. Now instead of setting configuration macros like HAVE_LSEEK64 on the command line using -D, they are defined in config.h, which is generated by ./configure, ignored by Git, and included by all headers and source files that use any configuration macro. The dependency on Makefile has been replaced with a dependency on Makefile.in and config.h, which helps avoid some redundant full recompiles after running ./configure, because the configure script does not overwrit config.h if its content does not change. --- .gitignore | 15 +-- Makefile.in | 14 +-- cli_stdio.c | 4 + config.h.in | 268 ++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 38 ++++--- directory_service.c | 4 + fakeradio.c | 4 + fdqueue.h | 4 + instance.c | 4 + jni_common.h | 4 + lang.h | 4 + lsif.c | 8 +- monitor-cli.c | 4 + monitor-client.c | 4 + monitor.c | 4 + net.h | 4 + os.h | 4 + overlay_interface.c | 4 + rhizome_store.c | 3 + serval.h | 4 + server.c | 4 + socket.h | 4 + strbuf.h | 1 + strbuf_helpers.h | 4 + strlcpy.h | 4 + uuid.c | 4 + vomp_console.c | 4 + 27 files changed, 395 insertions(+), 32 deletions(-) create mode 100644 config.h.in diff --git a/.gitignore b/.gitignore index ba3becd2..c7a1ce33 100644 --- a/.gitignore +++ b/.gitignore @@ -10,14 +10,15 @@ *.a *.suo .*.sw? -VERSION.txt +/VERSION.txt /configure /autom4te.cache /aclocal.m4 -Makefile -testconfig.sh -config.log -config.status +/config.log +/config.status +/Makefile +/testconfig.sh +/config.h /nacl/nacl-20110221/build /nacl/naclinc.txt /nacl/nacllib.txt @@ -31,6 +32,6 @@ config.status /simulator *.so test.*.log -/testlog -/coverage_html +/testlog/ +/coverage_html/ *.info diff --git a/Makefile.in b/Makefile.in index 6b7713b6..176f6e45 100644 --- a/Makefile.in +++ b/Makefile.in @@ -227,13 +227,13 @@ $(OBJSDIR_LIB)/%.o: $(SOURCE_PREFIX)%.c # broad so it sometimes results in unnecessary re-compilation, but that is # better than too narrow, which can result in missed re-compilation. -$(SERVAL_DAEMON_OBJS): $(SOURCE_PREFIX)Makefile $(PREFIXED_HEADERS) -$(SERVALD_OBJS): $(SOURCE_PREFIX)Makefile -$(LIB_SERVAL_OBJS): $(SOURCE_PREFIX)Makefile $(PREFIXED_HEADERS) -$(OBJSDIR_TOOLS)/tfw_createfile.o: $(SOURCE_PREFIX)Makefile $(SOURCE_PREFIX)str.h -$(OBJSDIR_TOOLS)/directory_service.o: $(SOURCE_PREFIX)Makefile $(PREFIXED_HEADERS) -$(MONITOR_CLIENT_OBJS): $(SOURCE_PREFIX)Makefile $(PREFIXED_HEADERS) -$(SIMULATOR_OBJS): $(SOURCE_PREFIX)Makefile $(PREFIXED_HEADERS) +$(SERVAL_DAEMON_OBJS): $(SOURCE_PREFIX)Makefile.in $(SOURCE_PREFIX)config.h $(PREFIXED_HEADERS) +$(SERVALD_OBJS): $(SOURCE_PREFIX)Makefile.in +$(LIB_SERVAL_OBJS): $(SOURCE_PREFIX)Makefile.in $(SOURCE_PREFIX)config.h $(PREFIXED_HEADERS) +$(OBJSDIR_TOOLS)/tfw_createfile.o: $(SOURCE_PREFIX)Makefile.in $(SOURCE_PREFIX)str.h +$(OBJSDIR_TOOLS)/directory_service.o: $(SOURCE_PREFIX)Makefile.in $(SOURCE_PREFIX)config.h $(PREFIXED_HEADERS) +$(MONITOR_CLIENT_OBJS): $(SOURCE_PREFIX)Makefile.in $(SOURCE_PREFIX)config.h $(PREFIXED_HEADERS) +$(SIMULATOR_OBJS): $(SOURCE_PREFIX)Makefile.in $(SOURCE_PREFIX)config.h $(PREFIXED_HEADERS) # Rules for main targets. diff --git a/cli_stdio.c b/cli_stdio.c index 9109e768..7a60f7db 100644 --- a/cli_stdio.c +++ b/cli_stdio.c @@ -18,6 +18,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include // for PRId64 #include "cli_stdio.h" diff --git a/config.h.in b/config.h.in new file mode 100644 index 00000000..ab191d75 --- /dev/null +++ b/config.h.in @@ -0,0 +1,268 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if the acosf() function is available. */ +#undef HAVE_ACOSF + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if the asinf() function is available. */ +#undef HAVE_ASINF + +/* Define to 1 if the atan2f() function is available. */ +#undef HAVE_ATAN2F + +/* Define to 1 if the atanf() function is available. */ +#undef HAVE_ATANF + +/* Define to 1 if you have the `bcmp' function. */ +#undef HAVE_BCMP + +/* Define to 1 if you have the `bcopy' function. */ +#undef HAVE_BCOPY + +/* Define to 1 if you have the `bzero' function. */ +#undef HAVE_BZERO + +/* Define to 1 if the ceilf() function is available. */ +#undef HAVE_CEILF + +/* Define to 1 if the cosf() function is available. */ +#undef HAVE_COSF + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define to 1 if the expf() function is available. */ +#undef HAVE_EXPF + +/* Define to 1 if you have the header file. */ +#undef HAVE_FLOAT_H + +/* Define to 1 if the floorf() function is available. */ +#undef HAVE_FLOORF + +/* Define to 1 if the system has the `aligned' function attribute */ +#undef HAVE_FUNC_ATTRIBUTE_ALIGNED + +/* Define to 1 if the system has the `alloc_size' function attribute */ +#undef HAVE_FUNC_ATTRIBUTE_ALLOC_SIZE + +/* Define to 1 if the system has the `error' function attribute */ +#undef HAVE_FUNC_ATTRIBUTE_ERROR + +/* Define to 1 if the system has the `format' function attribute */ +#undef HAVE_FUNC_ATTRIBUTE_FORMAT + +/* Define to 1 if the system has the `malloc' function attribute */ +#undef HAVE_FUNC_ATTRIBUTE_MALLOC + +/* Define to 1 if the system has the `unused' function attribute */ +#undef HAVE_FUNC_ATTRIBUTE_UNUSED + +/* Define to 1 if the system has the `used' function attribute */ +#undef HAVE_FUNC_ATTRIBUTE_USED + +/* Define to 1 if you have the `getpeereid' function. */ +#undef HAVE_GETPEEREID + +/* Define to 1 if you have the `gettid' function. */ +#undef HAVE_GETTID + +/* Define to 1 if you have the header file. */ +#undef HAVE_IFADDRS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_JNI_H + +/* Define to 1 if you have the `c' library (-lc). */ +#undef HAVE_LIBC + +/* Define to 1 if you have the `rt' library (-lrt). */ +#undef HAVE_LIBRT + +/* Define to 1 if you have the `sodium' library (-lsodium). */ +#undef HAVE_LIBSODIUM + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_NETLINK_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_RTNETLINK_H + +/* Linux threads are supported - gettid(2) and tgkill(2). */ +#undef HAVE_LINUX_THREADS + +/* Define to 1 if the log10f() function is available. */ +#undef HAVE_LOG10F + +/* Define to 1 if the logf() function is available. */ +#undef HAVE_LOGF + +/* Define to 1 if you have the `lseek64' function. */ +#undef HAVE_LSEEK64 + +/* Define to 1 if you have the header file. */ +#undef HAVE_MATH_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NET_IF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NET_ROUTE_H + +/* Define to 1 if the system has the type `off64_t'. */ +#undef HAVE_OFF64_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_POLL_H + +/* Define to 1 if the powf() function is available. */ +#undef HAVE_POWF + +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define to 1 if the sinf() function is available. */ +#undef HAVE_SINF + +/* Define to 1 if you have the header file. */ +#undef HAVE_SODIUM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if the strlcpy() function is available. */ +#undef HAVE_STRLCPY + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_BYTEORDER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_ENDIAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_FILIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MMAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STATVFS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_UCRED_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_VFS_H + +/* Define to 1 if the tanf() function is available. */ +#undef HAVE_TANF + +/* Define to 1 if you have the `tgkill' function. */ +#undef HAVE_TGKILL + +/* Define to 1 if you have the header file. */ +#undef HAVE_UCRED_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if the system has the `section' variable attribute */ +#undef HAVE_VAR_ATTRIBUTE_SECTION + +/* Define to 1 if the system has the `section_seg' variable attribute */ +#undef HAVE_VAR_ATTRIBUTE_SECTION_SEG + +/* default instance path */ +#undef INSTANCE_PATH + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* default Rhizome store directory */ +#undef RHIZOME_STORE_PATH + +/* default config directory */ +#undef SERVAL_ETC_PATH + +/* default log directory */ +#undef SERVAL_LOG_PATH + +/* default run directory */ +#undef SERVAL_RUN_PATH + +/* default Serval tmp directory */ +#undef SERVAL_TMP_PATH + +/* The size of `off_t', as computed by sizeof. */ +#undef SIZEOF_OFF_T + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* default system log directory */ +#undef SYSTEM_LOG_PATH + +/* Use abstract namespace sockets for local communication. */ +#undef USE_ABSTRACT_NAMESPACE diff --git a/configure.ac b/configure.ac index 12f57d80..14616f74 100644 --- a/configure.ac +++ b/configure.ac @@ -184,10 +184,12 @@ AC_CACHE_CHECK([Linux thread system calls], ac_cv_have_linux_threads, [ [ac_cv_have_linux_threads=yes] ) ]) -AS_IF([test "x$ac_cv_have_linux_threads" = xyes], [AC_DEFINE([HAVE_LINUX_THREADS])]) +AS_IF([test "x$ac_cv_have_linux_threads" = xyes], + [AC_DEFINE([HAVE_LINUX_THREADS], 1, [Linux threads are supported - gettid(2) and tgkill(2).])]) dnl Lazy way of checking for Linux -AS_IF([test "x$ac_cv_header_linux_if_h" = xyes], [AC_DEFINE([USE_ABSTRACT_NAMESPACE])]) +AS_IF([test "x$ac_cv_header_linux_if_h" = xyes], + [AC_DEFINE([USE_ABSTRACT_NAMESPACE], 1, [Use abstract namespace sockets for local communication.])]) AC_CACHE_CHECK([linker -z relro option], libc_cv_z_relro, [dnl libc_cv_z_relro=no @@ -219,22 +221,26 @@ AS_IF([test x"$have_ssp" = "x1"], [ ]) dnl Some platforms still seem to lack the basic single precision trig and power related function. -AC_SEARCH_LIBS([sinf], [m], AC_DEFINE([HAVE_SINF], [1], [Define to 1 if you have the sinf() function.])) -AC_SEARCH_LIBS([cosf], [m], AC_DEFINE([HAVE_COSF], [1], [Define to 1 if you have the cosf() function.])) -AC_SEARCH_LIBS([tanf], [m], AC_DEFINE([HAVE_TANF], [1], [Define to 1 if you have the tanf() function.])) -AC_SEARCH_LIBS([asinf], [m], AC_DEFINE([HAVE_ASINF], [1], [Define to 1 if you have the asinf() function.])) -AC_SEARCH_LIBS([acosf], [m], AC_DEFINE([HAVE_ACOSF], [1], [Define to 1 if you have the acosf() function.])) -AC_SEARCH_LIBS([atanf], [m], AC_DEFINE([HAVE_ATANF], [1], [Define to 1 if you have the atanf() function.])) -AC_SEARCH_LIBS([atan2f], [m], AC_DEFINE([HAVE_ATAN2F], [1], [Define to 1 if you have the atan2f() function.])) -AC_SEARCH_LIBS([ceilf], [m], AC_DEFINE([HAVE_CEILF], [1], [Define to 1 if you have the ceilf() function.])) -AC_SEARCH_LIBS([floorf], [m], AC_DEFINE([HAVE_FLOORF], [1], [Define to 1 if you have the floorf() function.])) -AC_SEARCH_LIBS([powf], [m], AC_DEFINE([HAVE_POWF], [1], [Define to 1 if you have the powf() function.])) -AC_SEARCH_LIBS([expf], [m], AC_DEFINE([HAVE_EXPF], [1], [Define to 1 if you have the expf() function.])) -AC_SEARCH_LIBS([logf], [m], AC_DEFINE([HAVE_LOGF], [1], [Define to 1 if you have the logf() function.])) -AC_SEARCH_LIBS([log10f], [m], AC_DEFINE([HAVE_LOG10F], [1], [Define to 1 if you have the log10f() function.])) +AC_SEARCH_LIBS([sinf], [m], AC_DEFINE([HAVE_SINF], [1], [Define to 1 if the sinf() function is available.])) +AC_SEARCH_LIBS([cosf], [m], AC_DEFINE([HAVE_COSF], [1], [Define to 1 if the cosf() function is available.])) +AC_SEARCH_LIBS([tanf], [m], AC_DEFINE([HAVE_TANF], [1], [Define to 1 if the tanf() function is available.])) +AC_SEARCH_LIBS([asinf], [m], AC_DEFINE([HAVE_ASINF], [1], [Define to 1 if the asinf() function is available.])) +AC_SEARCH_LIBS([acosf], [m], AC_DEFINE([HAVE_ACOSF], [1], [Define to 1 if the acosf() function is available.])) +AC_SEARCH_LIBS([atanf], [m], AC_DEFINE([HAVE_ATANF], [1], [Define to 1 if the atanf() function is available.])) +AC_SEARCH_LIBS([atan2f], [m], AC_DEFINE([HAVE_ATAN2F], [1], [Define to 1 if the atan2f() function is available.])) +AC_SEARCH_LIBS([ceilf], [m], AC_DEFINE([HAVE_CEILF], [1], [Define to 1 if the ceilf() function is available.])) +AC_SEARCH_LIBS([floorf], [m], AC_DEFINE([HAVE_FLOORF], [1], [Define to 1 if the floorf() function is available.])) +AC_SEARCH_LIBS([powf], [m], AC_DEFINE([HAVE_POWF], [1], [Define to 1 if the powf() function is available.])) +AC_SEARCH_LIBS([expf], [m], AC_DEFINE([HAVE_EXPF], [1], [Define to 1 if the expf() function is available.])) +AC_SEARCH_LIBS([logf], [m], AC_DEFINE([HAVE_LOGF], [1], [Define to 1 if the logf() function is available.])) +AC_SEARCH_LIBS([log10f], [m], AC_DEFINE([HAVE_LOG10F], [1], [Define to 1 if the log10f() function is available.])) dnl Check for strlcpy (eg Ubuntu) -AC_SEARCH_LIBS([strlcpy], [], AC_DEFINE([HAVE_STRLCPY], [1], [Define to 1 if you have the strlcpy() function.])) +AC_SEARCH_LIBS([strlcpy], [], AC_DEFINE([HAVE_STRLCPY], [1], [Define to 1 if the strlcpy() function is available.])) + +dnl Put all the -DHAVE_BLAH=1 definitions into config.h instead of expanding +dnl them in @DEFS@ on the command-line of every compilation invoked by make. +AC_CONFIG_HEADERS([config.h]) AC_OUTPUT([ Makefile diff --git a/directory_service.c b/directory_service.c index bd8600a8..b555acad 100644 --- a/directory_service.c +++ b/directory_service.c @@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_POLL_H #include #endif diff --git a/fakeradio.c b/fakeradio.c index f462ed6c..e64785ae 100644 --- a/fakeradio.c +++ b/fakeradio.c @@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include diff --git a/fdqueue.h b/fdqueue.h index abb61107..7399940a 100644 --- a/fdqueue.h +++ b/fdqueue.h @@ -49,6 +49,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __SERVAL_DNA__FDQUEUE_H #define __SERVAL_DNA__FDQUEUE_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_POLL_H #include #endif diff --git a/instance.c b/instance.c index 05019868..224aef71 100644 --- a/instance.c +++ b/instance.c @@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include "instance.h" #include "str.h" diff --git a/jni_common.h b/jni_common.h index 07624724..aef964c0 100644 --- a/jni_common.h +++ b/jni_common.h @@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifndef HAVE_JNI_H #error is not available #endif diff --git a/lang.h b/lang.h index a612e57a..3ed72fe1 100644 --- a/lang.h +++ b/lang.h @@ -20,6 +20,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __SERVAL_DNA__LANG_H #define __SERVAL_DNA__LANG_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + /* Useful macros not specific to Serval DNA that assist with using the C * language. */ diff --git a/lsif.c b/lsif.c index e32bf043..05f46882 100644 --- a/lsif.c +++ b/lsif.c @@ -26,6 +26,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -212,7 +216,7 @@ lsif(void) { return 0; } -#endif +#endif // SIOCGIFCONF #ifdef HAVE_IFADDRS_H int @@ -258,4 +262,4 @@ doifaddrs(void) { return 0; } -#endif +#endif // HAVE_IFADDRS_H diff --git a/monitor-cli.c b/monitor-cli.c index 1eb8136c..9fbf8416 100644 --- a/monitor-cli.c +++ b/monitor-cli.c @@ -16,6 +16,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include diff --git a/monitor-client.c b/monitor-client.c index 9b0a4aa1..7f560649 100644 --- a/monitor-client.c +++ b/monitor-client.c @@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include diff --git a/monitor.c b/monitor.c index b7bbae70..28f5decd 100644 --- a/monitor.c +++ b/monitor.c @@ -53,6 +53,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. data structures (except for a binary extent for an audio sample block). */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include "serval.h" #include "conf.h" diff --git a/net.h b/net.h index e55abbc3..b56fecab 100644 --- a/net.h +++ b/net.h @@ -19,6 +19,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __SERVAL_DNA__NET_H #define __SERVAL_DNA__NET_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include // for size_t, ssize_t #include // for struct sockaddr, socklen_t #ifdef HAVE_NETINET_IN_H diff --git a/os.h b/os.h index bf79d239..eec24269 100644 --- a/os.h +++ b/os.h @@ -20,6 +20,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __SERVAL_DNA__OS_H #define __SERVAL_DNA__OS_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include // for off64_t #include // for NULL #include diff --git a/overlay_interface.c b/overlay_interface.c index 57519e1a..13576df7 100644 --- a/overlay_interface.c +++ b/overlay_interface.c @@ -18,6 +18,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include diff --git a/rhizome_store.c b/rhizome_store.c index 6259842e..5b039dd8 100644 --- a/rhizome_store.c +++ b/rhizome_store.c @@ -17,6 +17,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #ifdef HAVE_SYS_STATVFS_H diff --git a/serval.h b/serval.h index 64c5fbf2..e3b86d85 100644 --- a/serval.h +++ b/serval.h @@ -50,6 +50,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __SERVAL_DNA__SERVAL_H #define __SERVAL_DNA__SERVAL_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include diff --git a/server.c b/server.c index 62a30877..579a5410 100644 --- a/server.c +++ b/server.c @@ -19,6 +19,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include diff --git a/socket.h b/socket.h index 69d4d982..9e5f36da 100644 --- a/socket.h +++ b/socket.h @@ -20,6 +20,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __SERVAL_DNA___SOCKET_H #define __SERVAL_DNA___SOCKET_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef WIN32 # include "win32/win32.h" #else diff --git a/strbuf.h b/strbuf.h index 85f6d90d..f2c1f95f 100644 --- a/strbuf.h +++ b/strbuf.h @@ -19,6 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __STRBUF_H__ #define __STRBUF_H__ + #include #include "lang.h" diff --git a/strbuf_helpers.h b/strbuf_helpers.h index 652e304a..1fd780fd 100644 --- a/strbuf_helpers.h +++ b/strbuf_helpers.h @@ -20,6 +20,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __STRBUF_HELPERS_H__ #define __STRBUF_HELPERS_H__ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + // For socklen_t #ifdef WIN32 # include "win32/win32.h" diff --git a/strlcpy.h b/strlcpy.h index bb8761e6..33c9ffd5 100644 --- a/strlcpy.h +++ b/strlcpy.h @@ -20,6 +20,10 @@ #ifndef __STRLCPY_H__ #define __STRLCPY_H__ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + // Do not use strlcpy() in Serval DNA source code, use strncpy_nul() or // buf_strncpy_nul() from "str.h" instead. This strlcpy() is provided only // because it is needed by sqlite3.c. diff --git a/uuid.c b/uuid.c index f3893365..7632f874 100644 --- a/uuid.c +++ b/uuid.c @@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #define __SERVAL_DNA__UUID_H_INLINE #include "uuid.h" #include "os.h" diff --git a/vomp_console.c b/vomp_console.c index b02c45de..06c665c6 100644 --- a/vomp_console.c +++ b/vomp_console.c @@ -45,6 +45,10 @@ POSSIBILITY OF SUCH DAMAGE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include