Browse Source

Merged in latest pandora-build.

Monty Taylor 15 years ago
parent
commit
d2c1aaa7b8

+ 23 - 10
m4/pandora_canonical.m4

@@ -4,7 +4,7 @@ dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl Which version of the canonical setup we're using
-AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.100])
+AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.119])
 
 AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
   AC_ARG_ENABLE([fat-binaries],
@@ -31,6 +31,7 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
   m4_define([PCT_ALL_ARGS],[$*])
   m4_define([PCT_REQUIRE_CXX],[no])
   m4_define([PCT_FORCE_GCC42],[no])
+  m4_define([PCT_DONT_SUPPRESS_INCLUDE],[no])
   m4_define([PCT_VERSION_FROM_VC],[no])
   m4_define([PCT_USE_VISIBILITY],[yes])
   m4_foreach([pct_arg],[$*],[
@@ -47,6 +48,10 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
         m4_undefine([PCT_USE_VISIBILITY])
         m4_define([PCT_USE_VISIBILITY],[no])
       ],
+      [dont-suppress-include], [
+        m4_undefine([PCT_DONT_SUPPRESS_INCLUDE])
+        m4_define([PCT_DONT_SUPPRESS_INCLUDE],[yes])
+      ],
       [version-from-vc], [
         m4_undefine([PCT_VERSION_FROM_VC])
         m4_define([PCT_VERSION_FROM_VC],[yes])
@@ -55,7 +60,7 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
 
   AC_CONFIG_MACRO_DIR([m4])
 
-  m4_if(m4_esyscmd(test -d src && echo -n 0),0,[
+  m4_if(m4_substr(m4_esyscmd(test -d src && echo 0),0,1),0,[
     AC_CONFIG_HEADERS([src/config.h])
   ],[
     AC_CONFIG_HEADERS([config.h])
@@ -71,10 +76,15 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
   
   AC_CANONICAL_TARGET
   
-  AM_INIT_AUTOMAKE(-Wall -Werror nostdinc subdir-objects foreign)
+  m4_if(PCT_DONT_SUPRESS_INCLUDE,yes,[
+    AM_INIT_AUTOMAKE(-Wall -Werror subdir-objects foreign)
+  ],[
+    AM_INIT_AUTOMAKE(-Wall -Werror nostdinc subdir-objects foreign)
+  ])
+
   m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 
-  m4_if(m4_esyscmd(test -d gnulib && echo -n 0),0,[
+  m4_if(m4_substr(m4_esyscmd(test -d gnulib && echo 0),0,1),0,[
     gl_EARLY
   ])
   
@@ -84,6 +94,8 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
 
   m4_if(PCT_VERSION_FROM_VC,yes,[
     PANDORA_VC_VERSION
+  ],[
+    PANDORA_TEST_VC_DIR
   ])
   PANDORA_VERSION
 
@@ -113,7 +125,7 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
 
   ])
   
-  m4_if(m4_esyscmd(test -d gnulib && echo -n 0),0,[
+  m4_if(m4_substr(m4_esyscmd(test -d gnulib && echo 0),0,1),0,[
     gl_INIT
     AC_CONFIG_LIBOBJ_DIR([gnulib])
   ])
@@ -128,8 +140,10 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
   AC_C_RESTRICT
 
   AC_HEADER_TIME
+  AC_STRUCT_TM
   AC_TYPE_SIZE_T
   AC_SYS_LARGEFILE
+  PANDORA_CLOCK_GETTIME
 
   # off_t is not a builtin type
   AC_CHECK_SIZEOF(off_t, 4)
@@ -163,10 +177,6 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
     AC_DEFINE([TIME_T_UNSIGNED], 1, [Define to 1 if time_t is unsigned])
   ])
 
-  dnl AC_FUNC_ALLOCA would test for stack direction if we didn't have a working
-  dnl alloca - but we need to know it anyway for check_stack_overrun.
-  PANDORA_STACK_DIRECTION
-
   AC_CHECK_LIBM
   
   AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
@@ -208,6 +218,9 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
 
   AC_CHECK_PROGS([DOXYGEN], [doxygen])
   AC_CHECK_PROGS([PERL], [perl])
+  AC_CHECK_PROGS([DPKG_GENSYMBOLS], [dpkg-gensymbols], [:])
+
+  AM_CONDITIONAL(HAVE_DPKG_GENSYMBOLS,[test "x${DPKG_GENSYMBOLS}" != "x:"])
 
   PANDORA_WITH_GETTEXT
 
@@ -218,7 +231,7 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
     AM_CPPFLAGS="-I\${top_srcdir}/gnulib -I\${top_builddir}/gnulib ${AM_CPPFLAGS}"
     ])
   ])
-  m4_if(m4_esyscmd(test -d src && echo -n 0),0,[
+  m4_if(m4_substr(m4_esyscmd(test -d src && echo 0),0,1),0,[
     AM_CPPFLAGS="-I\$(top_srcdir)/src -I\$(top_builddir)/src ${AM_CPPFLAGS}"
   ],[
     AM_CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${AM_CPPFLAGS}"

+ 15 - 0
m4/pandora_clock_gettime.m4

@@ -0,0 +1,15 @@
+dnl Copyright (C) 2010 Monty Taylor
+dnl This file is free software; Monty Taylor
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+#--------------------------------------------------------------------
+# Check for clock_gettime
+#--------------------------------------------------------------------
+
+AC_DEFUN([PANDORA_CLOCK_GETTIME],[
+  AC_SEARCH_LIBS([clock_gettime],[rt])
+  AS_IF([test "x${ac_cv_search_clock_gettime}" != "xno"],[
+    AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Have a working clock_gettime function])
+  ])
+])

+ 3 - 2
m4/pandora_drizzle_build.m4

@@ -9,8 +9,7 @@ dnl are set.
 
 AC_DEFUN([PANDORA_DRIZZLE_BUILD],[
 
-  dnl We need to turn on our CXXFLAGS to make sure it shows up correctly
-  PANDORA_CXX_STL_HASH
+  PANDORA_HAVE_CXX_UNORDERED
 
   PANDORA_CXX_CSTDINT
   PANDORA_CXX_CINTTYPES
@@ -70,6 +69,8 @@ AC_DEFUN([PANDORA_DRIZZLE_BUILD],[
   AC_CHECK_TYPES([uint, ulong])
 
   PANDORA_CXX_DEMANGLE
+  PANDORA_REQUIRE_BOOST([1.32])
+
 
   AH_TOP([
 #ifndef __CONFIG_H__

+ 2 - 2
m4/pandora_fdatasync.m4

@@ -11,7 +11,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([PANDORA_WORKING_FDATASYNC],[
   AC_CACHE_CHECK([working fdatasync],[ac_cv_func_fdatasync],[
     AC_LANG_PUSH(C++)
-    AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <unistd.h>
       ]],[[
 fdatasync(4);
@@ -22,4 +22,4 @@ fdatasync(4);
   ])
   AS_IF([test "x${ac_cv_func_fdatasync}" = "xyes"],
     [AC_DEFINE([HAVE_FDATASYNC],[1],[If the system has a working fdatasync])])
-])
+])

+ 73 - 0
m4/pandora_have_boost.m4

@@ -0,0 +1,73 @@
+dnl Copyright (C) 2010 Monty Taylor
+dnl This file is free software; Monty Taylor
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([_PANDORA_SEARCH_BOOST],[
+  AC_REQUIRE([AC_LIB_PREFIX])
+
+  dnl --------------------------------------------------------------------
+  dnl  Check for boost
+  dnl --------------------------------------------------------------------
+
+  AC_ARG_ENABLE([boost],
+    [AS_HELP_STRING([--disable-boost],
+      [Build with boost support @<:@default=on@:>@])],
+    [ac_enable_boost="$enableval"],
+    [ac_enable_boost="yes"])
+
+  AS_IF([test "x$ac_enable_boost" = "xyes"],[
+    dnl link against libc because we're just looking for headers here
+    AC_LANG_PUSH(C++)
+    AC_LIB_HAVE_LINKFLAGS(c,,[
+      #include <boost/pool/pool.hpp>
+    ],[
+      boost::pool<> test_pool(1);
+    ])
+    AC_LANG_POP()
+  ],[
+    ac_cv_boost="no"
+  ])
+  
+
+  AS_IF([test "x$1" != "x"],[
+    AC_CACHE_CHECK([if boost is recent enough],
+      [pandora_cv_recent_boost],[
+      pandora_need_boost_version=`echo "$1" | perl -nle '/(\d+)\.(\d+)/; printf "%d%0.3d00", $[]1, $[]2 ;'`
+      AS_IF([test "x${pandora_need_boost_version}" = "x000000"],[
+        pandora_cv_recent_boost=yes
+      ],[
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <boost/version.hpp>
+
+#if BOOST_VERSION < ${pandora_need_boost_version}
+# error boost too old!
+#endif
+          ]],[[]])
+        ],[
+          pandora_cv_recent_boost=yes
+        ],[
+          pandora_cv_recent_boost=no
+        ])
+      ])
+    ])
+    AS_IF([test "x${pandora_cv_recent_boost}" = "xno"],[
+      ac_cv_boost=no
+    ])
+  ])
+      
+
+  AM_CONDITIONAL(HAVE_BOOST, [test "x${ac_cv_boost}" = "xyes"])
+  
+])
+
+AC_DEFUN([PANDORA_HAVE_BOOST],[
+  _PANDORA_SEARCH_BOOST($1)
+])
+
+AC_DEFUN([PANDORA_REQUIRE_BOOST],[
+  PANDORA_HAVE_BOOST($1)
+  AS_IF([test x$ac_cv_boost = xno],
+      AC_MSG_ERROR([boost is required for ${PACKAGE}]))
+])
+

+ 2 - 2
m4/pandora_have_gcc_atomics.m4

@@ -13,7 +13,7 @@ AC_DEFUN([PANDORA_HAVE_GCC_ATOMICS],[
   AC_CACHE_CHECK(
     [whether the compiler provides atomic builtins],
     [ac_cv_gcc_atomic_builtins],
-    [AC_RUN_IFELSE(
+    [AC_LINK_IFELSE(
       [AC_LANG_PROGRAM([],[[
         int foo= -10; int bar= 10;
         if (!__sync_fetch_and_add(&foo, bar) || foo)
@@ -34,4 +34,4 @@ AC_DEFUN([PANDORA_HAVE_GCC_ATOMICS],[
               [Define to 1 if compiler provides atomic builtins.])
   ])
 
-])
+])

+ 44 - 0
m4/pandora_have_libcassandra.m4

@@ -0,0 +1,44 @@
+dnl  Copyright (C) 2010 Padraig O'Sullivan
+dnl This file is free software; 
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([_PANDORA_SEARCH_LIBCASSANDRA],[
+  AC_REQUIRE([AC_LIB_PREFIX])
+
+  dnl --------------------------------------------------------------------
+  dnl  Check for libcassandra
+  dnl --------------------------------------------------------------------
+
+  AC_ARG_ENABLE([libcassandra],
+    [AS_HELP_STRING([--disable-libcassandra],
+      [Build with libcassandra support @<:@default=on@:>@])],
+    [ac_enable_libcassandra="$enableval"],
+    [ac_enable_libcassandra="yes"])
+
+  AS_IF([test "x$ac_enable_libcassandra" = "xyes"],[
+    AC_LANG_PUSH([C++])
+    AC_LIB_HAVE_LINKFLAGS(cassandra,[thrift],[
+      #include <libcassandra/cassandra_factory.h>
+    ],[
+       libcassandra::CassandraFactory fact("localhost", 9306);
+    ])
+    AC_LANG_POP()
+  ],[
+    ac_cv_libcassandra="no"
+  ])
+  
+  AM_CONDITIONAL(HAVE_LIBCASSANDRA, [test "x${ac_cv_libcassandra}" = "xyes"])
+  
+])
+
+AC_DEFUN([PANDORA_HAVE_LIBCASSANDRA],[
+  AC_REQUIRE([_PANDORA_SEARCH_LIBCASSANDRA])
+])
+
+AC_DEFUN([PANDORA_REQUIRE_LIBCASSANDRA],[
+  AC_REQUIRE([PANDORA_HAVE_LIBCASSANDRA])
+  AS_IF([test "x$ac_cv_libcassandra" = "xno"],[
+      AC_MSG_ERROR([libcassandra is required for ${PACKAGE}])
+  ])
+])

+ 16 - 10
m4/pandora_have_libdrizzle.m4

@@ -36,20 +36,26 @@ AC_DEFUN([PANDORA_HAVE_LIBDRIZZLE],[
 
 AC_DEFUN([PANDORA_REQUIRE_LIBDRIZZLE],[
   AC_REQUIRE([PANDORA_HAVE_LIBDRIZZLE])
-  AS_IF([test "x${ac_cv_libdrizzle}" = "xno"],
-      AC_MSG_ERROR([libdrizzle is required for ${PACKAGE}]))
+  AS_IF([test "x${ac_cv_libdrizzle}" = "xno"],[
+    AC_MSG_ERROR([libdrizzle is required for ${PACKAGE}])
+  ],[
+    dnl We need at least 0.8 on Solaris non-sparc
+    AS_IF([test "$target_cpu" != "sparc" -a "x${TARGET_SOLARIS}" = "xtrue"],[
+      PANDORA_LIBDRIZZLE_RECENT
+    ])
+  ])
 ])
 
-AC_DEFUN([PANDORA_LIBDRIZZLE_NOVCOL],[
-  AC_CACHE_CHECK([if libdrizzle still has virtual columns],
-    [pandora_cv_libdrizzle_vcol],
+AC_DEFUN([PANDORA_LIBDRIZZLE_RECENT],[
+  AC_CACHE_CHECK([if libdrizzle is recent enough],
+    [pandora_cv_libdrizzle_recent],
     [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <libdrizzle/drizzle.h>
-int foo= DRIZZLE_COLUMN_TYPE_DRIZZLE_VIRTUAL;
+drizzle_con_options_t foo= DRIZZLE_CON_EXPERIMENTAL;
     ]])],
-    [pandora_cv_libdrizzle_vcol=yes],
-    [pandora_cv_libdrizzle_vcol=no])])
-  AS_IF([test "$pandora_cv_libdrizzle_vcol" = "yes"],[
-    AC_MSG_ERROR([Your version of libdrizzle is too old. ${PACKAGE} requires at least version 0.4])
+    [pandora_cv_libdrizzle_recent=yes],
+    [pandora_cv_libdrizzle_recent=no])])
+  AS_IF([test "$pandora_cv_libdrizzle_recent" = "no"],[
+    AC_MSG_ERROR([Your version of libdrizzle is too old. ${PACKAGE} requires at least version 0.8])
   ])
 ])

+ 44 - 0
m4/pandora_have_libgtest.m4

@@ -0,0 +1,44 @@
+dnl Copyright (C) 2010 Monty Taylor
+dnl This file is free software; Monty Taylor
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([_PANDORA_SEARCH_LIBGTEST],[
+  AC_REQUIRE([AC_LIB_PREFIX])
+
+  dnl --------------------------------------------------------------------
+  dnl  Check for libgtest
+  dnl --------------------------------------------------------------------
+
+  AC_ARG_ENABLE([libgtest],
+    [AS_HELP_STRING([--disable-libgtest],
+      [Build with libgtest support @<:@default=on@:>@])],
+    [ac_enable_libgtest="$enableval"],
+    [ac_enable_libgtest="yes"])
+
+  AS_IF([test "x$ac_enable_libgtest" = "xyes"],[
+    AC_LANG_PUSH(C++)
+    AC_LIB_HAVE_LINKFLAGS(gtest,,[
+      #include <gtest/gtest.h>
+TEST(pandora_test_libgtest, PandoraTest)
+{
+  ASSERT_EQ(1, 1);
+}
+    ],[])
+    AC_LANG_POP()
+  ],[
+    ac_cv_libgtest="no"
+  ])
+
+  AM_CONDITIONAL(HAVE_LIBGTEST, [test "x${ac_cv_libgtest}" = "xyes"])
+])
+
+AC_DEFUN([PANDORA_HAVE_LIBGTEST],[
+  AC_REQUIRE([_PANDORA_SEARCH_LIBGTEST])
+])
+
+AC_DEFUN([PANDORA_REQUIRE_LIBGTEST],[
+  AC_REQUIRE([_PANDORA_SEARCH_LIBGTEST])
+  AS_IF([test "x${ac_cv_libgtest}" = "xno"],
+    AC_MSG_ERROR([libgtest is required for ${PACKAGE}]))
+])

+ 64 - 0
m4/pandora_have_libinnodb.m4

@@ -0,0 +1,64 @@
+dnl  Copyright (C) 2009 Sun Microsystems
+dnl This file is free software; Sun Microsystems
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([_PANDORA_SEARCH_LIBINNODB],[
+  AC_REQUIRE([AC_LIB_PREFIX])
+
+  dnl --------------------------------------------------------------------
+  dnl  Check for libinnodb
+  dnl --------------------------------------------------------------------
+
+  AC_ARG_ENABLE([libinnodb],
+    [AS_HELP_STRING([--disable-libinnodb],
+      [Build with libinnodb support @<:@default=on@:>@])],
+    [ac_enable_libinnodb="$enableval"],
+    [ac_enable_libinnodb="yes"])
+
+  AS_IF([test "x$ac_enable_libinnodb" = "xyes"],[
+    AC_LIB_HAVE_LINKFLAGS(innodb,,[
+      #include <embedded_innodb-1.0/innodb.h>
+    ],[
+      ib_u64_t
+      ib_api_version(void);
+    ])
+  ],[
+    ac_cv_libinnodb="no"
+  ])
+
+
+  AC_CACHE_CHECK([if libinnodb is recent enough],
+    [ac_cv_recent_innodb_h],[
+      save_LIBS=${LIBS}
+      LIBS="${LIBS} ${LTLIBINNODB}"
+      AC_LINK_IFELSE(
+          [AC_LANG_PROGRAM([[
+      #include <embedded_innodb-1.0/innodb.h>
+        ]],[[
+      /* Make sure we have the two-arg version */
+      ib_table_drop(NULL, "nothing");
+        ]])],[
+        ac_cv_recent_innodb_h=yes
+      ],[
+        ac_cv_recent_innodb_h=no
+      ])
+      LIBS="${save_LIBS}"
+    ])
+  AS_IF([test "x${ac_cv_recent_innodb_h}" = "xno"],[
+    AC_MSG_WARN([${PACKAGE} requires at least version 1.0.6 of Embedded InnoDB])
+    ac_cv_libinnodb=no
+  ])
+        
+  AM_CONDITIONAL(HAVE_LIBINNODB, [test "x${ac_cv_libinnodb}" = "xyes"])
+])
+
+AC_DEFUN([PANDORA_HAVE_LIBINNODB],[
+  AC_REQUIRE([_PANDORA_SEARCH_LIBINNODB])
+])
+
+AC_DEFUN([PANDORA_REQUIRE_LIBINNODB],[
+  AC_REQUIRE([PANDORA_HAVE_LIBINNODB])
+  AS_IF([test "x${ac_cv_libinnodb}" = "xno"],
+      AC_MSG_ERROR([libinnodb is required for ${PACKAGE}]))
+])

Some files were not shown because too many files changed in this diff