Skip to content

Simplify mock_autotools.cmake

1. Unnecessary header checks

Checking for all of these headers is unnecessary, because all of them are standard C headers since at least C99 and since Octopus requires C11 anyway, these checks can safely be dropped. Autotools mandates C99 which is also sufficient for all these headers to exist

check_include_file(errno.h HAVE_ERRNO_H)
check_include_file(signal.h HAVE_SIGNAL_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(string.h HAVE_STRING_H)

2. standard C functions - checks can be removed

check_function_exists(strchr HAVE_STRCHR)
check_function_exists(strtod HAVE_STRTOD)
check_function_exists(perror HAVE_PERROR)
check_function_exists(strndup HAVE_STRNDUP)

3. GNU Extensions

getopt_long is a GNU extension and only available in glibc.

strcasestr is a GNU extension and only available in glibc.

The sbrk syscall is deprecated.

Edited by Alex Buccheri