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