# Copyright 2010 Nathan Phillip Brink, Ethan Zonca # # This file is a part of DistRen. # # Distren is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # DistRen is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with DistRen. If not, see . AC_PREREQ(2.61) AC_INIT([distren],[0.0],[http://bugs.ohnopub.net/], [], [http://ohnopub.net/distren/]) AC_CONFIG_HEADERS([src/common/config.h]) AC_CONFIG_SRCDIR([src/server/distrend.c]) AC_CONFIG_MACRO_DIR([m4]) AC_PROG_CC AC_PROG_LIBTOOL AM_INIT_AUTOMAKE([gnu dist-bzip2 subdir-objects -Wall]) AM_PROG_CC_C_O dnl these macros force the refered to types to be available without me dnl writing my own magic :-) AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_UINT8_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T dnl execio has a nice() call but it's not vital to our operation AC_CHECK_FUNCS([nice]) dnl selective compilation dnl For now, this is only left for when the C-based client is dnl reintroducded. AC_ARG_ENABLE([server], [AS_HELP_STRING([--disable-server],[Don't build the distren server])], [enable_server=$enableval], [enable_server=yes]) AM_CONDITIONAL([ENABLE_SERVER], [test "x$enable_server" = "xyes"]) dnl package dependencies: DISTLIBS_MODULES="libconfuse >= 2.5 libcurl libxml-2.0 liblist >= 2.3.1 libarchive >= 2.8.0 libcrypto" AC_SUBST([DISTLIBS_MODULES]) PKG_CHECK_MODULES([DISTLIBS], [$DISTLIBS_MODULES]) AX_LIB_MYSQL AS_IF( [test "x${MYSQL_VERSION}" = "x"], [ AC_MSG_ERROR([I need mysql]) ] ) LIBS_save="$LIBS" CFLAGS_save="$CFLAGS" LIBS="$LIBS $DISTLIBS_LIBS" CFLAGS="$CFLAGS $DISTLIBS_CFLAGS" AC_LINK_IFELSE([AC_LANG_PROGRAM([#include #include ], [printf(stderr, "%s", list_brag); return 0;])], [AC_DEFINE([HAVE_LIST_BRAG], [], [Define if liblist has list_brag.])], []) LIBS="$LIBS_save" CFLAGS="$CFLAGS_save" PKG_CHECK_MODULES([CHECK], [check >= 0.9.3]) dnl define paths for configuration files until a better arrangement is dnl made: AC_DEFINE_DIR([LOCALSTATEDIR], [localstatedir], [Default directory for storing state information]) AC_DEFINE_DIR([RUNSTATEDIR], [localstatedir/run], [Default directory for registering runtime information like pid-files]) AC_CONFIG_FILES([Makefile libdistren.pc etc/distrendaemon.conf etc/distrenslave.conf ]) AC_OUTPUT