You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

69 lines
1.5 KiB

AC_INIT([utun],[2.0.0],[https://github.com/anomalyco/utun3/issues])
AC_CONFIG_SRCDIR([src/utun.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
# Required programs
AC_PROG_CC
AC_PROG_RANLIB
AM_PROG_AR
AM_INIT_AUTOMAKE([foreign subdir-objects -Wall -Werror])
# Checks for programs
AC_PROG_INSTALL
AC_PROG_MAKE_SET
# Checks for libraries
AC_CHECK_LIB([crypto], [SHA256_Init], [], [AC_MSG_ERROR([OpenSSL crypto library required])])
# Checks for header files
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_C_INLINE
# Checks for library functions
AC_FUNC_MALLOC
AC_CHECK_FUNCS([gettimeofday memset socket strchr strdup strerror strstr])
# Check for TUN/TAP support
AC_MSG_CHECKING([for TUN/TAP support])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <linux/if_tun.h>
]], [[
int fd = open("/dev/net/tun", O_RDWR);
]])], [
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_TUN_TAP], [1], [Define if TUN/TAP is available])
], [
AC_MSG_RESULT([no])
])
# Output files
AC_CONFIG_FILES([
Makefile
src/Makefile
tests/Makefile
lib/Makefile
])
AC_OUTPUT
# Summary
echo "
Configuration summary:
----------------------
Prefix: ${prefix}
Compiler: ${CC}
CFLAGS: ${CFLAGS}
Features:
TUN/TAP: ${have_tun_tap}
"