diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2016-05-02 22:06:56 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2016-05-05 21:20:47 +0000 |
commit | 1822546133f017c0379d3fffa0797a26ae00387d (patch) | |
tree | 486d2c1841d1f966bdaef472335e318c78dd4c60 /Makefile.am | |
parent | 0a47ff79cae7476ed47bd74ec62eeee7224fa382 (diff) | |
download | strace-1822546133f017c0379d3fffa0797a26ae00387d.tar.gz |
Mpersify ioctl macros
As values of some ioctl macros differ between personalities, these
personality specific ioctl macros should be properly defined for
mpersified code. Implement this by redefining personality specific
ioctl macros from ioctlent*.h for each file that includes MPERS_DEFS.
* Makefile.am (ioctl_macros_h): New variable.
(ioctl_macros%.h): New rule.
(BUILT_SOURCES, CLEANFILES): Add $(ioctl_macros_h).
(m%_type_defs.h): #include MPERS_$(mpers_PREFIX)IOCTL_MACROS.
* defs.h [HAVE_M32_MPERS] (MPERS_m32_IOCTL_MACROS): New macro.
[HAVE_MX32_MPERS] (MPERS_mx32_IOCTL_MACROS): Likewise.
Acked-by: Elvira Khabirova <lineprinter0@gmail.com>
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am index b14f8ed8..df7366ba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -693,6 +693,15 @@ ioctlsort_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD) ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h) ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h)) +ioctl_redefs_h = $(filter-out ioctl_redefs0.h,$(subst ioctlent,ioctl_redefs,$(ioctlent_h))) + +ioctl_redefs%.h: ioctlent%.h ioctlent0.h + sort $< > $<-t + sort ioctlent0.h | comm -23 $<-t - | \ + sed -n 's/^{ "\([^"]\+\)", \(0x[[:xdigit:]]\+\) },$$/#ifdef \1\n# undef \1\n# define \1 \2\n#endif/p' \ + > $@-t + rm -f $<-t + mv $@-t $@ ioctlent%.h: ioctlsort% ./$< > $@ @@ -706,8 +715,10 @@ ioctlsort%.o: ioctls_all%.h $(srcdir)/ioctlsort.c ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioctls_arch%.h cat $^ > $@ -BUILT_SOURCES = $(ioctlent_h) native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h .version -CLEANFILES = $(ioctlent_h) native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h +BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) \ + native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h .version +CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) \ + native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h # defines mpers_source_files @@ -740,6 +751,7 @@ m%_type_defs.h: $(srcdir_mpers_source_files) echo '#undef MPERS_PRINTER_NAME' >> $@-t echo '#define MPERS_PRINTER_NAME(printer_name) printer_name' >> $@-t echo '#include "$(mpers_PREFIX)printer_decls.h"' >> $@-t + echo '#include MPERS_$(mpers_PREFIX)IOCTL_MACROS' >> $@-t mv $@-t $@ m%_funcs.h: $(srcdir_mpers_source_files) |