]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/Makefile
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / Makefile
CommitLineData
8d57beea 1ifeq ($(subdir),csu)
c6645251 2sysdep_routines += errno-loc
39778c6c
UD
3endif
4
2c008571
UD
5ifeq ($(subdir),assert)
6CFLAGS-assert.c += -DFATAL_PREPARE_INCLUDE='<fatal-prepare.h>'
7CFLAGS-assert-perr.c += -DFATAL_PREPARE_INCLUDE='<fatal-prepare.h>'
8endif
9
a1648746 10ifeq ($(subdir),malloc)
7c2842bf 11CFLAGS-malloc.c += -DMORECORE_CLEARS=2
a1648746
UD
12endif
13
8d57beea 14ifeq ($(subdir),misc)
6bdcd619 15sysdep_routines += sysctl clone llseek umount umount2 readahead \
9a276f8e 16 setfsuid setfsgid makedev
84724245 17
ce42435c
UD
18CFLAGS-gethostid.c = -fexceptions
19
67afae58 20sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
4974d2b2 21 sys/klog.h sys/kdaemon.h \
d1462d2e 22 sys/user.h sys/procfs.h sys/prctl.h \
39382b8b 23 sys/kd.h sys/soundcard.h sys/vt.h \
3d42e04d 24 sys/quota.h sys/fsuid.h \
844633d1 25 scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \
3e360d34 26 sys/ultrasound.h sys/raw.h sys/personality.h sys/epoll.h \
a334319f 27 bits/a.out.h
f127cd28 28
cd6ede75
UD
29install-others += $(inst_includedir)/bits/syscall.h
30
f127cd28 31# Generate the list of SYS_* macros for the system calls (__NR_* macros).
2cd8fda5 32# For bi-arch platforms, the CPU/Makefile defines {32,64}bit-predefine and
abe7b661 33# we generate a file that uses <bits/wordsize.h>.
df4ef2ab 34$(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscall.h
362f5ae2 35 $(make-target-directory)
9afc8a59
UD
36 { \
37 echo '/* Generated at libc build time from kernel syscall list. */';\
38 echo ''; \
39 echo '#ifndef _SYSCALL_H'; \
40 echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \
41 echo '#endif'; \
42 echo ''; \
7cd72ad3
RM
43 $(CC) -E -MD -MP -MF $(@:.h=.d)-t1 -MT '$(@:.d=.h) $(@:.h=.d)' \
44 -x c $(sysincludes) $< $(addprefix -U,$(64bit-predefine)) \
45 $(addprefix -D,$(32bit-predefine)) -D_LIBC -dM | \
abe7b661
RM
46 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
47 LC_ALL=C sort > $(@:.d=.h).new32; \
7cd72ad3
RM
48 $(CC) -E -MD -MP -MF $(@:.h=.d)-t2 -MT '$(@:.d=.h) $(@:.h=.d)' \
49 -x c $(sysincludes) $< $(addprefix -U,$(32bit-predefine)) \
50 $(addprefix -D,$(64bit-predefine)) -D_LIBC -dM | \
abe7b661
RM
51 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
52 LC_ALL=C sort > $(@:.d=.h).new64; \
53 if cmp -s $(@:.d=.h).new32 $(@:.d=.h).new64; then \
54 cat $(@:.d=.h).new32; \
55 else \
56 echo '#include <bits/wordsize.h>'; \
57 echo ''; \
58 LC_ALL=C comm -12 $(@:.d=.h).new32 $(@:.d=.h).new64; \
59 echo '#if __WORDSIZE == 64'; \
60 LC_ALL=C comm -13 $(@:.d=.h).new32 $(@:.d=.h).new64; \
61 echo '#else'; \
62 LC_ALL=C comm -23 $(@:.d=.h).new32 $(@:.d=.h).new64; \
63 echo '#endif'; \
64 fi; \
65 rm -f $(@:.d=.h).new32 $(@:.d=.h).new64; \
9afc8a59 66 } > $(@:.d=.h).new
f127cd28 67 mv -f $(@:.d=.h).new $(@:.d=.h)
7cd72ad3
RM
68ifneq (,$(objpfx))
69 sed $(sed-remove-objpfx) $(@:.h=.d)-t1 $(@:.h=.d)-t2 > $(@:.h=.d)-t3
70else
71 cat $(@:.h=.d)-t1 $(@:.h=.d)-t2 > $(@:.h=.d)-t3
72endif
73 rm -f $(@:.h=.d)-t1 $(@:.h=.d)-t2
74 mv -f $(@:.h=.d)-t3 $(@:.h=.d)
cd6ede75 75
73237de3 76$(inst_includedir)/bits/syscall.h: $(objpfx)syscall-list.h $(+force)
cd6ede75
UD
77 $(make-target-directory)
78 if test -r $@ && cmp -s $< $@; \
79 then echo 'bits/syscall.h unchanged'; \
80 else $(INSTALL_DATA) $< $@; fi
81
d705269e 82ifndef no_deps
f127cd28
RM
83# Get the generated list of dependencies (probably /usr/include/asm/unistd.h).
84-include $(objpfx)syscall-list.d
d705269e 85endif
f127cd28 86generated += syscall-list.h syscall-list.d
d2f5be2a
UD
87endif
88
8d57beea 89ifeq ($(subdir),time)
dfe1754a 90sysdep_headers += sys/timex.h
997d6467 91
fc4157da 92sysdep_routines += ntp_gettime
d2f5be2a
UD
93endif
94
8d57beea 95ifeq ($(subdir),socket)
4f173e2c 96sysdep_headers += net/if_ppp.h net/ppp-comp.h \
d705269e 97 net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
999b2f6b 98 net/if_slip.h net/if_packet.h net/if_shaper.h
7ce241a0 99sysdep_routines += cmsg_nxthdr sa_len
8f5ca04b
RM
100endif
101
8d57beea 102ifeq ($(subdir),sunrpc)
dfe1754a 103sysdep_headers += nfs/nfs.h
57aefafe
RM
104endif
105
8d57beea 106ifeq ($(subdir),termios)
5107cf1d 107sysdep_headers += termio.h
80791291
RM
108endif
109
a334319f
UD
110ifeq ($(subdir),stdio-common)
111# Just disable the auto generation in sysdeps/generic
112inhibit-siglist := yes
113endif
114
d64fae6a 115ifeq ($(subdir),posix)
13a571a7 116sysdep_headers += bits/initspin.h
7ae4abe9
UD
117
118sysdep_routines += exit-thread
d64fae6a
UD
119endif
120
8d57beea 121ifeq ($(subdir),inet)
d9997a45 122sysdep_headers += netinet/if_fddi.h netinet/if_tr.h \
59cacc81 123 netipx/ipx.h netash/ash.h netax25/ax25.h netatalk/at.h \
09236fba 124 netrom/netrom.h netpacket/packet.h netrose/rose.h \
80fbf0d1 125 neteconet/ec.h
a401eea9
UD
126endif
127
93995795
RM
128# Don't compile the ctype glue code, since there is no old non-GNU C library.
129inhibit-glue = yes
d705269e 130
9756dfe1 131ifeq ($(subdir),dirent)
e5cd813b 132sysdep_routines += getdirentries getdirentries64
9756dfe1
UD
133endif
134
9931ba24
UD
135ifeq ($(subdir),nis)
136CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1
137endif
913a752b 138
9c7ff11a 139ifeq ($(subdir),io)
08c9a553 140sysdep_routines += xstatconv internal_statvfs internal_statvfs64
9c7ff11a
UD
141endif
142
913a752b
UD
143ifeq ($(subdir),elf)
144sysdep-rtld-routines += dl-brk dl-sbrk
3ba06713
UD
145
146CPPFLAGS-lddlibc4 += -DNOT_IN_libc
913a752b 147endif
1fe42a2b
UD
148
149ifeq ($(subdir),rt)
150CFLAGS-mq_send.c += -fexceptions
151CFLAGS-mq_receive.c += -fexceptions
152endif
fc03df7a
UD
153
154ifeq ($(subdir),nscd)
a334319f 155CFLAGS-connections.c += -DHAVE_EPOLL
e14bbf53 156CFLAGS-gai.c += -DNEED_NETLINK
fc03df7a 157endif