Hi Mats, On Fri, Jun 16, 2017 at 11:44 AM, Mats Wichmann <mats at wichmann.us> wrote: > > Second a question that takes a few more words to describe: > > build_common/iotivityconfig contains some stuff that tries to sense the > host's environment. > > An older patch proposed moving this stuff to a place it's more naturally > (almost automatically) picked up by scons, though it never got any real > traction > > https://gerrit.iotivity.org/gerrit/8597 > > I think putting tools written in python in the right place is a fine > idea, but before moving this stuff, let's look at it: > > there's code there that looks for compiler details, etc, but it doesn't > look like any of it except a pthreads check is used: > > (from build_common/SConscript) > ###################################################################### > # Check for PThreads support > ###################################################################### > import iotivityconfig > from iotivityconfig import * > > conf = Configure(env, > custom_tests = > { > 'CheckPThreadsSupport' : iotivityconfig.check_pthreads > } ) > > # Identify whether we have pthreads support, which is necessary for > # threading and mutexes. This will set the environment variable > # POSIX_SUPPORTED, 1 if it is supported, 0 otherwise > conf.CheckPThreadsSupport() > env = conf.Finish() > > The test for this itself is a configure-style attempt to compile a very > small program which just checks if _POSIX_THREADS is defined. > > My question is, should we drop iotivityconfig and just make a decision > based on known characteristics of known targets? We do plenty of that > kind of stuff elsewhere in the code, there's no chance we'll suddenly be > facing a platform we don't know anything about without that build > falling apart in many many other places. The pthreads test does, as a > side effect, call a check-for-gcc test also but the result is not used > and scons already knows if it's gcc or not based on its internal stuff, > so it does not serve any purpose to check that. > > Does anyone left on the list know this stuff? Was it actually written > for iotivity,
It was indeed written for IoTivity. > or just copied from somewhere else and maybe now is just a > historical artifact? Is if okay if the above is replaced by a > target-specific rule which sets POSIX_SUPPORTED=1 in the environment? > I responded to your question about iotivityconfig on May 31 but the direct mail to you bounced (see https://lists.iotivity.org/pipermail/iotivity-dev/2017-May/007752.html). Here's what I said ... I introduced that compiler related detection code over two years ago after noticing that C++11 and C99 build flags were used in a rather ad hoc manner throughout many IoTivity Sconscript files. However, the Python calls that ran the compiler detection code were lost during the big connectivity branch merge back then, and were never reintroduced. ... The pthreads check was added later on (see commit 2cdbf260), but I wasn't involved with that so I don't know much about it. ... It's been a long time since I looked closely at the SConscript files, so I don't know if the problem the iotivityconfig module attempted to solve still exists. At the very least IoTivity seems to get along without it so if nobody is going to use it I'd just drop it. HTH, -Ossama -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20170616/da704bc7/attachment.html>