1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_INIT([PhyML],esyscmd([sh -c "echo "3.3." | tr -d '\n' ; echo "20200621" | tr -d '\n'"]),[guindon@lirmm.fr])
5AM_INIT_AUTOMAKE([foreign])
6
7AC_CONFIG_SRCDIR([src/simu.c],[doc/phyml-manual.tex])
8AC_CONFIG_HEADERS([config.h])
9
10AC_DEFINE([UNIX],[1],[Unix tag on])
11AC_DEFINE([DEBUG],[1],[Debug tag on])
12
13AC_CANONICAL_HOST
14
15AC_PROG_CC([gcc])
16
17
18# Checks for libraries.
19AC_CHECK_LIB([m], [log])
20
21# Checks for header files.
22AC_HEADER_STDC
23AC_CHECK_HEADERS([float.h stdlib.h string.h unistd.h])
24
25# Checks for typedefs, structures, and compiler characteristics.
26AC_C_CONST
27AC_C_INLINE
28AC_TYPE_SIZE_T
29
30# Check for presence of LaTeX and pdfLaTeX
31AC_CHECK_PROGS([PDFLATEX], pdflatex, [/bin/false])
32AC_CHECK_PROGS([LATEX], latex, [/bin/false])
33if test "x$PDFLATEX" = x/bin/false || test "x$LATEX" = x/bin/false; then
34 enable_docs=no
35AC_MSG_WARN([Documentation will not be built!])
36fi
37
38AM_CONDITIONAL([HAVE_PDFLATEX], test -n "$PDFLATEX")
39
40# Checks for library functions.
41AC_FUNC_MALLOC
42AC_FUNC_REALLOC
43AC_FUNC_SETVBUF_REVERSED
44AC_FUNC_VPRINTF
45AC_CHECK_FUNCS([floor pow rint sqrt strchr strstr])
46
47dnl DEFAULT_VECTOR_FLAG=
48dnl DEFAULT_VECTOR_FLAG="-mavx -mfma"
49dnl DEFAULT_VECTOR_FLAG=-msse3
50DEFAULT_VECTOR_FLAG="-march=native"
51
52
53AC_ARG_ENABLE([native],
54              [AS_HELP_STRING([--disable-native],
55                              [Remove AVX or SSE compilation options.])])
56AS_IF([test "x$enable_native" = "xno"],
57      [VECTOR_FLAG=],
58      [VECTOR_FLAG="${DEFAULT_VECTOR_FLAG}"])
59
60
61LDFLAGS="${ARGC_flag}"
62
63dnl Uncomment two rows below when compiling rwarp (need to have libtool installed)
64dnl LT_INIT
65dnl AC_PROG_LIBTOOL
66
67
68dnl DEFAULT_C_FLAG="-fno-inline-functions -fno-inline-functions-called-once -fno-optimize-sibling-calls -O2 -fno-omit-frame-pointer -g ${VECTOR_FLAG}"
69DEFAULT_C_FLAG="-std=c99 -O3 -fomit-frame-pointer -funroll-loops -Wall -Winline -finline ${VECTOR_FLAG}"
70dnl DEFAULT_C_FLAG="-O2 ${VECTOR_FLAG}"
71dnl DEFAULT_C_FLAG="${VECTOR_FLAG}"
72dnl DEFAULT_C_FLAG="-pthread  -O3 -g -ffunction-sections -fdata-sections"
73
74AC_ARG_ENABLE([debug],
75              [AS_HELP_STRING([--enable-debug],
76                              [Remove optimization options and add debug informations.])])
77AS_IF([test "x$enable_debug" = "xyes"],
78      [CFLAGS="-ansi ${VECTOR_FLAG} -pedantic -Wall -std=c99 -O0 -g -Wuninitialized -Wunused -Wunreachable-code"],
79      [CFLAGS="${DEFAULT_C_FLAG}"])
80
81AC_ARG_ENABLE([safemode],
82        AS_HELP_STRING([--enable-safemode],[Enable safe mode.]))
83AS_IF([test "x$enable_safemode" = "xyes"],
84      [CFLAGS="-Wall -DSAFEMODE -O3 ${VECTOR_FLAG}"],
85      [AS_IF([test "x$enable_debug" = "xno"],[CFLAGS="${DEFAULT_C_FLAG}"])])
86
87AC_ARG_ENABLE([gprof],
88              [AS_HELP_STRING([--enable-gprof],
89                              [Remove optimization options and add profiling informations.])])
90AS_IF([test "x$enable_gprof" = "xyes"],
91      [CFLAGS="-g -pg -fno-inline -fprofile-arcs -ftest-coverage ${VECTOR_FLAG}"],
92      [AS_IF([test "x$enable_debug" = "xno"],[CFLAGS="${DEFAULT_C_FLAG}"])])
93
94AC_ARG_ENABLE([mpi],
95              [AS_HELP_STRING([--enable-mpi],
96                              [Compile with mpicc instead of gcc.])])
97AS_IF([test "x$enable_mpi" = "xyes"],[CC="mpicc"])
98AS_IF([test "x$enable_mpi" = "xyes"],AC_DEFINE([MPI],[1],[MPI tag on]))
99AM_CONDITIONAL([WANT_MPI], [test "$enable_mpi" = yes])
100
101
102AC_ARG_ENABLE([win],
103              [AS_HELP_STRING([--enable-win],
104                              [Compile with mingw instead of gcc.])])
105AS_IF([test "x$enable_win" = "xyes"],[CC="i686-w64-mingw32-gcc"])
106AS_IF([test "x$enable_win" = "xyes"],AC_DEFINE([WIN32],[1],[WIN32 tag on]))
107AM_CONDITIONAL([WANT_WIN], [test "$enable_win" = yes])
108
109
110dnl AC_ARG_ENABLE([beagle], [AS_HELP_STRING([--enable-beagle], [Compute likelihoods using BEAGLE library.])], [beagle=yes],[beagle=no])
111dnl AS_IF([test "x$enable_beagle" = "xyes"],[PKG_CHECK_MODULES([BEAGLE],[hmsbeagle-1])])
112dnl AS_IF([test "x$enable_beagle" = "xyes"],
113dnl       [CFLAGS="${CFLAGS} ${BEAGLE_CFLAGS} ${BEAGLE_LIBS} -lstdc++"],
114dnl       [CFLAGS=${CFLAGS}])
115AS_IF([test "x$enable_beagle" = "xyes"], AC_DEFINE([BEAGLE],[1],[BEAGLE tag on]))
116AM_CONDITIONAL([WANT_BEAGLE], [test "$enable_beagle" = yes])
117
118
119AC_ARG_ENABLE([phytime],[AS_HELP_STRING([--enable-phytime],[Compile PhyTime])],[phytime=yes],[phytime=no])
120AM_CONDITIONAL([WANT_PHYTIME], [test "$phytime" = yes])
121if test "$phytime" = yes; then
122   AC_DEFINE([PHYTIME],[1],[PHYTIME tag on])
123fi
124
125AC_ARG_ENABLE([phyml],[AS_HELP_STRING([--enable-phyml],[Compile PhyML])],[phyml=yes],[phyml=no])
126AM_CONDITIONAL([WANT_PHYML], [test "$phyml" = yes])
127if test "$phyml" = yes; then
128   AC_DEFINE([PHYML],[1],[PHYML tag on])
129fi
130
131
132AC_ARG_ENABLE([tiporder],[AS_HELP_STRING([--enable-tiporder],[Compile tiporder])],[tiporder=yes],[tiporder=no])
133AM_CONDITIONAL([WANT_TIPORDER], [test "$tiporder" = yes])
134if test "$tiporder" = yes; then
135   AC_DEFINE([TIPORDER],[1],[TIPORDER tag on])
136fi
137
138AC_ARG_ENABLE([part],[AS_HELP_STRING([--enable-part],[Compile Part])],[part=yes],[part=no])
139AM_CONDITIONAL([WANT_PART], [test "$part" = yes])
140if test "$part" = yes; then
141   AC_DEFINE([PART],[1],[PART tag on])
142fi
143
144AC_ARG_ENABLE([rwrap],[AS_HELP_STRING([--enable-rwrap],[Compile Rwrap])],[rwrap=yes],[rwrap=no])
145AM_CONDITIONAL([WANT_RWRAP], [test "$rwrap" = yes])
146if test "$rwrap" = yes; then
147   AC_DEFINE([RWRAP],[1],[RWRAP tag on])
148fi
149
150AC_ARG_ENABLE([phycont],[AS_HELP_STRING([--enable-phycont],[Compile PhyCont])],[phycont=yes],[phycont=no])
151AM_CONDITIONAL([WANT_PHYCONT], [test "$phycont" = yes])
152if test "$phycont" = yes; then
153   AC_DEFINE([PHYCONT],[1],[PHYCONT tag on])
154fi
155
156AC_ARG_ENABLE([rf],[AS_HELP_STRING([--enable-rf],[Compile RF])],[rf=yes],[rf=no])
157AM_CONDITIONAL([WANT_RF], [test "$rf" = yes])
158if test "$rf" = yes; then
159   AC_DEFINE([RF],[1],[RF tag on])
160fi
161
162AC_ARG_ENABLE([test],[AS_HELP_STRING([--enable-test],[Compile test])],[test=yes],[test=no])
163AM_CONDITIONAL([WANT_TEST], [test "$test" = yes])
164if test "$test" = yes; then
165   AC_DEFINE([TEST],[1],[TEST tag on])
166fi
167
168AC_ARG_ENABLE([evolve],[AS_HELP_STRING([--enable-evolve],[Compile evolve])],[evolve=yes],[evolve=no])
169AM_CONDITIONAL([WANT_EVOLVE], [test "$evolve" = yes])
170if test "$evolve" = yes; then
171   AC_DEFINE([EVOLVE],[1],[EVOLVE tag on])
172fi
173
174AC_ARG_ENABLE([invitee],[AS_HELP_STRING([--enable-invitee],[Compile invitee])],[invitee=yes],[invitee=no])
175AM_CONDITIONAL([WANT_INVITEE], [test "$invitee" = yes])
176if test "$invitee" = yes; then
177   AC_DEFINE([INVITEE],[1],[INVITEE tag on])
178fi
179
180AC_ARG_ENABLE([geo],[AS_HELP_STRING([--enable-geo],[Compile geo])],[geo=yes],[geo=no])
181AM_CONDITIONAL([WANT_GEO], [test "$geo" = yes])
182if test "$geo" = yes; then
183   AC_DEFINE([GEO],[1],[GEO tag on])
184fi
185
186AC_ARG_ENABLE([checkpoint],[AS_HELP_STRING([--enable-checkpoint],[Compile checkpoint])],[checkpoint=yes],[checkpoint=no])
187AM_CONDITIONAL([WANT_CHECKPOINT], [test "$checkpoint" = yes])
188if test "$checkpoint" = yes; then
189   AC_DEFINE([CHECKPOINT],[1],[CHECKPOINT tag on])
190fi
191
192
193AC_ARG_ENABLE([phyrex],[AS_HELP_STRING([--enable-phyrex],[Compile phyrex])],[phyrex=yes],[phyrex=no])
194AM_CONDITIONAL([WANT_PHYREX], [test "$phyrex" = yes])
195if test "$phyrex" = yes; then
196   AC_DEFINE([PHYREX],[1],[PHYREX tag on])
197fi
198
199AC_ARG_ENABLE([phyrexsim],[AS_HELP_STRING([--enable-phyrexsim],[Compile phyrexsim])],[phyrexsim=yes],[phyrexsim=no])
200AM_CONDITIONAL([WANT_PHYREXSIM], [test "$phyrexsim" = yes])
201if test "$phyrexsim" = yes; then
202   AC_DEFINE([PHYREXSIM],[1],[PHYREXSIM tag on])
203fi
204
205dnl AS_IF([test "x$enable_phyrex" = "xyes"],[PKG_CHECK_MODULES([GTK], [gtk+-3.0])])
206dnl AS_IF([test "x$enable_phyrex" = "xyes"],[PKG_CHECK_MODULES([CAIRO], [cairo])])
207dnl AS_IF([test "x$enable_phyrex" = "xyes"],[CFLAGS="${CFLAGS} `pkg-config --cflags --libs gtk+-3.0`"])
208
209
210dnl AM_PATH_GTK_3_0(,,AC_MSG_ERROR(windoe-default needs GTK+-3))
211
212AC_ARG_ENABLE([date],[AS_HELP_STRING([--enable-date],[Compile date])],[date=yes],[date=no])
213AM_CONDITIONAL([WANT_DATE], [test "$date" = yes])
214if test "$date" = yes; then
215   AC_DEFINE([DATE],[1],[DATE tag on])
216fi
217
218if test "$phytime" = no; then
219if test "$tiporder" = no; then
220if test "$part" = no; then
221if test "$rwrap" = no; then
222if test "$phycont" = no; then
223if test "$test" = no; then
224if test "$rf" = no; then
225if test "$invitee" = no; then
226if test "$geo" = no; then
227if test "$evolve" = no; then
228if test "$checkpoint" = no; then
229if test "$phyrex" = no; then
230if test "$phyrexsim" = no; then
231if test "$date" = no; then
232   AC_DEFINE([PHYML],[1],[PHYML tag on])
233fi
234fi
235fi
236fi
237fi
238fi
239fi
240fi
241fi
242fi
243fi
244fi
245fi
246fi
247
248AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile])
249AC_OUTPUT
250