2006-06-13 17:09:13 +02:00
|
|
|
# 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
|
2007-06-30 15:31:19 +02:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
2006-06-13 17:09:13 +02:00
|
|
|
# (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
|
2007-06-30 15:31:19 +02:00
|
|
|
# along with SGPEMv2. If not, see http://www.gnu.org/licenses/.
|
|
|
|
|
2006-06-13 17:09:13 +02:00
|
|
|
|
|
|
|
dnl ----------------- CONFIGURE ---------------------
|
|
|
|
|
2008-11-08 21:01:09 +01:00
|
|
|
AC_INIT([sgpemv2-xmlsave],[1.1],[matteo@member.fsf.org])
|
2006-06-13 17:09:13 +02:00
|
|
|
|
|
|
|
if test -f "`pwd`/configure.ac"; then
|
|
|
|
AC_MSG_FAILURE([
|
2006-09-05 11:38:31 +02:00
|
|
|
** This seems to be the pkg root directory.
|
2008-11-08 19:35:13 +01:00
|
|
|
** Compiling here your sources is considered
|
|
|
|
** as unpolite as exploring your nose with
|
|
|
|
** your pinky whilst attending a wedding party.
|
2006-09-05 11:38:31 +02:00
|
|
|
** 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,
|
2008-11-08 19:35:13 +01:00
|
|
|
** please inform the mantainer of this error!
|
|
|
|
** He'll thoroughfully bash his head on the wall.],
|
|
|
|
-1 )
|
2006-06-13 17:09:13 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
AC_GNU_SOURCE
|
2008-11-08 21:01:09 +01:00
|
|
|
AC_CONFIG_AUX_DIR([config])
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2006-06-13 17:09:13 +02:00
|
|
|
|
|
|
|
AC_CANONICAL_TARGET
|
|
|
|
|
|
|
|
dnl starting automake
|
2006-09-07 21:12:19 +02:00
|
|
|
AM_INIT_AUTOMAKE([dejagnu dist-bzip2 subdir-objects])
|
2006-06-13 17:09:13 +02:00
|
|
|
|
|
|
|
dnl gettext & libtool
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
AM_GNU_GETTEXT([external])
|
2008-11-08 21:01:09 +01:00
|
|
|
AM_GNU_GETTEXT_VERSION([0.17])
|
2006-06-13 17:09:13 +02:00
|
|
|
|
|
|
|
dnl PYTHON_VERSION is declared precious by AC_PYTHON_DEVEL,
|
|
|
|
dnl so don't use it here
|
|
|
|
LIBXML2_VERSION=2.6.10
|
|
|
|
GTKMM_VERSION=2.8.0
|
2006-09-15 13:57:31 +02:00
|
|
|
SGPEMV2_VERSION=1.0
|
2006-06-13 17:09:13 +02:00
|
|
|
|
|
|
|
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_LDFLAG([LDFLAGS], [--as-needed])
|
|
|
|
|
2006-09-06 12:14:49 +02:00
|
|
|
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
|
|
|
|
|
2008-11-08 19:35:13 +01:00
|
|
|
|
|
|
|
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"
|
|
|
|
else
|
|
|
|
AC_CHECK_CXXFLAG([CXXFLAGS], [fvisibility-inlines-hidden])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([$enable_gcc_visibility])
|
|
|
|
|
|
|
|
|
2006-06-13 17:09:13 +02:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
|
|
|
dnl make
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
|
|
|
|
dnl add pkg-config search path for sgpemv2-uninstalled.pc
|
|
|
|
dnl if we're building in a subdir of that pkg it will be
|
|
|
|
dnl in $build_dir/config
|
|
|
|
_old_pkg_path=$[]PKG@&t@_CONFIG_PATH
|
|
|
|
export PKG_@&t@CONFIG_PATH="./config:$PKG_CONFIG_PATH"
|
|
|
|
|
|
|
|
dnl check for sgpemv2!
|
|
|
|
AC_PROG_SGPEMV2([$SGPEMV2_VERSION])
|
|
|
|
|
|
|
|
dnl revert from old var
|
|
|
|
dnl FIXME: probably you can safely remove this block:
|
|
|
|
if test "x$_old_pkg_path" = "x"; then
|
|
|
|
unset -v PKG@&t@_CONFIG_PATH
|
|
|
|
else
|
|
|
|
export PKG@&t@_CONFIG_PATH="$_old_pkg_path"
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl check for glib & cairo
|
|
|
|
PKG_CHECK_MODULES([GTHREAD],
|
|
|
|
[gthread-2.0 >= $GTKMM_VERSION],
|
|
|
|
:, AC_MSG_ERROR([$GTHREAD_PKG_ERRORS]))
|
|
|
|
PKG_CHECK_MODULES([GLIBMM],
|
|
|
|
[glibmm-2.4 >= $GTKMM_VERSION],
|
|
|
|
:, AC_MSG_ERROR([$GLIBMM_PKG_ERRORS]))
|
|
|
|
PKG_CHECK_MODULES([LIBXML2],
|
|
|
|
[libxml-2.0 >= $LIBXML2_VERSION],
|
|
|
|
:, AC_MSG_ERROR([$LIBXML2_PKG_ERRORS]))
|
|
|
|
|
2006-07-05 00:17:02 +02:00
|
|
|
|
2006-06-13 17:09:13 +02:00
|
|
|
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_HEADERS([config.h:config.h.in])
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
|
|
|
po/Makefile.in
|
|
|
|
])
|
|
|
|
AC_OUTPUT
|