Wrapper for Clustal Omega.
[jabaws.git] / binaries / src / clustalo / configure.ac
1 # configure.ac for Clustal Omega
2 #
3 # RCS $Id: configure.ac 256 2011-06-23 13:57:28Z fabian $
4
5
6 # release
7 #
8 #AC_INIT([Clustal Omega], [0.1.1], [clustalw@ucd.ie])
9 #PACKAGE_CODENAME="OppidumLeonis"
10 #r238
11 #AC_INIT([Clustal Omega], [0.2.0], [clustalw@ucd.ie])
12 #PACKAGE_CODENAME="IbiMeVidebunt"
13 #r250
14 #AC_INIT([Clustal Omega], [1.0.1], [clustalw@ucd.ie])
15 #PACKAGE_CODENAME="DeshilHollesEamus"
16 #r255
17 AC_INIT([Clustal Omega], [1.0.2], [clustalw@ucd.ie])
18 PACKAGE_CODENAME="DeshilHollesEamus"
19
20 # The AC_INIT macro can take any source file as an argument. It just
21 # checks that the file is there, which should, in turn, mean that the
22 # source directory is there. AC_INIT generates the following m4
23 # macros, output variables and preprocessor symbols:
24 AC_SUBST(PACKAGE_NAME)
25 AC_SUBST(PACKAGE_TARNAME)
26 AC_SUBST(PACKAGE_VERSION)
27 AC_SUBST(PACKAGE_STRING)
28 AC_SUBST(PACKAGE_BUGREPORT)
29 AC_SUBST(PACKAGE_CODENAME)
30
31 AC_MSG_NOTICE([
32
33     Welcome to $PACKAGE_NAME - version $PACKAGE_VERSION ($PACKAGE_CODENAME)
34                                                
35                        +NMMMMMMMMMS=             
36                     MMMMM?      :MMMMM8          
37                   IMMMMS           MMMMM,        
38                 ~MMMMN              ,MMMMM       
39                =MMMMM                 MMMMM      
40               ?MMMMM                  +MMMMM     
41               MMMMMS                   MMMMM     
42               MMMMM                    MMMMM:    
43               MMMMM                    MMMMM+    
44               MMMMM                    MMMMM~    
45               MMMMM                    MMMMM     
46               MMMMMZ                   MMMMM     
47                MMMMM                  ,MMMMZ     
48                 MMMM8                 MMMM+      
49                  MMMMS               MMMM,       
50                    MMMMO           MMMM          
51             ,N       SMMM        MMM8       +8   
52             ,M7         M+       M+        :M8   
53             ,MMMMMMMMMMMMI       MMMMMMMMMMMM8   
54             ,MMMMMMMMMMMM8       MMMMMMMMMMMM8   
55             ,MMMMMMMMMMMMN       MMMMMMMMMMMM8   
56                                                
57               ])
58 #
59 # Created with http://www.glassgiant.com/ascii/ and Wikipedia's Omega
60 # Replaced all dollars with S's.
61 #
62
63 #                 ,MMMMMMMMMD:        MMMMM     
64 #               NMMMMMMMMMMMMMM+      SMMMM     
65 #             DMMMMMMMMMMMMMMMMMM,    +MMMM     
66 #            MMMMMMMMM8ZSO8MMMMMMMM   +MMMM     
67 #           MMMMM7             SMMMM  +MMMM     
68 #          MMMO                   MM? +MMMM     
69 #         ?MMI                     NMIIMMMM     
70 #         MMM                       MMMMMMM     
71 #         MM                                    
72 #         MN                                    
73 #         MD                                    
74 #         MM                                    
75 #         MM?                       ,~+ISON     
76 #         =MMI                     MMSOMMMM     
77 #          MMMZ                   MMS +MMMM     
78 #           MMMM8:             :NMMM  +MMMM     
79 #            MMMMMMMMMDOODMMMMMMMMM   +MMMM     
80 #             MMMMMMMMMMMMMMMMMMMM    +MMMM     
81 #               OMMMMMMMMMMMMMMZ      SMMMM     
82 #                  MMMMMMMMMM+        MMMMM     
83 #                                                
84
85
86 # AC_MSG_NOTICE([Configuring for your system...])
87
88 AC_PREREQ(2.6) # 2.60 needed for AC_USE_SYSTEM_EXTENSIONS
89 # consider 2.64 which allows to define a URL as well
90
91 # The AM_INIT_AUTOMAKE line adds several standard checks. 
92 # This macro is always needed for automake
93 # Obsolete: It takes the program name and version number as arguments.
94 AM_INIT_AUTOMAKE
95
96 # config header: provides a way for people to customise the
97 # configuration for their platform, via #defines. config.h.in can be
98 # generated automatically with the autoheader tool. However, you need
99 # a stamp-h file in your project to ensure that automake regenerates
100 # config.h from config.h.in. Type 'touch stamp-h' to add this file to
101 # your project.
102 #
103 AM_CONFIG_HEADER(src/config.h) 
104
105 # the following allows to install a copy config.h for libclustalo in a
106 # namespace like way, i.e. no name clash with your own config.h
107 AX_PREFIX_CONFIG_H(src/clustal-omega-config.h)
108
109 # This macro was introduced in Autoconf 2.60. If possible, enable
110 # extensions to C or Posix on hosts that normally disable the
111 # extensions.
112 AC_USE_SYSTEM_EXTENSIONS
113
114
115 # for cross compilation
116 #
117 AC_CANONICAL_HOST
118 ## AC_CANONICAL_BUILD
119 ## AC_CANONICAL_TARGET
120
121 # Set the @SET_MAKE@ variable=make if $(MAKE) not set
122 AC_PROG_MAKE_SET
123
124 # AC_PROG_RANLIB will allow you to build code in sub-directories into
125 # temporary libraries, which make will then link in with the rest of
126 # the code.
127 # Rendered obsolte by LT_INIT: AC_PROG_RANLIB
128 #AC_PROG_LIBTOOL
129 LT_INIT
130
131 # AC_PROG_INSTALL will generate an install target so that users may
132 # just type 'make install' to install the software.
133 AC_PROG_INSTALL
134
135 # check for C++ preprocessor and compiler and the library compiler
136 # (might change the compiler flags)
137 #
138 # Determine a C compiler to use. If using the GNU C compiler, set
139 # shell variable GCC to `yes'. If output variable CFLAGS was not
140 # already set, set it to `-g -O2' for the GNU C compiler (`-O2' on
141 # systems where GCC does not accept `-g'), or `-g' for other
142 # compilers.
143 AC_PROG_CC
144 # Set output variable CPP to a command that runs the C preprocessor. 
145 AC_PROG_CPP
146 #
147 # Determine a C++ compiler to use. If output variable CXXFLAGS was not
148 # already set, set it to `-g -O2' for the GNU C++ compiler (`-O2' on
149 # systems where G++ does not accept `-g'), or `-g' for other
150 # compilers.
151 AC_PROG_CXX
152 # Set CXXCPP to a command that runs the C++ preprocessor
153 AC_PROG_CXXCPP
154 #
155 # reset compiler flags to initial flags
156 #CXXFLAGS=$OLD_CXXFLAGS
157
158
159
160
161 # safety check: AC_CONFIG_SRCDIR([src/clustal.h])
162
163 # Let source files know in which context they are being used
164 AC_DEFINE([CLUSTALO], [1],
165           [Let all files know they are being used inside Clustal Omega])
166
167 AC_DEFINE_UNQUOTED(PACKAGE_CODENAME, "$PACKAGE_CODENAME", [The package code name])
168
169
170 # Get svn revision
171 #AC_PATH_PROG(svnversioncommand, svnversion)
172 #if test "X$svnversioncommand" = "X" || test `$svnversioncommand -n '.'` = "exported"; then
173 #AC_DEFINE_UNQUOTED(SVN_VERSION, ["`cat saved_svn_version.txt`"], [repository svn version])
174 #else
175 #AC_DEFINE_UNQUOTED(SVN_VERSION, ["`svnversion -n`"], [repository svn version])
176 #`svnversion -n > saved_svn_version.txt`
177 #fi
178
179
180
181
182 # AW: we might need this in the future
183 #
184 case "$host_os" in
185 linux*)
186 #      AC_DEFINE(LINUX,1,[This is a Linux system])
187      AC_DEFINE_UNQUOTED(LINUX,1,[This is a LINUX system])
188 #     AM_CONDITIONAL(HAVE_GNU_LD, true)    
189 #     AM_CONDITIONAL(SOMEBSD, false)
190 #     XTRA_CPPLIBS=-lstdc++
191 #     LIBEXT=.so
192      ;;
193 freebsd*)
194      AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
195 #     AC_CHECK_LIB(c_r, pthread_create)
196 #     AM_CONDITIONAL(HAVE_GNU_LD, true)
197 #     AM_CONDITIONAL(SOMEBSD, true)
198 #     XTRA_CPPLIBS=-lstdc++
199 #     LIBEXT=.so
200      ;;
201 openbsd*)
202      AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
203 #     AC_CHECK_LIB(c_r, pthread_create)
204 #     AM_CONDITIONAL(HAVE_GNU_LD, true)
205 #     AM_CONDITIONAL(SOMEBSD, true)
206 #     XTRA_CPPLIBS=-lstdc++
207 #     LIBEXT=.so
208      ;;
209 netbsd*)
210      AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
211 #     AC_CHECK_LIB(c_r, pthread_create)
212 #     AM_CONDITIONAL(HAVE_GNU_LD, true)
213 #     AM_CONDITIONAL(SOMEBSD, true)
214 #     XTRA_CPPLIBS=-lstdc++
215 #     LIBEXT=.so
216      ;;
217 *solaris*)
218      AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
219 #     AC_CHECK_LIB(resolv, res_init)
220 #     XTRA_CPPLIBS=-lstdc++
221 #     AM_CONDITIONAL(HAVE_GNU_LD, false)
222 #     AM_CONDITIONAL(SOMEBSD, false)
223 #     CFLAGS="-D_POSIX_PTHREAD_SEMANTICS $CFLAGS"
224 #     LIBEXT=.so
225      ;;
226 darwin*)
227      AC_DEFINE_UNQUOTED(DARWIN,1,[This is a Darwin system])
228 #     AM_CONDITIONAL(HAVE_GNU_LD, false)
229 #     AM_CONDITIONAL(SOMEBSD, false)
230 #     CFLAGS="-fno-common $CFLAGS"
231 #     LIBEXT=.so
232      ;;
233 cygwin*)
234      AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a CYGWIN system])
235 #     LDFLAGS="$LDFLAGS -no-undefined"
236 #     AM_CONDITIONAL(SOMEBSD, false)
237 #     AM_CONDITIONAL(HAVE_GNU_LD, false)
238 #     LIBEXT=.dll
239      ;;
240 mingw*)
241      AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
242 #     AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
243 #     AC_CHECK_LIB(intl, gettext)
244 #     AC_CHECK_LIB(ws2_32, _head_libws2_32_a,,[AC_MSG_ERROR([libextractor requires Winsock2])])
245 #     AC_CHECK_LIB(plibc, plibc_init,,[AC_MSG_ERROR([libextractor requires PlibC])])
246 #     LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols"
247 #                LIBSOLD=$LIBS
248 #     AM_CONDITIONAL(HAVE_GNU_LD, true)
249 #     AM_CONDITIONAL(SOMEBSD, false)
250 #     LIBEXT=.dll
251      ;;
252 *)
253 #     AC_MSG_RESULT(Unrecognised OS $host_os)
254      AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
255 #     AC_MSG_RESULT(otheros)
256 #     AM_CONDITIONAL(HAVE_GNU_LD, false)
257 #     AM_CONDITIONAL(SOMEBSD, false)
258 #     LIBEXT=.so
259      ;;
260 esac
261
262
263
264 # Checks for standard header files.
265 # obsolescent according to http://www.gnu.org/software/hello/manual/autoconf/Particular-Headers.html
266 AC_HEADER_STDC
267 # Guess the next one is obsolete as well then?
268 AC_CHECK_HEADERS(assert.h ctype.h float.h limits.h math.h memory.h stdarg.h stdio.h stdlib.h string.h time.h unistd.h)
269 #  awk  '/^#include *</ {print $2}' $(find src/ -name \*.[ch] -or -name \*.cpp) | grep -v argtable2.h  | sort -u | tr -d '<>'
270
271 # Checks for typedefs, structures, and compiler characteristics.
272 AC_C_CONST
273 AC_TYPE_SIZE_T
274 AC_C_INLINE
275
276 # Checks for library functions.
277 # AC_CHECK_FUNCS(strdup strstr strchr erand48)
278 # AW is there an automatic way to extract library functions used in the program?
279
280
281 # explicit libm check
282 AC_CHECK_LIB(m, log,, AC_MSG_ERROR([Could not find libm]))
283 AC_CHECK_LIB(m, log2, AC_DEFINE(HAVE_LOG2, 1, [Has log2()]))
284
285
286 # ---    argtable header and library check
287 #
288 #
289 AC_CHECK_HEADERS([argtable2.h], [],
290                  AC_MSG_ERROR([Could not find argtable2.h. Try $ ./configure CFLAGS='-Iyour-argtable2-include-path]))
291 AC_CHECK_LIB(argtable2, arg_parse, [],
292              AC_MSG_ERROR([Could not find libargtable2. Try $ ./configure LDFLAGS="-Lyour-argtable2-lib-path']))
293
294
295 # enable python if requested (--with-python)
296 #
297 #AC_ARG_WITH([python],
298 #        [AS_HELP_STRING([--with-python],
299 #        [Enable Python Interface])],
300 #        [with_python=$withval],
301 #        [with_python=no])
302 #if test "$with_python" = "yes"; then
303 #   AC_MSG_CHECKING([for python-config to get compiler flags])
304 #   AC_CHECK_PROG(python_config, 'python-config', yes)
305 #   if test "${python_config}" != "yes"; then
306 #      AC_MSG_ERROR("Could not run python-config.")
307 #   fi
308 #   PYTHON_CFLAGS=`python-config --cflags`
309 #   PYTHON_LDFLAGS=`python-config --ldflags`
310 #   AC_DEFINE([PYTHON_ENABLED], [1], [define for python usage])
311 #fi
312 #AC_SUBST(PYTHON_CFLAGS)
313 #AC_SUBST(PYTHON_LDFLAGS)
314
315
316 # ---   SSE support
317 # "One instruction to do the same operation on 4 packed elements simultaneously."
318 #
319 # http://www.codeproject.com/KB/recipes/sseintro.aspx?msg=568491
320 # http://www.drdobbs.com/go-parallel/blog/archives/2010/03/getting_amazing.html
321 # http://software.intel.com/file/1000
322 #
323 # AC_MSG_CHECKING(for SSE in current arch/CFLAGS)
324 # AC_LINK_IFELSE([
325 # AC_LANG_PROGRAM([[
326 # #include <xmmintrin.h>
327 # __m128 testfunc(float *a, float *b) {
328 #   return _mm_add_ps(_mm_loadu_ps(a), _mm_loadu_ps(b));
329 # }
330 # ]])],
331 # [has_sse=yes], [has_sse=no]
332 # )
333 # AC_MSG_RESULT($has_sse)  
334 #  
335 # AC_ARG_ENABLE([sse],
336 #         [AS_HELP_STRING([--enable-sse],
337 #                         [Enable SSE support])],
338 #         [has_sse="$enableval"],
339 #         [has_sse=no])
340 #  
341 # if test x"$has_sse" = x"yes"; then
342 #    AC_DEFINE([USE_SSE], , [Enable SSE support])
343 #    CFLAGS="${CFLAGS} -msse"
344 # fi
345
346
347 # --- openmp
348 #
349 AC_CONFIG_MACRO_DIR([m4])
350 m4_include([m4/ax_openmp.m4])
351 AC_ARG_WITH([openmp],
352     AS_HELP_STRING([--without-openmp], [Do not use OpenMP]))
353 AS_IF([test "x$with_openmp" = "xno"], 
354             [], 
355             [AX_OPENMP(
356                 AC_DEFINE([HAVE_OPENMP],[1],[Defined if OpenMP should and can be used])
357              )]
358      )
359 AC_SUBST(OPENMP_CFLAGS)
360 # according to http://beagle-lib.googlecode.com/svn-history/r824/trunk/configure.ac:
361 # "OpenMP checker only defines for C when compiling both C and C++"
362 OPENMP_CXXFLAGS=$OPENMP_CFLAGS
363 AC_SUBST(OPENMP_CXXFLAGS)
364
365 # version 2: enable openmp only if explicitely asked for it
366 #AC_ARG_ENABLE(openmp, AS_HELP_STRING([--enable-openmp], [Multi-threaded parallel version using OpenMP]))
367 #if test -n "${enable_openmp}" -a x"${enable_openmp}" != x"no"; then
368 #   m4_include([m4/ax_openmp.m4])
369 #   AX_OPENMP(AC_DEFINE(HAVE_OPENMP, 1, [enable OpenMP support]),
370 #             AC_MSG_ERROR([Compiler does not seem to support OpenMP]))
371 #   AC_SUBST(OPENMP_CFLAGS)
372 #   AC_SUBST(OPENMP_CXXFLAGS)
373 #fi
374
375 # ---   squid
376 #
377 #
378 # Extra checks for squid; see their configure, config.log, squidconf.h
379 # etc. For example, I'm not sure about USE_HOST_BYTESWAP_FUNCTIONS,
380 # SIZEOF_UNSIGNED_LONG, HAVE_STRTOUL and HAVE_STRTOULL
381 #
382 # Might not just have to set compiler flags but create use squidconf.h.in
383 #
384 # The following hopefully takes about byte ordering (big-endian...).
385 # My hope is that it will set WORDS_BIGENDIAN and
386 # USE_HOST_BYTESWAP_FUNCTIONS (as used by squid) if necessary:
387 #
388 AC_C_BIGENDIAN(AC_MSG_WARN([$PACKAGE_NAME hasn't been tested on Big-Endian machines...expecting trouble!]))
389 AC_CHECK_FUNCS([ntohs ntohl ntons ntonl])
390 #
391 AC_CHECK_SIZEOF(unsigned short)
392 AC_CHECK_SIZEOF(unsigned int)
393 AC_CHECK_SIZEOF(unsigned long)
394 AC_CHECK_SIZEOF(unsigned long long)
395 #
396 AC_CHECK_FUNCS([stroul strtoull])
397 AC_CHECK_FUNCS([ftello fseeko])
398 AC_CHECK_FUNCS([ftello64 fseeko64])
399 AC_CHECK_FUNCS([ftell64 fseek64])
400 #
401 AC_TYPE_OFF_T
402 AC_CHECK_SIZEOF(fpos_t)
403 #
404 # struct stat64 and stat64 test:
405 # version 1:
406 #AC_CHECK_TYPE(struct stat64,
407 #               [AC_CHECK_FUNC([stat64],
408 #                             AC_DEFINE([HAVE_STAT64], [1], [Define if you have the stat64 function]))])
409 # version 2:
410 #AC_MSG_CHECKING(for struct stat64)
411 #AC_CACHE_VAL(sc_cv_type_stat64,
412 #[AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 s;],
413 #[sc_cv_type_stat64=yes],
414 #[sc_cv_type_stat64=no])])
415 #if test $sc_cv_type_stat64 = yes; then
416 #   AC_MSG_RESULT($sc_cv_type_stat64)
417 #   AC_CHECK_FUNC([stat64], AC_DEFINE([HAVE_STAT64], [1], [Define if you have the stat64 function]))
418 #   #AC_DEFINE(HAVE_STAT64, [1], [Define if you have the stat64 function])
419 #fi
420 #
421 #
422 # Above fails on myosin because storage size of struct 64 is unknown:
423 #  ssi.c:480: error: storage size of ‘s1’ isn’t known 
424 #
425 # On my MacBook OS X 10.6 I get:
426 #  ssi.c:481: warning: ‘stat64’ is deprecated (declared at /usr/include/sys/stat.h:465)
427 #
428 # So forget about it: we won't use stat64 or define HAVE_STAT64 and
429 # consequently do no tests here
430 #
431
432
433
434 # Add support for the Dmalloc package. If the user runs configure with
435 # --with-dmalloc, then define WITH_DMALLOC and add -ldmalloc to LIBS.
436 AM_WITH_DMALLOC
437
438
439 # Check if svnversion is installed
440 #AC_PATH_PROG([SVNVERSION_BIN], [svnversionFIXME], [no])
441 ## checking if we build in a subversion WC
442 #wc_found="no";
443 #if test "$SVNVERSION_BIN" != "no"; then
444 #   SVNVERSION=`$SVNVERSION_BIN -n $srcdir`
445 #   if test $SVNVERSION != "exported";
446 #   then
447 #       AC_MSG_NOTICE($SVNVERSION);
448 #   fi
449 #fi
450
451
452 # ---   debugging
453
454
455 #
456 AC_MSG_CHECKING([whether to build with debug information])
457 AC_ARG_ENABLE([debug],
458               [AS_HELP_STRING([--enable-debug],
459                               [Enable debugging (default=no)])],
460               [debugit="$enableval"],
461               [debugit=no])
462 AC_MSG_RESULT([$debugit])
463
464 if test x"$debugit" = x"yes"; then
465     # User variables CFLAGS/CXXFLAGS are used last during compilation and
466     # can therefore overwrite system settings.
467     #
468     # if debugging was requested, add debugging info at the end of
469     # C[XX]FLAGS, which makes sure previous optimisation flags are
470     # overwritten (normally C[XX]FLAGS should not be modified as they
471     # are user variables):
472     # switch off assert etc
473     # AC_DEFINE([DEBUG],[],[Debug Mode])
474     CFLAGS="${CFLAGS} -g -ansi -Wall -O0"
475     CXXFLAGS="${CXXFLAGS} -g -ansi -Wall -O0"
476 else
477     # switch off assert etc
478     AC_DEFINE([NDEBUG],[],[No-debug Mode])
479     # if no debugging is requested, we make optimisation explicit
480     AM_CXXFLAGS="${AM_CXXFLAGS} -O3"
481     AM_CFLAGS="${AM_CFLAGS} -O3"
482 fi
483
484
485
486 AC_SUBST([AM_CXXFLAGS])
487 AC_SUBST([AM_CFLAGS])
488 AC_SUBST([AM_LDFLAGS])
489
490
491 AC_CONFIG_FILES(Makefile
492  src/Makefile
493  clustalo.pc
494  Doxyfile
495  src/clustal/Makefile
496  src/hhalign/Makefile
497  src/kmpp/Makefile
498  src/squid/Makefile)
499 AC_OUTPUT