]> granicus.if.org Git - strace/commitdiff
mpers.m4: workaround missing gnu/stubs-*.h files
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 27 Aug 2015 19:51:05 +0000 (19:51 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 28 Aug 2015 08:46:24 +0000 (08:46 +0000)
On some systems missing gnu/stubs-*.h files make -m32/-mx32 compilation
checks fail.  As we want to support multiple personalities despite of
this limitation, workaround the check by creating empty gnu stub files
if necessary.

* m4/mpers.m4 (st_MPERS): Check for the gnu stub file.  Create an empty
gnu stub file if the system one is missing.
* Makefile.am (DISTCLEANFILES): Add gnu/stubs-32.h and gnu/stubs-x32.h.

Makefile.am
m4/mpers.m4

index 6cc0a086ab90a85a166b3349e0118414fff6d3e5..9e19b353723b9fcdfd06d1df2fc1d8ae599227e7 100644 (file)
@@ -658,6 +658,7 @@ ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioc
 
 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
+DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h
 
 # defines mpers_source_files
 include mpers.am
index 3d173005e3f65b720f8c7cfa54d17e49029734c8..70933ffa204aba71f4d97f9898f9db7a9ff97fd6 100644 (file)
@@ -10,8 +10,19 @@ pushdef([st_cv_mpers], [st_cv_$1_mpers])
 
 case "$arch" in
        [$2])
+       AH_TEMPLATE([HAVE_GNU_STUBS_32_H],
+                   [Define to 1 if you have the <gnu/stubs-32.h> header file.])
+       AH_TEMPLATE([HAVE_GNU_STUBS_X32_H],
+                   [Define to 1 if you have the <gnu/stubs-x32.h> header file.])
+       pushdef([gnu_stubs], [gnu/stubs-][m4_substr([$1], 1)][.h])
+       AC_CHECK_HEADERS([gnu_stubs], [IFLAG=],
+                        [mkdir -p gnu
+                         : > gnu_stubs
+                         AC_MSG_NOTICE([Created empty gnu_stubs])
+                         IFLAG=-I.])
+       popdef([gnu_stubs])
        saved_CFLAGS="$CFLAGS"
-       CFLAGS="$CFLAGS CFLAG"
+       CFLAGS="$CFLAGS CFLAG $IFLAG"
        AC_CACHE_CHECK([for CFLAG compile support], [st_cv_cc],
                [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdint.h>
                                                     int main(){return 0;}]])],