On Solaris, check for getexecname in CMake.

We expect it to be checked for in wsutil/filesystem.c, so we should
check for it.  It's a Solarisism, so check for it only on Solaris.

Change-Id: I09104c17d2ec91c74862b63e735c32a9d188f2a6
Reviewed-on: https://code.wireshark.org/review/27351
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2018-05-04 23:00:29 -07:00
parent 1ebbb09c5b
commit f447aa7dd7
2 changed files with 13 additions and 4 deletions

View File

@ -71,10 +71,16 @@ endif()
include(CheckFunctionExists)
include(CheckSymbolExists)
cmake_push_check_state()
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS})
check_function_exists("dladdr" HAVE_DLADDR)
cmake_pop_check_state()
#
# Platform-specific functions used in platform-specific code.
# We check for them only on the platform on which we use them.
#
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_VERSION MATCHES "5[.][0-9.]*")
#
# Solaris
#
check_function_exists("getexecname" HAVE_GETEXECNAME)
endif()
#
# Use check_symbol_exists just in case math.h does something magic

View File

@ -65,6 +65,9 @@
/* Define to 1 if you have the <ifaddrs.h> header file. */
#cmakedefine HAVE_IFADDRS_H 1
/* Define to 1 if you have the `getexecname' function. */
#cmakedefine HAVE_GETEXECNAME 1
/* Define to 1 if you have the `getifaddrs' function. */
#cmakedefine HAVE_GETIFADDRS 1