1# Process this file with autoconf(1) to produce a configure script. 2 3# Copyright (c) 2013 Holger Weiss <holger@weiss.in-berlin.de> 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are met: 8# 9# 1. Redistributions of source code must retain the above copyright notice, this 10# list of conditions and the following disclaimer. 11# 12# 2. Redistributions in binary form must reproduce the above copyright notice, 13# this list of conditions and the following disclaimer in the documentation 14# and/or other materials provided with the distribution. 15# 16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 27# Autotools initialization. 28AC_PREREQ([2.60]) dnl But Autoconf 2.63 is required for AC_INIT's URL parameter. 29AC_INIT([NSCA-ng], 30 [1.6], 31 [developers@nsca-ng.org], 32 [nsca-ng], 33 [http://www.nsca-ng.org/]) 34AC_CONFIG_SRCDIR([src/server/nsca-ng.c]) 35AC_CONFIG_MACRO_DIR([m4]) 36AC_CONFIG_LIBOBJ_DIR([lib]) 37AC_CONFIG_AUX_DIR([build-aux]) 38AC_CONFIG_TESTDIR([tests], [tests:src/client:src/server]) 39AM_INIT_AUTOMAKE([1.10 -Wall -Werror check-news]) 40AM_MAINTAINER_MODE([enable]) 41 42m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) dnl Automake 1.11 added this. 43 44# Set the release date. 45RELEASE_DATE='March 19, 2019' 46 47AC_SUBST([RELEASE_DATE]) 48 49# Check whether to build the client. 50AC_ARG_ENABLE([client], 51 [AS_HELP_STRING([--enable-client], 52 [build the NSCA-ng client [default: yes]])], 53 [nsca_enable_client=$enable_client], 54 [nsca_enable_client=yes]) 55AC_MSG_CHECKING([whether the NSCA-ng client should be built]) 56AS_IF([test "x$nsca_enable_client" = xyes], 57 [AC_MSG_RESULT([yes])], 58 [AC_MSG_RESULT([no])]) 59 60# Check whether to build the server. 61AC_ARG_ENABLE([server], 62 [AS_HELP_STRING([--enable-server], 63 [build the NSCA-ng server [default: no]])], 64 [nsca_enable_server=$enable_server], 65 [nsca_enable_server=no]) 66AC_MSG_CHECKING([whether the NSCA-ng server should be built]) 67AS_IF([test "x$nsca_enable_server" = xyes], 68 [AC_MSG_RESULT([yes])], 69 [AC_MSG_RESULT([no])]) 70 71# Check whether to use the POSIX AIO API. 72AC_ARG_ENABLE([posix-aio], 73 [AS_HELP_STRING([--disable-posix-aio], 74 [do not use the POSIX AIO API [default: auto-detect]])], 75 [nsca_enable_posix_aio=$enable_posix_aio], 76 [nsca_enable_posix_aio=yes]) 77 78# Bail out if neither the client nor the server should be built. 79AS_IF([test "x$nsca_enable_client" = xno && test "x$nsca_enable_server" = xno], 80 [AC_MSG_ERROR([Please specify --enable-client and/or --enable-server])]) 81 82# Tell Automake whether to build the client and/or server. 83AM_CONDITIONAL([BUILD_CLIENT], [test "x$nsca_enable_client" = xyes]) 84AM_CONDITIONAL([BUILD_SERVER], [test "x$nsca_enable_server" = xyes]) 85 86# Check for programs. 87AC_USE_SYSTEM_EXTENSIONS 88AC_PROG_CC 89AM_PROG_CC_C_O 90AC_PROG_CC_STDC 91AC_PROG_INSTALL 92AC_PROG_MKDIR_P 93AC_PROG_RANLIB 94 95m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) dnl Automake 1.11.2 added this. 96 97AM_CONDITIONAL([GCC], [test "x$GCC" = xyes]) 98 99# Check for libraries. 100NSCA_LIB_NETWORKING 101NSCA_LIB_EV 102NSCA_LIB_OPENSSL 103AS_IF([test "x$nsca_enable_server" = xyes], 104 [NSCA_LIB_CONFUSE 105 NSCA_LIB_SYSTEMD 106 NSCA_LIB_PIDFILE 107 AS_IF([test "x$nsca_enable_posix_aio" = xyes], 108 [NSCA_LIB_AIO])]) 109 110# Tell Automake about some of our check results. 111AM_CONDITIONAL([USE_EMBEDDED_EV], 112 [test "x$nsca_lib_ev_embedded" = xyes]) 113AM_CONDITIONAL([USE_EMBEDDED_PIDFILE], 114 [test "x$nsca_lib_pidfile_embedded" = xyes]) 115AM_CONDITIONAL([HAVE_FLOCK], 116 [test "x$nsca_func_flock" = xyes]) 117 118# Check for header files. 119AC_HEADER_STDBOOL 120AC_CHECK_HEADERS([inttypes.h]) 121 122# Check for typedefs, structures, and compiler characteristics. 123AC_C_INLINE 124AC_C_RESTRICT 125AC_TYPE_SIZE_T 126AS_IF([test "x$nsca_enable_server" = xyes], 127 [AC_TYPE_SSIZE_T 128 AC_TYPE_INTMAX_T 129 AC_TYPE_PID_T]) 130 131# Check for library functions. 132HW_FUNC_VSNPRINTF 133HW_FUNC_SNPRINTF 134HW_FUNC_VASPRINTF 135HW_FUNC_ASPRINTF 136NSCA_FUNC_PROGNAME 137AC_REPLACE_FUNCS([strdup strcasecmp strncasecmp]) 138AS_IF([test "x$nsca_enable_client" = xyes], 139 [AC_CHECK_FUNCS([nanosleep])]) 140AS_IF([test "x$nsca_enable_server" = xyes], 141 [AC_CHECK_FUNCS([closefrom]) 142 NSCA_FUNC_DAEMON]) 143 144# Communicate the PIPE_BUF value to Autotest. 145AC_COMPUTE_INT([nsca_pipe_buf], [PIPE_BUF], [[#include <limits.h>]], 146 [nsca_pipe_buf=512]) 147AC_SUBST([nsca_pipe_buf]) 148 149# Spit out the results. 150AC_CONFIG_HEADERS([config.h]) 151AC_CONFIG_FILES([ 152 Makefile 153 build-aux/Makefile 154 contrib/Makefile 155 etc/Makefile 156 lib/Makefile 157 lib/ev/Makefile 158 lib/pidfile/Makefile 159 man/Makefile 160 perl/Makefile 161 python/Makefile 162 src/Makefile 163 src/client/Makefile 164 src/common/Makefile 165 src/server/Makefile 166 tests/Makefile 167 tests/atlocal]) 168 169AC_OUTPUT 170 171AC_MSG_NOTICE([summary of build options: 172 173 Build NSCA-ng client: $nsca_enable_client 174 Build NSCA-ng server: $nsca_enable_server 175 Use embedded libev: $nsca_lib_ev_embedded 176 Compiler: $CC 177]) 178 179dnl vim:set joinspaces textwidth=80 filetype=m4: 180