Commit Graph

17 Commits

Author SHA1 Message Date
Kefu Chai
28c8373734 msg,common: do not include assert.h everywhere to clobber <assert.h>
* reverts c93daaf92b
* add "#include "include/assert.h" to where <cassert> or <assert.h> are
  included, or avoid including them if possible.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-08 11:46:26 +08:00
Kefu Chai
8f7643792c cmake: turn libcommon into a shared library
prior to this change, libcommon is a convenient library which gets
linked into librados, librbd and libcephfs and all ceph executables.
this incurs some problems:
 - double dose of libcommon in memory space and HDD: waste of memory
   and disk space.
 - if an application links to two libraries including libcommon at the
   same time. take librados and libcephfs as an example, they could
   interfere with each other by changing the other guy's status.
after this change, libcommon is tuned into a shared library and
renamed to libceph-common. it will be installed into $prefix/lib/ceph,
and packaged in librados2.

ceph.spec.in,debian/librados2.install: package libceph-common in
  librados2.
CMakeLists.txt:
  - do not link against libboost-* if not necessary.
  - s/common/ceph-common/g
  - install libceph-common into $prefix/lib/ceph
  - set rpath to $prefix/lib/ceph
  - link against ceph-common if an executable needs access to non public
    symbols in ceph.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-01-10 21:10:53 +08:00
Sage Weil
fba798dcad remove autotools
Signed-off-by: Sage Weil <sage@redhat.com>
2016-09-07 11:50:14 -04:00
Kefu Chai
8382dda5f9 cmake: move common_utf8 closer to where it is used
for example, json_spirit uses common_utf8, so link json_spirit against common_utf8.
because libcommon includes json_spirit, this change does not impact the
consumers of libcommon.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-28 19:15:03 +08:00
Kefu Chai
1dbfb264ff cmake: s/ENABLE_SHARED/BUILD_SHARED_LIBS/
* BUILD_SHARED_LIB is a cmake variable respected by add_library().
  so we can simply expose it as an option instead of reinventing our own.
* and mark internal libraries as STATIC explicitly
* and add keyutil to librbd as secret.cc is using it. and secret.cc is
  linked into librbd.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-05-28 00:34:52 +08:00
Ricardo Dias
ce9e8f5ccf test: cmake: Fix make check compilation error
Signed-off-by: Ricardo Dias <rdias@suse.com>
2016-03-14 18:30:41 +00:00
Kefu Chai
6b68b27146 json_sprit: fix the FTBFS on old gcc
Fixes: #11574
Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-05-08 12:01:19 +08:00
Tim Serong
8add15b86e json_spirit: use utf8 intenally when parsing \uHHHH
When the python CLI is given non-ASCII characters, it converts them to
\uHHHH escapes in JSON.  json_spirit parses these internally into 16 bit
characters, which could only work if json_spirit were built to use
std::wstring, which it isn't; it's using std::string, so the high byte
ends up being zero'd, leaving the low byte which is effectively garbage.

This hack^H^H^H^H change makes json_spirit convert to utf8 internally
instead, which can be stored just fine inside a std::string.

Note that this implementation still assumes \uHHHH escapes are four hex
digits, so it'll only cope with characters in the Basic Multilingual
Plane.  Still, that's rather a lot more characters than it could cope
with before ;)

(For characters outside the BMP, Python seems to generate escapes in the
form \uHHHHHHHH, i.e. 8 hex digits, which the current implementation
doesn't expect to see)

Fixes: #7387

Signed-off-by: Tim Serong <tserong@suse.com>
2015-05-06 20:18:34 +10:00
Ali Maredia
0f6b9f2816 Combined CMake Build for Hammer
CMake Ceph Build System (Firefly)
CMake.  Add tests.
Respace src/CMakeLists.txt.
CMake.  Spacing cleanups.
CMake for Firefly is Triumphant
CMake for Giant
Adapt to Giant.
Fix installation for scripts and man pages
Fix CEPH_LIBDIR and CEPH_PKGLIBDIR defines
Add erasure-code libraries
	uses try_compile() to detect support for -msse flags
Fix rados object classes
Propagate Casey's cls library change to src/test.
Fix CMake build for Hammer.
Try-add rados and common to librbd link.
Fix name and linkage of libec_lrc.
Rename arch/neon.c arm.c
Fix libcommon.a dependencies (some unit tests).

Authors:
	Ali Maredia <ali@cohortfs.com>
	Casey Bodley <casey@cohortfs.com>
	Adam Emerson <aemerson@cohortfs.com>
	Marcus Watts <mdw@cohortfs.com>
	Matt Benjamin <matt@cohortfs.com>

Signed-off-by: Matt Benjamin <matt@cohortfs.com>
2015-01-14 16:40:05 -05:00
Sage Weil
b08470f0bf configure.ac: link libboost_thread only with json-spirit
Signed-off-by: Sage Weil <sage@redhat.com>
2014-07-27 16:58:08 -07:00
Noah Watkins
8c8be16df7 json_spirit: don't build json_spirit_value.cpp
This file just includes the header that is full of templates and
typedefs, so the resulting object file has no symbols in it and
generates warnings.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2013-12-30 12:58:37 -08:00
Roald J. van Loon
6949d221ad automake cleanup: implementing non-recursive make
- Enabling subdir objects
- Created a Makefile-env.am with basic automake init
- Created .am files per subdir, included from src/Makefile.am

Signed-off-by: Roald J. van Loon <roaldvanloon@gmail.com>
2013-09-08 00:11:09 +02:00
Sage Weil
6abae35a39 json_spirit: remove unused typedef
In file included from json_spirit/json_spirit_writer.cpp:7:0:
json_spirit/json_spirit_writer_template.h: In function 'String_type json_spirit::non_printable_to_string(unsigned int)':
json_spirit/json_spirit_writer_template.h:37:50: warning: typedef 'Char_type' locally defined but not used [-Wunused-local-typedefs]
         typedef typename String_type::value_type Char_type;

(Also, ha ha, this file uses \r\n.)

Signed-off-by: Sage Weil <sage@inktank.com>
2013-08-20 16:54:05 -07:00
Dan Mick
d9ff7d4a65 mon: add JSON command parsing framework
Use json_spirit to read/parse JSON command input into a "cmdmap",
which is a boost::variant typechecked discriminant union.
This means that requests to read from the map must match the type
given.  Types are string, bool, int64_t, double, and vector<string>,
and that type is a "cmd_vartype"; a cmdmap is a map of name (string) to
cmd_vartype.

Also, an evolutionary deadend hack "build_fullcmd()", which reassembles
certain commands from the cmdmap back into a string for the sole reason
of running them through _allowed_command.  This is due to be replaced by
a better allow mechanism very shortly.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
2013-05-21 15:54:13 -07:00
Yehuda Sadeh
b69da4b8db json_spirit: thread safe
apparently the library is not thread safe by default.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-11-08 13:24:29 -08:00
Yehuda Sadeh
86b06f12a9 json_spirit: update grammar
Support a more relaxed grammar, where last entity in an array
or an object can have a comma trailing.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-23 10:43:09 -07:00
Sage Weil
2677c72fde add libjson_spirit.la
This is lightweight and relies on boost spirit, which we already use, so
there are no new dependencies.

There were some other libraries that also looked good, but they weren't
already packages for existing Debian distros like squeeze or even wheezy.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2012-02-24 11:24:44 -08:00