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>
diff --git a/defs.h b/defs.h
index d1e8e1b..fe2e46b 100644
--- a/defs.h
+++ b/defs.h
@@ -157,6 +157,7 @@
 #   define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
 #   define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
 #   define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
+#   define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
 #  endif
 # endif
 #endif
@@ -170,11 +171,13 @@
 #  define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
 #  define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
 #  define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
+#  define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
 # endif
 # ifdef HAVE_MX32_MPERS
 #  define PERSONALITY2_INCLUDE_FUNCS "mx32_funcs.h"
 #  define PERSONALITY2_INCLUDE_PRINTERS_DECLS "mx32_printer_decls.h"
 #  define PERSONALITY2_INCLUDE_PRINTERS_DEFS "mx32_printer_defs.h"
+#  define MPERS_mx32_IOCTL_MACROS "ioctl_redefs2.h"
 # endif
 #endif
 
@@ -186,6 +189,7 @@
 #  define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
 #  define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
 #  define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
+#  define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
 # endif
 #endif
 
@@ -202,6 +206,7 @@
 #  define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
 #  define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
 #  define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
+#  define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
 # endif
 #endif
 
@@ -213,6 +218,7 @@
 #  define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
 #  define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
 #  define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
+#  define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
 # endif
 #endif
 
@@ -227,6 +233,7 @@
 #  define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
 #  define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
 #  define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
+#  define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
 # endif
 #endif