Permalink
Browse files

MB-6433: Remove pandora build system

Change-Id: Ie06d3fee44f63f8e47c8a4cf2bedbf5cc1b00f8a
Reviewed-on: http://review.couchbase.org/20183
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
  • Loading branch information...
1 parent 8962083 commit 8440faece5f3b8d8e5ac35f8b13c3116f3628c8c @trondn trondn committed Aug 27, 2012
Showing with 414 additions and 4,156 deletions.
  1. +6 −97 config/autorun.sh
  2. +180 −43 configure.ac
  3. +0 −103 m4/ac_cxx_compile_stdcxx_0x.m4
  4. +0 −67 m4/ac_cxx_header_stdcxx_98.m4
  5. +0 −276 m4/acx_pthread.m4
  6. +228 −0 m4/couchbase.m4
  7. +0 −110 m4/lib-ld.m4
  8. +0 −767 m4/lib-link.m4
  9. +0 −221 m4/lib-prefix.m4
  10. +0 −60 m4/pandora_64bit.m4
  11. +0 −172 m4/pandora_canonical.m4
  12. +0 −37 m4/pandora_check_compiler_version.m4
  13. +0 −23 m4/pandora_check_cxx_standard.m4
  14. +0 −39 m4/pandora_ensure_gcc_version.m4
  15. +0 −16 m4/pandora_extensions.m4
  16. +0 −41 m4/pandora_have_innodb.m4
  17. +0 −42 m4/pandora_have_libcouchstore.m4
  18. +0 −55 m4/pandora_have_libdrizzle.m4
  19. +0 −66 m4/pandora_have_libevent.m4
  20. +0 −41 m4/pandora_have_libgearman.m4
  21. +0 −44 m4/pandora_have_libmemcached.m4
  22. +0 −80 m4/pandora_have_protobuf.m4
  23. +0 −23 m4/pandora_header_assert.m4
  24. +0 −15 m4/pandora_libtool.m4
  25. +0 −79 m4/pandora_optimize.m4
  26. +0 −77 m4/pandora_platform.m4
  27. +0 −41 m4/pandora_plugins.m4
  28. +0 −59 m4/pandora_print_callstack.m4
  29. +0 −94 m4/pandora_pthread.m4
  30. +0 −236 m4/pandora_python3_devel.m4
  31. +0 −133 m4/pandora_sasl.m4
  32. +0 −56 m4/pandora_shared_ptr.m4
  33. +0 −39 m4/pandora_swig.m4
  34. +0 −52 m4/pandora_unordered_map.m4
  35. +0 −36 m4/pandora_use_pipe.m4
  36. +0 −57 m4/pandora_vc_build.m4
  37. +0 −343 m4/pandora_warnings.m4
  38. +0 −55 m4/pandora_with_lua.m4
  39. +0 −33 m4/pandora_with_memcached.m4
  40. +0 −81 m4/pandora_with_perl.m4
  41. +0 −56 m4/pandora_with_php.m4
  42. +0 −28 m4/pandora_with_python.m4
  43. +0 −44 m4/pandora_with_python3.m4
  44. +0 −33 m4/pandora_with_r.m4
  45. +0 −79 m4/pandora_with_ruby.m4
  46. +0 −7 m4/pod2man.m4
