Vulpes - XMPP Bot
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.
 
 
 
 

114 lines
4.6 KiB

AC_INIT([vulpes], [0.0.0], [stefan@devlug.de])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_FILES([Makefile])
AM_INIT_AUTOMAKE([foreign subdir-objects])
# -----------------------------------------------------------------------------
# Status of Package
# - release - release version
# - development - development only
#PACKAGE_STATUS="release"
PACKAGE_STATUS="development"
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Checking programs
AC_PROG_CC
AC_PROG_LIBTOOL
AC_SYS_LARGEFILE
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Checking platform
AC_CANONICAL_HOST
PLATFORM="unknown"
AS_CASE([$host_os],
[freebsd*], [PLATFORM="freebsd"],
[openbsd*], [PLATFORM="openbsd"],
[darwin*], [PLATFORM="osx"],
[cygwin], [PLATFORM="cygwin"],
[PLATFORM="nix"])
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# format-sources - clang-format
AM_EXTRA_RECURSIVE_TARGETS([format-sources])
AC_CHECK_PROG([SOURCE_FORMATTER], [clang-format], [clang-format])
AM_CONDITIONAL([HAVE_SOURCE_FORMATTER], [test x$SOURCE_FORMATTER = xclang-format])
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Flags for C compiler
AM_CFLAGS="-Wall -Wno-deprecated-declarations -pedantic -std=c18 -rdynamic -ldl"
# Additional C compiler flags during development
AS_IF([test "x$PACKAGE_STATUS" = xdevelopment],
[AM_CFLAGS="-Wunused -Werror -g -O0 $AM_CFLAGS"])
# Addition defines for development
AS_IF([test "x$PACKAGE_STATUS" = xdevelopment],
[AC_DEFINE([PACKAGE_STATUS_DEVELOPMENT], [1], [Package status - Development])])
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# glib-2.0 >= 2.58.3
PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.58.3],
[LIBS="$glib_LIBS $LIBS" CFLAGS="$CFLAGS $glib_CFLAGS"],
[AC_MSG_ERROR([glib >= 2.58.3 not found - Install libglib2.0-dev])])
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# libstrophe >= 0.10.0
PKG_CHECK_MODULES([libstrophe], [libstrophe >= 0.10.0],
[LIBS="$libstrophe_LIBS $LIBS" CFLAGS="$CFLAGS $libstrophe_CFLAGS" AC_DEFINE([HAVE_LIBSTROPHE], [1], [libstrophe])],
[AC_MSG_ERROR([libstrophe in version >= 0.10.0 not found - Install libstrophe-dev])])
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# libcurl >= 7.74.0
PKG_CHECK_MODULES([curl], [libcurl >= 7.74.0],
[LIBS="$curl_LIBS $LIBS" CFLAGS="$CFLAGS $curl_CFLAGS"],
[AC_MSG_ERROR([curl >= 7.74.0 not found - Install libcurl4])])
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# libxml-2.0 >= 2.9.10
PKG_CHECK_MODULES([xml2], [libxml-2.0 >= 2.9.10],
[LIBS="$xml2_LIBS $LIBS" CFLAGS="$CFLAGS $xml2_CFLAGS"],
[AC_MSG_ERROR([xml2 >= 2.9.10 not found - Install libxml2-dev])])
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# sqlite3 >= 3.34.1
PKG_CHECK_MODULES([sqlite3], [sqlite3 >= 3.34.1],
[LIBS="$sqlite3_LIBS $LIBS" CFLAGS="$CFLAGS $sqlite3_CFLAGS"],
[AC_MSG_ERROR([sqlite3 >= 3.34.1 not found - Install libsqlite3-dev])])
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# liblutjanus
CFLAGS="$CFLAGS -I/usr/local/include/"
#LIBS="$LIBS /usr/local/lib/liblutjanus.la"
LIBS="$LIBS /usr/local/lib/liblutjanus.a"
# -----------------------------------------------------------------------------
AC_SUBST(AM_LDFLAGS)
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_CPPFLAGS)
AC_CHECK_FUNCS([strdup])
AC_OUTPUT
echo ""
echo "PLATFORM : $host_os"
echo "PACKAGE_STATUS : $PACKAGE_STATUS"
echo "AM_CFLAGS : $AM_CFLAGS"
echo "AM_CPPFLAGS : $AM_CPPFLAGS"
echo "AM_LDFLAGS : $AM_LDFLAGS"
echo "LIBS : $LIBS"