diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2014-07-29 17:23:18 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2014-07-29 17:23:18 +1000 |
commit | a580a89e8513f002a4fb8de7c0c2ce9185fb53b8 (patch) | |
tree | 74de1f640fe5acec33103ea24f52e6b0a8a6e437 | |
parent | c285f5484bbe84b11e0146a7aa4e7bcd8738743d (diff) | |
download | mongo-a580a89e8513f002a4fb8de7c0c2ce9185fb53b8.tar.gz |
Sanity check the LevelDB configuration at build time, not runtime.
-rw-r--r-- | api/leveldb/leveldb_wt.cc | 7 | ||||
-rw-r--r-- | build_posix/configure.ac.in | 9 |
2 files changed, 10 insertions, 6 deletions
diff --git a/api/leveldb/leveldb_wt.cc b/api/leveldb/leveldb_wt.cc index 8f8067ed5ce..cfeb0549db4 100644 --- a/api/leveldb/leveldb_wt.cc +++ b/api/leveldb/leveldb_wt.cc @@ -208,12 +208,7 @@ wtleveldb_create( s_table << "leaf_page_max=" << options.block_size << ","; s_table << "leaf_item_max=" << options.block_size / 4 << ","; if (options.compression == leveldb::kSnappyCompression) -#ifdef HAVE_LIBSNAPPY s_table << "block_compressor=snappy,"; -#else - return WiredTigerErrorToStatus(ENOTSUP, - "WiredTiger must be built with snappy support"); -#endif #ifdef HAVE_ROCKSDB if (options.compression == leveldb::kZlibCompression) s_table << "block_compressor=zlib,"; @@ -280,7 +275,7 @@ leveldb::DB::Open(const Options &options, const std::string &name, leveldb::DB * else if (ret != 0) return WiredTigerErrorToStatus(ret, NULL); - if (options.create_if_missing) + if (options.create_if_missing) ret = wtleveldb_create(conn, options, WT_URI); if (ret != 0) { diff --git a/build_posix/configure.ac.in b/build_posix/configure.ac.in index dc764a7525b..4905cd45e26 100644 --- a/build_posix/configure.ac.in +++ b/build_posix/configure.ac.in @@ -136,6 +136,15 @@ AC_MSG_RESULT($with_helium) AM_CONDITIONAL([HAVE_HELIUM], [test -d $with_helium]) AC_SUBST(HELIUM_PATH, [$with_helium]) +# Sanity check the build +AM_COND_IF([LEVELDB], [ + AM_COND_IF([SNAPPY], [], [ + AC_MSG_ERROR( + [--enable-leveldb requires --enable-snappy or --with-builtins=snappy.]) + ]) +]) + + # Warn that diagnostic builds should not be used in production if test "$wt_cv_enable_diagnostic" = "yes"; then AC_MSG_WARN( |