157 lines
4.1 KiB
Plaintext
157 lines
4.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],[0.00],[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])
|
|
|
|
dnl gettext & libtool
|
|
AC_PROG_LIBTOOL
|
|
AM_GNU_GETTEXT([external])
|
|
AM_GNU_GETTEXT_VERSION([0.14.1])
|
|
|
|
dnl various requisites
|
|
GTKMM_VERSION=2.8.0
|
|
CAIRO_VERSION=1.0.0
|
|
|
|
dnl c++ compiler and flags
|
|
AC_PROG_CXX
|
|
AC_CHECK_CXXFLAG([Wall])
|
|
AC_CHECK_CXXFLAG([pedantic])
|
|
AC_CHECK_CXXFLAG([Wextra])
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
dnl make
|
|
AC_PROG_MAKE_SET
|
|
|
|
dnl check for python and SWIG
|
|
AC_PYTHON_DEVEL
|
|
AC_PROG_SWIG
|
|
SWIG_ENABLE_CXX
|
|
SWIG_PYTHON
|
|
|
|
dnl check for gtkmm & cairo
|
|
PKG_CHECK_MODULES([CAIRO],
|
|
[cairo >= $CAIRO_VERSION],
|
|
:, AC_MSG_ERROR([$CAIRO_PKG_ERRORS]))
|
|
PKG_CHECK_MODULES([GLIB],
|
|
[glibmm-2.4 >= $GTKMM_VERSION],
|
|
:, AC_MSG_ERROR([$GLIB_PKG_ERRORS]))
|
|
PKG_CHECK_MODULES([GTHREAD],
|
|
[gthread-2.0 >= $GTKMM_VERSION],
|
|
:, AC_MSG_ERROR([$GTHREAD_PKG_ERRORS]))
|
|
PKG_CHECK_MODULES([GTKMM],
|
|
[gtkmm-2.4 >= $GTKMM_VERSION],
|
|
:, AC_MSG_ERROR([$GTKMM_PKG_ERRORS]))
|
|
|
|
dnl use DSO visibility tags for systems that supports it correctly
|
|
dnl (for example, GCC 4.0 and above)
|
|
dnl see http://gcc.gnu.org/wiki/Visibility for more informations
|
|
AC_MSG_CHECKING([whether the compiler supports DSO visibility attributes])
|
|
AC_LANG_PUSH([C++])
|
|
AC_COMPILE_IFELSE(
|
|
AC_LANG_PROGRAM([], [
|
|
#if defined (GCC_HASCLASSVISIBILITY) || defined (WIN32)
|
|
return 0;
|
|
#else
|
|
bails out with a compilation error.
|
|
#endif
|
|
]),[
|
|
AC_MSG_RESULT([yes])
|
|
AH_VERBATIM([DLLEXPORT],[
|
|
// DSO visibility support enabled by configure
|
|
#ifdef WIN32
|
|
#define DLLIMPORT __declspec(dllimport)
|
|
#define DLLEXPORT __declspec(dllexport)
|
|
#define DLLLOCAL
|
|
#define DLLPUBLIC
|
|
#else
|
|
#define DLLIMPORT
|
|
#ifdef GCC_HASCLASSVISIBILITY
|
|
#define DLLEXPORT __attribute__ ((visibility("default")))
|
|
#define DLLLOCAL __attribute__ ((visibility("hidden")))
|
|
#define DLLPUBLIC __attribute__ ((visibility("default")))
|
|
#else
|
|
#define DLLEXPORT
|
|
#define DLLLOCAL
|
|
#define DLLPUBLIC
|
|
#endif
|
|
#endif
|
|
])
|
|
AC_CHECK_CXXFLAG([fvisibility=hidden])
|
|
AC_CHECK_CXXFLAG([fvisibility-inlines-hidden])
|
|
],[
|
|
AC_MSG_RESULT([no])
|
|
AH_VERBATIM([DLLEXPORT],[
|
|
// Proper DSO visibility is unsupported
|
|
#define DLLIMPORT
|
|
#define DLLEXPORT
|
|
#define DLLLOCAL
|
|
#define DLLPUBLIC
|
|
])
|
|
])
|
|
AC_LANG_POP
|
|
|
|
|
|
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])
|
|
|
|
AC_CONFIG_FILES([config/Doxyfile])
|
|
|
|
AC_CONFIG_HEADERS([config.h:config.h.in])
|
|
|
|
AC_CONFIG_FILES([
|
|
Makefile
|
|
doc/Makefile
|
|
m4/Makefile
|
|
po/Makefile.in
|
|
src/Makefile
|
|
src/builtin-policies/Makefile
|
|
src/gtkgui/Makefile
|
|
src/pyloader/Makefile
|
|
src/testsuite/Makefile
|
|
])
|
|
AC_OUTPUT
|