File: configure.in

package info (click to toggle)
tree-puzzle 5.0-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 884 kB
  • ctags: 1,100
  • sloc: ansic: 13,543; sh: 330; makefile: 116
file content (117 lines) | stat: -rw-r--r-- 2,430 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117

dnl Disable caching.
define([AC_CACHE_LOAD], )dnl
define([AC_CACHE_SAVE], )dnl

dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/ml.h)

AM_INIT_AUTOMAKE(tree-puzzle, 5.0)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_MAKE_SET


AC_DEFUN(AC_TEST_MPICC,[dnl
 if test  "$1" != ""  ; then
 if test  "$MPICCSET" = ""  ; then
cat > conftest.c <<EOF
#include<mpi.h>
int main (int argc, char **argv)
{
MPI_Init(&argc,&argv);
MPI_Finalize();
exit(0);
}
EOF


MPICC=$1
dnl if test  "$MPICC" != "$CC"  ; then
dnl   
dnl fi

 if test  "$MPICC" != ""  ; then
    AC_MSG_CHECKING(whether $MPICC works as MPI compiler)
    $MPICC conftest.c -o conftest > /dev/null 2>&1
    if test $? = 0 ; then
        AC_MSG_RESULT(yes)
        #MPICC=$MPICC
        MPILIBS=
        MPICCSET=$MPICC
        PPUZZLE=ppuzzle
    else
        AC_MSG_RESULT(no)
        AC_MSG_CHECKING(whether $MPICC needs -lmpi)
        $MPICC conftest.c -o conftest -lmpi > /dev/null 2>&1
        if test $? = 0 ; then
            AC_MSG_RESULT(yes)
            #MPICC=$PCC
            MPILIBS=-lmpi
            MPICCSET=$MPICC
            PPUZZLE=ppuzzle
        else
            AC_MSG_RESULT(no)
            MPICC=
            MPILIBS=
            MPICCSET=
            PPUZZLE=
        fi
    fi
  fi
  rm -f conftest*
 fi
 fi ])

if test  "$MPICC" != ""  ; then
  AC_PATH_PROG(MPICC0, $MPICC)
fi
AC_PATH_PROG(MPICC1, mpcc)
AC_PATH_PROG(MPICC2, hcc)
AC_PATH_PROG(MPICC3, mpicc)
AC_PATH_PROG(MPICC4, mpicc_lam)
AC_PATH_PROG(MPICC5, mpicc_mpich)

AC_TEST_MPICC($MPICC0)
AC_TEST_MPICC($MPICC1)
AC_TEST_MPICC($MPICC2)
AC_TEST_MPICC($MPICC3)
AC_TEST_MPICC($MPICC4)
AC_TEST_MPICC($MPICC5)

ac_cv_prog_MPICC=$MPICC

AC_SUBST(MPICC)
AC_SUBST(MPILIBS)
AC_SUBST(MPIDEFS)
AC_SUBST(MPICFLAGS)
AC_SUBST(PPUZZLE)

dnl Checks for libraries.
dnl Replace `main' with a function in -lm:
AC_CHECK_LIB(m, main)
dnl AC_CHECK_LIB(mpi, main)

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h)
dnl AC_HAVE_HEADERS(mpi.h)

dnl AC_HAVE_HEADERS(rpc/xdr.h)


dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T

dnl Checks for library functions.
dnl AC_CHECK_FUNCS(xdr_u_char)
dnl AC_CHECK_FUNCS(xdr_double)
dnl AC_CHECK_FUNCS(xdrstdio_create)
dnl AC_CHECK_FUNCS(xdr_destroy)
dnl AC_CHECK_FUNCS(xdr_inline)

AC_OUTPUT(Makefile src/Makefile src/test doc/Makefile data/Makefile)