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