2017-03-05 00:02:49 +00:00
|
|
|
AC_PREREQ([2.63])
|
2018-05-13 15:05:41 +00:00
|
|
|
AC_INIT([cryb.otp], [0.20180513], [des@des.no], [cryb-otp], [http://cryb.to/])
|
2017-03-05 00:02:49 +00:00
|
|
|
AC_CONFIG_SRCDIR([include/cryb/otp.h])
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz])
|
|
|
|
AM_CONFIG_HEADER([include/config.h])
|
2018-05-05 13:29:41 +00:00
|
|
|
AM_MAINTAINER_MODE([enable])
|
2017-03-05 00:02:49 +00:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
#
|
|
|
|
# Toolchain
|
|
|
|
#
|
|
|
|
|
|
|
|
# C compiler and features
|
|
|
|
AC_LANG(C)
|
|
|
|
AC_PROG_CC([clang gcc cc])
|
|
|
|
AC_PROG_CC_STDC
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_CXX([clang++ g++ c++])
|
|
|
|
AC_GNU_SOURCE
|
|
|
|
AC_C_CONST
|
|
|
|
AC_C_RESTRICT
|
|
|
|
AC_C_VOLATILE
|
|
|
|
AC_C_BIGENDIAN
|
|
|
|
AC_TYPE_INT16_T
|
|
|
|
AC_TYPE_INT32_T
|
|
|
|
AC_TYPE_INT8_T
|
|
|
|
AC_TYPE_INTMAX_T
|
|
|
|
AC_TYPE_INTPTR_T
|
|
|
|
AC_TYPE_OFF_T
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_TYPE_SSIZE_T
|
|
|
|
AC_TYPE_UINT16_T
|
|
|
|
AC_TYPE_UINT32_T
|
|
|
|
AC_TYPE_UINT8_T
|
|
|
|
AC_TYPE_UINTMAX_T
|
|
|
|
AC_TYPE_UINTPTR_T
|
|
|
|
|
|
|
|
# libtool
|
|
|
|
LT_PREREQ([2.2.6])
|
|
|
|
LT_INIT()
|
|
|
|
|
2017-03-07 00:33:16 +00:00
|
|
|
# pkg-config
|
2017-05-05 23:24:20 +00:00
|
|
|
AX_PROG_PKG_CONFIG
|
2017-03-07 00:33:16 +00:00
|
|
|
|
2017-03-05 00:02:49 +00:00
|
|
|
# other programs
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
#
|
|
|
|
# Headers and functions
|
|
|
|
#
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS([endian.h sys/endian.h])
|
|
|
|
AX_GCC_BUILTIN([__builtin_bswap16])
|
|
|
|
AX_GCC_BUILTIN([__builtin_bswap32])
|
|
|
|
AX_GCC_BUILTIN([__builtin_bswap64])
|
|
|
|
AC_CHECK_DECLS([
|
|
|
|
bswap16, bswap32, bswap64,
|
|
|
|
be16enc, be16dec, le16enc, le16dec,
|
|
|
|
be32enc, be32dec, le32enc, le32dec,
|
|
|
|
be64enc, be64dec, le64enc, le64dec,
|
|
|
|
htobe16, be16toh, htole16, le16toh,
|
|
|
|
htobe32, be32toh, htole32, le32toh,
|
|
|
|
htobe64, be64toh, htole64, le64toh,
|
|
|
|
nothing
|
|
|
|
], [], [], [[
|
|
|
|
#if HAVE_SYS_ENDIAN_H
|
|
|
|
#include <sys/endian.h>
|
|
|
|
#endif
|
|
|
|
#if HAVE_ENDIAN_H
|
|
|
|
#include <endian.h>
|
|
|
|
#endif
|
|
|
|
]])
|
|
|
|
AC_CHECK_FUNCS([strlcat strlcmp strlcpy])
|
|
|
|
AC_CHECK_FUNCS([wcslcat wcslcmp wcslcpy])
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
#
|
|
|
|
# Build options
|
|
|
|
#
|
|
|
|
|
|
|
|
# Documentation
|
|
|
|
AC_ARG_ENABLE([doc],
|
2017-05-05 23:03:17 +00:00
|
|
|
AS_HELP_STRING([--disable-doc],
|
2017-03-05 00:02:49 +00:00
|
|
|
[do not build the documentation]),
|
|
|
|
[with_doc=$enableval])
|
|
|
|
AM_CONDITIONAL([WITH_DOC], [test x"$with_doc" != x"no"])
|
|
|
|
|
|
|
|
# Make utilities setuid
|
|
|
|
AC_ARG_ENABLE([setuid],
|
2017-05-05 23:03:17 +00:00
|
|
|
AS_HELP_STRING([--disable-setuid],
|
2017-03-05 00:02:49 +00:00
|
|
|
[do not set the setuid bit on command-line utilities]),
|
|
|
|
[enable_setuid=$enableval],
|
|
|
|
[enable_setuid=yes])
|
|
|
|
AM_CONDITIONAL([WITH_SETUID], [test x"$enable_setuid" = x"yes"])
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
#
|
|
|
|
# Debugging
|
|
|
|
#
|
|
|
|
|
|
|
|
# Developer-friendly compiler flags
|
|
|
|
AC_ARG_ENABLE([developer-warnings],
|
|
|
|
AS_HELP_STRING([--enable-developer-warnings],
|
|
|
|
[enable strict warnings (default is NO)]),
|
2017-05-02 12:18:07 +00:00
|
|
|
[CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -Wshadow"])
|
2017-03-05 00:02:49 +00:00
|
|
|
AC_ARG_ENABLE([debugging-symbols],
|
|
|
|
AS_HELP_STRING([--enable-debugging-symbols],
|
|
|
|
[enable debugging symbols (default is NO)]),
|
|
|
|
[CFLAGS="${CFLAGS} -O0 -g -fno-inline"])
|
|
|
|
AC_ARG_ENABLE([werror],
|
|
|
|
AS_HELP_STRING([--enable-werror],
|
|
|
|
[use -Werror (default is NO)]),
|
|
|
|
[CFLAGS="${CFLAGS} -Werror"])
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
#
|
|
|
|
# Components
|
|
|
|
#
|
2018-05-12 22:29:06 +00:00
|
|
|
CRYB_INIT
|
|
|
|
|
|
|
|
CRYB_LIB_REQUIRE([digest test])
|
|
|
|
|
|
|
|
CRYB_LIB_PROVIDE([otp], [core oath])
|
|
|
|
|
|
|
|
CRYB_PROVIDE([bsdauth], [otp])
|
|
|
|
CRYB_PROVIDE([pam], [otp])
|
|
|
|
CRYB_PROVIDE([radius], [otp])
|
|
|
|
CRYB_PROVIDE([cli], [otp])
|
|
|
|
|
|
|
|
if test x"$enable_cryb_pam" = x"yes" ; then
|
|
|
|
save_LIBS="${LIBS}"
|
|
|
|
LIBS=""
|
|
|
|
AC_CHECK_LIB([pam], [pam_start], [], [
|
|
|
|
AC_MSG_ERROR([libpam is required to build the PAM module])
|
|
|
|
])
|
|
|
|
PAM_LIBS="${LIBS}"
|
|
|
|
LIBS="${save_LIBS}"
|
|
|
|
AC_SUBST(PAM_LIBS)
|
|
|
|
fi
|
2017-03-05 00:02:49 +00:00
|
|
|
|
2018-05-12 22:29:06 +00:00
|
|
|
CRYB_RESOLVE
|
2017-03-05 00:02:49 +00:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
#
|
|
|
|
# Output
|
|
|
|
#
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
|
|
|
include/Makefile
|
|
|
|
include/cryb/Makefile
|
|
|
|
lib/Makefile
|
|
|
|
lib/otp/Makefile
|
2017-03-07 00:33:16 +00:00
|
|
|
lib/otp/cryb-otp.pc
|
2017-03-05 00:02:49 +00:00
|
|
|
pam/Makefile
|
|
|
|
pam/pam_otp/Makefile
|
|
|
|
libexec/Makefile
|
|
|
|
libexec/login_otp/Makefile
|
|
|
|
bin/Makefile
|
|
|
|
bin/otpkey/Makefile
|
|
|
|
sbin/Makefile
|
|
|
|
sbin/otpradiusd/Makefile
|
|
|
|
t/Makefile
|
|
|
|
])
|
|
|
|
AC_OUTPUT
|
|
|
|
|
2018-05-12 22:29:06 +00:00
|
|
|
CRYB_SUMMARY
|