sgpemv2/configure.ac

163 lines
5.1 KiB
Plaintext

# configure.ac - Copyright 2005, University
# of Padova, dept. of Pure and Applied
# Mathematics
#
# This file is part of SGPEMv2.
#
# This 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.
#
# SGPEMv2 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 SGPEMv2; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
dnl ----------------- CONFIGURE ---------------------
AC_INIT([sgpemv2],[1.0],[matteo@member.fsf.org])
if test -f "`pwd`/configure.ac"; then
AC_MSG_FAILURE([
** This seems to be the pkg root directory.
** Compiling here your sources is considered
** as unpolite as exploring your nose with
** your pinky whilst attending a wedding party.
** Please create a new dir as described in
** the README file, and then run configure
** into it. If you think you've got it right,
** please inform the mantainer of this error!
** He'll thoroughfully bash his head on the wall.],
-1 )
fi
AC_GNU_SOURCE
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_TARGET
dnl starting automake
AM_INIT_AUTOMAKE([dejagnu dist-bzip2 subdir-objects])
dnl HACK to avoid multiple definition of macros when
dnl including spgemv2-config.h (autoheader generated)
AH_TOP([#if not defined PACKAGE])
AH_BOTTOM([#endif])
dnl gettext & libtool
AC_PROG_LIBTOOL
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.14.1])
dnl various requisites
SIGCPP_VERSION=2.0.10
GTKMM_VERSION=2.8.0
LIBGLADEMM_VERSION=2.6.0
CAIRO_VERSION=1.0.0
dnl c++ compiler and flags
AC_PROG_CXX
AC_CHECK_CXXFLAG([CXXFLAGS], [Wall])
AC_CHECK_CXXFLAG([CXXFLAGS], [pedantic])
AC_CHECK_CXXFLAG([CXXFLAGS], [Wextra])
AC_CHECK_CXXFLAG([CXXFLAGS], [Wno-long-long])
AC_CHECK_CXXFLAG([CXXFLAGS], [fvisibility-inlines-hidden])
AC_CHECK_LDFLAG([LDFLAGS],[--as-needed])
dnl see if we've to enable debug flags
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug],
[turn on debug compiler flags. Disabled by default]),
[enable_debug="$enableval"], [enable_debug="no"])
if test "$enable_debug" = "yes"; then
AC_CHECK_CXXFLAG([CXXFLAGS], [O0])
AC_CHECK_CXXFLAG([CXXFLAGS], [g3])
else
AC_CHECK_CXXFLAG([CXXFLAGS], [DNDEBUG])
fi
dnl see if we have to enable visibility support
AC_ARG_ENABLE([visibility-support],
AS_HELP_STRING([--enable-visibility-support],
[enable the new GCC visibility support; requires GCC >= 4.0 to work.]),
[enable_gcc_visibility="$enableval"],
[enable_gcc_visibility="no"])
AC_MSG_CHECKING([whether to use new GCC visibility attributes])
if test "x$enable_gcc_visibility" = "xno"; then
CPPFLAGS="${CPPFLAGS} -DDISABLE_VISIBILITY_SUPPORT"
fi
AC_MSG_RESULT([$enable_gcc_visibility])
AC_PROG_INSTALL
dnl make
AC_PROG_MAKE_SET
dnl check for gtkmm & cairo
PKG_PROG_PKG_CONFIG([0.19])
if test -z "$PKG_CONFIG"; then
AC_MSG_ERROR([You may need to update your pkg-config installation])
fi
PKG_CHECK_MODULES([CAIRO],
[cairo >= $CAIRO_VERSION],
:, AC_MSG_ERROR([$CAIRO_PKG_ERRORS]))
PKG_CHECK_MODULES([GTHREAD],
[gthread-2.0 >= $GTKMM_VERSION],
:, AC_MSG_ERROR([$GTHREAD_PKG_ERRORS]))
PKG_CHECK_MODULES([SIGCPP],
[sigc++-2.0 >= $SIGCPP_VERSION],
:, AC_MSG_ERROR([$SIGCPP_PKG_ERRORS]))
PKG_CHECK_MODULES([GLIBMM],
[glibmm-2.4 >= $GTKMM_VERSION],
:, AC_MSG_ERROR([$GLIBMM_PKG_ERRORS]))
PKG_CHECK_MODULES([GTKMM],
[gtkmm-2.4 >= $GTKMM_VERSION],
:, AC_MSG_ERROR([$GTKMM_PKG_ERRORS]))
PKG_CHECK_MODULES([LIBGLADEMM],
[libglademm-2.4 >= $LIBGLADEMM_VERSION],
:, AC_MSG_ERROR([$LIBGLADEMM_PKG_ERRORS]))
dnl check for Doxygen
AC_CHECK_PROG([HAVE_DOXYGEN],[doxygen],[yes])
AC_CHECK_PROG([HAVE_DOT],[dot], [yes])
AM_CONDITIONAL([HAVE_DOXYGEN],[test x$HAVE_DOXYGEN = xyes])
dnl see if we've to compile tests
AC_MSG_CHECKING([whether tests have to be built])
AC_ARG_ENABLE([tests],
AS_HELP_STRING([--disable-tests],
[don't compile the tests provided with sgpemv2]),
[compile_tests="$enableval"],
[compile_tests="yes"])
AC_MSG_RESULT([$compile_tests])
AM_CONDITIONAL([COND_TESTS], [test "$compile_tests" = "yes"])
dnl output files
AC_CONFIG_FILES([config/Doxyfile config/sgpemv2.pc config/sgpemv2-uninstalled.pc])
AC_CONFIG_HEADERS([config.h:config.h.in])
# force include of configuration header in every compilation unit
CPPFLAGS="${CPPFLAGS} -include config.h"
dnl configure plugin directories
dnl TODO: make this conditional
AC_CONFIG_FILES([plugins/pyloader/config/sgpemv2-uninstalled.pc:config/sgpemv2-uninstalled.pc.in])
AC_CONFIG_FILES([plugins/xmlsave/config/sgpemv2-uninstalled.pc:config/sgpemv2-uninstalled.pc.in])
AC_CONFIG_SUBDIRS([plugins/pyloader plugins/xmlsave])
# Now, output this very package Makefiles:
AC_CONFIG_FILES([
Makefile
po/Makefile.in
])
AC_OUTPUT