]>
Commit | Line | Data |
---|---|---|
8d57beea | 1 | ifeq ($(subdir),csu) |
c6645251 | 2 | sysdep_routines += errno-loc |
39778c6c UD |
3 | endif |
4 | ||
2c008571 UD |
5 | ifeq ($(subdir),assert) |
6 | CFLAGS-assert.c += -DFATAL_PREPARE_INCLUDE='<fatal-prepare.h>' | |
7 | CFLAGS-assert-perr.c += -DFATAL_PREPARE_INCLUDE='<fatal-prepare.h>' | |
8 | endif | |
9 | ||
a1648746 | 10 | ifeq ($(subdir),malloc) |
7c2842bf | 11 | CFLAGS-malloc.c += -DMORECORE_CLEARS=2 |
a1648746 UD |
12 | endif |
13 | ||
1e1dc4e8 | 14 | ifeq ($(subdir),socket) |
123be9de | 15 | sysdep_routines += internal_accept4 internal_recvmmsg internal_sendmmsg |
1e1dc4e8 JJ |
16 | endif |
17 | ||
8d57beea | 18 | ifeq ($(subdir),misc) |
c9009328 L |
19 | include $(firstword $(wildcard $(sysdirs:=/sysctl.mk))) |
20 | ||
cb191f23 | 21 | sysdep_routines += clone llseek umount umount2 readahead \ |
6789aaaa | 22 | setfsuid setfsgid makedev epoll_pwait signalfd \ |
c08fb0d7 | 23 | eventfd eventfd_read eventfd_write prlimit |
84724245 | 24 | |
ce42435c | 25 | CFLAGS-gethostid.c = -fexceptions |
c27714f1 | 26 | CFLAGS-tst-writev.c += "-DARTIFICIAL_LIMIT=0x80000000-__getpagesize()" |
ce42435c | 27 | |
67afae58 | 28 | sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ |
4974d2b2 | 29 | sys/klog.h sys/kdaemon.h \ |
d1462d2e | 30 | sys/user.h sys/procfs.h sys/prctl.h \ |
39382b8b | 31 | sys/kd.h sys/soundcard.h sys/vt.h \ |
3d42e04d | 32 | sys/quota.h sys/fsuid.h \ |
844633d1 | 33 | scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \ |
3e360d34 | 34 | sys/ultrasound.h sys/raw.h sys/personality.h sys/epoll.h \ |
2e3e9ff1 | 35 | bits/a.out.h sys/inotify.h sys/signalfd.h sys/eventfd.h \ |
8e475601 | 36 | sys/timerfd.h sys/fanotify.h bits/eventfd.h bits/inotify.h \ |
02a6f887 | 37 | bits/signalfd.h bits/timerfd.h bits/epoll.h \ |
4dd4e157 AJ |
38 | bits/socket_type.h bits/syscall.h bits/sysctl.h \ |
39 | bits/mman-linux.h | |
cd6ede75 | 40 | |
38027f90 UD |
41 | tests += tst-clone |
42 | ||
f127cd28 | 43 | # Generate the list of SYS_* macros for the system calls (__NR_* macros). |
154bfc16 JM |
44 | |
45 | # If there is more than one syscall list for different architecture | |
0ab0291b L |
46 | # variants, the CPU/Makefile defines abi-variants to be a list of names |
47 | # for those variants (e.g. 32 64), and, for each variant, defines | |
48 | # abi-$(variant)-options to be compiler options to cause <asm/unistd.h> | |
49 | # to define the desired list of syscalls and abi-$(variant)-condition to | |
50 | # be the condition for those options to use in a C #if condition. | |
51 | # abi-includes may be defined to a list of headers to include | |
154bfc16 JM |
52 | # in the generated header, if the default does not suffice. |
53 | ||
bd951ccb | 54 | $(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/syscall.h |
362f5ae2 | 55 | $(make-target-directory) |
9afc8a59 UD |
56 | { \ |
57 | echo '/* Generated at libc build time from kernel syscall list. */';\ | |
58 | echo ''; \ | |
59 | echo '#ifndef _SYSCALL_H'; \ | |
60 | echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \ | |
61 | echo '#endif'; \ | |
62 | echo ''; \ | |
0ab0291b | 63 | $(foreach h,$(abi-includes), echo '#include <$(h)>';) \ |
154bfc16 | 64 | echo ''; \ |
0ab0291b L |
65 | $(if $(abi-variants), \ |
66 | $(foreach v,$(abi-variants),\ | |
154bfc16 | 67 | $(CC) -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \ |
0ab0291b | 68 | -x c $(sysincludes) $< $(abi-$(v)-options) \ |
154bfc16 | 69 | -D_LIBC -dM | \ |
abe7b661 | 70 | sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \ |
154bfc16 | 71 | LC_ALL=C sort > $(@:.d=.h).new$(v); \ |
0ab0291b L |
72 | $(if $(abi-$(v)-condition),\ |
73 | echo '#if $(abi-$(v)-condition)';) \ | |
154bfc16 | 74 | cat $(@:.d=.h).new$(v); \ |
0ab0291b | 75 | $(if $(abi-$(v)-condition),echo '#endif';) \ |
154bfc16 | 76 | rm -f $(@:.d=.h).new$(v); \ |
0ab0291b L |
77 | ), \ |
78 | $(CC) -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \ | |
79 | -x c $(sysincludes) $< \ | |
80 | -D_LIBC -dM | \ | |
81 | sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \ | |
82 | LC_ALL=C sort;) \ | |
9afc8a59 | 83 | } > $(@:.d=.h).new |
f127cd28 | 84 | mv -f $(@:.d=.h).new $(@:.d=.h) |
0ab0291b | 85 | ifdef abi-variants |
7cd72ad3 | 86 | ifneq (,$(objpfx)) |
154bfc16 | 87 | sed $(sed-remove-objpfx) \ |
0ab0291b | 88 | $(foreach v,$(abi-variants),$(@:.h=.d)-t$(v)) > $(@:.h=.d)-t3 |
7cd72ad3 | 89 | else |
0ab0291b | 90 | cat $(foreach v,$(abi-variants),$(@:.h=.d)-t$(v)) \ |
154bfc16 | 91 | > $(@:.h=.d)-t3 |
7cd72ad3 | 92 | endif |
0ab0291b | 93 | rm -f $(foreach v,$(abi-variants),$(@:.h=.d)-t$(v)) |
7cd72ad3 | 94 | mv -f $(@:.h=.d)-t3 $(@:.h=.d) |
0ab0291b L |
95 | else |
96 | mv -f $(@:.h=.d)-t $(@:.h=.d) | |
97 | endif | |
cd6ede75 | 98 | |
d705269e | 99 | ifndef no_deps |
f127cd28 | 100 | # Get the generated list of dependencies (probably /usr/include/asm/unistd.h). |
bd951ccb | 101 | -include $(objpfx)bits/syscall.d |
d705269e | 102 | endif |
bd951ccb | 103 | generated += bits/syscall.h bits/syscall.d |
d2f5be2a UD |
104 | endif |
105 | ||
8d57beea | 106 | ifeq ($(subdir),time) |
6e63d5e1 | 107 | sysdep_headers += sys/timex.h bits/timex.h |
997d6467 | 108 | |
eb415739 | 109 | sysdep_routines += ntp_gettime ntp_gettimex |
d2f5be2a UD |
110 | endif |
111 | ||
8d57beea | 112 | ifeq ($(subdir),socket) |
4f173e2c | 113 | sysdep_headers += net/if_ppp.h net/ppp-comp.h \ |
d705269e | 114 | net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \ |
999b2f6b | 115 | net/if_slip.h net/if_packet.h net/if_shaper.h |
7ce241a0 | 116 | sysdep_routines += cmsg_nxthdr sa_len |
8f5ca04b RM |
117 | endif |
118 | ||
8d57beea | 119 | ifeq ($(subdir),sunrpc) |
dfe1754a | 120 | sysdep_headers += nfs/nfs.h |
57aefafe RM |
121 | endif |
122 | ||
8d57beea | 123 | ifeq ($(subdir),termios) |
5107cf1d | 124 | sysdep_headers += termio.h |
80791291 RM |
125 | endif |
126 | ||
d64fae6a | 127 | ifeq ($(subdir),posix) |
13a571a7 | 128 | sysdep_headers += bits/initspin.h |
7ae4abe9 | 129 | |
bce20b9a | 130 | sysdep_routines += exit-thread sched_getcpu |
341c566f UD |
131 | |
132 | tests += tst-getcpu | |
d64fae6a UD |
133 | endif |
134 | ||
8d57beea | 135 | ifeq ($(subdir),inet) |
d9997a45 | 136 | sysdep_headers += netinet/if_fddi.h netinet/if_tr.h \ |
59cacc81 | 137 | netipx/ipx.h netash/ash.h netax25/ax25.h netatalk/at.h \ |
09236fba | 138 | netrom/netrom.h netpacket/packet.h netrose/rose.h \ |
ea2c47b6 | 139 | neteconet/ec.h netiucv/iucv.h |
a401eea9 UD |
140 | endif |
141 | ||
93995795 RM |
142 | # Don't compile the ctype glue code, since there is no old non-GNU C library. |
143 | inhibit-glue = yes | |
d705269e | 144 | |
9756dfe1 | 145 | ifeq ($(subdir),dirent) |
e5cd813b | 146 | sysdep_routines += getdirentries getdirentries64 |
9756dfe1 UD |
147 | endif |
148 | ||
9931ba24 UD |
149 | ifeq ($(subdir),nis) |
150 | CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1 | |
151 | endif | |
913a752b | 152 | |
9c7ff11a | 153 | ifeq ($(subdir),io) |
4e87573f | 154 | sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \ |
749f5cc9 | 155 | sync_file_range open_2 open64_2 fallocate fallocate64 |
1728f92d | 156 | sysdep_headers += bits/fcntl-linux.h |
9c7ff11a UD |
157 | endif |
158 | ||
913a752b | 159 | ifeq ($(subdir),elf) |
6fb2dde3 UD |
160 | sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \ |
161 | dl-fxstatat64 | |
3ba06713 UD |
162 | |
163 | CPPFLAGS-lddlibc4 += -DNOT_IN_libc | |
913a752b | 164 | endif |
1fe42a2b UD |
165 | |
166 | ifeq ($(subdir),rt) | |
167 | CFLAGS-mq_send.c += -fexceptions | |
168 | CFLAGS-mq_receive.c += -fexceptions | |
169 | endif | |
fc03df7a UD |
170 | |
171 | ifeq ($(subdir),nscd) | |
3a2c0242 | 172 | sysdep-CFLAGS += -DHAVE_EPOLL -DHAVE_SENDFILE -DHAVE_INOTIFY -DHAVE_NETLINK |
e14bbf53 | 173 | CFLAGS-gai.c += -DNEED_NETLINK |
fc03df7a | 174 | endif |