NetBSD: Detect copysign(3) properly on NetBSD inside the math library
authorKamil Rytarowski <n54@gmx.com>
Fri, 22 Jan 2016 13:41:40 +0000 (14:41 +0100)
committerKamil Rytarowski <n54@gmx.com>
Fri, 22 Jan 2016 13:41:40 +0000 (14:41 +0100)
The copysing(3) function is a part of the libm library on NetBSD.
This is also true for other POSIX platforms.

NAME
     copysign, copysignf, copysignl - functions to manipulate signs

LIBRARY
     Math Library (libm, -lm)

SYNOPSIS
     #include <math.h>

     double
     copysign(double x, double y);

     float
     copysignf(float x, float y);

     long double
     copysignl(long double x, long double y);

STANDARDS
     The described functions conform to ISO/IEC 9899:1999 (``ISO C99'').

src/pal/src/configure.cmake

index 7d40d81..c5db338 100644 (file)
@@ -46,7 +46,9 @@ check_library_exists(pthread pthread_getattr_np "" HAVE_PTHREAD_GETATTR_NP)
 check_library_exists(pthread pthread_sigqueue "" HAVE_PTHREAD_SIGQUEUE)
 check_function_exists(sigreturn HAVE_SIGRETURN)
 check_function_exists(_thread_sys_sigreturn HAVE__THREAD_SYS_SIGRETURN)
+set(CMAKE_REQUIRED_LIBRARIES m)
 check_function_exists(copysign HAVE_COPYSIGN)
+set(CMAKE_REQUIRED_LIBRARIES)
 check_function_exists(fsync HAVE_FSYNC)
 check_function_exists(futimes HAVE_FUTIMES)
 check_function_exists(utimes HAVE_UTIMES)