libcli/configure.ac
2026-04-24 00:52:41 +02:00

56 lines
1.2 KiB
Text

AC_PREREQ([2.69])
AC_INIT([libcli], [0.1.0], [])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIRS([m4])
AM_INIT_AUTOMAKE([foreign -Wall -Werror subdir-objects])
AC_PROG_CC
if test "x$ac_cv_env_CFLAGS_set" != "xset"; then
CFLAGS="-O2"
fi
STRICT_CFLAGS="-Wall -Wextra -Werror -pipe -Wpedantic -Wconversion -Wshadow"
AC_SUBST([STRICT_CFLAGS])
AM_PROG_AR
LT_PREREQ([2.2])
LT_INIT
# --enable-tests
AC_ARG_ENABLE([tests],
[AS_HELP_STRING([--enable-tests], [Build Criterion unit tests (default: no)])],
[enable_tests=$enableval],
[enable_tests=no])
AM_CONDITIONAL([BUILD_TESTS], [test "x$enable_tests" = "xyes"])
AS_IF([test "x$enable_tests" = "xyes"], [
PKG_CHECK_MODULES([CRITERION], [criterion], [], [
AC_MSG_NOTICE([pkg-config could not find criterion -- trying manual detection])
AC_CHECK_HEADER([criterion/criterion.h], [], [
AC_MSG_ERROR([criterion/criterion.h not found])])
AC_CHECK_LIB([criterion], [main],
[CRITERION_LIBS="-lcriterion"],
[AC_MSG_ERROR([libcriterion not found])])
])
])
AC_CONFIG_FILES([
Makefile
src/Makefile
tests/Makefile
example/Makefile
libcli.pc
])
AC_OUTPUT
AC_MSG_NOTICE([
libcli $VERSION
---------------
prefix : $prefix
CC : $CC
CFLAGS : $STRICT_CFLAGS
tests : $enable_tests
])