1 | # -*- Autoconf -*- |
---|
2 | # Process this file with autoconf to produce a configure script. |
---|
3 | |
---|
4 | AC_INIT([PhyML],esyscmd([sh -c "date \"+%Y%m%d\" | tr -d '\n'"]),[s.guindon@auckland.ac.nz]) |
---|
5 | AM_INIT_AUTOMAKE([foreign]) |
---|
6 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) |
---|
7 | |
---|
8 | AC_CONFIG_SRCDIR([src/simu.c],[doc/phyml-manual.tex]) |
---|
9 | AC_CONFIG_HEADERS([config.h]) |
---|
10 | |
---|
11 | AC_DEFINE([UNIX],[1],[Unix tag on]) |
---|
12 | AC_DEFINE([DEBUG],[1],[Debug tag on]) |
---|
13 | |
---|
14 | AM_INIT_AUTOMAKE |
---|
15 | AC_CANONICAL_HOST |
---|
16 | |
---|
17 | AC_PROG_CC([gcc]) |
---|
18 | |
---|
19 | # Checks for libraries. |
---|
20 | AC_CHECK_LIB([m], [log]) |
---|
21 | |
---|
22 | # Checks for header files. |
---|
23 | AC_HEADER_STDC |
---|
24 | AC_CHECK_HEADERS([float.h stdlib.h string.h unistd.h]) |
---|
25 | |
---|
26 | # Checks for typedefs, structures, and compiler characteristics. |
---|
27 | AC_C_CONST |
---|
28 | AC_C_INLINE |
---|
29 | AC_TYPE_SIZE_T |
---|
30 | |
---|
31 | # Check for presence of LaTeX and pdfLaTeX |
---|
32 | AC_CHECK_PROGS([PDFLATEX], pdflatex, [/bin/false]) |
---|
33 | AC_CHECK_PROGS([LATEX], latex, [/bin/false]) |
---|
34 | if test "x$PDFLATEX" = x/bin/false || test "x$LATEX" = x/bin/false; then |
---|
35 | enable_docs=no |
---|
36 | AC_MSG_WARN([Documentation will not be built!]) |
---|
37 | fi |
---|
38 | |
---|
39 | AM_CONDITIONAL([HAVE_PDFLATEX], test -n "$PDFLATEX") |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | # Checks for library functions. |
---|
44 | AC_FUNC_MALLOC |
---|
45 | AC_FUNC_REALLOC |
---|
46 | AC_FUNC_SETVBUF_REVERSED |
---|
47 | AC_FUNC_VPRINTF |
---|
48 | AC_CHECK_FUNCS([floor pow rint sqrt strchr strstr]) |
---|
49 | |
---|
50 | # Thanks to Shane Sturrock from Biomatters |
---|
51 | #case "${host}" in |
---|
52 | #*darwin*) |
---|
53 | #AM_INIT_AUTOMAKE([no-dependencies]) |
---|
54 | #ARCH_flag="-arch i386 -arch ppc -arch x86_64 -mmacosx-version-min=10.4" |
---|
55 | #;; |
---|
56 | #esac |
---|
57 | |
---|
58 | |
---|
59 | dnl CFLAGS="-O3 -fomit-frame-pointer -funroll-loops -Wall ${ARCH_flag}" |
---|
60 | dnl CFLAGS="-O3 -Wfloat-equal -fomit-frame-pointer -funroll-loops" |
---|
61 | dnl CFLAGS="-O3 -Wfloat-equal" |
---|
62 | dnl CFLAGS="-g" |
---|
63 | |
---|
64 | LDFLAGS="${ARGC_flag}" |
---|
65 | |
---|
66 | dnl LT_INIT |
---|
67 | dnl AC_PROG_LIBTOOL |
---|
68 | dnl Add option for compiling with debugging informations |
---|
69 | |
---|
70 | AC_ARG_ENABLE([debug], |
---|
71 | [AS_HELP_STRING([--enable-debug], |
---|
72 | [Remove optimization options and add debug informations.])]) |
---|
73 | AS_IF([test "x$enable_debug" = "xyes"], |
---|
74 | [CFLAGS="-ansi -pedantic -Wall -std=c99 -O0 -g"], |
---|
75 | [CFLAGS="-Wall -O2 -msse -fomit-frame-pointer -funroll-loops ${ARCH_flag}"]) |
---|
76 | |
---|
77 | AC_ARG_ENABLE([gprof], |
---|
78 | [AS_HELP_STRING([--enable-gprof], |
---|
79 | [Remove optimization options and add profiling informations.])]) |
---|
80 | AS_IF([test "x$enable_gprof" = "xyes"], |
---|
81 | [CFLAGS="-ansi -pedantic -Wall -std=c99 -O0 -g -pg"], |
---|
82 | [AS_IF([test "x$enable_debug" = "xno"],[CFLAGS="-Wall -O2 -msse -fomit-frame-pointer -funroll-loops ${ARCH_flag}"])]) |
---|
83 | |
---|
84 | AC_ARG_ENABLE([mpi], |
---|
85 | [AS_HELP_STRING([--enable-mpi], |
---|
86 | [Compile with mpicc instead of gcc.])]) |
---|
87 | AS_IF([test "x$enable_mpi" = "xyes"],[CC="mpicc"]) |
---|
88 | AS_IF([test "x$enable_mpi" = "xyes"],AC_DEFINE([MPI],[1],[MPI tag on])) |
---|
89 | AM_CONDITIONAL([WANT_MPI], [test "x$enable_mpi" = "xyes"]) |
---|
90 | |
---|
91 | |
---|
92 | AC_ARG_ENABLE([win], |
---|
93 | [AS_HELP_STRING([--enable-win], |
---|
94 | [Compile with mingw instead of gcc.])]) |
---|
95 | AS_IF([test "x$enable_win" = "xyes"],[CC="i586-mingw32msvc-cc"]) |
---|
96 | |
---|
97 | AC_ARG_ENABLE([phytime],[AS_HELP_STRING([--enable-phytime],[Compile PhyTime])],[phytime=yes],[phytime=no]) |
---|
98 | AM_CONDITIONAL([WANT_PHYTIME], [test "$phytime" = yes]) |
---|
99 | if test "$phytime" = yes; then |
---|
100 | AC_DEFINE([PHYTIME],[1],[PHYTIME tag on]) |
---|
101 | fi |
---|
102 | |
---|
103 | AC_ARG_ENABLE([tiporder],[AS_HELP_STRING([--enable-tiporder],[Compile tiporder])],[tiporder=yes],[tiporder=no]) |
---|
104 | AM_CONDITIONAL([WANT_TIPORDER], [test "$tiporder" = yes]) |
---|
105 | if test "$tiporder" = yes; then |
---|
106 | AC_DEFINE([TIPORDER],[1],[TIPORDER tag on]) |
---|
107 | fi |
---|
108 | |
---|
109 | AC_ARG_ENABLE([part],[AS_HELP_STRING([--enable-part],[Compile Part])],[part=yes],[part=no]) |
---|
110 | AM_CONDITIONAL([WANT_PART], [test "$part" = yes]) |
---|
111 | if test "$part" = yes; then |
---|
112 | AC_DEFINE([PART],[1],[PART tag on]) |
---|
113 | fi |
---|
114 | |
---|
115 | AC_ARG_ENABLE([rwrap],[AS_HELP_STRING([--enable-rwrap],[Compile Rwrap])],[rwrap=yes],[rwrap=no]) |
---|
116 | AM_CONDITIONAL([WANT_RWRAP], [test "$rwrap" = yes]) |
---|
117 | if test "$rwrap" = yes; then |
---|
118 | AC_DEFINE([RWRAP],[1],[RWRAP tag on]) |
---|
119 | fi |
---|
120 | |
---|
121 | AC_ARG_ENABLE([phycont],[AS_HELP_STRING([--enable-phycont],[Compile PhyCont])],[phycont=yes],[phycont=no]) |
---|
122 | AM_CONDITIONAL([WANT_PHYCONT], [test "$phycont" = yes]) |
---|
123 | if test "$phycont" = yes; then |
---|
124 | AC_DEFINE([PHYCONT],[1],[PHYCONT tag on]) |
---|
125 | fi |
---|
126 | |
---|
127 | AC_ARG_ENABLE([m4],[AS_HELP_STRING([--enable-m4],[Compile M4])],[m4=yes],[m4=no]) |
---|
128 | AM_CONDITIONAL([WANT_M4], [test "$m4" = yes]) |
---|
129 | if test "$m4" = yes; then |
---|
130 | AC_DEFINE([M4],[1],[m4 tag on]) |
---|
131 | fi |
---|
132 | |
---|
133 | AC_ARG_ENABLE([rf],[AS_HELP_STRING([--enable-rf],[Compile RF])],[rf=yes],[rf=no]) |
---|
134 | AM_CONDITIONAL([WANT_RF], [test "$rf" = yes]) |
---|
135 | if test "$rf" = yes; then |
---|
136 | AC_DEFINE([RF],[1],[RF tag on]) |
---|
137 | fi |
---|
138 | |
---|
139 | AC_ARG_ENABLE([test],[AS_HELP_STRING([--enable-test],[Compile test])],[test=yes],[test=no]) |
---|
140 | AM_CONDITIONAL([WANT_TEST], [test "$test" = yes]) |
---|
141 | if test "$test" = yes; then |
---|
142 | AC_DEFINE([TEST],[1],[TEST tag on]) |
---|
143 | fi |
---|
144 | |
---|
145 | AC_ARG_ENABLE([evolve],[AS_HELP_STRING([--enable-evolve],[Compile evolve])],[evolve=yes],[evolve=no]) |
---|
146 | AM_CONDITIONAL([WANT_EVOLVE], [test "$evolve" = yes]) |
---|
147 | if test "$evolve" = yes; then |
---|
148 | AC_DEFINE([EVOLVE],[1],[EVOLVE tag on]) |
---|
149 | fi |
---|
150 | |
---|
151 | AC_ARG_ENABLE([sergeii],[AS_HELP_STRING([--enable-sergeii],[Compile sergeii])],[sergeii=yes],[sergeii=no]) |
---|
152 | AM_CONDITIONAL([WANT_SERGEII], [test "$sergeii" = yes]) |
---|
153 | if test "$sergeii" = yes; then |
---|
154 | AC_DEFINE([SERGEII],[1],[SERGEII tag on]) |
---|
155 | fi |
---|
156 | |
---|
157 | AC_ARG_ENABLE([geo],[AS_HELP_STRING([--enable-geo],[Compile geo])],[geo=yes],[geo=no]) |
---|
158 | AM_CONDITIONAL([WANT_GEO], [test "$geo" = yes]) |
---|
159 | if test "$geo" = yes; then |
---|
160 | AC_DEFINE([GEO],[1],[GEO tag on]) |
---|
161 | fi |
---|
162 | |
---|
163 | AC_ARG_ENABLE([checkpoint],[AS_HELP_STRING([--enable-checkpoint],[Compile checkpoint])],[checkpoint=yes],[checkpoint=no]) |
---|
164 | AM_CONDITIONAL([WANT_CHECKPOINT], [test "$checkpoint" = yes]) |
---|
165 | if test "$checkpoint" = yes; then |
---|
166 | AC_DEFINE([CHECKPOINT],[1],[CHECKPOINT tag on]) |
---|
167 | fi |
---|
168 | |
---|
169 | |
---|
170 | if test "$phytime" = no; then |
---|
171 | if test "$tiporder" = no; then |
---|
172 | if test "$part" = no; then |
---|
173 | if test "$rwrap" = no; then |
---|
174 | if test "$phycont" = no; then |
---|
175 | if test "$m4" = no; then |
---|
176 | if test "$test" = no; then |
---|
177 | if test "$sergeii" = no; then |
---|
178 | if test "$geo" = no; then |
---|
179 | if test "$evolve" = no; then |
---|
180 | if test "$checkpoint" = no; then |
---|
181 | AC_DEFINE([PHYML],[1],[PHYML tag on]) |
---|
182 | fi |
---|
183 | fi |
---|
184 | fi |
---|
185 | fi |
---|
186 | fi |
---|
187 | fi |
---|
188 | fi |
---|
189 | fi |
---|
190 | fi |
---|
191 | fi |
---|
192 | fi |
---|
193 | |
---|
194 | AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile]) |
---|
195 | AC_OUTPUT |
---|