Hi all

As you might have noticed, the prebuilt package for JsonCpp has changed
its path for headers to be included by applications from
*include/jsoncpp/* to *include/json/* some time ago. (Probably to better
match the upstream directory name
<http://jsoncpp.svn.sourceforge.net/viewvc/jsoncpp/trunk/jsoncpp/include/json/>?)
The include search path for non-standalone was adapted accordingly
<https://bitbucket.org/lindenlab/viewer-development/changeset/7690f4cb5e81#chg-indra/cmake/JsonCpp.cmake>.
(Actually, it'll now search both places.) At the same time, the #include
for the one JsonCpp header we use, *reader.h*, was changed
<https://bitbucket.org/lindenlab/viewer-development/changeset/7690f4cb5e81#chg-indra/newview/lltranslate.cpp>
to only the filename. (Before that, it had "jsoncpp/" prepended.)

So now the question is how to get this to work on STANDALONE. Currently,
during configuration, CMake will search for *jsoncpp/json.h*
<https://bitbucket.org/lindenlab/viewer-development/src/7690f4cb5e81/indra/cmake/FindJsonCpp.cmake#cl-12>
in */usr/local/include/* and */usr/include/*
<https://bitbucket.org/lindenlab/viewer-development/src/7690f4cb5e81/indra/cmake/FindJsonCpp.cmake#cl-13>.
The first of those paths to contain the file jsoncpp/json.h will be
added as include search path, and thus searched by the compiler during
build for ... well, just "*reader.h*", which won't be there (it'd be one
level lower in the tree). The straight forward thing to do would be to
have CMake search for just *json.h* (in /usr/local/include/*json/* and
/usr/include/*json/*) during configuration, so that reader.h would later
be found when building.

However, if you have an unaltered JsonCpp installed so that json.h
resides at one of those paths, making that path an include search dir
has a nasty side effect, because in the same directory
<http://jsoncpp.svn.sourceforge.net/viewvc/jsoncpp/trunk/jsoncpp/include/json/>,
there's a file named features.h. That filename collides with that of a
standard system header
<http://www.kernel.org/doc/man-pages/online/pages/man7/feature_test_macros.7.html>
which is included (indirectly) elsewhere in the viewer code. However,
with the .../*json* dir in the include search path, JsonCpp's features.h
will be included at those other places, too, which leads to essential
macros not being defined. (The prebuilt package avoids this by having
the header renamed
<https://bitbucket.org/lindenlab/3p-jsoncpp/changeset/1e607b7ffffa>.)

We probably don't want to go rename system-installed headers, so we have
to change the #include line back to including the parent dir of json.h
as a namespacing measure. If there are no plans to use old JsonCpp
prebuilt packages (where that parent dir is called jsoncpp instead of
json), that line can be the same for non-standalone and standalone, I
guess. Otherwise, we can do some #if(STANDALONE)...#else...-thing so
that non-standalone can keep including from both paths.

Now my question is, is the name of the parent dir the same on all Linux
distributions that have a JsonCpp package? The ebuild from Techwolf's
gentoo linux portage overlay places the headers in
/usr/include/jsoncpp/, but I guess that was done just the accommodate
the Viewer build back then and could be easily changed to
/usr/include/json/.

So if you are on another Linux distribution (and especially if you do or
want to build in STANDALONE mode), I'd like to know:

   1. Is a JsonCpp package available for your distribution?
      If yes:
   2. Does it come from an official, semi-official or non-official
      package repository? (Or even just a manual download?)
   3. Does it install a features.h header? If so, where?
   4. Where does it install json.h and reader.h?

Cheers,
Boroondas
_______________________________________________
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges

Reply via email to