Changeset 5666

Show
Ignore:
Timestamp:
11/02/09 17:31:04 (3 weeks ago)
Author:
goodell
Message:

Work around Darwin strict behavior and sys/stat.h in ROMIO.

When MPICH2 is configured with --enable-strict it has the effect of
removing the u_char, u_short, u_int, and u_long types from sys/types.h.
Unfortunately, sys/stat.h still uses these types whether or not they are
defined. So we define them ourselves if they are not present so that
our checks involving sys/stat.h will succeed later.

Reviewed by balaji@.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • mpich2/trunk/src/mpi/romio/configure.in

    r5525 r5666  
    722722# Find the CPP before the header check 
    723723AC_PROG_CPP 
    724 AC_CHECK_HEADERS(unistd.h fcntl.h malloc.h stddef.h) 
    725 # 
     724AC_CHECK_HEADERS([unistd.h fcntl.h malloc.h stddef.h sys/types.h]) 
     725# 
     726 
     727# When compiling ROMIO on Darwin with _POSIX_C_SOURCE defined (such as when 
     728# using --enable-strict in MPICH2), sys/types.h does not define u_short and 
     729# friends unless _DARWIN_C_SOURCE is also defined (see compat(5) on a Darwin 
     730# box).  This would normally be fine, except sys/stat.h defines struct stat to 
     731# use u_long, so strict compiles fail.  One option is to also compile with 
     732# _DARWIN_C_SOURCE, but this disables much of the strictness that is intended 
     733# by _POSIX_C_SOURCE.  Instead we just define our own types if they are not 
     734# provided by the system.  This isn't quite as safe as typedef'ing the 
     735# replacement types, but it will apply to later configure tests, which is 
     736# important. 
     737AC_CHECK_TYPE([u_char],[],[AC_DEFINE_UNQUOTED([u_char],[unsigned char],[Define to "unsigned char" if sys/types.h does not define.])]) 
     738AC_CHECK_TYPE([u_short],[],[AC_DEFINE_UNQUOTED([u_short],[unsigned short],[Define to "unsigned short" if sys/types.h does not define.])]) 
     739AC_CHECK_TYPE([u_int],[],[AC_DEFINE_UNQUOTED([u_int],[unsigned int],[Define to "unsigned int" if sys/types.h does not define.])]) 
     740AC_CHECK_TYPE([u_long],[],[AC_DEFINE_UNQUOTED([u_long],[unsigned long],[Define to "unsigned long" if sys/types.h does not define.])]) 
     741 
     742# must come _after_ the above checks for u_char/u_short/u_int/u_long 
     743AC_CHECK_HEADERS([sys/attr.h]) 
     744 
    726745AC_CHECK_SIZEOF(int) 
    727746AC_CHECK_SIZEOF(void *)