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