1 # configure.ac for Clustal Omega
3 # RCS $Id: configure.ac 256 2011-06-23 13:57:28Z fabian $
8 #AC_INIT([Clustal Omega], [0.1.1], [clustalw@ucd.ie])
9 #PACKAGE_CODENAME="OppidumLeonis"
11 #AC_INIT([Clustal Omega], [0.2.0], [clustalw@ucd.ie])
12 #PACKAGE_CODENAME="IbiMeVidebunt"
14 #AC_INIT([Clustal Omega], [1.0.1], [clustalw@ucd.ie])
15 #PACKAGE_CODENAME="DeshilHollesEamus"
17 AC_INIT([Clustal Omega], [1.0.2], [clustalw@ucd.ie])
18 PACKAGE_CODENAME="DeshilHollesEamus"
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)
33 Welcome to $PACKAGE_NAME - version $PACKAGE_VERSION ($PACKAGE_CODENAME)
53 ,MMMMMMMMMMMMI MMMMMMMMMMMM8
54 ,MMMMMMMMMMMM8 MMMMMMMMMMMM8
55 ,MMMMMMMMMMMMN MMMMMMMMMMMM8
59 # Created with http://www.glassgiant.com/ascii/ and Wikipedia's Omega
60 # Replaced all dollars with S's.
64 # NMMMMMMMMMMMMMM+ SMMMM
65 # DMMMMMMMMMMMMMMMMMM, +MMMM
66 # MMMMMMMMM8ZSO8MMMMMMMM +MMMM
79 # MMMMMMMMMDOODMMMMMMMMM +MMMM
80 # MMMMMMMMMMMMMMMMMMMM +MMMM
81 # OMMMMMMMMMMMMMMZ SMMMM
86 # AC_MSG_NOTICE([Configuring for your system...])
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
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.
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
103 AM_CONFIG_HEADER(src/config.h)
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)
109 # This macro was introduced in Autoconf 2.60. If possible, enable
110 # extensions to C or Posix on hosts that normally disable the
112 AC_USE_SYSTEM_EXTENSIONS
115 # for cross compilation
118 ## AC_CANONICAL_BUILD
119 ## AC_CANONICAL_TARGET
121 # Set the @SET_MAKE@ variable=make if $(MAKE) not set
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
127 # Rendered obsolte by LT_INIT: AC_PROG_RANLIB
131 # AC_PROG_INSTALL will generate an install target so that users may
132 # just type 'make install' to install the software.
135 # check for C++ preprocessor and compiler and the library compiler
136 # (might change the compiler flags)
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
144 # Set output variable CPP to a command that runs the C preprocessor.
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
152 # Set CXXCPP to a command that runs the C++ preprocessor
155 # reset compiler flags to initial flags
156 #CXXFLAGS=$OLD_CXXFLAGS
161 # safety check: AC_CONFIG_SRCDIR([src/clustal.h])
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])
167 AC_DEFINE_UNQUOTED(PACKAGE_CODENAME, "$PACKAGE_CODENAME", [The package code name])
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])
175 #AC_DEFINE_UNQUOTED(SVN_VERSION, ["`svnversion -n`"], [repository svn version])
176 #`svnversion -n > saved_svn_version.txt`
182 # AW: we might need this in the future
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++
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++
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++
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++
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"
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"
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)
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"
248 # AM_CONDITIONAL(HAVE_GNU_LD, true)
249 # AM_CONDITIONAL(SOMEBSD, false)
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)
264 # Checks for standard header files.
265 # obsolescent according to http://www.gnu.org/software/hello/manual/autoconf/Particular-Headers.html
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 '<>'
271 # Checks for typedefs, structures, and compiler characteristics.
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?
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()]))
286 # --- argtable header and library check
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']))
295 # enable python if requested (--with-python)
297 #AC_ARG_WITH([python],
298 # [AS_HELP_STRING([--with-python],
299 # [Enable Python Interface])],
300 # [with_python=$withval],
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.")
308 # PYTHON_CFLAGS=`python-config --cflags`
309 # PYTHON_LDFLAGS=`python-config --ldflags`
310 # AC_DEFINE([PYTHON_ENABLED], [1], [define for python usage])
312 #AC_SUBST(PYTHON_CFLAGS)
313 #AC_SUBST(PYTHON_LDFLAGS)
317 # "One instruction to do the same operation on 4 packed elements simultaneously."
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
323 # AC_MSG_CHECKING(for SSE in current arch/CFLAGS)
326 # #include <xmmintrin.h>
327 # __m128 testfunc(float *a, float *b) {
328 # return _mm_add_ps(_mm_loadu_ps(a), _mm_loadu_ps(b));
331 # [has_sse=yes], [has_sse=no]
333 # AC_MSG_RESULT($has_sse)
335 # AC_ARG_ENABLE([sse],
336 # [AS_HELP_STRING([--enable-sse],
337 # [Enable SSE support])],
338 # [has_sse="$enableval"],
341 # if test x"$has_sse" = x"yes"; then
342 # AC_DEFINE([USE_SSE], , [Enable SSE support])
343 # CFLAGS="${CFLAGS} -msse"
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"],
356 AC_DEFINE([HAVE_OPENMP],[1],[Defined if OpenMP should and can be used])
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)
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)
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
382 # Might not just have to set compiler flags but create use squidconf.h.in
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:
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])
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)
396 AC_CHECK_FUNCS([stroul strtoull])
397 AC_CHECK_FUNCS([ftello fseeko])
398 AC_CHECK_FUNCS([ftello64 fseeko64])
399 AC_CHECK_FUNCS([ftell64 fseek64])
402 AC_CHECK_SIZEOF(fpos_t)
404 # struct stat64 and stat64 test:
406 #AC_CHECK_TYPE(struct stat64,
407 # [AC_CHECK_FUNC([stat64],
408 # AC_DEFINE([HAVE_STAT64], [1], [Define if you have the stat64 function]))])
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])
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
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)
428 # So forget about it: we won't use stat64 or define HAVE_STAT64 and
429 # consequently do no tests here
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.
439 # Check if svnversion is installed
440 #AC_PATH_PROG([SVNVERSION_BIN], [svnversionFIXME], [no])
441 ## checking if we build in a subversion WC
443 #if test "$SVNVERSION_BIN" != "no"; then
444 # SVNVERSION=`$SVNVERSION_BIN -n $srcdir`
445 # if test $SVNVERSION != "exported";
447 # AC_MSG_NOTICE($SVNVERSION);
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"],
462 AC_MSG_RESULT([$debugit])
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.
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"
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"
486 AC_SUBST([AM_CXXFLAGS])
487 AC_SUBST([AM_CFLAGS])
488 AC_SUBST([AM_LDFLAGS])
491 AC_CONFIG_FILES(Makefile