]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/Makefile
Add sendmmsg syscall
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / Makefile
1 ifeq ($(subdir),csu)
2 sysdep_routines += errno-loc
3 endif
4
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
10 ifeq ($(subdir),malloc)
11 CFLAGS-malloc.c += -DMORECORE_CLEARS=2
12 endif
13
14 ifeq ($(subdir),socket)
15 sysdep_routines += internal_accept4 recvmmsg internal_recvmmsg sendmmsg \
16 internal_sendmmsg
17 endif
18
19 ifeq ($(subdir),misc)
20 sysdep_routines += sysctl clone llseek umount umount2 readahead \
21 setfsuid setfsgid makedev epoll_pwait signalfd \
22 eventfd eventfd_read eventfd_write prlimit
23
24 CFLAGS-gethostid.c = -fexceptions
25
26 sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
27 sys/klog.h sys/kdaemon.h \
28 sys/user.h sys/procfs.h sys/prctl.h \
29 sys/kd.h sys/soundcard.h sys/vt.h \
30 sys/quota.h sys/fsuid.h \
31 scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \
32 sys/ultrasound.h sys/raw.h sys/personality.h sys/epoll.h \
33 bits/a.out.h sys/inotify.h sys/signalfd.h sys/eventfd.h \
34 sys/timerfd.h sys/fanotify.h
35
36 install-others += $(inst_includedir)/bits/syscall.h
37
38 tests += tst-clone
39
40 # Generate the list of SYS_* macros for the system calls (__NR_* macros).
41 # For bi-arch platforms, the CPU/Makefile defines {32,64}bit-predefine and
42 # we generate a file that uses <bits/wordsize.h>.
43 $(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscall.h
44 $(make-target-directory)
45 { \
46 echo '/* Generated at libc build time from kernel syscall list. */';\
47 echo ''; \
48 echo '#ifndef _SYSCALL_H'; \
49 echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \
50 echo '#endif'; \
51 echo ''; \
52 $(CC) -E -MD -MP -MF $(@:.h=.d)-t1 -MT '$(@:.d=.h) $(@:.h=.d)' \
53 -x c $(sysincludes) $< $(addprefix -U,$(64bit-predefine)) \
54 $(addprefix -D,$(32bit-predefine)) -D_LIBC -dM | \
55 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
56 LC_ALL=C sort > $(@:.d=.h).new32; \
57 $(CC) -E -MD -MP -MF $(@:.h=.d)-t2 -MT '$(@:.d=.h) $(@:.h=.d)' \
58 -x c $(sysincludes) $< $(addprefix -U,$(32bit-predefine)) \
59 $(addprefix -D,$(64bit-predefine)) -D_LIBC -dM | \
60 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
61 LC_ALL=C sort > $(@:.d=.h).new64; \
62 if cmp -s $(@:.d=.h).new32 $(@:.d=.h).new64; then \
63 cat $(@:.d=.h).new32; \
64 else \
65 echo '#include <bits/wordsize.h>'; \
66 echo ''; \
67 LC_ALL=C comm -12 $(@:.d=.h).new32 $(@:.d=.h).new64; \
68 echo '#if __WORDSIZE == 64'; \
69 LC_ALL=C comm -13 $(@:.d=.h).new32 $(@:.d=.h).new64; \
70 echo '#else'; \
71 LC_ALL=C comm -23 $(@:.d=.h).new32 $(@:.d=.h).new64; \
72 echo '#endif'; \
73 fi; \
74 rm -f $(@:.d=.h).new32 $(@:.d=.h).new64; \
75 } > $(@:.d=.h).new
76 mv -f $(@:.d=.h).new $(@:.d=.h)
77 ifneq (,$(objpfx))
78 sed $(sed-remove-objpfx) $(@:.h=.d)-t1 $(@:.h=.d)-t2 > $(@:.h=.d)-t3
79 else
80 cat $(@:.h=.d)-t1 $(@:.h=.d)-t2 > $(@:.h=.d)-t3
81 endif
82 rm -f $(@:.h=.d)-t1 $(@:.h=.d)-t2
83 mv -f $(@:.h=.d)-t3 $(@:.h=.d)
84
85 $(inst_includedir)/bits/syscall.h: $(objpfx)syscall-list.h $(+force)
86 $(make-target-directory)
87 if test -r $@ && cmp -s $< $@; \
88 then echo 'bits/syscall.h unchanged'; \
89 else $(INSTALL_DATA) $< $@; fi
90
91 ifndef no_deps
92 # Get the generated list of dependencies (probably /usr/include/asm/unistd.h).
93 -include $(objpfx)syscall-list.d
94 endif
95 generated += syscall-list.h syscall-list.d
96 endif
97
98 ifeq ($(subdir),time)
99 sysdep_headers += sys/timex.h bits/timex.h
100
101 sysdep_routines += ntp_gettime ntp_gettimex
102 endif
103
104 ifeq ($(subdir),socket)
105 sysdep_headers += net/if_ppp.h net/ppp-comp.h \
106 net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
107 net/if_slip.h net/if_packet.h net/if_shaper.h
108 sysdep_routines += cmsg_nxthdr sa_len
109 endif
110
111 ifeq ($(subdir),sunrpc)
112 sysdep_headers += nfs/nfs.h
113 endif
114
115 ifeq ($(subdir),termios)
116 sysdep_headers += termio.h
117 endif
118
119 ifeq ($(subdir),posix)
120 sysdep_headers += bits/initspin.h
121
122 sysdep_routines += exit-thread sched_getcpu
123
124 tests += tst-getcpu
125 endif
126
127 ifeq ($(subdir),inet)
128 sysdep_headers += netinet/if_fddi.h netinet/if_tr.h \
129 netipx/ipx.h netash/ash.h netax25/ax25.h netatalk/at.h \
130 netrom/netrom.h netpacket/packet.h netrose/rose.h \
131 neteconet/ec.h netiucv/iucv.h
132 endif
133
134 # Don't compile the ctype glue code, since there is no old non-GNU C library.
135 inhibit-glue = yes
136
137 ifeq ($(subdir),dirent)
138 sysdep_routines += getdirentries getdirentries64
139 endif
140
141 ifeq ($(subdir),nis)
142 CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1
143 endif
144
145 ifeq ($(subdir),io)
146 sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
147 sync_file_range open_2 open64_2 fallocate fallocate64
148 endif
149
150 ifeq ($(subdir),elf)
151 sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \
152 dl-fxstatat64
153
154 CPPFLAGS-lddlibc4 += -DNOT_IN_libc
155 endif
156
157 ifeq ($(subdir),rt)
158 CFLAGS-mq_send.c += -fexceptions
159 CFLAGS-mq_receive.c += -fexceptions
160 endif
161
162 ifeq ($(subdir),nscd)
163 CFLAGS-connections.c += -DHAVE_EPOLL -DHAVE_SENDFILE -DHAVE_INOTIFY
164 CFLAGS-pwdcache.c += -DHAVE_SENDFILE
165 CFLAGS-grpcache.c += -DHAVE_SENDFILE
166 CFLAGS-hstcache.c += -DHAVE_SENDFILE
167 CFLAGS-aicache.c += -DHAVE_SENDFILE
168 CFLAGS-initgrcache.c += -DHAVE_SENDFILE
169 CFLAGS-gai.c += -DNEED_NETLINK
170 endif