freebsd-dev/contrib/openpam/configure.ac

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

171 lines
5.0 KiB
Plaintext
Raw Normal View History

2023-06-27 17:01:49 +00:00
AC_PREREQ([2.69])
AC_INIT([OpenPAM], [20230627], [des@des.no], [openpam], [https://openpam.org/])
AC_CONFIG_SRCDIR([lib/libpam/pam_start.c])
2011-12-18 17:08:40 +00:00
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign])
AM_CONFIG_HEADER([config.h])
2005-02-01 10:16:17 +00:00
2011-12-18 17:08:40 +00:00
# C compiler and features
2007-12-21 11:49:29 +00:00
AC_LANG(C)
2023-06-27 17:01:49 +00:00
AC_PROG_CC([clang gcc cc])
2011-12-18 17:08:40 +00:00
AC_PROG_CC_STDC
AC_PROG_CPP
2023-06-27 17:01:49 +00:00
AC_PROG_CXX([clang++ g++ c++])
2011-12-18 17:08:40 +00:00
AC_GNU_SOURCE
AC_C_CONST
AC_C_RESTRICT
2005-02-01 10:16:17 +00:00
AC_C_VOLATILE
2023-06-27 17:01:49 +00:00
AX_COMPILER_VENDOR
2011-12-18 17:08:40 +00:00
# libtool
LT_PREREQ([2.2.6])
LT_INIT([disable-static dlopen])
2019-02-24 20:54:06 +00:00
# pkg-config
AX_PROG_PKG_CONFIG
2011-12-18 17:08:40 +00:00
# other programs
AC_PROG_INSTALL
2005-02-01 10:16:17 +00:00
LIB_MAJ=2
AC_SUBST(LIB_MAJ)
AC_DEFINE_UNQUOTED(LIB_MAJ, $LIB_MAJ, [OpenPAM library major number])
2011-12-18 17:08:40 +00:00
AC_ARG_ENABLE([debug],
AC_HELP_STRING([--enable-debug],
2023-06-27 17:01:49 +00:00
[turn debugging macros on]),
2013-09-07 16:15:30 +00:00
AC_DEFINE(OPENPAM_DEBUG, 1, [Turn debugging macros on]))
2011-12-18 17:08:40 +00:00
AC_ARG_ENABLE([unversioned-modules],
AC_HELP_STRING([--disable-unversioned-modules],
2023-06-27 17:01:49 +00:00
[support loading of unversioned modules]),
2011-12-18 17:08:40 +00:00
[AS_IF([test x"$enableval" = x"no"], [
2023-06-27 17:01:49 +00:00
AC_DEFINE(DISABLE_UNVERSIONED_MODULES,
1,
[Whether loading unversioned modules support is disabled])
2011-12-18 17:08:40 +00:00
])])
AC_ARG_WITH([modules-dir],
AC_HELP_STRING([--with-modules-dir=DIR],
2023-06-27 17:01:49 +00:00
[OpenPAM modules directory]),
2011-12-18 17:08:40 +00:00
[AS_IF([test x"$withval" != x"no"], [
2023-06-27 17:01:49 +00:00
OPENPAM_MODULES_DIR="$withval"
AC_DEFINE_UNQUOTED(OPENPAM_MODULES_DIR,
"${OPENPAM_MODULES_DIR%/}",
[OpenPAM modules directory])
2013-09-07 16:15:30 +00:00
])])
2005-02-01 10:16:17 +00:00
AC_SUBST(OPENPAM_MODULES_DIR)
2013-09-07 16:15:30 +00:00
AM_CONDITIONAL([CUSTOM_MODULES_DIR], [test x"$OPENPAM_MODULES_DIR" != x""])
2005-02-01 10:16:17 +00:00
2011-12-18 17:08:40 +00:00
AC_ARG_WITH([doc],
AC_HELP_STRING([--without-doc], [do not build documentation]),
[],
[with_doc=yes])
AM_CONDITIONAL([WITH_DOC], [test x"$with_doc" = x"yes"])
2007-12-21 11:49:29 +00:00
2011-12-18 17:08:40 +00:00
AC_ARG_WITH([pam-unix],
2017-02-19 21:00:46 +00:00
AC_HELP_STRING([--with-pam-unix], [build sample pam_unix(8) module]),
2011-12-18 17:08:40 +00:00
[],
[with_pam_unix=no])
AM_CONDITIONAL([WITH_PAM_UNIX], [test x"$with_pam_unix" = x"yes"])
2005-02-01 10:16:17 +00:00
2011-12-18 17:08:40 +00:00
AC_ARG_WITH(pamtest,
2017-02-19 21:00:46 +00:00
AC_HELP_STRING([--with-pamtest], [build test application]),
2011-12-18 17:08:40 +00:00
[],
[with_pamtest=no])
AM_CONDITIONAL([WITH_PAMTEST], [test x"$with_pamtest" = x"yes"])
2005-02-01 10:16:17 +00:00
2011-12-18 17:08:40 +00:00
AC_ARG_WITH(su,
2017-02-19 21:00:46 +00:00
AC_HELP_STRING([--with-su], [build sample su(1) implementation]),
2011-12-18 17:08:40 +00:00
[],
[with_su=no])
AM_CONDITIONAL([WITH_SU], [test x"$with_su" = x"yes"])
2017-02-19 21:00:46 +00:00
AC_ARG_WITH(system-libpam,
AC_HELP_STRING([--with-system-libpam], [use system libpam]),
[],
[with_system_libpam=no])
AM_CONDITIONAL([WITH_SYSTEM_LIBPAM], [test x"$with_system_libpam" = x"yes"])
2011-12-18 17:08:40 +00:00
AC_CHECK_HEADERS([crypt.h])
2005-02-01 10:16:17 +00:00
2013-09-07 16:15:30 +00:00
AC_CHECK_FUNCS([asprintf vasprintf])
AC_CHECK_FUNCS([dlfunc fdlopen])
AC_CHECK_FUNCS([fpurge])
AC_CHECK_FUNCS([setlogmask])
2014-09-15 09:40:30 +00:00
AC_CHECK_FUNCS([strlcat strlcmp strlcpy strlset])
2005-02-01 10:16:17 +00:00
2011-12-18 17:08:40 +00:00
saved_LIBS="${LIBS}"
LIBS=""
AC_CHECK_LIB([dl], [dlopen])
DL_LIBS="${LIBS}"
LIBS="${saved_LIBS}"
2005-02-01 10:16:17 +00:00
AC_SUBST(DL_LIBS)
2017-02-19 21:00:46 +00:00
saved_LIBS="${LIBS}"
LIBS=""
AC_CHECK_LIB([pam], [pam_start])
SYSTEM_LIBPAM="${LIBS}"
LIBS="${saved_LIBS}"
AC_SUBST(SYSTEM_LIBPAM)
2019-02-24 20:54:06 +00:00
AX_PKG_CONFIG_CHECK([cryb-test],
[AC_MSG_NOTICE([Cryb test framework found, unit tests enabled.])],
[AC_MSG_WARN([Cryb test framework not found, unit tests disabled.])])
AM_CONDITIONAL([WITH_TEST], [test x"$CRYB_TEST_LIBS" != x""])
2017-02-19 21:00:46 +00:00
2011-12-18 17:08:40 +00:00
AC_ARG_ENABLE([developer-warnings],
AS_HELP_STRING([--enable-developer-warnings], [enable strict warnings (default is NO)]),
2017-02-19 21:00:46 +00:00
[CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual"])
2011-12-18 17:08:40 +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"])
2007-12-21 11:49:29 +00:00
2023-06-27 17:01:49 +00:00
AC_ARG_ENABLE([code-coverage],
AS_HELP_STRING([--enable-code-coverage],
[enable code coverage]))
AS_IF([test x"$enable_code_coverage" = x"yes"], [
AM_COND_IF([WITH_TEST], [
AS_IF([test x"$ax_cv_c_compiler_vendor" = x"clang"], [
CFLAGS="${CFLAGS} -fprofile-instr-generate -fcoverage-mapping"
clang_code_coverage="yes"
AC_SUBST([clang_ver], [${CC#clang}])
], [
AC_MSG_ERROR([code coverage is only supported with clang])
])
AC_DEFINE([WITH_CODE_COVERAGE], [1], [Define to 1 if code coverage is enabled])
AC_MSG_NOTICE([code coverage enabled])
], [
AC_MSG_ERROR([code coverage requires unit tests])
])
])
AM_CONDITIONAL([WITH_CODE_COVERAGE], [test x"$enable_code_coverage" = x"yes"])
AM_CONDITIONAL([CLANG_CODE_COVERAGE], [test x"$clang_code_coverage" = x"yes"])
2007-12-21 11:49:29 +00:00
AC_CONFIG_FILES([
2012-05-26 14:23:18 +00:00
Makefile
2011-12-18 17:08:40 +00:00
bin/Makefile
2012-05-26 14:23:18 +00:00
bin/openpam_dump_policy/Makefile
2011-12-18 17:08:40 +00:00
bin/pamtest/Makefile
bin/su/Makefile
2012-05-26 14:23:18 +00:00
doc/Makefile
doc/man/Makefile
2023-06-27 17:01:49 +00:00
freebsd/Makefile
2011-12-18 17:08:40 +00:00
include/Makefile
include/security/Makefile
2013-09-07 16:15:30 +00:00
lib/Makefile
lib/libpam/Makefile
2017-02-19 21:00:46 +00:00
misc/Makefile
2011-12-18 17:08:40 +00:00
modules/Makefile
modules/pam_deny/Makefile
modules/pam_permit/Makefile
2017-02-19 21:00:46 +00:00
modules/pam_return/Makefile
2012-05-26 14:23:18 +00:00
modules/pam_unix/Makefile
t/Makefile
2007-12-21 11:49:29 +00:00
])
2017-02-19 21:00:46 +00:00
AC_CONFIG_FILES([misc/coverity.sh],[chmod +x misc/coverity.sh])
2005-02-01 10:16:17 +00:00
AC_OUTPUT