initial commit
[jalview.git] / forester / archive / RIO / others / puzzle_mod / configure.in
1
2 dnl Disable caching.
3 define([AC_CACHE_LOAD], )dnl
4 define([AC_CACHE_SAVE], )dnl
5
6 dnl Process this file with autoconf to produce a configure script.
7 AC_INIT(src/ml.h)
8
9 AM_INIT_AUTOMAKE(tree-puzzle, 5.0)
10
11 dnl Checks for programs.
12 AC_PROG_CC
13 AC_PROG_CC_C_O
14 AC_PROG_INSTALL
15 AC_PROG_MAKE_SET
16
17
18 AC_DEFUN(AC_TEST_MPICC,[dnl
19  if test  "$1" != ""  ; then
20  if test  "$MPICCSET" = ""  ; then
21 cat > conftest.c <<EOF
22 #include<mpi.h>
23 int main (int argc, char **argv)
24 {
25 MPI_Init(&argc,&argv);
26 MPI_Finalize();
27 exit(0);
28 }
29 EOF
30
31
32 MPICC=$1
33 dnl if test  "$MPICC" != "$CC"  ; then
34 dnl   
35 dnl fi
36
37  if test  "$MPICC" != ""  ; then
38     AC_MSG_CHECKING(whether $MPICC works as MPI compiler)
39     $MPICC conftest.c -o conftest > /dev/null 2>&1
40     if test $? = 0 ; then
41         AC_MSG_RESULT(yes)
42         #MPICC=$MPICC
43         MPILIBS=
44         MPICCSET=$MPICC
45         PPUZZLE=ppuzzle
46     else
47         AC_MSG_RESULT(no)
48         AC_MSG_CHECKING(whether $MPICC needs -lmpi)
49         $MPICC conftest.c -o conftest -lmpi > /dev/null 2>&1
50         if test $? = 0 ; then
51             AC_MSG_RESULT(yes)
52             #MPICC=$PCC
53             MPILIBS=-lmpi
54             MPICCSET=$MPICC
55             PPUZZLE=ppuzzle
56         else
57             AC_MSG_RESULT(no)
58             MPICC=
59             MPILIBS=
60             MPICCSET=
61             PPUZZLE=
62         fi
63     fi
64   fi
65   rm -f conftest*
66  fi
67  fi ])
68
69 if test  "$MPICC" != ""  ; then
70   AC_PATH_PROG(MPICC0, $MPICC)
71 fi
72 AC_PATH_PROG(MPICC1, mpcc)
73 AC_PATH_PROG(MPICC2, hcc)
74 AC_PATH_PROG(MPICC3, mpicc)
75 AC_PATH_PROG(MPICC4, mpicc_lam)
76 AC_PATH_PROG(MPICC5, mpicc_mpich)
77
78 AC_TEST_MPICC($MPICC0)
79 AC_TEST_MPICC($MPICC1)
80 AC_TEST_MPICC($MPICC2)
81 AC_TEST_MPICC($MPICC3)
82 AC_TEST_MPICC($MPICC4)
83 AC_TEST_MPICC($MPICC5)
84
85 ac_cv_prog_MPICC=$MPICC
86
87 AC_SUBST(MPICC)
88 AC_SUBST(MPILIBS)
89 AC_SUBST(MPIDEFS)
90 AC_SUBST(MPICFLAGS)
91 AC_SUBST(PPUZZLE)
92
93 dnl Checks for libraries.
94 dnl Replace `main' with a function in -lm:
95 AC_CHECK_LIB(m, main)
96 dnl AC_CHECK_LIB(mpi, main)
97
98 dnl Checks for header files.
99 AC_HEADER_STDC
100 AC_CHECK_HEADERS(limits.h)
101 dnl AC_HAVE_HEADERS(mpi.h)
102
103 dnl AC_HAVE_HEADERS(rpc/xdr.h)
104
105
106 dnl Checks for typedefs, structures, and compiler characteristics.
107 AC_C_CONST
108 AC_TYPE_SIZE_T
109
110 dnl Checks for library functions.
111 dnl AC_CHECK_FUNCS(xdr_u_char)
112 dnl AC_CHECK_FUNCS(xdr_double)
113 dnl AC_CHECK_FUNCS(xdrstdio_create)
114 dnl AC_CHECK_FUNCS(xdr_destroy)
115 dnl AC_CHECK_FUNCS(xdr_inline)
116
117 AC_OUTPUT(Makefile src/Makefile src/test doc/Makefile data/Makefile)