From: Dmitry V. Levin Date: Thu, 27 Aug 2015 19:51:05 +0000 (+0000) Subject: mpers.m4: workaround missing gnu/stubs-*.h files X-Git-Tag: v4.11~223 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2a3370f67dfc9085fad454fc2cac07357f3be56;p=strace mpers.m4: workaround missing gnu/stubs-*.h files 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. --- diff --git a/Makefile.am b/Makefile.am index 6cc0a086..9e19b353 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/m4/mpers.m4 b/m4/mpers.m4 index 3d173005..70933ffa 100644 --- a/m4/mpers.m4 +++ b/m4/mpers.m4 @@ -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 header file.]) + AH_TEMPLATE([HAVE_GNU_STUBS_X32_H], + [Define to 1 if you have the 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 int main(){return 0;}]])],