- Finish splitting the visibility macro also for plugins
---Questa linea, e quelle sotto di essa, saranno ignorate-- A trunk/plugins/pyloader/m4/sgpemv2-visibility.m4 M trunk/plugins/pyloader/configure.ac M trunk/plugins/pyloader/Makefile.am A trunk/plugins/xmlsave/m4/sgpemv2-visibility.m4 M trunk/plugins/xmlsave/configure.ac M trunk/plugins/xmlsave/Makefile.am git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@722 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
cd9a73ee0e
commit
b69f9b9d12
|
@ -51,7 +51,8 @@ ACLOCAL_AMFLAGS = -I m4
|
|||
|
||||
macros = m4/compilerflags.m4 \
|
||||
m4/linkingflags.m4 \
|
||||
m4/sgpemv2-dirs.m4
|
||||
m4/sgpemv2-dirs.m4 \
|
||||
m4/sgpemv2-visibility.m4
|
||||
|
||||
EXTRA_DIST += \
|
||||
config/config.rpath \
|
||||
|
|
|
@ -104,54 +104,7 @@ PKG_CHECK_MODULES([GLIBMM],
|
|||
:, 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
|
||||
|
||||
SGPEMV2_VISIBILITY_SUPPORT
|
||||
|
||||
dnl see if we've to compile tests
|
||||
AC_MSG_CHECKING([whether tests have to be built])
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
dnl m4/sgpemv2-visibility.m4 - Copyright 2005, 2006, University
|
||||
dnl of Padova, dept. of Pure and Applied
|
||||
dnl Mathematics
|
||||
dnl
|
||||
dnl This file is part of SGPEMv2.
|
||||
dnl
|
||||
dnl This is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
dnl the Free Software Foundation; either version 2 of the License, or
|
||||
dnl (at your option) any later version.
|
||||
dnl
|
||||
dnl SGPEMv2 is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License
|
||||
dnl along with SGPEMv2; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
dnl ---------- AC_PROG_SGPEMV2 ---------------------
|
||||
dnl
|
||||
dnl Synopsis: AC_PROG_SGPEMV2([min_version])
|
||||
dnl
|
||||
dnl This macro enables the new DSO visibility
|
||||
dnl support for compilers that supports it, defining
|
||||
dnl the following preprocessor macros:
|
||||
dnl SG_DLLEXPORT : for objects exported by the DSO
|
||||
dnl SG_DLLIMPORT : for objects imported by the DSO
|
||||
dnl SG_DLLLOCAL : for objects local to the DSO
|
||||
dnl SG_DLLPUBLIC : for objects public outside the DSO
|
||||
dnl
|
||||
dnl Example of usage: SGPEMV2_VISIBILITY_SUPPORT
|
||||
dnl ------------------------------------------------
|
||||
AC_DEFUN([SGPEMV2_VISIBILITY_SUPPORT],
|
||||
[
|
||||
|
||||
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 ------- SGPEMV2_VISIBILITY_SUPPORT ---------------------
|
|
@ -50,7 +50,8 @@ ACLOCAL_AMFLAGS = -I m4
|
|||
|
||||
macros = m4/compilerflags.m4 \
|
||||
m4/linkingflags.m4 \
|
||||
m4/sgpemv2-dirs.m4
|
||||
m4/sgpemv2-dirs.m4 \
|
||||
m4/sgpemv2-visibility.m4
|
||||
|
||||
EXTRA_DIST += \
|
||||
config/config.rpath \
|
||||
|
|
|
@ -102,54 +102,7 @@ PKG_CHECK_MODULES([LIBXML2],
|
|||
|
||||
|
||||
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
|
||||
|
||||
SGPEMV2_VISIBILITY_SUPPORT
|
||||
|
||||
dnl see if we've to compile tests
|
||||
AC_MSG_CHECKING([whether tests have to be built])
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
dnl m4/sgpemv2-visibility.m4 - Copyright 2005, 2006, University
|
||||
dnl of Padova, dept. of Pure and Applied
|
||||
dnl Mathematics
|
||||
dnl
|
||||
dnl This file is part of SGPEMv2.
|
||||
dnl
|
||||
dnl This is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
dnl the Free Software Foundation; either version 2 of the License, or
|
||||
dnl (at your option) any later version.
|
||||
dnl
|
||||
dnl SGPEMv2 is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License
|
||||
dnl along with SGPEMv2; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
dnl ---------- AC_PROG_SGPEMV2 ---------------------
|
||||
dnl
|
||||
dnl Synopsis: AC_PROG_SGPEMV2([min_version])
|
||||
dnl
|
||||
dnl This macro enables the new DSO visibility
|
||||
dnl support for compilers that supports it, defining
|
||||
dnl the following preprocessor macros:
|
||||
dnl SG_DLLEXPORT : for objects exported by the DSO
|
||||
dnl SG_DLLIMPORT : for objects imported by the DSO
|
||||
dnl SG_DLLLOCAL : for objects local to the DSO
|
||||
dnl SG_DLLPUBLIC : for objects public outside the DSO
|
||||
dnl
|
||||
dnl Example of usage: SGPEMV2_VISIBILITY_SUPPORT
|
||||
dnl ------------------------------------------------
|
||||
AC_DEFUN([SGPEMV2_VISIBILITY_SUPPORT],
|
||||
[
|
||||
|
||||
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 ------- SGPEMV2_VISIBILITY_SUPPORT ---------------------
|
Loading…
Reference in New Issue