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.
This commit is contained in:
Дмитрий Левин 2015-08-27 19:51:05 +00:00
parent 9d77b562d3
commit e2a3370f67
2 changed files with 13 additions and 1 deletions

View 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

View 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;}]])],