aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/Makefile
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-10-16 03:03:00 +0000
committerRoland McGrath <roland@gnu.org>2002-10-16 03:03:00 +0000
commitabe7b661ff7a361c9fe11789bab068e44de849b0 (patch)
tree2d1f05a2896d87ddeb83d344b2dc1c818a392149 /sysdeps/unix/sysv/linux/Makefile
parentc55dca8d85b4585f3e72eb72a9c1164568a68472 (diff)
downloadglibc-abe7b661ff7a361c9fe11789bab068e44de849b0.tar
glibc-abe7b661ff7a361c9fe11789bab068e44de849b0.tar.gz
glibc-abe7b661ff7a361c9fe11789bab068e44de849b0.tar.bz2
glibc-abe7b661ff7a361c9fe11789bab068e44de849b0.zip
Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/Makefile ($(objpfx)syscall-%.h $(objpfx)syscall-%.d): Take code from sparc/Makefile to produce a bi-arch file as needed. That's now parameterized by the variable $(64bit-predefine). Use LC_ALL=C for `comm' commands in that rule. No longer conditional on [$(no_syscall_list_h)]. * sysdeps/unix/sysv/linux/sparc/Makefile: Remove replacement rules. (64bit-predefine): New variable. * sysdeps/unix/sysv/linux/x86_64/Makefile: Likewise. * sysdeps/unix/sysv/linux/s390/Makefile: New file. * sysdeps/unix/sysv/linux/powerpc/Makefile (64bit-predefine): New variable. 2002-10-15 Roland McGrath <roland@redhat.com> * sysdeps/unix/sysv/linux/Makefile ($(objpfx)syscall-%.h $(objpfx)syscall-%.d) * login/utmp-private.h: Declare __libc_utmp_lock. * sysdeps/unix/getlogin_r.c (getlogin_r): Take __libc_utmp_lock once call __libc_utmp_jump_table functions directly, instead of using __setutent et al. * sysdeps/unix/sysv/linux/configure.in: Use case instead of if. * sysdeps/unix/sysv/linux/configure: Regenerated.
Diffstat (limited to 'sysdeps/unix/sysv/linux/Makefile')
-rw-r--r--sysdeps/unix/sysv/linux/Makefile27
1 files changed, 23 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 3055e1bd10..17d9238909 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -24,8 +24,9 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
install-others += $(inst_includedir)/bits/syscall.h
-ifndef no_syscall_list_h
# Generate the list of SYS_* macros for the system calls (__NR_* macros).
+# For bi-arch platforms, the CPU/Makefile defines 64bit-predefine and
+# we generate a file that uses <bits/wordsize.h>.
$(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscall.h
rm -f $(@:.h=.d)-t
{ \
@@ -36,8 +37,26 @@ $(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscal
echo '#endif'; \
echo ''; \
SUNPRO_DEPENDENCIES='$(@:.h=.d)-t $@' \
- $(CC) -E -x c $(sysincludes) $< -D_LIBC -dM | \
- sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p'; \
+ $(CC) -E -x c $(sysincludes) $< $(addprefix -U,$(64bit-predefine)) -D_LIBC -dM | \
+ sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
+ LC_ALL=C sort > $(@:.d=.h).new32; \
+ SUNPRO_DEPENDENCIES='$(@:.h=.d)-t $@' \
+ $(CC) -E -x c $(sysincludes) $< $(addprefix -D,$(64bit-predefine)) -D_LIBC -dM | \
+ sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
+ LC_ALL=C sort > $(@:.d=.h).new64; \
+ if cmp -s $(@:.d=.h).new32 $(@:.d=.h).new64; then \
+ cat $(@:.d=.h).new32; \
+ else \
+ echo '#include <bits/wordsize.h>'; \
+ echo ''; \
+ LC_ALL=C comm -12 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+ echo '#if __WORDSIZE == 64'; \
+ LC_ALL=C comm -13 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+ echo '#else'; \
+ LC_ALL=C comm -23 $(@:.d=.h).new32 $(@:.d=.h).new64; \
+ echo '#endif'; \
+ fi; \
+ rm -f $(@:.d=.h).new32 $(@:.d=.h).new64; \
} > $(@:.d=.h).new
mv -f $(@:.d=.h).new $(@:.d=.h)
sed < $(@:.h=.d)-t > $(@:.h=.d)-t2 \
@@ -45,7 +64,7 @@ $(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscal
$(@:.d=.h) $(@:.h=.d)),'
rm -f $(@:.h=.d)-t
mv -f $(@:.h=.d)-t2 $(@:.h=.d)
-endif
+
$(inst_includedir)/bits/syscall.h: $(objpfx)syscall-list.h $(+force)
$(make-target-directory)