]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/m4/sim_ac_platform.m4
b7573567d24cf9b2ca445666259f34aab4d337d6
[thirdparty/binutils-gdb.git] / sim / m4 / sim_ac_platform.m4
1 dnl Copyright (C) 1997-2021 Free Software Foundation, Inc.
2 dnl
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.
7 dnl
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.
12 dnl
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/>.
15 dnl
16 dnl Check for various platform settings.
17 AC_DEFUN([SIM_AC_PLATFORM],
18 [dnl
19 dnl Check for common headers.
20 dnl NB: You can assume C11 headers exist.
21 AC_CHECK_HEADERS_ONCE(m4_flatten([
22 dlfcn.h
23 fcntl.h
24 fpu_control.h
25 termios.h
26 unistd.h
27 utime.h
28 linux/if_tun.h
29 linux/mii.h
30 linux/types.h
31 net/if.h
32 netinet/in.h
33 netinet/tcp.h
34 sys/ioctl.h
35 sys/mman.h
36 sys/mount.h
37 sys/param.h
38 sys/resource.h
39 sys/socket.h
40 sys/stat.h
41 sys/statfs.h
42 sys/termio.h
43 sys/termios.h
44 sys/types.h
45 sys/vfs.h
46 ]))
47 AC_HEADER_DIRENT
48
49 AC_CHECK_FUNCS_ONCE(m4_flatten([
50 __setfpucw
51 access
52 aint
53 anint
54 cfgetispeed
55 cfgetospeed
56 cfsetispeed
57 cfsetospeed
58 chdir
59 chmod
60 dup
61 dup2
62 execv
63 execve
64 fcntl
65 fork
66 fstat
67 fstatfs
68 ftruncate
69 getdirentries
70 getegid
71 geteuid
72 getgid
73 getpid
74 getppid
75 getrusage
76 gettimeofday
77 getuid
78 ioctl
79 kill
80 link
81 lseek
82 mmap
83 munmap
84 pipe
85 posix_fallocate
86 pread
87 rmdir
88 setregid
89 setreuid
90 setgid
91 setuid
92 sigaction
93 sigprocmask
94 sqrt
95 stat
96 strsignal
97 symlink
98 tcdrain
99 tcflow
100 tcflush
101 tcgetattr
102 tcgetpgrp
103 tcsendbreak
104 tcsetattr
105 tcsetpgrp
106 time
107 truncate
108 umask
109 unlink
110 utime
111 ]))
112
113 AC_STRUCT_ST_BLKSIZE
114 AC_STRUCT_ST_BLOCKS
115 AC_STRUCT_ST_RDEV
116 AC_STRUCT_TIMEZONE
117
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>
125 #endif
126 #ifdef HAVE_SYS_STAT_H
127 #include <sys/stat.h>
128 #endif]])
129
130 AC_CHECK_TYPES([__int128])
131 AC_CHECK_TYPES(socklen_t, [], [],
132 [#include <sys/types.h>
133 #include <sys/socket.h>
134 ])
135
136 dnl Types used by common code
137 AC_TYPE_GETGROUPS
138 AC_TYPE_MODE_T
139 AC_TYPE_OFF_T
140 AC_TYPE_PID_T
141 AC_TYPE_SIGNAL
142 AC_TYPE_SIZE_T
143 AC_TYPE_UID_T
144
145 dnl We don't use gettext, but bfd does. So we do the appropriate checks
146 dnl to see if there are intl libraries we should link against.
147 ALL_LINGUAS=
148 ZW_GNU_GETTEXT_SISTER_DIR
149
150 dnl BFD conditionally uses zlib, so we must link it in if libbfd does, by
151 dnl using the same condition.
152 AM_ZLIB
153
154 dnl BFD uses libdl when when plugins enabled.
155 AC_PLUGINS
156 AM_CONDITIONAL(PLUGINS, test "$plugins" = yes)
157 LT_INIT([dlopen])
158 AC_SUBST(lt_cv_dlopen_libs)
159
160 dnl Libraries.
161 AC_CHECK_LIB(socket, bind)
162 AC_CHECK_LIB(nsl, gethostbyname)
163 AC_CHECK_LIB(m, fabs)
164 AC_CHECK_LIB(m, log2)
165 ])