Add <sys/auxv.h> and getauxval.
[glibc.git] / sysdeps / unix / sysv / linux / Makefile
blob120d54428910bfa979ebfd256d5bf6e7c9ee9d04
1 ifeq ($(subdir),csu)
2 sysdep_routines += errno-loc
3 endif
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
10 ifeq ($(subdir),malloc)
11 CFLAGS-malloc.c += -DMORECORE_CLEARS=2
12 endif
14 ifeq ($(subdir),socket)
15 sysdep_routines += internal_accept4 recvmmsg internal_recvmmsg sendmmsg \
16 internal_sendmmsg
17 endif
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
24 CFLAGS-gethostid.c = -fexceptions
25 CFLAGS-tst-writev.c += "-DARTIFICIAL_LIMIT=0x80000000-__getpagesize()"
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 bits/eventfd.h bits/inotify.h \
36 bits/signalfd.h bits/timerfd.h bits/epoll.h \
37 bits/socket_type.h bits/syscall.h
39 tests += tst-clone
41 # Generate the list of SYS_* macros for the system calls (__NR_* macros).
43 # If there is more than one syscall list for different architecture
44 # variants, the CPU/Makefile defines syscall-list-variants to be a
45 # list of names for those variants (e.g. 32bit 64bit), and, for each
46 # variant, defines syscall-list-$(variant)-options to be compiler
47 # options to cause <asm/unistd.h> to define the desired list of
48 # syscalls and syscall-list-$(variant)-condition to be the condition
49 # for those options to use in a C #if condition.
50 # syscall-list-includes may be defined to a list of headers to include
51 # in the generated header, if the default does not suffice.
53 ifndef syscall-list-variants
54 syscall-list-variants := default
55 syscall-list-default-options :=
56 syscall-list-default-condition :=
57 endif
59 ifndef syscall-list-includes
60 syscall-list-includes := bits/wordsize.h
61 endif
63 $(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/syscall.h
64 $(make-target-directory)
65 { \
66 echo '/* Generated at libc build time from kernel syscall list. */';\
67 echo ''; \
68 echo '#ifndef _SYSCALL_H'; \
69 echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \
70 echo '#endif'; \
71 echo ''; \
72 $(foreach h,$(syscall-list-includes), echo '#include <$(h)>';) \
73 echo ''; \
74 $(foreach v,$(syscall-list-variants),\
75 $(CC) -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \
76 -x c $(sysincludes) $< $(syscall-list-$(v)-options) \
77 -D_LIBC -dM | \
78 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
79 LC_ALL=C sort > $(@:.d=.h).new$(v); \
80 $(if $(syscall-list-$(v)-condition),\
81 echo '#if $(syscall-list-$(v)-condition)';) \
82 cat $(@:.d=.h).new$(v); \
83 $(if $(syscall-list-$(v)-condition),echo '#endif';) \
84 rm -f $(@:.d=.h).new$(v); \
85 ) \
86 } > $(@:.d=.h).new
87 mv -f $(@:.d=.h).new $(@:.d=.h)
88 ifneq (,$(objpfx))
89 sed $(sed-remove-objpfx) \
90 $(foreach v,$(syscall-list-variants),$(@:.h=.d)-t$(v)) > $(@:.h=.d)-t3
91 else
92 cat $(foreach v,$(syscall-list-variants),$(@:.h=.d)-t$(v)) \
93 > $(@:.h=.d)-t3
94 endif
95 rm -f $(foreach v,$(syscall-list-variants),$(@:.h=.d)-t$(v))
96 mv -f $(@:.h=.d)-t3 $(@:.h=.d)
98 ifndef no_deps
99 # Get the generated list of dependencies (probably /usr/include/asm/unistd.h).
100 -include $(objpfx)bits/syscall.d
101 endif
102 generated += bits/syscall.h bits/syscall.d
103 endif
105 ifeq ($(subdir),time)
106 sysdep_headers += sys/timex.h bits/timex.h
108 sysdep_routines += ntp_gettime ntp_gettimex
109 endif
111 ifeq ($(subdir),socket)
112 sysdep_headers += net/if_ppp.h net/ppp-comp.h \
113 net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
114 net/if_slip.h net/if_packet.h net/if_shaper.h
115 sysdep_routines += cmsg_nxthdr sa_len
116 endif
118 ifeq ($(subdir),sunrpc)
119 sysdep_headers += nfs/nfs.h
120 endif
122 ifeq ($(subdir),termios)
123 sysdep_headers += termio.h
124 endif
126 ifeq ($(subdir),posix)
127 sysdep_headers += bits/initspin.h
129 sysdep_routines += exit-thread sched_getcpu
131 tests += tst-getcpu
132 endif
134 ifeq ($(subdir),inet)
135 sysdep_headers += netinet/if_fddi.h netinet/if_tr.h \
136 netipx/ipx.h netash/ash.h netax25/ax25.h netatalk/at.h \
137 netrom/netrom.h netpacket/packet.h netrose/rose.h \
138 neteconet/ec.h netiucv/iucv.h
139 endif
141 # Don't compile the ctype glue code, since there is no old non-GNU C library.
142 inhibit-glue = yes
144 ifeq ($(subdir),dirent)
145 sysdep_routines += getdirentries getdirentries64
146 endif
148 ifeq ($(subdir),nis)
149 CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1
150 endif
152 ifeq ($(subdir),io)
153 sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
154 sync_file_range open_2 open64_2 fallocate fallocate64
155 endif
157 ifeq ($(subdir),elf)
158 sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \
159 dl-fxstatat64
161 CPPFLAGS-lddlibc4 += -DNOT_IN_libc
162 endif
164 ifeq ($(subdir),rt)
165 CFLAGS-mq_send.c += -fexceptions
166 CFLAGS-mq_receive.c += -fexceptions
167 endif
169 ifeq ($(subdir),nscd)
170 sysdep-CFLAGS += -DHAVE_EPOLL -DHAVE_SENDFILE -DHAVE_INOTIFY -DHAVE_NETLINK
171 CFLAGS-gai.c += -DNEED_NETLINK
172 endif