Newer
Older
# This file is part of SLS.
# Copyright (C) 2008 Sebastien LUTTRINGER <contact@seblu.net>
# SLS is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# SLS 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 General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with SLS; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Require a recent version of autotools
AC_PREREQ(2.59)
# Auto conf init
# Define configure generator directory
AC_CONFIG_AUX_DIR([build])
# Auto Make init
AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
# Check platform
AC_CANONICAL_HOST
# without-error arg
AC_ARG_WITH([error],
[AS_HELP_STRING([--without-error], [GCC warnings dont make compilation errors])],
[],
[with_error=yes]
)
# with-debug arg
AC_ARG_WITH([debug],
[AS_HELP_STRING([--with-debug], [Use -g and don't use neither -DNDEBUG nor -O3])],
[],
[with_debug=no]
)
# with-efence arg
AC_ARG_WITH([efence],
[AS_HELP_STRING([--with-efence], [Link with Electric-Fence library])],
CXXFLAGS='-Wall -W -ansi -pedantic -D_XOPEN_SOURCE=600 -pipe'
# Set Error flags
AS_IF([test "x$with_error" != xno],[CXXFLAGS="$CXXFLAGS -Werror"])
AS_IF([test "x$with_debug" != xyes],[CXXFLAGS="$CXXFLAGS -DNDEBUG -O3"], [CXXFLAGS="$CXXFLAGS -g"])
# Check for C++ compiler
AC_LANG([C++])
AC_PROG_CXX
# Check for libs
AC_CHECK_LIB([sqlite3], [sqlite3_open],,[AC_MSG_ERROR([Library sqlite3 not found!])])
AC_CHECK_LIB([ssl], [SSL_library_init],,[AC_MSG_ERROR([Library ssl not found!])])
AC_CHECK_LIB([pthread], [pthread_create],,[AC_MSG_ERROR([Library pthread not found!])])
# Set efence library
AS_IF([test "x$with_efence" = "xyes" ],
[AC_CHECK_LIB([efence], [malloc],
[],
[AC_MSG_ERROR([Electric-Fence library not found!])])])