sgpemv2/plugins/pyloader/configure.ac

174 lines
5.3 KiB
Plaintext
Raw Normal View History

# 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-pyloader],[0.1],[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_ARG_VAR([LT_LDFLAGS],
[You can use this variable to pass an option
to libtool when it is in linking mode (for
example, "-all-static")])
AC_PROG_LIBTOOL
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.14.1])
dnl PYTHON_VERSION is declared precious by AC_PYTHON_DEVEL,
dnl so don't use it here
PY_VERSION=2.3
GTKMM_VERSION=2.8.0
SGPEMV2_VERSION=0.1
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])
AC_PROG_INSTALL
dnl make
AC_PROG_MAKE_SET
dnl check for python and SWIG
AC_PYTHON_DEVEL([>= '$PY_VERSION'])
AC_PROG_SWIG
SWIG_ENABLE_CXX
SWIG_PYTHON
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]))
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
AH_TEMPLATE([SG_DLLEXPORT],[Attribute for objects to be exported from DSOs])
AH_TEMPLATE([SG_DLLIMPORT],[Attribute for objects to be imported from DSOs])
AH_TEMPLATE([SG_DLLLOCAL], [Attribute for objects local to current DSO])
AH_TEMPLATE([SG_DLLPUBLIC],[Attribute for DSO public objects])
AC_ARG_ENABLE([visibility-support],
AS_HELP_STRING([--disable-visibility-support],
[disable the new GCC visibility support]),
[enable_gcc_visibility="$enableval"],
[enable_gcc_visibility="yes"])
AC_MSG_CHECKING([whether to use new GCC visibility attributes])
dnl for now it works only with GCC >= 4.0.0
AC_LANG_PUSH([C++])
if test "x$enable_gcc_visibility" = "xyes"; then
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([], [
#if defined __GNUC__ && (__GNUC__) >= 4
return 0;
#else
bails out with a compilation error.
#endif
]),
:,
[enable_gcc_visibility="no"])
fi
AC_LANG_POP
if test "x$enable_gcc_visibility" = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([SG_DLLIMPORT],[/* intentionally left with no value */])
AC_DEFINE([SG_DLLEXPORT],[__attribute__ ((visibility("default")))])
AC_DEFINE([SG_DLLLOCAL],[__attribute__ ((visibility("hidden")))])
AC_DEFINE([SG_DLLPUBLIC],[__attribute__ ((visibility("default")))])
AC_CHECK_CXXFLAG([VISIB_HIDDEN], [fvisibility=hidden])
AC_SUBST([VISIB_HIDDEN])
AC_CHECK_CXXFLAG([CXXFLAGS],[fvisibility-inlines-hidden])
else
AC_MSG_RESULT([no])
AC_DEFINE([SG_DLLIMPORT],[/* unsupported */])
AC_DEFINE([SG_DLLEXPORT],[/* unsupported */])
AC_DEFINE([SG_DLLLOCAL],[/* unsupported */])
AC_DEFINE([SG_DLLPUBLIC],[/* unsupported */])
fi
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