dnl Copyright (C) 2001-2025 Zabbix SIA
dnl This program is free software: you can redistribute it and/or modify it under the terms of
dnl the GNU Affero General Public License as published by the Free Software Foundation, version 3.
dnl This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
dnl without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
dnl See the GNU Affero General Public License for more details.
dnl You should have received a copy of the GNU Affero General Public License along with this program.
dnl If not, see <https://www.gnu.org/licenses/>.
dnl Process this file with autoconf to produce a configure script.
AC_INIT([Zabbix],[7.0.11rc1])
AC_CONFIG_SRCDIR(src/zabbix_server/server.c)
AM_INIT_AUTOMAKE([subdir-objects tar-pax])
AC_MSG_NOTICE([Configuring $PACKAGE_NAME $PACKAGE_VERSION])
AC_CONFIG_HEADERS(include/common/config.h)
AC_SUBST(DEFAULT_INCLUDES, ['-I$(top_srcdir)/include/common -I$(top_srcdir)/include'])
dnl *****************************************************************
dnl * Checks for programs *
dnl *****************************************************************
AC_PROG_CC([cc c99 gcc clang])
dnl A C99 compliant compiler must support this.
dnl The implementations differ across compilers and platforms.
dnl GCC allocates the storage blocks in bss during compilation,
dnl while others elect for the runtime loader to handle the allocation.
dnl This means the proper test would be to run the executable,
dnl but that would make no sense when cross-compiling,
dnl so the best we can do is just reject compilers that don't even
dnl recognize the keyword.
AC_MSG_CHECKING(whether compiler supports thread-local storage)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
static __thread int a = 0;
AC_MSG_ERROR([compiler does not recognize the __thread keyword])
dnl *****************************************************************
dnl * Checks for header files *
dnl *****************************************************************
AC_CHECK_HEADERS(stdio.h stdlib.h string.h unistd.h netdb.h signal.h malloc.h \
syslog.h time.h errno.h sys/types.h sys/stat.h netinet/in.h \
math.h sys/socket.h dirent.h ctype.h \
fcntl.h sys/param.h arpa/inet.h \
sys/vfs.h sys/pstat.h sys/sysinfo.h sys/statvfs.h sys/statfs.h \
sys/loadavg.h sys/vmmeter.h strings.h vm/vm_param.h \
sys/time.h kstat.h sys/syscall.h sys/sysmacros.h \
stdint.h mach/host_info.h mach/mach_host.h pwd.h \
sys/var.h arpa/nameser.h assert.h sys/dkstat.h sys/disk.h sys/sched.h \
zone.h nlist.h kvm.h linux/version.h procinfo.h sys/dk.h \
sys/resource.h pthread.h windows.h process.h conio.h sys/wait.h \
stdarg.h winsock2.h pdh.h psapi.h sys/sem.h sys/ipc.h sys/shm.h Winldap.h \
Winber.h lber.h ws2tcpip.h inttypes.h sys/file.h grp.h \
execinfo.h sys/systemcfg.h sys/mnttab.h mntent.h sys/times.h \
dlfcn.h sys/utsname.h sys/un.h sys/protosw.h stddef.h limits.h float.h poll.h \
AC_CHECK_HEADERS(resolv.h, [], [], [