log-platform-config.jam 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # log-platform-config.jam
  2. #
  3. # Copyright 2017 Andrey Semashev
  4. #
  5. # Distributed under the Boost Software License Version 1.0. (See
  6. # accompanying file LICENSE_1_0.txt or copy at
  7. # http://www.boost.org/LICENSE_1_0.txt)
  8. import configure ;
  9. import project ;
  10. import path ;
  11. import property ;
  12. import feature ;
  13. local here = [ modules.binding $(__name__) ] ;
  14. project.push-current [ project.current ] ;
  15. project.load [ path.join [ path.make $(here:D) ] ../config/xopen-source-600 ] ;
  16. project.pop-current ;
  17. rule set-platform-defines ( properties * )
  18. {
  19. local result = ;
  20. if ( <target-os>windows in $(properties) ) || ( <target-os>cygwin in $(properties) )
  21. {
  22. result += <define>NOMINMAX ;
  23. result += <define>WIN32_LEAN_AND_MEAN ;
  24. result += <define>SECURITY_WIN32 ;
  25. result += <define>BOOST_USE_WINDOWS_H ;
  26. if <target-os>cygwin in $(properties)
  27. {
  28. result += <define>__USE_W32_SOCKETS ;
  29. result += <define>_XOPEN_SOURCE=600 ;
  30. }
  31. }
  32. else if <target-os>solaris in $(properties)
  33. {
  34. # Solaris headers are broken and cannot be included in C++03 when _XOPEN_SOURCE=600. At the same time, they cannot be included with _XOPEN_SOURCE=500 in C++11 and later.
  35. # This is because the system headers check the C language version and error out if the version does not match. We have to test if we can request _XOPEN_SOURCE=600.
  36. if [ configure.builds /boost/log/xopen-source-600//xopen_source_600 : $(properties) : xopen-source-600-supported ]
  37. {
  38. result += <define>_XOPEN_SOURCE=600 ;
  39. }
  40. else
  41. {
  42. result += <define>_XOPEN_SOURCE=500 ;
  43. }
  44. result += <define>__EXTENSIONS__ ;
  45. }
  46. else if ( <target-os>linux in $(properties) ) || ( <target-os>hpux in $(properties) )
  47. {
  48. result += <define>_XOPEN_SOURCE=600 ;
  49. }
  50. return $(result) ;
  51. }