diff options
author | Daniel Elstner <daniel@src.gnome.org> | 2007-08-12 01:58:05 +0000 |
---|---|---|
committer | Daniel Elstner <daniel@src.gnome.org> | 2007-08-12 01:58:05 +0000 |
commit | 3ee4145bf7246ead5c289f1a87feeb74081c6636 (patch) | |
tree | 72267f2f1f665e9ebc2e938c6958f8b91480e12b | |
parent | 3dc5e0d4e1e9ea885613520fdc4077232faa4286 (diff) | |
download | glibmm-3ee4145bf7246ead5c289f1a87feeb74081c6636.tar.gz |
New file, defining M4 utility macros for feature testing. These macros are
* scripts/dk-feature.m4: New file, defining M4 utility macros for
feature testing. These macros are part of my personal autoconf
library and are not specific to glibmm, as indicated by the "DK_"
namespace prefix.
* configure.in (AC_INIT): Switch to the non-deprecated usage of
AC_INIT() by passing project name and version number as arguments.
This is necessary to define a couple of auxiliary macros.
(AC_PREREQ): Bump Autoconf version requirement to 2.58.
(AC_CONFIG_SRCDIR): Point to project-specific source file.
(AC_CONFIG_MACRO_DIR): Declare scripts/ as M4 directory.
(AM_INIT_AUTOMAKE): Switch to non-deprecated usage.
(AC_CHECK_SIZEOF): Use to determine the size of wchar_t.
(DK_CHECK_FEATURE): Use new feature test macro to check for
support of wide-character streams.
* config.h.in (SIZEOF_WCHAR_T): Add #undef template.
* glib/glibmmconfig.h.in (GLIBMM_HAVE_WIDE_STREAM): Likewise.
svn path=/trunk/; revision=431
-rw-r--r-- | ChangeLog | 21 | ||||
-rw-r--r-- | config.h.in | 1 | ||||
-rw-r--r-- | configure.in | 19 | ||||
-rw-r--r-- | glib/glibmmconfig.h.in | 1 | ||||
-rw-r--r-- | scripts/dk-feature.m4 | 101 |
5 files changed, 136 insertions, 7 deletions
@@ -1,3 +1,24 @@ +2007-08-12 Daniel Elstner <danielk@openismus.com> + + * scripts/dk-feature.m4: New file, defining M4 utility macros for + feature testing. These macros are part of my personal autoconf + library and are not specific to glibmm, as indicated by the "DK_" + namespace prefix. + + * configure.in (AC_INIT): Switch to the non-deprecated usage of + AC_INIT() by passing project name and version number as arguments. + This is necessary to define a couple of auxiliary macros. + (AC_PREREQ): Bump Autoconf version requirement to 2.58. + (AC_CONFIG_SRCDIR): Point to project-specific source file. + (AC_CONFIG_MACRO_DIR): Declare scripts/ as M4 directory. + (AM_INIT_AUTOMAKE): Switch to non-deprecated usage. + (AC_CHECK_SIZEOF): Use to determine the size of wchar_t. + (DK_CHECK_FEATURE): Use new feature test macro to check for + support of wide-character streams. + + * config.h.in (SIZEOF_WCHAR_T): Add #undef template. + * glib/glibmmconfig.h.in (GLIBMM_HAVE_WIDE_STREAM): Likewise. + 2007-08-04 Daniel Elstner <daniel.kitta@gmail.com> * containerhandle_shared.h (TypeTraits<bool>): Rewrite completely diff --git a/config.h.in b/config.h.in index d04186be..20390c5e 100644 --- a/config.h.in +++ b/config.h.in @@ -3,3 +3,4 @@ #undef HAVE_FUNLOCKFILE #undef GETC_UNLOCKED #undef HAVE_MKFIFO +#undef SIZEOF_WCHAR_T diff --git a/configure.in b/configure.in index eca87ea8..a07ce47f 100644 --- a/configure.in +++ b/configure.in @@ -11,8 +11,10 @@ # Copyright 1999 gtkmm Development Team # Copyright 1998 Stephan Kulow # -AC_INIT(glib/glibmmconfig.h.in) -AC_PREREQ(2.50) +AC_INIT([glibmm], [2.13.9]) +AC_PREREQ([2.58]) +AC_CONFIG_SRCDIR([glib/glibmmconfig.h.in]) +AC_CONFIG_MACRO_DIR([scripts]) ######################################################################### # Version and initialization @@ -43,12 +45,8 @@ AC_SUBST(LIBGLIBMM_SO_VERSION) AC_CONFIG_AUX_DIR(scripts) -dnl For automake. -VERSION=$GLIBMM_VERSION -PACKAGE=glibmm - dnl Initialize automake stuff -AM_INIT_AUTOMAKE($PACKAGE, $VERSION) +AM_INIT_AUTOMAKE([1.7 gnu]) dnl Specify a configuration file (no autoheader) AM_CONFIG_HEADER(config.h glib/glibmmconfig.h) @@ -188,6 +186,13 @@ if test "x$config_error" = xyes ; then fi AC_MSG_RESULT([yes]) +AC_CHECK_SIZEOF([wchar_t]) +DK_CHECK_FEATURE([wide stream], +[ + AC_LANG_PROGRAM([[#include <sstream>]], + [[std::wostringstream s; (void) s.str();]]) +]) + GLIBMM_CXX_HAS_NAMESPACE_STD() GLIBMM_CXX_HAS_STD_ITERATOR_TRAITS() GLIBMM_CXX_HAS_SUN_REVERSE_ITERATOR() diff --git a/glib/glibmmconfig.h.in b/glib/glibmmconfig.h.in index da7a98da..c36afc33 100644 --- a/glib/glibmmconfig.h.in +++ b/glib/glibmmconfig.h.in @@ -30,6 +30,7 @@ #ifdef GLIBMM_CONFIGURE #undef GLIBMM_CXX_HAVE_MUTABLE #undef GLIBMM_CXX_HAVE_NAMESPACES +#undef GLIBMM_HAVE_WIDE_STREAM //#undef GLIBMM_CXX_GAUB //#undef GLIBMM_CXX_AMBIGUOUS_TEMPLATES #undef GLIBMM_HAVE_NAMESPACE_STD diff --git a/scripts/dk-feature.m4 b/scripts/dk-feature.m4 new file mode 100644 index 00000000..87a0e26e --- /dev/null +++ b/scripts/dk-feature.m4 @@ -0,0 +1,101 @@ +## Copyright (c) 2004-2007 Daniel Elstner <daniel.kitta@gmail.com> +## +## This file is part of danielk's Autostuff. +## +## danielk's Autostuff 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. +## +## danielk's Autostuff 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 danielk's Autostuff; if not, write to the Free Software Foundation, +## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +#serial 20070105 + +## _DK_SH_VAR_PUSH_DEPTH(depth, variable, [value]) +## +m4_define([_DK_SH_VAR_PUSH_DEPTH], +[dnl +m4_pushdef([_DK_SH_VAR_DEPTH_$2], [$1])[]dnl +dk_save_sh_var_$2_$1=$$2 +m4_if([$3], [],, [$2=$3 +])[]dnl +]) + +## _DK_SH_VAR_POP_DEPTH(depth, variable) +## +m4_define([_DK_SH_VAR_POP_DEPTH], +[dnl +$2=$dk_save_sh_var_$2_$1 +m4_popdef([_DK_SH_VAR_DEPTH_$2])[]dnl +]) + +## DK_SH_VAR_PUSH(variable, [value]) +## +## Temporarily replace the current value of the shell variable <variable> +## with <value> until DK_SH_VAR_POP(<variable>) is invoked to restore the +## original value. If <value> is empty, <variable> is left unchanged but +## its current value is still saved. +## +## This macro may safely be used repeatedly on the same shell variable, +## as long as each DK_SH_VAR_PUSH(variable) is matched by a corresponding +## DK_SH_VAR_POP(variable). +## +AC_DEFUN([DK_SH_VAR_PUSH], +[dnl +m4_if([$1],, [AC_FATAL([argument expected])])[]dnl +_DK_SH_VAR_PUSH_DEPTH(m4_ifdef([_DK_SH_VAR_DEPTH_$1], + [m4_incr(_DK_SH_VAR_DEPTH_$1)], + [1]), + [$1], [$2])[]dnl +]) + +## DK_SH_VAR_POP(variable) +## +## Restore the original value of the shell variable <variable> which it had +## before the corresponding invocation of DK_SH_VAR_PUSH(<variable>). +## +AC_DEFUN([DK_SH_VAR_POP], +[dnl +m4_if([$1],, [AC_FATAL([argument expected])])[]dnl +_DK_SH_VAR_POP_DEPTH(_DK_SH_VAR_DEPTH_$1, [$1])[]dnl +]) + +## _DK_CHECK_FEATURE_VAR(feature, source, cache var, shell var, cpp define) +## +m4_define([_DK_CHECK_FEATURE_VAR], +[dnl +AC_CACHE_CHECK([for $1], [$3], + [AC_LINK_IFELSE([$2], [$3=yes], [$3=no])]) +$4=$$3 + +AS_IF([test "x$$4" = xyes], + [AC_DEFINE([$5], [1], [Define to 1 if $1 is available.]) +])[]dnl +]) + +## DK_CHECK_FEATURE(feature, test source) +## +## Check for a feature of the C/C++ environment. If compiling and linking +## the supplied test program is successful, the configuration header macro +## <PACKAGE_TARNAME>_HAVE_<FEATURE> is defined to 1 and "yes" is assigned +## to the shell variable <PACKAGE_TARNAME>_FEATURE_<FEATURE>. Otherwise, +## <PACKAGE_TARNAME>_FEATURE_<FEATURE> is set to "no". +## +## This macro is intended to be used in conjunction with AC_LANG_PROGRAM +## or AC_LANG_SOURCE. +## +AC_DEFUN([DK_CHECK_FEATURE], +[dnl +m4_if([$2],, [AC_FATAL([2 arguments expected])])[]dnl +_DK_CHECK_FEATURE_VAR([$1], [$2], + m4_quote(AS_TR_SH([dk_cv_feature_$1])), + m4_quote(AS_TR_CPP(AC_PACKAGE_TARNAME[_FEATURE_$1])), + m4_quote(AS_TR_CPP(AC_PACKAGE_TARNAME[_HAVE_$1])))[]dnl +]) |