|
| 1 | +dnl -*- shell-script -*- |
| 2 | +dnl |
| 3 | +dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana |
| 4 | +dnl University Research and Technology |
| 5 | +dnl Corporation. All rights reserved. |
| 6 | +dnl Copyright (c) 2004-2005 The University of Tennessee and The University |
| 7 | +dnl of Tennessee Research Foundation. All rights |
| 8 | +dnl reserved. |
| 9 | +dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, |
| 10 | +dnl University of Stuttgart. All rights reserved. |
| 11 | +dnl Copyright (c) 2004-2005 The Regents of the University of California. |
| 12 | +dnl All rights reserved. |
| 13 | +dnl Copyright (c) 2014 Intel, Inc. All rights reserved. |
| 14 | +dnl Copyright (c) 2016 Research Organization for Information Science |
| 15 | +dnl and Technology (RIST). All rights reserved. |
| 16 | +dnl $COPYRIGHT$ |
| 17 | +dnl |
| 18 | +dnl Additional copyrights may follow |
| 19 | +dnl |
| 20 | +dnl $HEADER$ |
| 21 | +dnl |
| 22 | + |
| 23 | +AC_DEFUN([PMIX_CHECK_ICC_VARARGS],[ |
| 24 | +dnl |
| 25 | +dnl On EM64T, icc-8.1 before version 8.1.027 segfaulted, since |
| 26 | +dnl va_start was miscompiled... |
| 27 | +dnl |
| 28 | +AC_MSG_CHECKING([whether icc-8.1 for EM64T works with variable arguments]) |
| 29 | +AC_TRY_RUN([ |
| 30 | +#include <stdarg.h> |
| 31 | +#include <stdio.h> |
| 32 | +#include <stdlib.h> |
| 33 | + |
| 34 | +void func (int c, char * f, ...) |
| 35 | +{ |
| 36 | + va_list arglist; |
| 37 | + va_start (arglist, f); |
| 38 | + /* vprintf (f, arglist); */ |
| 39 | + va_end (arglist); |
| 40 | +} |
| 41 | + |
| 42 | +int main () |
| 43 | +{ |
| 44 | + FILE *f; |
| 45 | + func (4711, "Help %d [%s]\n", 10, "ten"); |
| 46 | + f=fopen ("conftestval", "w"); |
| 47 | + if (!f) exit (1); |
| 48 | + return 0; |
| 49 | +} |
| 50 | + |
| 51 | +],[pmix_ac_icc_varargs=`test -f conftestval`],[pmix_ac_icc_varargs=1],[pmix_ac_icc_varargs=1]) |
| 52 | + |
| 53 | +if test "$pmix_ac_icc_varargs" = "1"; then |
| 54 | + AC_MSG_WARN([*** Problem running configure test!]) |
| 55 | + AC_MSG_WARN([*** Your icc-8.1 compiler seems to miscompile va_start!]) |
| 56 | + AC_MSG_WARN([*** Please upgrade compiler to at least version 8.1.027]) |
| 57 | + AC_MSG_ERROR([*** Cannot continue.]) |
| 58 | +fi |
| 59 | + |
| 60 | +AC_MSG_RESULT([yes]) |
| 61 | + |
| 62 | +rm -rf conftest*])dnl |
0 commit comments