On Wed, Jul 6, 2016 at 8:13 PM, Thiago Macieira <thiago.macieira at intel.com> wrote:
> On quarta-feira, 6 de julho de 2016 18:17:00 PDT Gregg Reynolds wrote: > > My 2 cents: if you're using scons, then config.h is utterly pointless. > The > > *only* reason config.h exists in configure/make systems is to transfer > info > > from the configure phase to the make phase. There is no justification > for > > it in a scons system. > > And how do propose we pass the detected configuration to the C and C++ > source > code? > That's what scons construction environments are for. You can see one way to do this at https://github.com/iotk/iochibity/blob/master/site_scons/build/utils.py and https://github.com/iotk/iochibity/blob/master/build_common/SConscript, see feature_tests(). The code is not optimal but it's a start. Here's what the ensuing compile command looks like: g++ -o out/darwin/x86_64/release/resource/c_common/ocrandom/test/linux/randomtest.o -c -std=c++11 -m64 -fPIC -Wall -Wextra -Wno-unused -Os -pthread -DHAVE_UUID -DHAVE_PTHREADS -DHAVE_GDBUS -DHAVE_GETTIMEOFDAY -DHAVE_STRPTIME -DHAVE_ARPA_INET_H -DHAVE_FCNTL_H -DHAVE_GRP_H -DHAVE_MEMORY_H -DHAVE_NETDB_H -DHAVE_NETINET_IN_H -DHAVE_PTHREAD_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_STRINGS_H -DHAVE_SYS_SOCKET_H -DHAVE_SYS_STAT_H -DHAVE_SYS_TIME_H -DHAVE_SYS_TIMEB_H -DHAVE_SYS_TYPES_H -DHAVE_SYS_UNISTD_H -DHAVE_SYSLOG_H -DHAVE_TIME_H -DHAVE_UNISTD_H -DHAVE_UUID_UUID_H -DNDEBUG -D_DARWIN_C_SOURCE -DWITH_POSIX -D__darwin__ -DIP_ADAPTER -DNO_EDR_ADAPTER -DNO_LE_ADAPTER -DROUTING_EP -DWITH_BWT -Iout/darwin/x86... ... resource/c_common/ocrandom/test/linux/randomtest.cpp -Gregg -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20160706/df613050/attachment.html>
