there was an #include directive missing
[openmpi-llc.git] / config / ompi_try_assemble.m4
blob45b62a65cb85df068fdfe25f460533d75c274be7
1 dnl
2 dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3 dnl                         University Research and Technology
4 dnl                         Corporation.  All rights reserved.
5 dnl Copyright (c) 2004-2005 The University of Tennessee and The University
6 dnl                         of Tennessee Research Foundation.  All rights
7 dnl                         reserved.
8 dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
9 dnl                         University of Stuttgart.  All rights reserved.
10 dnl Copyright (c) 2004-2005 The Regents of the University of California.
11 dnl                         All rights reserved.
12 dnl $COPYRIGHT$
13 dnl 
14 dnl Additional copyrights may follow
15 dnl 
16 dnl $HEADER$
17 dnl
19 dnl OMPI_TRY_ASSEMBLE(asm-code, [action-if-success], [action-if-fail])
20 dnl
21 dnl Attempt to assemble asm-code.  If success, run action-if-success.
22 dnl Otherwise, run action-if-fail.  Neither action-if-success nor
23 dnl action-if-fail are required.
24 dnl
25 dnl No preprocessing is guaranteed to be done on asm-code.  Some
26 dnl compilers do not run the preprocessor on assembly files.  
27 dnl
28 dnl On failure, asm-test.s will be included in config.out
29 AC_DEFUN([OMPI_TRY_ASSEMBLE],
30 [cat >conftest.s <<EOF
31 [$1]
32 EOF
33 if test "$CC" = "$CCAS" ; then
34     ompi_assemble="$CCAS $CCASFLAGS -c conftest.s >conftest.out 2>&1"
35 else
36     ompi_assemble="$CCAS $CCASFLAGS conftest.s >conftest.out 2>&1"
38 if AC_TRY_EVAL(ompi_assemble); then
39   # save the warnings
40   cat conftest.out >&AC_FD_CC
41   ifelse([$2],,:,[$2])
42 else
43   # save compiler output and failed program
44   cat conftest.out >&AC_FD_CC
45   echo "configure: failed program was:" >&AC_FD_CC
46   cat conftest.s >&AC_FD_CC
47   ifelse([$3],,:,[$3])
49 rm -f conftest*
50 unset ompi_assemble
51 ])dnl