dnl -*- shell-script -*- # # $Id: lam_get_sizeof.m4,v 1.2 2001/01/20 14:20:39 jsquyres Exp $ # # This file is part of the University of Notre Dame implementation of # LAM/MPI. See the LICENSE file in the top-level directory for # license and copyright details. define(LAM_GET_SIZEOF,[ # Determine datatype size. # First arg is type, 2nd (optional) arg is config var to define. AC_MSG_CHECKING(size of $1) cat > conftest.c < #include int main(int argc, char** argv) { FILE *f=fopen("conftestval", "w"); if (!f) return 1; fprintf(f, "%d\n", sizeof($1)); return 0; } EOF $CC $CFLAGS -o conftest conftest.c 1>&5 2>&1 if test -s conftest && (./conftest; exit) 2>/dev/null; then lam_ac_size=`cat conftestval` else lam_ac_size=0 fi AC_MSG_RESULT($lam_ac_size) if test -n "$2"; then AC_DEFINE_UNQUOTED($2,$lam_ac_size) fi /bin/rm -f conftest*])dnl