From f447aa7dd7f0e36916847b8bb7193fecc42ddc89 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 4 May 2018 23:00:29 -0700 Subject: [PATCH] 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 --- ConfigureChecks.cmake | 14 ++++++++++---- cmakeconfig.h.in | 3 +++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 421fcf13e4..739fe7c32b 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -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 diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in index 2c7ba5c75e..cba6e062e6 100644 --- a/cmakeconfig.h.in +++ b/cmakeconfig.h.in @@ -65,6 +65,9 @@ /* Define to 1 if you have the 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