[uim-commit] r639 - in trunk: . m4

ekato at freedesktop.org ekato at freedesktop.org
Sun Feb 13 08:34:29 PST 2005


Author: ekato
Date: 2005-02-13 08:34:26 -0800 (Sun, 13 Feb 2005)
New Revision: 639

Added:
   trunk/m4/ac_cxx_have_stl.m4
   trunk/m4/ac_cxx_namespace.m4
Modified:
   trunk/configure.ac
Log:
* m4/ac_cxx_namespace.m4 : New file. From
  http://ac-archive.sourceforge.net/C++_Support/ac_cxx_namespaces.html
* m4/ac_cxx_have_stl.m4 : New file. From
  http://ac-archive.sourceforge.net/C++_Support/ac_cxx_have_stl.html
* configure.ac : Add check for AC_CXX_NAMESPACES and
  AC_CXX_HAVE_STL for uim-xim.


Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2005-02-13 15:57:06 UTC (rev 638)
+++ trunk/configure.ac	2005-02-13 16:34:26 UTC (rev 639)
@@ -140,6 +140,11 @@
 use_xim="no"
 if test x$have_x != xdisabled && test x$have_x != xno; then
    use_xim="yes"
+   AC_CXX_NAMESPACES
+   AC_CXX_HAVE_STL
+   if test $ac_cv_cxx_have_stl = no; then
+     use_xim="no"
+   fi
 fi
 
 

Added: trunk/m4/ac_cxx_have_stl.m4
===================================================================
--- trunk/m4/ac_cxx_have_stl.m4	2005-02-13 15:57:06 UTC (rev 638)
+++ trunk/m4/ac_cxx_have_stl.m4	2005-02-13 16:34:26 UTC (rev 639)
@@ -0,0 +1,22 @@
+
+
+
+AC_DEFUN([AC_CXX_HAVE_STL],
+[AC_CACHE_CHECK(whether the compiler supports Standard Template Library,
+ac_cv_cxx_have_stl,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <list>
+#include <deque>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[list<int> x; x.push_back(5);
+list<int>::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0;],
+ ac_cv_cxx_have_stl=yes, ac_cv_cxx_have_stl=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_stl" = yes; then
+  AC_DEFINE(HAVE_STL,,[define if the compiler supports Standard Template Library])
+fi
+])

Added: trunk/m4/ac_cxx_namespace.m4
===================================================================
--- trunk/m4/ac_cxx_namespace.m4	2005-02-13 15:57:06 UTC (rev 638)
+++ trunk/m4/ac_cxx_namespace.m4	2005-02-13 16:34:26 UTC (rev 639)
@@ -0,0 +1,14 @@
+AC_DEFUN([AC_CXX_NAMESPACES],
+[AC_CACHE_CHECK(whether the compiler implements namespaces,
+ac_cv_cxx_namespaces,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
+                [using namespace Outer::Inner; return i;],
+ ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_namespaces" = yes; then
+  AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
+fi
+])



More information about the Uim-commit mailing list