[libsigc++2] Don't use obsolete macros.



commit 8b4246c3d6d20d6e19d774b8df6cf38bed6a4ba6
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Sat Sep 10 18:00:05 2011 +0200

    Don't use obsolete macros.
    
    * autogen.sh: Warn about everything during autoreconf.
    * build/cxx.m4:
    * build/cxx_std.m4: Replaced AC_TRY_COMPILE with AC_COMPILE_IFELSE.
    * configure.ac: Use LT_INIT.

 autogen.sh       |    2 +-
 build/cxx.m4     |   37 +++++++++++++++++--------------------
 build/cxx_std.m4 |   41 ++++++++++++++++-------------------------
 configure.ac     |    3 +--
 4 files changed, 35 insertions(+), 48 deletions(-)
---
diff --git a/autogen.sh b/autogen.sh
index 6686611..fadccc7 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -3,5 +3,5 @@ test -n "$srcdir" || srcdir=`dirname "$0"`
 test -n "$srcdir" || srcdir=.
 
 mm-common-prepare --copy --force "$srcdir"
-autoreconf --force --install --verbose "$srcdir"
+autoreconf --force --install --verbose --warnings=all "$srcdir"
 test -n "$NOCONFIGURE" || "$srcdir/configure" --enable-maintainer-mode "$@"
diff --git a/build/cxx.m4 b/build/cxx.m4
index 11f1969..c055faa 100644
--- a/build/cxx.m4
+++ b/build/cxx.m4
@@ -4,8 +4,8 @@ dnl
 dnl
 AC_DEFUN([SIGC_CXX_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[
 AC_MSG_CHECKING([if C++ compiler supports the use of a particular specialization when calling operator() template methods.])
-AC_TRY_COMPILE(
-[
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[
   #include <iostream>
 
   class Thing
@@ -33,25 +33,24 @@ AC_TRY_COMPILE(
        //This fails with or without the template keyword, on SUN Forte C++ 5.3, 5.4, and 5.5:
     }
   };
-],
-[
+]],
+[[
   OtherThing<int> thing;
   thing.do_something();
-],
+]])],
 [
   sigcm_cxx_gcc_template_specialization_operator_overload=yes
   AC_DEFINE([SIGC_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[1],[does the C++ compiler support the use of a particular specialization when calling operator() template methods.])
-  AC_MSG_RESULT([$sigcm_cxx_gcc_template_specialization_operator_overload])
 ],[
   sigcm_cxx_gcc_template_specialization_operator_overload=no
-  AC_MSG_RESULT([$sigcm_cxx_gcc_template_specialization_operator_overload])
 ])
+AC_MSG_RESULT([$sigcm_cxx_gcc_template_specialization_operator_overload])
 ])
 
 AC_DEFUN([SIGC_CXX_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[
 AC_MSG_CHECKING([if C++ compiler supports the use of a particular specialization when calling operator() template methods omitting the template keyword.])
-AC_TRY_COMPILE(
-[
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[
   #include <iostream>
 
   class Thing
@@ -79,26 +78,25 @@ AC_TRY_COMPILE(
        //This fails with or without the template keyword, on SUN Forte C++ 5.3, 5.4, and 5.5:
     }
   };
-],
-[
+]],
+[[
   OtherThing<int> thing;
   thing.do_something();
-],
+]])],
 [
   sigcm_cxx_msvc_template_specialization_operator_overload=yes
   AC_DEFINE([SIGC_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[1],[does the C++ compiler support the use of a particular specialization when calling operator() template methods omitting the template keyword.])
-  AC_MSG_RESULT([$sigcm_cxx_msvc_template_specialization_operator_overload])
 ],[
   sigcm_cxx_msvc_template_specialization_operator_overload=no
-  AC_MSG_RESULT([$sigcm_cxx_msvc_template_specialization_operator_overload])
 ])
+AC_MSG_RESULT([$sigcm_cxx_msvc_template_specialization_operator_overload])
 ])
 
 
 AC_DEFUN([SIGC_CXX_SELF_REFERENCE_IN_MEMBER_INITIALIZATION], [
 AC_MSG_CHECKING([if C++ compiler allows usage of member function in initialization of static member field.])
-AC_TRY_COMPILE(
-[
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[
   struct test
   {
     static char  test_function();
@@ -108,15 +106,14 @@ AC_TRY_COMPILE(
     static const bool  test_value
       = (sizeof(test_function()) == sizeof(char));
   };
-],
-[],
+]],
+[[]])],
 [
   sigcm_cxx_self_reference_in_member_initialization=yes
   AC_DEFINE([SIGC_SELF_REFERENCE_IN_MEMBER_INITIALIZATION],[1],
             [does c++ compiler allows usage of member function in initialization of static member field.])
-  AC_MSG_RESULT([$sigcm_cxx_self_reference_in_member_initialization])
 ],[
   sigcm_cxx_self_reference_in_member_initialization=no
-  AC_MSG_RESULT([$sigcm_cxx_self_reference_in_member_initialization])
 ])