View
@@ -1,101 +1,10 @@
#!/bin/sh
-LIBTOOLIZE_FLAGS="--automake --copy --force"
-AUTOMAKE_FLAGS="--add-missing --copy --force --foreign --warning=portability"
-ACLOCAL_FLAGS="-I m4"
-AUTOHEADER_FLAGS="--warnings=error"
-AUTOCONF_CLAGS="--warnings=error --force"
+set -e
+cat > m4/version.m4 <<EOF
+m4_define([VERSION_NUMBER], [`git describe | tr '-' '_'`])
+m4_define([GIT_CHANGESET],[`git rev-parse HEAD`])
+EOF
-ARGV0=$0
-ARGS="$@"
-
-die() { echo "$@"; exit 1; }
-
-run() {
- echo "$ARGV0: running \`$@' $ARGS"
- $@ $ARGS
-}
-
-# Try to locate a program by using which, and verify that the file is an
-# executable
-locate_binary() {
- for f in $@
- do
- file=`which $f 2>/dev/null | grep -v '^no '`
- if test -n "$file" -a -x "$file"; then
- echo $file
- return 0
- fi
- done
-
- echo ""
- return 1
-}
-
-if test -f config/pre_hook.sh
-then
- . config/pre_hook.sh
-fi
-
-if [ -d .git ]
-then
- perl config/version.pl || die "Failed to run config/version.pl"
-fi
-
-# Try to detect the supported binaries if the user didn't
-# override that by pushing the environment variable
-if test x$LIBTOOLIZE = x; then
- LIBTOOLIZE=`locate_binary libtoolize glibtoolize`
- if test x$LIBTOOLIZE = x; then
- die "Did not find a supported libtoolize"
- fi
-fi
-
-if test x$ACLOCAL = x; then
- ACLOCAL=`locate_binary aclocal-1.11 aclocal-1.10 aclocal`
- if test x$ACLOCAL = x; then
- die "Did not find a supported aclocal"
- fi
-fi
-
-if test x$AUTOMAKE = x; then
- AUTOMAKE=`locate_binary automake-1.11 automake-1.10 automake`
- if test x$AUTOMAKE = x; then
- die "Did not find a supported automake"
- fi
-fi
-
-if test x$AUTOCONF = x; then
- AUTOCONF=`locate_binary autoconf`
- if test x$AUTOCONF = x; then
- die "Did not find a supported autoconf"
- fi
-fi
-
-if test x$AUTOHEADER = x; then
- AUTOHEADER=`locate_binary autoheader`
- if test x$AUTOHEADER = x; then
- die "Did not find a supported autoheader"
- fi
-fi
-
-run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize"
-run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
-run $AUTOHEADER $AUTOHEADER_FLAGS || die "Can't execute autoheader"
-run $AUTOMAKE $AUTOMAKE_FLAGS || die "Can't execute automake"
-run $AUTOCONF $AUTOCONF_FLAGS || die "Can't execute autoconf"
-
-if test -f config/post_hook.sh
-then
- . config/post_hook.sh
-fi
-
-echo "---"
-echo "Configured with the following tools:"
-echo " * `$LIBTOOLIZE --version | head -1`"
-echo " * `$ACLOCAL --version | head -1`"
-echo " * `$AUTOHEADER --version | head -1`"
-echo " * `$AUTOMAKE --version | head -1`"
-echo " * `$AUTOCONF --version | head -1`"
-echo "---"
+autoreconf -i --force
View
@@ -18,17 +18,181 @@ m4_include([m4/version.m4])
AC_INIT(ep-engine, VERSION_NUMBER, support@couchbase.com)
AC_CONFIG_SRCDIR([README.markdown])
AC_CONFIG_AUX_DIR(config)
+
+# Preserve what the user specified as CFLAGS/CXXFLAGS/CPPFLAGS/LDFLAGS
+SAVE_CFLAGS="$CFLAGS"
+SAVE_CXXFLAGS="$CXXFLAGS"
+SAVE_CPPFLAGS="$CPPFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
+
+# The stupid automake system thinks it is a good idea to inject
+# -g -O2 to C(XX)FLAGS if it isn't set..
+# Why I don't like this? Well -g is in conflict with -g3 that I'm
+# adding for Sun Studio
+AS_IF([test "x$CFLAGS" = "x" ],
+ [CFLAGS="-I."])
+AS_IF([test "x$CXXFLAGS" = "x" ],
+ [CXXFLAGS="-I."])
+AS_IF([test "x$CPPFLAGS" = "x" ],
+ [CPPFLAGS="-I."])
+
+AC_USE_SYSTEM_EXTENSIONS
+AM_INIT_AUTOMAKE(subdir-objects foreign)
+AC_PROG_CXX
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_LN_S
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
AM_CONFIG_HEADER([src/config.h])
AC_CONFIG_MACRO_DIR([m4])
-AC_DISABLE_STATIC
-m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
-
-PANDORA_CANONICAL_TARGET(less-warnings, warnings-always-on, require-cxx,
- force-gcc42)
-PANDORA_SHARED_PTR
-PANDORA_REQUIRE_PTHREAD
-PANDORA_REQUIRE_LIBEVENT
-PANDORA_HAVE_LIBCOUCHSTORE
+
+# Restore CFLAGS/CXXFLAGS now that I've prevented automake
+# to inject the extra options ;)
+AS_IF([test "x$CFLAGS" = "x-I." ],
+ [CFLAGS=""])
+AS_IF([test "x$CXXFLAGS" = "x-I." ],
+ [CXXFLAGS=""])
+AS_IF([test "x$CPPFLAGS" = "x-I." ],
+ [CPPFLAGS=""])
+
+# the malloc tests seems to be broken for cross compilation.. ignore them
+ac_cv_func_malloc_0_nonnull=yes
+ac_cv_func_realloc_0_nonnull=yes
+
+COUCHBASE_GENERIC_COMPILER(c99 c++ pthread)
+
+AS_IF([test "$ac_cv_enable_gcov" = "yes"],
+ [ LIBS="$LIBS -lgcov" ])
+
+AC_CHECK_HEADERS_ONCE([arpa/inet.h netdb.h mach/mach_time.h poll.h
+ atomic.h sysexits.h unistd.h sys/socket.h
+ netinet/in.h netinet/tcp.h ws2tcpip.h
+ winsock2.h])
+
+AC_LANG_PUSH(C++)
+AC_CHECK_HEADERS([memory tr1/memory boost/shared_ptr.hpp])
+AC_CACHE_CHECK([the namespace of shared_ptr],
+ [ac_cv_shared_namespace],[
+ for namespace in std tr1 std::tr1 boost
+ do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+#if defined(HAVE_MEMORY)
+# include <memory>
+#endif
+#if defined(HAVE_TR1_MEMORY)
+# include <tr1/memory>
+#endif
+#if defined(HAVE_BOOST_SHARED_PTR_HPP)
+# include <boost/shared_ptr.hpp>
+#endif
+#include <string>
+
+using $namespace::shared_ptr;
+using namespace std;
+ ]],[[
+shared_ptr<string> test_ptr(new string("test string"));
+ ]])],
+ [
+ ac_cv_shared_ptr_namespace="${namespace}"
+ break
+ ],[ac_cv_shared_ptr_namespace=missing])
+ done
+ ])
+AS_IF([test "x$ac_cv_shared_ptr_namespace" = "missing" ],
+ AC_MSG_ERROR([Can't build ep-engine without a known shared_ptr]))
+
+AC_DEFINE_UNQUOTED([SHARED_PTR_NAMESPACE],
+ ${ac_cv_shared_ptr_namespace},
+ [The namespace in which SHARED_PTR can be found])
+
+AC_CHECK_HEADERS([tr1/unordered_map boost/unordered_map.hpp])
+AC_CACHE_CHECK([the location of unordered_map header file],
+ [ac_cv_unordered_namespace],[
+ for namespace in std tr1 std::tr1 boost
+ do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+#if defined(HAVE_TR1_UNORDERED_MAP)
+# include <tr1/unordered_map>
+#endif
+#if defined(HAVE_BOOST_UNORDERED_MAP_HPP)
+# include <boost/unordered_map.hpp>
+#endif
+#include <string>
+
+using $namespace::unordered_map;
+using namespace std;
+ ]],[[
+unordered_map<string, string> test_map;
+ ]])],
+ [
+ ac_cv_unordered_map_namespace="${namespace}"
+ break
+ ],[ac_cv_unordered_map_namespace=missing])
+ done
+ ])
+
+AC_DEFINE_UNQUOTED([UNORDERED_MAP_NAMESPACE],
+ ${ac_cv_unordered_map_namespace},
+ [The namespace in which UNORDERED_MAP can be found])
+
+AS_IF([test "x$ac_cv_unordered_map_namespace" = "missing" ],
+ AC_MSG_ERROR([Can't build ep-engine without a known unordered_map]))
+
+AC_LANG_POP()
+
+
+saved_LIBS="$LIBS"
+LIBS="$LIBS -lcouchstore"
+AC_CACHE_CHECK([for libcouchstore],[ac_cv_have_libcouchstore],[
+ AC_TRY_LINK([
+ #include <sys/types.h>
+ #include <stdlib.h>
+ #include <libcouchstore/couch_db.h>
+ ],[
+ couchstore_close_db(NULL);
+ ], [
+ ac_cv_have_libcouchstore=yes
+ ], [
+ ac_cv_have_libcouchstore=no
+ ])
+ ])
+LIBS="$saved_LIBS"
+
+AS_IF([test "x$ac_cv_have_libcouchstore" = "xyes"],
+ [ AC_DEFINE([HAVE_LIBCOUCHSTORE], [1], [Have libcouchstore])
+ LTLIBCOUCHSTORE=-lcouchstore
+ ], [
+ AC_MSG_ERROR([Can't build ep-engine without libcouchstore])
+ ])
+
+AC_SUBST(LTLIBCOUCHSTORE)
+AM_CONDITIONAL(HAVE_LIBCOUCHSTORE, [test "x$ac_cv_have_libcouchstore" = "xyes"])
+
+AC_CACHE_CHECK([for libevent >= 1.4], [ac_cv_have_libevent],
+ [ saved_libs="$LIBS"
+ LIBS="$LIBS -levent"
+ AC_TRY_LINK([
+ #include <sys/types.h>
+ #include <event.h>
+ ],[
+ event_base_new();
+ ],[
+ ac_cv_have_libevent="yes"
+ ], [
+ ac_cv_have_libevent="no"
+ ])
+ LIBS="$saved_libs"
+ ])
+LIBS="$saved_LIBS"
+AS_IF([test "x$ac_cv_have_libevent" = "xyes"],
+ [ AC_DEFINE([HAVE_LIBEVENT], [1], [Have libevent])
+ LTLIBEVENT=-levent
+ ])
+AC_SUBST(LTLIBEVENT)
+
PANDORA_ENABLE_DTRACE
AC_ARG_ENABLE([valgrind],
@@ -70,20 +234,6 @@ AC_DEFUN([AC_C_HTONLL],
AC_C_HTONLL
-AC_CHECK_HEADERS([arpa/inet.h])
-AC_CHECK_HEADERS([netdb.h])
-AC_CHECK_HEADERS([mach/mach_time.h])
-AC_CHECK_HEADERS([poll.h])
-AC_CHECK_HEADERS([atomic.h])
-AC_CHECK_HEADERS([sysexits.h])
-AC_CHECK_HEADERS([unistd.h])
-
-AC_CHECK_HEADERS_ONCE([sys/socket.h
- netinet/in.h
- netinet/tcp.h
- ws2tcpip.h
- winsock2.h])
-
AC_CHECK_FUNCS(gethrtime)
AC_SEARCH_LIBS(clock_gettime, rt)
AC_CHECK_FUNCS(clock_gettime)
@@ -149,6 +299,7 @@ AC_ARG_WITH([memcached],
AS_IF(test "x${ac_cv_with_memcached}" != "x",
[CPPFLAGS="-I${ac_cv_with_memcached}/include $CPPFLAGS"
+ AM_CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS"
PATH="${ac_cv_with_memcached}:$PATH"])
AC_CHECK_HEADERS(memcached/engine.h)
@@ -167,13 +318,6 @@ AS_IF(test "x${ENGINE_TESTAPP}" = "xno",
AM_CONDITIONAL(BUILD_BYTEORDER, test "x$ac_cv_have_htonll" != "xyes")
-AS_IF([test "x$SUNCC" = "xyes"],
- [
- CFLAGS="-D_XOPEN_SOURCE=600 $CFLAGS"
- CPPFLAGS="-xldscope=hidden -mt $CPPFLAGS"
- CXXFLAGS="-erroff=truncwarn1,signextwarn,notused,inllargeuse,wunreachable $CXXFLAGS"
- ])
-
AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(gethostbyname, nsl)
@@ -210,23 +354,16 @@ return 0;
AM_CONDITIONAL(HAVE_GOOGLETEST, [test "$ac_cv_have_gtest" = "yes"])
+dnl restore CFLAGS, CPPFLAGS, CXXFLAGS and LDFLAGS
+CFLAGS="$SAVE_CFLAGS"
+CXXFLAGS="$SAVE_CXXFLAGS"
+CPPFLAGS="$SAVE_CPPFLAGS"
+LDFLAGS="$SAVE_LDFLAGS"
+
dnl ----------------------------------------------------------------------------
AC_CONFIG_FILES(Makefile wrapper/wrapper)
AC_OUTPUT
-echo "---"
-echo "Configuration summary for $PACKAGE_NAME version $VERSION"
-echo ""
-echo " * Installation prefix: $prefix"
-echo " * System type: $host_vendor-$host_os"
-echo " * Host CPU: $host_cpu"
-echo " * C Compiler: $CC_VERSION"
-echo " * C++ Compiler: $CXX_VERSION"
-echo " * Assertions enabled: $ac_cv_assert"
-echo " * Debug enabled: $with_debug"
-echo " * Warnings as failure: $ac_cv_warnings_as_errors"
-echo " * Google test framework: $ac_cv_have_gtest"
-echo ""
AS_IF(test "$ac_cv_have_gtest" = "", [
echo "**************************************************************"
echo "You should consider installing gtest to be able to run tests.."
Oops, something went wrong.

0 comments on commit 8440fae

Please sign in to comment.