1# Process this file with autoconf to produce the HMMER3 configure script.
2#
3# HMMER configures Easel in addition to itself, so this is
4# synchronized with Easel's configure script.  Saves having to do a
5# separate ./configure in Easel, but everything in Easel's configure
6# script must also appear here.
7#
8# reminders to save re-reading autoconf manual for the n'th time:
9#    output variables:
10#      -  defined here as normal shell variables, e.g. FOO="my string"
11#      -  made into output variables by calling AC_SUBST(FOO)
12#      -  @FOO@ in an output file is substituted
13#      -  output files assigned w/ AC_CONFIG_FILES; e.g. Makefile.in
14#
15#   C preprocessor symbols:
16#      -  defined here by calling AC_DEFINE(FOO) or AC_DEFINE(FOO, [42])
17#      -  #undef FOO in a config file becomes #define FOO or #define FOO 42
18#      -  config files assigned w/ AC_CONFIG_HEADERS; e.g. p7_config.h.in
19#
20#   shell variables:
21#      -  defined as usual, e.g. esl_var=no
22#      -  use within scope of the ./configure script
23#
24# Contents:
25#   1. autoconf requirements
26#   2. AC_INIT
27#   3. info on the package
28#   4. process ./configure command line
29#   5. checks for programs, including ${CC}, ${CFLAGS}
30#   6. checks for libraries
31#   7. checks for header files
32#   8. checks for types
33#   9. checks for structures
34#  10. checks for compiler characteristics
35#  11. checks for library functions
36#  12. checks for system services
37#  13. AC_CONFIG_FILES
38#  14. AC_OUTPUT
39#
40# This obeys "standard configure.ac layout" according to autoconf manual.
41#
42# To update config.guess and config.sub from GNU:
43#    wget -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
44#    wget -O config.sub   'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
45#
46# Use full 3-arg form of AC_DEFINE() macros. autoheader chokes if you
47# don't.  We don't use autoheader (we only use autoconf, out of the
48# GNU build tools, to limit complexity) but some packagers do, such
49# as Debian.
50
51
52
53################################################################
54# 1. autoconf requirements
55################################################################
56# Autoconf 2.61 (circa 2006) has a bug in AC_FUNC_FSEEKO; don't use it.
57# 2.63 was released in 2008.
58AC_PREREQ(2.63)
59
60# Our extra macros are with Easel, in easel/m4.
61# It's sort of standard to expect them in m4/, don't
62# be confused that they're down in easel.
63#
64m4_include([easel/m4/ax_gcc_func_attribute.m4])
65
66m4_include([easel/m4/esl_sse.m4])
67m4_include([easel/m4/esl_vmx.m4])
68
69m4_include([easel/m4/ax_mpi.m4])
70m4_include([easel/m4/ax_pthread.m4])
71
72m4_include([easel/m4/esl_pic_flags.m4])
73
74################################################################
75# 2. AC_INIT
76################################################################
77
78AC_INIT(HMMER, 3.3, sean@eddylab.org, hmmer)
79AC_MSG_NOTICE([Configuring HMMER3 for your system.])
80
81# remember if the user is overriding CFLAGS
82esl_cflags_env_set=no
83if test x"$CFLAGS" != x; then
84  esl_cflags_env_set=yes
85fi
86
87################################################################
88# 3. Info on the package
89################################################################
90#
91# AC_INIT args set these output variables and preprocessor symbols:
92#     PACKAGE_NAME      <package>     e.g. "HMMER"
93#     PACKAGE_VERSION   <version>     e.g. "3.2"
94#     PACKAGE_BUGREPORT <bug-report>  e.g. "sean@eddylab.org"
95#     PACKAGE_TARNAME   <tarname>     e.g. "hmmer"
96# From them, AC_INIT automatically derives one more:
97#     PACKAGE_STRING    <package> <version>, e.g. "HMMER 3.2"
98# and we define additional output variables of our own:
99#     HMMER_DATE        release date: e.g. "August 2017"
100#     HMMER_COPYRIGHT   one-line copyright string
101#     HMMER_LICENSE     one-line license string
102#     HMMER_VERSION     copy of version code, e.g. "3.2"
103#     HMMER_URL         URL home for HMMER.
104# And we have to define the relevant package variables for Easel as well.
105#
106# We avoid using AC_INIT's PACKAGE_ variables anywhere, because we want to be able
107# to use HMMER as a library inside other packages, with no name clashes.
108################################################################
109
110HMMER_DATE="Nov 2019"
111HMMER_COPYRIGHT="Copyright (C) 2019 Howard Hughes Medical Institute."
112HMMER_LICENSE="Freely distributed under the BSD open source license."
113HMMER_VERSION=$PACKAGE_VERSION
114HMMER_URL="http://hmmer.org/"
115
116HMMER_ESLDIR="easel"
117HMMER_SADIR="libdivsufsort"
118
119EASEL_DATE="Nov 2019"
120EASEL_COPYRIGHT="Copyright (C) 2019 Howard Hughes Medical Institute."
121EASEL_LICENSE="Freely distributed under the BSD open source license."
122EASEL_VERSION="0.46"
123EASEL_URL="http://bioeasel.org/"
124
125AC_SUBST(HMMER_DATE)
126AC_SUBST(HMMER_COPYRIGHT)
127AC_SUBST(HMMER_LICENSE)
128AC_SUBST(HMMER_VERSION)
129AC_SUBST(HMMER_URL)
130
131AC_SUBST(HMMER_ESLDIR)
132AC_SUBST(HMMER_SADIR)
133
134AC_SUBST(EASEL_DATE)
135AC_SUBST(EASEL_COPYRIGHT)
136AC_SUBST(EASEL_LICENSE)
137AC_SUBST(EASEL_VERSION)
138AC_SUBST(EASEL_URL)
139
140AC_DEFINE_UNQUOTED([HMMER_DATE],      ["$HMMER_DATE"],      [Release date])
141AC_DEFINE_UNQUOTED([HMMER_COPYRIGHT], ["$HMMER_COPYRIGHT"], [Brief copyright statement])
142AC_DEFINE_UNQUOTED([HMMER_LICENSE],   ["$HMMER_LICENSE"],   [Brief license statement])
143AC_DEFINE_UNQUOTED([HMMER_VERSION],   ["$HMMER_VERSION"],   [Version number])
144AC_DEFINE_UNQUOTED([HMMER_URL],       ["$HMMER_URL"],       [HMMER web site])
145
146AC_DEFINE_UNQUOTED([EASEL_DATE],      ["$EASEL_DATE"],      [Easel release date])
147AC_DEFINE_UNQUOTED([EASEL_COPYRIGHT], ["$EASEL_COPYRIGHT"], [Easel copyright])
148AC_DEFINE_UNQUOTED([EASEL_LICENSE],   ["$EASEL_LICENSE"],   [Easel license])
149AC_DEFINE_UNQUOTED([EASEL_VERSION],   ["$EASEL_VERSION"],   [Easel version])
150AC_DEFINE_UNQUOTED([EASEL_URL],       ["$EASEL_URL"],       [Easel web URL])
151
152
153# Figure out what host we're compiling on.
154# Three GNU scripts must be included in the distro:
155#       install.sh, config.guess, config.sub
156# This sets four shell variables:
157#       host            example: i686-pc-linux-gnu
158#       host_cpu        example: i686
159#       host_vendor     example: pc
160#       host_os         example: linux-gnu
161AC_CANONICAL_HOST
162
163
164
165
166################################################################
167# 4. Process the ./configure command line
168################################################################
169
170# --enable-debugging      - set basic debugging (level 0)
171# --enable-debugging=x    - set debugging level to <x> (1-3)
172#
173# At all levels, including 0, replaces CFLAGS w/ "-g -Wall" (so it assumes gcc).
174# Sets eslDEBUGLEVEL preprocessor symbol, which compiles in debugging support, to 0..3.
175#
176AC_ARG_ENABLE(debugging,
177  [
178    AS_HELP_STRING([--enable-debugging],[include debugging code])
179    AS_HELP_STRING([--enable-debugging=x],[also set diagnostics verbosity level to <x> (1-3)])
180  ],
181  enable_debugging=$enableval,
182  enable_debugging=no)
183
184case $enable_debugging in
185   yes)  AC_DEFINE(eslDEBUGLEVEL, 1, [debugging on (low verbosity)]);;
186     1)  AC_DEFINE(eslDEBUGLEVEL, 1, [debugging on (low verbosity)]);;
187     2)  AC_DEFINE(eslDEBUGLEVEL, 2, [debugging on (moderate verbosity)]);;
188     3)  AC_DEFINE(eslDEBUGLEVEL, 3, [debugging on (high verbosity)]);;
189    no)  AC_DEFINE(eslDEBUGLEVEL, 0, [debugging off]);;
190     *)  AC_MSG_ERROR([Unknown argument to --enable-debugging: $enable_debugging]);;
191esac
192
193
194AC_ARG_ENABLE(gcov,    [AS_HELP_STRING([--enable-gcov],    [compile for code coverage testing])],        enable_gcov=$enableval,    enable_gcov=no)
195AC_ARG_ENABLE(gprof,   [AS_HELP_STRING([--enable-gprof],   [compile for gcc code profiling])],           enable_gprof=$enableval,   enable_gprof=no)
196
197AC_ARG_ENABLE(sse,     [AS_HELP_STRING([--enable-sse],     [enable our SSE vector code])],               enable_sse=$enableval,     enable_sse=check)
198AC_ARG_ENABLE(vmx,     [AS_HELP_STRING([--enable-vmx],     [enable our Altivec/VMX vector code])],       enable_vmx=$enableval,     enable_vmx=check)
199
200AC_ARG_ENABLE(threads, [AS_HELP_STRING([--enable-threads], [enable POSIX threads parallelization])],     enable_threads=$enableval, enable_threads=check)
201AC_ARG_ENABLE(mpi,     [AS_HELP_STRING([--enable-mpi],     [enable MPI parallelization])],               enable_mpi=$enableval,     enable_mpi=no)
202
203AC_ARG_ENABLE(pic,     [AS_HELP_STRING([--enable-pic],     [enable position-independent code])],         enable_pic=$enableval,     enable_pic=no)
204
205AC_ARG_WITH(gsl,       [AS_HELP_STRING([--with-gsl],       [use the GSL, GNU Scientific Library])],      with_gsl=$withval,         with_gsl=no)
206
207
208
209
210# If a vector implementation is force-selected, make sure only one is,
211# and turn off checking for the others.
212vecsel=0
213if test "$enable_sse"     = "yes"; then vecsel=$((vecsel+1)); fi
214if test "$enable_vmx"     = "yes"; then vecsel=$((vecsel+1)); fi
215if   [[ $vecsel -gt 1 ]]; then
216  AC_MSG_ERROR([Select only one implementation: sse or vmx])
217elif [[ $vecsel -eq 1 ]]; then
218  if test "$enable_sse"   = "check"; then enable_sse="no";   fi
219  if test "$enable_vmx"   = "check"; then enable_vmx="no";   fi
220fi
221
222
223################################################################
224# 5. Checks for programs, including ${CC} and ${CFLAGS}.
225################################################################
226
227AC_PROG_CC
228AC_PROG_CC_STDC
229AC_PROG_CPP
230AC_PROG_INSTALL
231AC_PROG_RANLIB
232AC_PATH_PROG([AR], [ar], [:], [$PATH:/usr/ccs/bin:/usr/xpg4/bin])
233AC_PROG_LN_S
234
235# Select our default optimization flags in CFLAGS.
236#  --enable-gcov, --enable-gprof, and --enable-debugging are mutually exclusive.
237#
238if test "$enable_gcov" = "yes"; then
239   if test "$esl_cflags_env_set" = "yes"; then
240     AC_MSG_ERROR([--enable-gcov overrides CFLAGS, so don't set CFLAGS])
241   fi
242   CFLAGS="-g -Wall -fprofile-arcs -ftest-coverage"
243elif test "$enable_gprof" = "yes"; then
244   if test "$esl_cflags_env_set" = "yes"; then
245     AC_MSG_ERROR([--enable-gprof overrides CFLAGS, so don't set CFLAGS])
246   fi
247   CFLAGS="-O -g -pg"
248elif test "$enable_debugging" != "no"; then
249   if test "$GCC" = "yes"; then
250      CFLAGS="-g -Wall"
251   fi
252elif test "$esl_cflags_env_set" != "yes"; then
253   CFLAGS="-O3"
254fi
255
256
257
258# MPI parallelization.
259#   If MPI support is available, AX_MPI macro sets @MPICC@ and @MPILIBS@.
260#
261#   We set @CC@ to mpicc (TODO: may be better to use AX_PROG_CC_MPI)
262#      define HAVE_MPI for Easel,
263#      define HMMER_MPI for HMMER.
264#
265if test "$enable_mpi" = "yes"; then
266  AX_MPI([
267    CC=$MPICC
268    AC_DEFINE(HAVE_MPI, 1, [Use MPI parallelization])
269    AC_DEFINE(HMMER_MPI, 1, [Use MPI parallelization])
270    AC_SUBST([MPI_UTESTS], ["mpi_utest"])
271    AC_SUBST([MPI_BENCHMARKS], ["mpi_benchmark"])
272    ],
273    AC_MSG_ERROR([MPI library not found for --enable-mpi]))
274fi
275
276
277# PIC (position-independent code) for shared library support
278#
279if test "$enable_pic" = "yes"; then
280   ESL_PIC_FLAGS
281fi
282
283
284# Support for POSIX multithreading (we should generally have this)
285#
286if test "$enable_threads" != "no"; then
287  AX_PTHREAD([
288      AC_DEFINE(HAVE_PTHREAD, 1, [Use POSIX threads])
289      AC_DEFINE(HMMER_THREADS, 1, [Use POSIX threads])
290      AC_SUBST(PTHREAD_LIBS)
291      AC_SUBST(PTHREAD_CFLAGS)
292    ],[
293      if test "$enable_threads" = "yes"; then
294        AC_MSG_FAILURE([Unable to compile with POSIX multithreading.])
295      fi
296      enable_threads=no
297    ])
298fi
299
300
301
302
303# Support for vector implementations
304#
305# If we were explicitly told to enable one ($enable_foo="yes") and we
306# can't, fail with an error.
307#
308# If we're autodetecting ($enable_foo="check"), set $enable_foo to the
309# result ("yes" or "no").
310#
311# If vector support "foo" is enabled:
312#    - define preprocessor symbol eslENABLE_FOO (esl_config.h.in, p7_config.h.in)
313#    - set output variable FOO_CFLAGS, if needed (Makefile.in)
314#    - set shell variable $enable_foo to "yes"
315#    - set shell variable $impl_choice to "foo"
316# and if vector support is available (regardless of whether we
317# decide to enable it), the autoconf macros:
318#    - set shell variable $esl_have_foo to "yes"
319#    - set shell var $esl_foo_cflags to any necessary compiler flags
320#
321if test "$enable_vmx" = "yes" || test "$enable_vmx" = "check"; then
322  ESL_VMX([
323    AC_DEFINE(eslENABLE_VMX, 1, [Enable Altivec/VMX vector implementation])
324    AC_SUBST([HMMERIMPLLIB], ["impl_vmx/libhmmerimpl.a"])
325    VMX_CFLAGS=$esl_vmx_cflags
326    AC_SUBST(VMX_CFLAGS)
327    enable_vmx=yes
328    impl_choice=vmx
329    ],[
330    if test "$enable_vmx" = "yes"; then
331      AC_MSG_FAILURE([Unable to compile our Altivec/VMX implementations. Try another compiler?])
332    fi
333    enable_vmx=no
334    ])
335fi
336
337if test "$enable_sse" = "yes" || test "$enable_sse" = "check"; then
338  ESL_SSE([
339    AC_DEFINE(eslENABLE_SSE, 1, [Enable SSE vector implementation])
340    AC_SUBST([HMMERIMPLLIB], ["impl_sse/libhmmerimpl.a"])
341    SSE_CFLAGS=$esl_sse_cflags
342    AC_SUBST(SSE_CFLAGS)
343    enable_sse=yes
344    impl_choice=sse
345    ],[
346    if test "$enable_sse" = "yes"; then
347      AC_MSG_FAILURE([Unable to compile our SSE implementations. Try another compiler?])
348    fi
349    enable_sse=no
350    ])
351fi
352
353# If we didn't choose an implementation, die.
354case "$impl_choice" in
355sse)  AC_MSG_NOTICE([Activating Intel/AMD SSE vector DP implementation])
356      ;;
357vmx)  AC_MSG_NOTICE([Activating Altivec/VMX vector DP implementation])
358      ;;
359*)    AC_MSG_NOTICE([::::::::::--- no vector instruction set ---::::::::::])
360      AC_MSG_NOTICE([HMMER3 requires SSE or VMX vector instructions.])
361      AC_MSG_NOTICE([Supported platforms are x86 (Intel/AMD) and PowerPC.])
362      AC_MSG_ERROR([No supported vectorization found for your machine.])
363      ;;
364esac
365IMPL_CHOICE=$impl_choice
366AC_SUBST(IMPL_CHOICE)
367
368
369
370# Easel has additional vector implementations that HMMER3 does not
371# support. Provide blank config for those CFLAGS.
372AC_SUBST(SSE4_CFLAGS)
373AC_SUBST(AVX_CFLAGS)
374AC_SUBST(AVX512_CFLAGS)
375AC_SUBST(NEON_CFLAGS)
376
377
378# For x86 processors check if the flush to zero macro is available
379# in order to avoid the performance penalty dealing with sub-normal
380# values in the floating point calculations.
381if test "$impl_choice" = "sse"; then
382  AC_MSG_CHECKING([whether _MM_SET_FLUSH_ZERO_MODE is supported])
383  esl_save_cflags="$CFLAGS"
384  CFLAGS="$CFLAGS $SSE_CFLAGS"
385  AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include <xmmintrin.h>]],
386 				 [[_MM_SET_FLUSH_ZERO_MODE (_MM_FLUSH_ZERO_ON);
387				 ]])],
388	[ AC_MSG_RESULT([yes])
389          AC_DEFINE([HAVE_FLUSH_ZERO_MODE], 1, [Processor supports flush-to-zero mode])],
390	[ AC_MSG_RESULT([no])]
391  )
392  CFLAGS="$esl_save_cflags"
393fi
394
395# Check if the linker supports library groups for recursive libraries
396AS_IF([test "x$impl_choice" != xno],
397      [AC_MSG_CHECKING([compiler support --start-group])
398       LDFLAGS_save=$LDFLAGS
399       LDFLAGS="-Wl,--start-group -Wl,--end-group $LDFLAGS"
400       AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
401           [AC_MSG_RESULT([yes])
402            AC_SUBST([GROUPHMMERLIBS], ["-Wl,--start-group -lhmmer -lhmmerimpl -Wl,--end-group"])],
403           [AC_MSG_RESULT([no])
404            AC_SUBST([GROUPHMMERLIBS], ["-lhmmer -lhmmerimpl"])])
405       LDFLAGS=$LDFLAGS_save],
406      [AC_SUBST([GROUPHMMERLIBS], ["-lhmmer"])])
407
408# Define HAVE_GZIP if gzip is in $PATH (or if HAVE_GZIP is already set)
409AC_PATH_PROG(HAVE_GZIP, "gzip", "no")
410if test "${HAVE_GZIP}" = "no"; then
411  AC_MSG_WARN([gzip not found])
412else
413  AC_DEFINE(HAVE_GZIP, 1, [Support external gzip decompression])
414fi
415
416# We need python 3 for 'make check' and some dev tools. sqc checks
417# too, as does the Makefile, but we also check in ./configure, so we
418# don't recommend 'make check' to the user if they can't use it.
419#
420AC_CHECK_PROG(HAVE_PYTHON3, python3, yes)
421
422
423################################################################
424# 6. Checks for libraries
425#################################################################
426LIBGSL=
427AS_IF([test "x$with_gsl" != xno],
428      [AC_CHECK_LIB([gsl], [gsl_expm1],
429           [AC_SUBST([LIBGSL], ["-lgsl -lgslcblas"])
430            AC_DEFINE([HAVE_LIBGSL], [1], [Define if you have libgsl])
431           ],
432           [if test "x$with_gsl" != xcheck; then
433             AC_MSG_FAILURE(
434               [--with-gsl was given, but GSL library was not found])
435            fi
436           ],
437           [-lgslcblas]
438        )])
439
440# Easel stopwatch high-res timer may try to use clock_gettime,
441# which may be in librt
442AC_SEARCH_LIBS(clock_gettime, [rt posix4])
443
444
445################################################################
446# 7. Checks for headers
447#################################################################
448
449# Defines HAVE_SYS_TYPES_H, HAVE_STDINT_H, etc.
450AC_CHECK_HEADERS([ \
451  endian.h\
452  inttypes.h\
453  stdint.h\
454  unistd.h\
455  sys/types.h\
456  netinet/in.h
457])
458
459# Check for sysctl.h separately.  On OpenBSD, it requires
460# <sys/param.h> and autoconf needs special logic to deal w. this as
461# follows.
462AC_CHECK_HEADERS([sys/param.h])
463AC_CHECK_HEADERS([sys/sysctl.h], [], [],
464[[#ifdef HAVE_SYS_PARAM_H
465#include <sys/param.h>
466#endif
467]])
468
469
470# altivec.h requires the simd cflags
471# For reasons I don't understand, this needs to come after any other CHECK_HEADERS().
472if test "$impl_choice" = "vmx"; then
473   esl_save_CFLAGS="$CFLAGS"
474   esl_save_CPPFLAGS="$CPPFLAGS"
475   CFLAGS="$CFLAGS $VMX_CFLAGS"
476   CPPFLAGS="$CPPFLAGS $VMX_CFLAGS"
477   AC_CHECK_HEADERS([altivec.h])
478   CFLAGS="$esl_save_CFLAGS"
479   CPPFLAGS="$esl_save_CPPFLAGS"
480fi
481
482################################################################
483# 8. Checks for types
484#################################################################
485AC_TYPE_UINT8_T
486AC_TYPE_UINT16_T
487AC_TYPE_UINT32_T
488AC_TYPE_UINT64_T
489AC_TYPE_OFF_T
490
491
492################################################################
493# 9. Checks for structures - currently none
494################################################################
495
496
497################################################################
498# 10. Checks for compiler characteristics
499################################################################
500
501AC_C_BIGENDIAN([
502  AC_DEFINE(WORDS_BIGENDIAN, 1, [Set autoconf's default WORDS_BIGENDIAN flag])
503  ],[
504  if test "$enable_vmx" = "yes"; then
505    AC_MSG_NOTICE([::::::::::--- no vector instruction set ---::::::::::])
506    AC_MSG_NOTICE([HMMER3 Altivec/VMX only supports bigendian platforms: e.g. ppc64 not ppc64le])
507    AC_MSG_ERROR([No supported vectorization found for your machine.])
508  fi
509  ],[
510    AC_MSG_NOTICE([::::::::::--- no vector instruction set ---::::::::::])
511    AC_MSG_NOTICE([Couldn't determine byte order for your platform.])
512    AC_MSG_NOTICE([HMMER3 vector code is sensitive to byte order.])
513    AC_MSG_ERROR([No supported vectorization found for your machine.])
514  ])
515
516# __attribute__() tags on function declarations
517# HAVE_FUNC_ATTRIBUTE_NORETURN
518#
519#   The clang static analyzer can't figure out that some of our
520#   varargs-dependent fatal error handlers (esl_fatal(), for example)
521#   cannot return. To tell it so, we take advantage of __attribute__
522#   tags on function declarations, a non-ISO gcc extension, when
523#   available. gcc, clang, and other gcc-like compilers support this.
524#
525# This gets set in the Easel esl_config.h.
526#
527AX_GCC_FUNC_ATTRIBUTE(noreturn)
528
529# HAVE_FUNC_ATTRIBUTE_FORMAT
530#
531#   We have some printf()-style functions that use varargs.
532#   Apparently when you do something like
533#           int64_t bigint;
534#           my_printf("%d", bigint);
535#   a compiler can't normally detect the size mismatch between the
536#   specifier (%d) and the argument (bigint). Usually this isn't a
537#   problem (apparently most platforms cast appropriately) but we had
538#   problems on ARM. gcc-like compilers allow declaring an attribute
539#   of format(printf, <string_index>, <first-to-check>), enabling the
540#   compiler to typecheck printf()-like arguments, and warn appropriately.
541#   We only need or use this in development.
542#
543# This gets set in the Easel esl_config.h.
544AX_GCC_FUNC_ATTRIBUTE(format)
545
546
547
548################################################################
549# 11. Checks for functions, defining HAVE_FOO when foo is found
550################################################################
551
552AC_CHECK_FUNCS(mkstemp)
553AC_CHECK_FUNCS(popen)
554AC_CHECK_FUNCS(putenv)
555AC_CHECK_FUNCS(strcasecmp)
556AC_CHECK_FUNCS(strsep)
557AC_CHECK_FUNCS(times)
558AC_CHECK_FUNCS(getpid)
559AC_CHECK_FUNCS(sysctl)
560AC_CHECK_FUNCS(sysconf)
561AC_CHECK_FUNCS(getcwd)
562AC_CHECK_FUNCS(chmod)
563AC_CHECK_FUNCS(stat)
564AC_CHECK_FUNCS(fstat)
565AC_CHECK_FUNCS(erfc)
566
567AC_SEARCH_LIBS(ntohs,     socket)
568AC_SEARCH_LIBS(ntohl,     socket)
569AC_SEARCH_LIBS(htons,     socket)
570AC_SEARCH_LIBS(htonl,     socket)
571AC_SEARCH_LIBS(socket,    socket)
572AC_SEARCH_LIBS(inet_pton, nsl)
573
574AC_FUNC_FSEEKO
575
576
577#################################################################
578# 12. System services
579#################################################################
580AC_SYS_LARGEFILE
581
582
583
584################################################################
585# 13. Config subdirs and files
586################################################################
587
588# HMMER Makefiles.
589AC_CONFIG_FILES([ \
590  Makefile                                     \
591  src/Makefile                                 \
592  testsuite/Makefile                           \
593  profmark/Makefile                            \
594  src/impl_${impl_choice}/Makefile             \
595  documentation/Makefile                       \
596  documentation/man/Makefile                   \
597  documentation/userguide/Makefile             \
598  documentation/userguide/inclusions/Makefile  \
599  libdivsufsort/Makefile                       \
600  ])
601
602# Easel Makefiles.
603AC_CONFIG_FILES([ \
604  easel/Makefile                \
605  easel/miniapps/Makefile       \
606  easel/testsuite/Makefile      \
607  easel/documentation/Makefile  \
608  ])
609
610# Substitutions in Userguide .tex files
611# HMMER_VERSION, HMMER_DATE, HMMER_COPYRIGHT
612AC_CONFIG_FILES([ \
613  documentation/userguide/titlepage.tex  \
614  documentation/userguide/titlepage_daemon.tex  \
615  documentation/userguide/copyright.tex  \
616  ])
617
618# Substitutions in HMMER man pages:
619# HMMER_VERSION, HMMER_DATE, HMMER_COPYRIGHT, HMMER_LICENSE, HMMER_URL
620AC_CONFIG_FILES([ \
621  documentation/man/alimask.man     \
622  documentation/man/hmmalign.man    \
623  documentation/man/hmmbuild.man    \
624  documentation/man/hmmc2.man       \
625  documentation/man/hmmconvert.man  \
626  documentation/man/hmmemit.man     \
627  documentation/man/hmmer.man       \
628  documentation/man/hmmfetch.man    \
629  documentation/man/hmmlogo.man     \
630  documentation/man/hmmpgmd.man     \
631  documentation/man/hmmpgmd_shard.man     \
632  documentation/man/hmmpress.man    \
633  documentation/man/hmmscan.man     \
634  documentation/man/hmmsearch.man   \
635  documentation/man/hmmsim.man      \
636  documentation/man/hmmstat.man     \
637  documentation/man/jackhmmer.man   \
638  documentation/man/makehmmerdb.man \
639  documentation/man/nhmmer.man      \
640  documentation/man/nhmmscan.man    \
641  documentation/man/phmmer.man      \
642  ])
643
644# Substitutions in Easel man pages:
645# EASEL_VERSION, EASEL_DATE, EASEL_COPYRIGHT, EASEL_LICENSE, EASEL_URL
646AC_CONFIG_FILES([ \
647  easel/miniapps/esl-afetch.man      \
648  easel/miniapps/esl-alimanip.man    \
649  easel/miniapps/esl-alimap.man      \
650  easel/miniapps/esl-alimask.man     \
651  easel/miniapps/esl-alimerge.man    \
652  easel/miniapps/esl-alipid.man      \
653  easel/miniapps/esl-alirev.man      \
654  easel/miniapps/esl-alistat.man     \
655  easel/miniapps/esl-compalign.man   \
656  easel/miniapps/esl-compstruct.man  \
657  easel/miniapps/esl-construct.man   \
658  easel/miniapps/esl-histplot.man    \
659  easel/miniapps/esl-mask.man        \
660  easel/miniapps/esl-mixdchlet.man   \
661  easel/miniapps/esl-reformat.man    \
662  easel/miniapps/esl-selectn.man     \
663  easel/miniapps/esl-seqrange.man    \
664  easel/miniapps/esl-seqstat.man     \
665  easel/miniapps/esl-sfetch.man      \
666  easel/miniapps/esl-shuffle.man     \
667  easel/miniapps/esl-ssdraw.man      \
668  easel/miniapps/esl-translate.man   \
669  easel/miniapps/esl-weight.man      \
670 ])
671
672AC_CONFIG_HEADERS([easel/decoy_config.h])   # Put this first to keep gnu 'autoheader' from overwriting a real config file.
673AC_CONFIG_HEADERS([src/p7_config.h])
674AC_CONFIG_HEADERS([easel/esl_config.h])
675AC_CONFIG_HEADERS([libdivsufsort/divsufsort.h])
676
677# the following incantation establishes a symlink of
678# src/impl_{whatever} to src/impl in the *build* directory.
679# Testsuite sqc tests rely on it.
680AC_CONFIG_LINKS([src/impl:${ac_top_build_prefix}src/impl_${impl_choice}])
681
682
683
684################################################################
685# 14. AC_OUTPUT
686################################################################
687AC_OUTPUT
688
689echo "
690
691HMMER configuration:
692   compiler:             ${CC} ${CFLAGS} ${SSE_CFLAGS} ${VMX_CFLAGS} ${PTHREAD_CFLAGS} ${PIC_CFLAGS}
693   host:                 $host
694   linker:               ${LDFLAGS}
695   libraries:            ${LIBS} ${LIBGSL} ${PTHREAD_LIBS}
696   DP implementation:    ${impl_choice}"
697
698
699if test x"$HAVE_PYTHON3" = x"yes"; then echo "
700Now do 'make'  to build HMMER, and optionally:
701       'make check'  to run self tests,
702       'make install'  to install programs and man pages,
703       '(cd easel; make install)'  to install Easel tools.
704";
705else echo "
706   (No python3 found, so 'make check' is disabled.)
707
708Now do 'make'  to build HMMER, and optionally:
709       'make install'  to install programs and man pages,
710       '(cd easel; make install)'  to install Easel tools.
711";
712fi
713
714