aboutsummaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-03-23 14:21:06 -0700
committerGuy Harris <guy@alum.mit.edu>2018-03-23 22:39:07 +0000
commitd12a41b17a006ccc1b0f98e9df3fc442e4ee7643 (patch)
tree009988dd542bad8784861bce8bb0df0483ba122a /ConfigureChecks.cmake
parenta7edc4f25f1cffb452959e2093fe7b2a65e75d79 (diff)
Include alloca.h if we have it.
Bug: 14552 Change-Id: I799691f7f33ca56748ed4e51d7d548f37769837b Reviewed-on: https://code.wireshark.org/review/26611 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index bd6e977348..9079ee396f 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -89,11 +89,25 @@ cmake_pop_check_state()
check_function_exists("getopt_long" HAVE_GETOPT_LONG)
if(HAVE_GETOPT_LONG)
+ #
+ # The OS has getopt_long(), so it might have optreset.
+ # Do we have it?
+ #
if(HAVE_GETOPT_H)
check_symbol_exists("optreset" "getopt.h" HAVE_OPTRESET)
else()
check_symbol_exists("optreset" HAVE_OPTRESET)
endif()
+else()
+ #
+ # The OS doesn't have getopt_long(), so we're using the GNU libc
+ # version that we have in wsutil. It doesn't have optreset, so we
+ # don't need to check for it.
+ #
+ # However, it uses alloca(), so we may need to include alloca.h;
+ # check for it.
+ #
+ check_include_file("alloca.h" HAVE_ALLOCA_H)
endif()
check_function_exists("getifaddrs" HAVE_GETIFADDRS)
check_function_exists("issetugid" HAVE_ISSETUGID)