Update.
[glibc.git] / sysdeps / unix / sysv / linux / Makefile
blob5c38ced83ff2ebdf645b4a072c28a5dd5d92f510
1 ifeq ($(subdir),csu)
2 CFLAGS-init-first.c = -fkeep-inline-functions
4 sysdep_routines += errno-loc
5 endif
7 ifeq ($(subdir),db2)
8 CPPFLAGS += -DHAVE_LLSEEK=1
9 endif
11 ifeq ($(subdir),misc)
12 sysdep_routines += sysctl clone llseek getresuid getresgid sys_setresuid \
13 umount umount2
15 sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h sys/mtio.h \
16 sys/io.h sys/klog.h sys/kdaemon.h \
17 sys/user.h sys/sysmacros.h sys/procfs.h sys/prctl.h \
18 sys/debugreg.h sys/kd.h sys/soundcard.h sys/vt.h \
19 sys/quota.h sys/fsuid.h bits/mman.h \
20 scsi/sg.h scsi/scsi.h sys/pci.h sys/ultrasound.h
22 install-others += $(inst_includedir)/bits/syscall.h
24 # Generate the list of SYS_* macros for the system calls (__NR_* macros).
25 $(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscall.h
26 rm -f $(@:.h=.d)
27 { \
28 echo '/* Generated at libc build time from kernel syscall list. */';\
29 echo ''; \
30 echo '#ifndef _SYSCALL_H'; \
31 echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \
32 echo '#endif'; \
33 echo ''; \
34 SUNPRO_DEPENDENCIES='$(@:.h=.d) $(patsubst $(objpfx)%,$$(objpfx)%,\
35 $(@:.d=.h) $(@:.h=.d))' \
36 $(CC) -E -x c $< -D_LIBC -dM | \
37 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p'; \
38 } > $(@:.d=.h).new
39 mv -f $(@:.d=.h).new $(@:.d=.h)
41 $(inst_includedir)/bits/syscall.h: $(objpfx)syscall-list.h $(+force)
42 $(make-target-directory)
43 if test -r $@ && cmp -s $< $@; \
44 then echo 'bits/syscall.h unchanged'; \
45 else $(INSTALL_DATA) $< $@; fi
47 ifndef no_deps
48 # Get the generated list of dependencies (probably /usr/include/asm/unistd.h).
49 -include $(objpfx)syscall-list.d
50 endif
51 generated += syscall-list.h syscall-list.d
52 endif
54 ifeq ($(subdir),time)
55 sysdep_headers += sys/timex.h
56 endif
58 ifeq ($(subdir),socket)
59 sysdep_headers += net/if.h net/if_ppp.h net/ppp-comp.h \
60 net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
61 net/if_slip.h net/if_packet.h
62 sysdep_routines += cmsg_nxthdr sa_len
63 endif
65 ifeq ($(subdir),sunrpc)
66 sysdep_headers += nfs/nfs.h
67 endif
69 ifeq ($(subdir),termios)
70 sysdep_headers += termio.h
71 endif
73 ifeq ($(subdir),stdio-common)
74 # Just disable the auto generation in sysdeps/generic
75 inhibit-siglist := yes
76 endif
78 ifeq ($(subdir),posix)
79 sysdep_headers += bits/pthreadtypes.h
80 endif
82 ifeq ($(subdir),inet)
83 sysdep_headers += netinet/in_systm.h netinet/udp.h \
84 netinet/if_fddi.h netinet/if_tr.h netinet/igmp.h \
85 netinet/ip_fw.h netinet/ip_icmp.h netipx/ipx.h \
86 sys/socketvar.h netash/ash.h netax25/ax25.h netatalk/at.h \
87 netrom/netrom.h netpacket/packet.h netrose/rose.h
88 endif
90 # Don't compile the ctype glue code, since there is no old non-GNU C library.
91 inhibit-glue = yes
93 # Tell sysdeps/posix/Makefile that we create stdio_lim.h differently.
94 inhibit-stdio_lim = yes
96 $(common-objpfx)bits/stdio_%.h $(common-objpfx)bits/stdio_%.d: \
97 $(..)sysdeps/unix/sysv/linux/stdio_%.h.in
98 rm -f $(@:.h=.d) $(@:.d=.h)-t
99 echo '#include <linux/limits.h>' | \
100 SUNPRO_DEPENDENCIES='$(@:.h=.d) \
101 $(patsubst $(common-objpfx)%,$$(common-objpfx)%,\
102 $(@:.d=.h) $(@:.h=.d))' \
103 $(CC) -E -dM - > $(@:.d=.h)-t
104 fopen_max=`sed -n 's/^#define OPEN_MAX //p' $(@:.d=.h)-t`; \
105 filename_max=`sed -n 's/^#define PATH_MAX //p' $(@:.d=.h)-t`; \
106 if test -n "$$fopen_max" && test -n "$$filename_max"; then \
107 sed -e "s/DEFAULT_FOPEN_MAX/$$fopen_max/" \
108 -e "s/DEFAULT_FILENAME_MAX/$$filename_max/" $< \
109 > $(@:.d=.h).new && \
110 mv -f $(@:.d=.h).new $(@:.d=.h); \
111 else exit 1; fi
112 # Remove this last so that it can be examined if something went wrong.
113 rm -f $(@:.d=.h)-t
114 ifndef no_deps
115 # Get the list of dependencies (probably /usr/include/linux/limits.h).
116 -include $(common-objpfx)bits/stdio_lim.d
117 endif
119 ifeq ($(subdir),signal)
120 sysdep_routines += rt_sigsuspend rt_sigprocmask rt_sigtimedwait \
121 rt_sigqueueinfo rt_sigaction rt_sigpending
122 endif
124 ifeq ($(subdir),dirent)
125 sysdep_routines += getdents64
126 endif
128 ifeq ($(subdir),nis)
129 CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1
130 endif
132 common-generated += bits/stdio_lim.h bits/stdio_lim.d