+AC_MSG_RESULT([$sigcm_cxx_self_reference_in_member_initialization])
 ])
diff --git a/build/cxx_std.m4 b/build/cxx_std.m4
index ff640be..8ef9548 100644
--- a/build/cxx_std.m4
+++ b/build/cxx_std.m4
@@ -13,13 +13,13 @@ AC_DEFUN([SIGC_CXX_HAS_NAMESPACE_STD],
     [whether C++ library symbols are declared in namespace std],
     [sigc_cv_cxx_has_namespace_std],
   [
-    AC_TRY_COMPILE(
-    [
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+    [[
       #include <algorithm>
       #include <iterator>
       #include <iostream>
       #include <string>
-    ],[
+    ]],[[
       using std::min;
       using std::find;
       using std::copy;
@@ -27,17 +27,14 @@ AC_DEFUN([SIGC_CXX_HAS_NAMESPACE_STD],
       using std::string;
       using std::istream;
       using std::cout;
-    ],
-      [sigc_cv_cxx_has_namespace_std="yes"],
-      [sigc_cv_cxx_has_namespace_std="no"]
+    ]])],
+      [sigc_cv_cxx_has_namespace_std='yes'],
+      [sigc_cv_cxx_has_namespace_std='no']
     )
   ])
 
-  if test "x${sigc_cv_cxx_has_namespace_std}" = "xyes"; then
-  {
-    AC_DEFINE([SIGC_HAVE_NAMESPACE_STD],[1], [Defined when the libstdc++ declares the std-namespace])
-  }
-  fi
+  AS_IF([test "x${sigc_cv_cxx_has_namespace_std}" = 'xyes'],
+  [AC_DEFINE([SIGC_HAVE_NAMESPACE_STD],[1], [Defined when the libstdc++ declares the std-namespace])])
 ])
 
 ## SIGC_CXX_HAS_SUN_REVERSE_ITERATOR()
@@ -53,26 +50,20 @@ AC_DEFUN([SIGC_CXX_HAS_SUN_REVERSE_ITERATOR],
     [for non-standard Sun libCstd reverse_iterator],
     [sigc_cv_cxx_has_sun_reverse_iterator],
   [
-    AC_TRY_COMPILE(
-    [
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+    [[
       #include <iterator>
       #ifdef SIGC_HAVE_NAMESPACE_STD
       using namespace std;
       #endif
-    ],[
+    ]],[[
       typedef reverse_iterator<char*,random_access_iterator_tag,char,char&,char*,int> ReverseIter;
-    ],
-      [sigc_cv_cxx_has_sun_reverse_iterator="yes"],
-      [sigc_cv_cxx_has_sun_reverse_iterator="no"]
+    ]])],
+      [sigc_cv_cxx_has_sun_reverse_iterator='yes'],
+      [sigc_cv_cxx_has_sun_reverse_iterator='no']
     )
   ])
 
-  if test "x${sigc_cv_cxx_has_sun_reverse_iterator}" = "xyes"; then
-  {
-    AC_DEFINE([SIGC_HAVE_SUN_REVERSE_ITERATOR], [1],
-              [Define if the non-standard Sun reverse_iterator must be used.])
-  }
-  fi
+  AS_IF([test "x${sigc_cv_cxx_has_sun_reverse_iterator}" = 'xyes'],
+  [AC_DEFINE([SIGC_HAVE_SUN_REVERSE_ITERATOR], [1], [Define if the non-standard Sun reverse_iterator must be used.])])
 ])
-
-
diff --git a/configure.ac b/configure.ac
index 19a99cb..f37d667 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,8 +36,7 @@ MM_CONFIG_DOCTOOL_DIR([docs])
 
 AC_PROG_CXX
 AC_DISABLE_STATIC
-AC_LIBTOOL_WIN32_DLL
-AC_PROG_LIBTOOL
+LT_INIT([win32-dll])
 
 AC_ARG_VAR([M4], [M4 macro processor command])
 AC_CHECK_PROGS([M4], [gm4 m4])



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]