1 dnl Copyright (C) 1997-2021 Free Software Foundation, Inc.
3 dnl This program is free software; you can redistribute it and/or modify
4 dnl it under the terms of the GNU General Public License as published by
5 dnl the Free Software Foundation; either version 3 of the License, or
6 dnl (at your option) any later version.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 dnl GNU General Public License for more details.
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
16 dnl Check for various platform settings.
17 AC_DEFUN([SIM_AC_PLATFORM],
19 dnl Check for common headers.
20 dnl NB: You can assume C11 headers exist.
21 AC_CHECK_HEADERS_ONCE(m4_flatten([
49 AC_CHECK_FUNCS_ONCE(m4_flatten([
118 AC_CHECK_MEMBERS([[struct stat.st_dev], [struct stat.st_ino],
119 [struct stat.st_mode], [struct stat.st_nlink], [struct stat.st_uid],
120 [struct stat.st_gid], [struct stat.st_rdev], [struct stat.st_size],
121 [struct stat.st_blksize], [struct stat.st_blocks], [struct stat.st_atime],
122 [struct stat.st_mtime], [struct stat.st_ctime]], [], [],
123 [[#ifdef HAVE_SYS_TYPES_H
124 #include <sys/types.h>
126 #ifdef HAVE_SYS_STAT_H
127 #include <sys/stat.h>
130 AC_CHECK_TYPES([__int128])
131 AC_CHECK_TYPES(socklen_t, [], [],
132 [#include <sys/types.h>
133 #include <sys/socket.h>
136 dnl Types used by common code
145 dnl BFD conditionally uses zlib, so we must link it in if libbfd does, by
146 dnl using the same condition.
149 dnl BFD uses libdl when when plugins enabled.
151 AM_CONDITIONAL(PLUGINS, test "$plugins" = yes)
153 AC_SUBST(lt_cv_dlopen_libs)
156 AC_CHECK_LIB(socket, bind)
157 AC_CHECK_LIB(nsl, gethostbyname)
158 AC_CHECK_LIB(m, fabs)
159 AC_CHECK_LIB(m, log2)