<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[206458] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/206458">206458</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-09-27 13:30:09 -0700 (Tue, 27 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[CMake] Use CMake to determine HAVE_* defines
https://bugs.webkit.org/show_bug.cgi?id=162368

Patch by Don Olmstead &lt;don.olmstead@am.sony.com&gt; on 2016-09-27
Reviewed by Alex Christensen.

.:

* Source/cmake/OptionsCommon.cmake:

Source/WTF:

* wtf/Platform.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkChangeLog">trunk/ChangeLog</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfPlatformh">trunk/Source/WTF/wtf/Platform.h</a></li>
<li><a href="#trunkSourcecmakeOptionsCommoncmake">trunk/Source/cmake/OptionsCommon.cmake</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/ChangeLog (206457 => 206458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/ChangeLog        2016-09-27 20:07:15 UTC (rev 206457)
+++ trunk/ChangeLog        2016-09-27 20:30:09 UTC (rev 206458)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2016-09-27  Don Olmstead  &lt;don.olmstead@am.sony.com&gt;
+
+        [CMake] Use CMake to determine HAVE_* defines
+        https://bugs.webkit.org/show_bug.cgi?id=162368
+
+        Reviewed by Alex Christensen.
+
+        * Source/cmake/OptionsCommon.cmake:
+
</ins><span class="cx"> 2016-09-27  Konstantin Tokarev  &lt;annulen@yandex.ru&gt;
</span><span class="cx"> 
</span><span class="cx">         [cmake] Simplify Clang checks and prepare for compiler ID split
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (206457 => 206458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-09-27 20:07:15 UTC (rev 206457)
+++ trunk/Source/WTF/ChangeLog        2016-09-27 20:30:09 UTC (rev 206458)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2016-09-27  Don Olmstead  &lt;don.olmstead@am.sony.com&gt;
+
+        [CMake] Use CMake to determine HAVE_* defines
+        https://bugs.webkit.org/show_bug.cgi?id=162368
+
+        Reviewed by Alex Christensen.
+
+        * wtf/Platform.h:
+
</ins><span class="cx"> 2016-09-20  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         PlatformEvent::m_modifiers should be an OptionSet
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Platform.h (206457 => 206458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Platform.h        2016-09-27 20:07:15 UTC (rev 206457)
+++ trunk/Source/WTF/wtf/Platform.h        2016-09-27 20:30:09 UTC (rev 206458)
</span><span class="lines">@@ -605,21 +605,26 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif /* !defined(HAVE_ACCESSIBILITY) */
</span><span class="cx"> 
</span><del>-#if OS(UNIX)
</del><ins>+/* FIXME: Remove after CMake build enabled on Darwin */
+#if OS(DARWIN)
</ins><span class="cx"> #define HAVE_ERRNO_H 1
</span><span class="cx"> #define HAVE_LANGINFO_H 1
</span><span class="cx"> #define HAVE_MMAP 1
</span><span class="cx"> #define HAVE_SIGNAL_H 1
</span><ins>+#define HAVE_STAT_BIRTHTIME 1
</ins><span class="cx"> #define HAVE_STRINGS_H 1
</span><ins>+#define HAVE_STRNSTR 1
</ins><span class="cx"> #define HAVE_SYS_PARAM_H 1
</span><span class="cx"> #define HAVE_SYS_TIME_H 1 
</span><ins>+#define HAVE_TM_GMTOFF 1
+#define HAVE_TM_ZONE 1
+#define HAVE_TIMEGM 1
+#endif /* OS(DARWIN) */
+
+#if OS(UNIX)
</ins><span class="cx"> #define USE_PTHREADS 1
</span><span class="cx"> #endif /* OS(UNIX) */
</span><span class="cx"> 
</span><del>-#if (OS(FREEBSD) || OS(OPENBSD)) &amp;&amp; !defined(__GLIBC__)
-#define HAVE_PTHREAD_NP_H 1
-#endif
-
</del><span class="cx"> #if !defined(HAVE_VASPRINTF)
</span><span class="cx"> #if !COMPILER(MSVC) &amp;&amp; !COMPILER(MINGW)
</span><span class="cx"> #define HAVE_VASPRINTF 1
</span><span class="lines">@@ -626,24 +631,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if !defined(HAVE_STRNSTR)
-#if OS(DARWIN) || (OS(FREEBSD) &amp;&amp; !defined(__GLIBC__))
-#define HAVE_STRNSTR 1
-#endif
-#endif
-
-#if (OS(DARWIN) || OS(FREEBSD) || OS(NETBSD)) &amp;&amp; !defined(__GLIBC__)
-#define HAVE_STAT_BIRTHTIME 1
-#endif
-
-#if !OS(WINDOWS) &amp;&amp; !OS(SOLARIS)
-#define HAVE_TM_GMTOFF 1
-#define HAVE_TM_ZONE 1
-#define HAVE_TIMEGM 1
-#endif
-
</del><span class="cx"> #if OS(DARWIN)
</span><del>-
</del><span class="cx"> #define HAVE_DISPATCH_H 1
</span><span class="cx"> #define HAVE_MADV_FREE 1
</span><span class="cx"> #define HAVE_MADV_FREE_REUSE 1
</span><span class="lines">@@ -662,18 +650,6 @@
</span><span class="cx"> 
</span><span class="cx"> #endif /* OS(DARWIN) */
</span><span class="cx"> 
</span><del>-#if OS(WINDOWS)
-
-#define HAVE_SYS_TIMEB_H 1
-#define HAVE_ALIGNED_MALLOC 1
-#define HAVE_ISDEBUGGERPRESENT 1
-
-#endif
-
-#if OS(WINDOWS)
-#define HAVE_VIRTUALALLOC 1
-#endif
-
</del><span class="cx"> #if (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200) || (PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 100000)
</span><span class="cx"> #define HAVE_CFNETWORK_STORAGE_PARTITIONING 1
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourcecmakeOptionsCommoncmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/cmake/OptionsCommon.cmake (206457 => 206458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/OptionsCommon.cmake        2016-09-27 20:07:15 UTC (rev 206457)
+++ trunk/Source/cmake/OptionsCommon.cmake        2016-09-27 20:30:09 UTC (rev 206458)
</span><span class="lines">@@ -203,8 +203,58 @@
</span><span class="cx">     set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1)
</span><span class="cx"> endif ()
</span><span class="cx"> 
</span><ins>+# Macros for determining HAVE values.
+include(CheckIncludeFile)
+include(CheckFunctionExists)
+include(CheckSymbolExists)
+include(CheckStructHasMember)
+
+macro(_HAVE_CHECK_INCLUDE _variable _header)
+    check_include_file(${_header} ${_variable}_value)
+    SET_AND_EXPOSE_TO_BUILD(${_variable} ${_variable}_value)
+endmacro()
+
+macro(_HAVE_CHECK_FUNCTION _variable _function)
+    check_function_exists(${_function} ${_variable}_value)
+    SET_AND_EXPOSE_TO_BUILD(${_variable} ${_variable}_value)
+endmacro()
+
+macro(_HAVE_CHECK_SYMBOL _variable _symbol _header)
+    check_symbol_exists(${_symbol} ${_header} ${_variable}_value)
+    SET_AND_EXPOSE_TO_BUILD(${_variable} ${_variable}_value)
+endmacro()
+
+macro(_HAVE_CHECK_STRUCT _variable _struct _member _header)
+    check_struct_has_member(${_struct} ${_member} ${_header} ${_variable}_value)
+    SET_AND_EXPOSE_TO_BUILD(${_variable} ${_variable}_value)
+endmacro()
+
</ins><span class="cx"> # Check whether features.h header exists.
</span><span class="cx"> # Including glibc's one defines __GLIBC__, that is used in Platform.h
</span><del>-include(CheckIncludeFiles)
-check_include_files(features.h HAVE_FEATURES_H)
-SET_AND_EXPOSE_TO_BUILD(HAVE_FEATURES_H ${HAVE_FEATURES_H})
</del><ins>+_HAVE_CHECK_INCLUDE(HAVE_FEATURES_H features.h)
+
+# Check for headers
+_HAVE_CHECK_INCLUDE(HAVE_ERRNO_H errno.h)
+_HAVE_CHECK_INCLUDE(HAVE_LANGINFO_H langinfo.h)
+_HAVE_CHECK_INCLUDE(HAVE_MMAP sys/mman.h)
+_HAVE_CHECK_INCLUDE(HAVE_PTHREAD_NP_H pthread_np.h)
+_HAVE_CHECK_INCLUDE(HAVE_STRINGS_H strings.h)
+_HAVE_CHECK_INCLUDE(HAVE_SYS_PARAM_H sys/param.h)
+_HAVE_CHECK_INCLUDE(HAVE_SYS_TIME_H sys/time.h)
+_HAVE_CHECK_INCLUDE(HAVE_SYS_TIMEB_H sys/timeb.h)
+
+# Check for functions
+_HAVE_CHECK_FUNCTION(HAVE_ALIGNED_MALLOC _aligned_malloc)
+_HAVE_CHECK_FUNCTION(HAVE_ISDEBUGGERPRESENT IsDebuggerPresent)
+_HAVE_CHECK_FUNCTION(HAVE_STRNSTR strnstr)
+_HAVE_CHECK_FUNCTION(HAVE_TIMEGM timegm)
+_HAVE_CHECK_FUNCTION(HAVE_VASPRINTF vasprintf)
+
+# Check for symbols
+# Windows has signal.h but is missing symbols that are used in calls to signal.
+_HAVE_CHECK_SYMBOL(HAVE_SIGNAL_H SIGTRAP signal.h)
+
+# Check for struct members
+_HAVE_CHECK_STRUCT(HAVE_STAT_BIRTHTIME &quot;struct stat&quot; st_birthtime sys/stat.h)
+_HAVE_CHECK_STRUCT(HAVE_TM_GMTOFF &quot;struct tm&quot; tm_gmtoff time.h)
+_HAVE_CHECK_STRUCT(HAVE_TM_ZONE &quot;struct tm&quot; tm_zone time.h)
</ins></span></pre>
</div>
</div>

</body>
</html>