Bug #69595 Cmake searches for sys/devpoll.h twice
Submitted: 27 Jun 2013 2:24 Modified: 4 Jul 2013 14:50
Reporter: Chris Calender Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.6.12 OS:Windows
Assigned to: CPU Architecture:Any
Tags: cmake, compiling, devpoll.h

[27 Jun 2013 2:24] Chris Calender
Description:
Cmake checks for the same file, sys/devpoll.h, twice during its checks.

c:\mysql\mysql-5.6.12\bld>cmake ..
-- Building for: Visual Studio 10
-- Running cmake version 2.8.11.1
-- The C compiler identification is MSVC 16.0.30319.1
-- The CXX compiler identification is MSVC 16.0.30319.1
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
-- Check for working CXX compiler using: Visual Studio 10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check size of void *
-- Check size of void * - done
-- MySQL 5.6.12
-- Packaging as: mysql-5.6.12-win32
-- Looking for include file sasl/sasl.h
-- Looking for include file sasl/sasl.h - found
-- Looking for include file sys/devpoll.h
-- Looking for include file sys/devpoll.h - found
-- Looking for include file signal.h
-- Looking for include file signal.h - found
-- Looking for include file sys/devpoll.h
-- Looking for include file sys/devpoll.h - found
...

In the configure.cmake file, we see:

# For libevent
CHECK_INCLUDE_FILES(sys/devpoll.h HAVE_DEVPOLL)
CHECK_INCLUDE_FILES(signal.h HAVE_SIGNAL_H)
CHECK_INCLUDE_FILES(sys/devpoll.h HAVE_SYS_DEVPOLL_H)

So, it does check for the same file twice, but one is for the check HAVE_DEVPOLL and the other for HAVE_SYS_DEVPOLL_H.

But since they are the same file, are both of these necessary?

How to repeat:
Run "cmake ." (or "cmake ..") in a clean build environment.

Suggested fix:
Remove one of the checks, if they are both not necessary.
[4 Jul 2013 7:44] Jon Olav Hauglid
Verified.
Thanks for the bug report! (I consider this a bug, not a feature request)
[4 Jul 2013 14:50] Paul DuBois
Fixed in 5.7.2. No changelog entry; user impact negligible (slight CMake speedup).