-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathconfigure.ac
More file actions
198 lines (163 loc) · 7.02 KB
/
Copy pathconfigure.ac
File metadata and controls
198 lines (163 loc) · 7.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
###
##
## AUTHORS
##
## Jeffrey E. Barrick <jeffrey.e.barrick@gmail.com> and other contributors
##
## LICENSE AND COPYRIGHT
##
## Copyright (c) 2008-2010 Michigan State University
## Copyright (c) 2011-2025 The University of Texas at Austin
## Copyright (c) 2025- Michigan State University
##
## breseq is free software; you can redistribute it and/or modify it under the
## terms of the GNU General Public License as published by the Free Software
## Foundation; either version 2, or (at your option) any later version.
##
## SPDX-License-Identifier: GPL-2.0-or-later
##
###
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
AC_INIT([breseq], [0.50.0], [https://github.com/barricklab/breseq/issues], [breseq], [http://barricklab.org/breseq])
AC_CONFIG_AUX_DIR(aux_build)
AC_CONFIG_MACRO_DIR([aux_build/m4])
AC_CONFIG_HEADERS([aux_build/config.h])
AC_CONFIG_SRCDIR([])
AC_PREFIX_DEFAULT([$prefix])
LT_INIT
AM_INIT_AUTOMAKE([subdir-objects])
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_MKDIR_P
AX_COMPUTE_RELATIVE_PATHS([bindir:datadir:bin_to_data])
AC_MSG_NOTICE([Local path from bin to data...])
AC_MSG_NOTICE([$bin_to_data])
AC_SUBST([BIN_TO_DATA_RELATIVE_PATH], [$bin_to_data])
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h netdb.h stddef.h stdint.h stdlib.h string.h sys/socket.h unistd.h wchar.h])
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_FUNC_FSEEKO
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([bzero gethostbyaddr gethostbyname memmove memset pow select socket sqrt strchr strdup strerror strstr strtol ftello])
#AC_SEARCH_LIBS([wclear], [curses ncurses], [],
# [AC_MSG_ERROR(["lib(n)curses is required."])])
AC_SEARCH_LIBS([acosf], [m], [], [AC_MSG_ERROR(["libm is required."])])
AC_SEARCH_LIBS([pthread_create], [pthread], [], [AC_MSG_ERROR(["libpthread is required."])])
#### libz
# Dynamic linking to libz (bioconda install) — verify at ${prefix}/lib and set
# LIBZ_LINK/STATIC_LIBZ_INC. (binarydist.sh links statically against its own
# universal build of zlib by passing -I/-L paths and LIBS directly to
# ./configure, ahead of these -lfoo flags resolving against ${prefix}/lib.)
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L${prefix}/lib"
AC_CHECK_LIB([z], [deflateSetHeader], [],
[AC_MSG_ERROR([libz >=1.2.2.1 not found at ${prefix}/lib. Install zlib or set --prefix=\$CONDA_PREFIX])])
LDFLAGS="$save_LDFLAGS"
AC_SUBST([LIBZ_LINK], ["-lz"])
AC_SUBST([STATIC_LIBZ_INC], [""])
#### miniz (required for --zip-html evidence ZIP archive support)
# Dynamic linking to libminiz (bioconda install) — verify at ${prefix} and set
# MINIZ_LINK/MINIZ_INC. (binarydist.sh links statically against its own
# universal build of miniz by passing -I/-L paths and LIBS directly to
# ./configure, ahead of these -lfoo flags resolving against ${prefix}/lib.)
save_CPPFLAGS="$CPPFLAGS"
save_LDFLAGS="$LDFLAGS"
CPPFLAGS="$CPPFLAGS -I${prefix}/include"
LDFLAGS="$LDFLAGS -L${prefix}/lib"
AC_CHECK_HEADER([miniz/miniz.h], [],
[AC_MSG_ERROR([miniz/miniz.h not found at ${prefix}/include. Install: conda install -c conda-forge miniz and configure with --prefix=\$CONDA_PREFIX])])
AC_CHECK_LIB([miniz], [mz_zip_writer_init_file], [],
[AC_MSG_ERROR([libminiz not found at ${prefix}/lib. Install: conda install -c conda-forge miniz and configure with --prefix=\$CONDA_PREFIX])])
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
AC_SUBST([MINIZ_INC], [""])
AC_SUBST([MINIZ_LINK], ["-lminiz"])
# On Linux, export symbols so dladdr() can resolve names from the main binary
case "$host_os" in
darwin*) ;;
*) LDFLAGS="$LDFLAGS -rdynamic" ;;
esac
#### htslib (required for BAM/SAM reading and pileup)
# Dynamic linking to libhts (bioconda install) — verify at ${prefix} and set
# HTSLIB_LINK/HTSLIB_INC. (binarydist.sh links statically against its own
# universal build of htslib by passing -I/-L paths and LIBS directly to
# ./configure, ahead of these -lfoo flags resolving against ${prefix}/lib.)
save_CPPFLAGS="$CPPFLAGS"
save_LDFLAGS="$LDFLAGS"
save_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS -I${prefix}/include"
LDFLAGS="$LDFLAGS -L${prefix}/lib"
# $CRAM_CODEC_LIBS (set by binarydist.sh to full .a paths for bzip2/xz) must be
# present for this link check when statically linking: libhts.a has undefined
# CRAM-codec symbols that only those archives resolve, and AC_CHECK_LIB's probe
# program needs to link cleanly to detect -lhts. Dynamic/conda builds leave it
# unset, so this is a no-op there (libhts.so resolves its own dependencies).
LIBS="$LIBS $CRAM_CODEC_LIBS"
AC_CHECK_HEADER([htslib/sam.h], [],
[AC_MSG_ERROR([htslib/sam.h not found at ${prefix}/include. Install: conda install -c bioconda htslib and configure with --prefix=\$CONDA_PREFIX])])
AC_CHECK_LIB([hts], [hts_open], [],
[AC_MSG_ERROR([libhts not found at ${prefix}/lib. Install: conda install -c bioconda htslib and configure with --prefix=\$CONDA_PREFIX])])
# Check whether this htslib version has sam_hdr_destroy (added in 1.10)
LIBS="$LIBS -lhts"
AC_CHECK_FUNC([sam_hdr_destroy],
[AC_DEFINE([HAVE_SAM_HDR_DESTROY], [1], [htslib has sam_hdr_destroy (>= 1.10)])])
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
LIBS="$save_LIBS"
AC_SUBST([HTSLIB_INC], [""])
AC_SUBST([HTSLIB_LINK], ["-lhts"])
# Lets binarydist.sh hand the final breseq/gdtools program links full .a paths
# to htslib's CRAM-codec dependencies (bzip2/xz) — e.g.
# ./configure CRAM_CODEC_LIBS="/path/to/libbz2.a /path/to/liblzma.a". Routed
# through breseq_LDADD/gdtools_LDADD (not the global LIBS) so libtool doesn't
# also see these static archives while linking the libbreseq.la convenience
# library and emit "Linking the shared library ... against the static
# library ... is not portable" warnings; conda/dynamic builds leave it unset.
AC_ARG_VAR([CRAM_CODEC_LIBS], [Static libraries (e.g. full paths to libbz2.a and liblzma.a) to append to the breseq/gdtools link, after libhts, for CRAM codec support])
AC_SUBST([LIBZ], [extern/zlib-1.3.1])
AC_SUBST([BRESEQ], [src/c/breseq])
AC_SUBST([GDTOOLS], [src/c/gdtools])
AC_CHECK_FILE([.git/refs/heads/master],
AC_SUBST(GITHUB_REVISION_HASH, [`eval head -n 1 .git/refs/heads/master | sed 's/^\(.\{12\}\).*/\1/'`]),
AC_SUBST(GITHUB_REVISION_HASH, [])
)
AC_CHECK_FILE([.git/refs/heads/master],
AC_SUBST(GITHUB_REVISION_PREFIX, "revision "),
AC_SUBST(GITHUB_REVISION_PREFIX, [])
)
AC_DEFINE_UNQUOTED([GITHUB_REVISION_STRING], ["${GITHUB_REVISION_PREFIX}${GITHUB_REVISION_HASH}"], [Defining GitHub repository version])
AC_CANONICAL_HOST
# Check for which host we are on and setup a few things
# specifically based on the host
case $host_os in
cygwin* )
AC_MSG_NOTICE([Detected host 'cygwin'.])
AC_SUBST(SAMTOOLS_ADDITIONAL_CFLAGS, ["-Dexpl=exp -Dlogl=log"])
;;
darwin* )
AC_MSG_NOTICE([Detected host 'darwin'.])
;;
esac
AC_CONFIG_FILES([
src/c/breseq/Makefile
Makefile
])
AC_OUTPUT