]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/m4/sim_ac_platform.m4
sim: unify various library testing logic
[thirdparty/binutils-gdb.git] / sim / m4 / sim_ac_platform.m4
CommitLineData
b15c5d7a
MF
1dnl Copyright (C) 1997-2021 Free Software Foundation, Inc.
2dnl
3dnl This program is free software; you can redistribute it and/or modify
4dnl it under the terms of the GNU General Public License as published by
5dnl the Free Software Foundation; either version 3 of the License, or
6dnl (at your option) any later version.
7dnl
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11dnl GNU General Public License for more details.
12dnl
13dnl You should have received a copy of the GNU General Public License
14dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
15dnl
16dnl Check for various platform settings.
17AC_DEFUN([SIM_AC_PLATFORM],
18[dnl
19dnl Check for common headers.
20dnl NB: You can assume C11 headers exist.
21AC_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
a48ff3ef 36 sys/mount.h
b15c5d7a
MF
37 sys/param.h
38 sys/resource.h
b15c5d7a
MF
39 sys/socket.h
40 sys/stat.h
a48ff3ef
MF
41 sys/statfs.h
42 sys/termio.h
43 sys/termios.h
44 sys/types.h
45 sys/vfs.h
b15c5d7a 46]))
a48ff3ef 47AC_HEADER_DIRENT
b15c5d7a
MF
48
49AC_CHECK_FUNCS_ONCE(m4_flatten([
50 __setfpucw
a48ff3ef 51 access
b15c5d7a
MF
52 aint
53 anint
a48ff3ef
MF
54 cfgetispeed
55 cfgetospeed
56 cfsetispeed
57 cfsetospeed
58 chdir
b15c5d7a 59 chmod
a48ff3ef
MF
60 dup
61 dup2
b15c5d7a
MF
62 execv
63 execve
a48ff3ef 64 fcntl
b15c5d7a 65 fork
a48ff3ef
MF
66 fstat
67 fstatfs
b15c5d7a 68 ftruncate
a48ff3ef 69 getdirentries
b15c5d7a 70 getegid
a48ff3ef 71 geteuid
b15c5d7a 72 getgid
a48ff3ef
MF
73 getpid
74 getppid
b15c5d7a 75 getrusage
a48ff3ef 76 gettimeofday
b15c5d7a 77 getuid
a48ff3ef 78 ioctl
b15c5d7a 79 kill
a48ff3ef
MF
80 link
81 lseek
b15c5d7a
MF
82 mmap
83 munmap
a48ff3ef 84 pipe
b15c5d7a
MF
85 posix_fallocate
86 pread
a48ff3ef
MF
87 rmdir
88 setregid
89 setreuid
b15c5d7a 90 setgid
a48ff3ef 91 setuid
b15c5d7a 92 sigaction
a48ff3ef 93 sigprocmask
b15c5d7a 94 sqrt
a48ff3ef 95 stat
b15c5d7a 96 strsignal
a48ff3ef
MF
97 symlink
98 tcdrain
99 tcflow
100 tcflush
101 tcgetattr
102 tcgetpgrp
103 tcsendbreak
104 tcsetattr
105 tcsetpgrp
b15c5d7a
MF
106 time
107 truncate
a48ff3ef
MF
108 umask
109 unlink
b15c5d7a
MF
110 utime
111]))
112
a48ff3ef
MF
113AC_STRUCT_ST_BLKSIZE
114AC_STRUCT_ST_BLOCKS
115AC_STRUCT_ST_RDEV
116AC_STRUCT_TIMEZONE
117
b15c5d7a
MF
118AC_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
130AC_CHECK_TYPES([__int128])
131AC_CHECK_TYPES(socklen_t, [], [],
132[#include <sys/types.h>
133#include <sys/socket.h>
134])
135
136dnl Types used by common code
a48ff3ef
MF
137AC_TYPE_GETGROUPS
138AC_TYPE_MODE_T
139AC_TYPE_OFF_T
140AC_TYPE_PID_T
b15c5d7a 141AC_TYPE_SIGNAL
a48ff3ef
MF
142AC_TYPE_SIZE_T
143AC_TYPE_UID_T
07490bf8
MF
144
145dnl Libraries.
146AC_CHECK_LIB(socket, bind)
147AC_CHECK_LIB(nsl, gethostbyname)
148AC_CHECK_LIB(m, fabs)
149AC_CHECK_LIB(m, log2)
b15c5d7a 150])