-
Notifications
You must be signed in to change notification settings - Fork 21
/
configure.ac
199 lines (158 loc) · 5.54 KB
/
configure.ac
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
199
###
##
## AUTHORS
##
## Jeffrey E. Barrick <jeffrey.e.barrick@gmail.com>
## David B. Knoester
##
## LICENSE AND COPYRIGHT
##
## Copyright (c) 2010 Michigan State University
##
## breseq is free software; you can redistribute it and/or modify it under the terms the
## GNU General Public License as published by the Free Software Foundation; either
## version 1, or (at your option) any later version.
##
###
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
AC_INIT([breseq], [0.39.0], [jeffrey.e.barrick@gmail.com], [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([])
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
# 1) static linking to libz if command line option used
with_static_libz="$WITH_STATIC_LIBZ"
AC_ARG_WITH([static-libz],
[AS_HELP_STRING([--with-static-libz=<path>],
[Prefix to static install of libz. Directory that has lib and include within it.])],
[AS_IF([test -f "$with_static_libz/lib/libz.a"],
[AC_MSG_NOTICE([Static linking to libz.a located in "$with_static_libz/lib"])],
[AC_MSG_ERROR([Could not find libz.a library for static linking in: "$with_static_libz/lib"])])]
)
AS_IF([test -n "$with_static_libz"], [AC_SUBST([STATIC_LIBZ_LIB], "$with_static_libz/lib/libz.a" )])
AS_IF([test -n "$with_static_libz"], [AC_SUBST([STATIC_LIBZ_INC], "-I$with_static_libz/lib/include")])
# 2) dynamic linking to libz otherwise
AS_IF([test -z "$with_static_libz"], [
AC_SEARCH_LIBS([deflateSetHeader], [z], [], [AC_MSG_ERROR(["libz >=1.2.2.1 is required."])])
])
#Find libunwind
AC_ARG_WITH([libunwind],
AS_HELP_STRING([--without-libunwind], [Disable preferring to use libunwind for debug info]))
AS_IF([test "x$with_libunwind" != "xno"], [
AC_CHECK_HEADER(libunwind.h, FOUND_LIBUNWIND_H=1, FOUND_LIBUNWIND_H=0)
AC_SEARCH_LIBS([unw_getcontext], [unwind], FOUND_LIBUNWIND=1, FOUND_LIBUNWIND=0)
if [[ $FOUND_LIBUNWIND == 0 ]] && [[ $FOUND_LIBUNWIND_H == 1 ]]; then
AC_MSG_CHECKING([libunwind])
AC_MSG_CHECKING([for target architecture])
case x"$target" in
xNONE | x)
target_or_host="$host" ;;
*)
target_or_host="$target" ;;
esac
AC_MSG_RESULT([$target_or_host])
case "$target_or_host" in
i*86-*)
TARGET_PLATFORM="x86"
;;
x86_64-*)
TARGET_PLATFORM="x86_64"
;;
arm-*)
TARGET_PLATFORM="arm"
;;
esac
AC_SEARCH_LIBS([_UL${TARGET_PLATFORM}_step], [unwind], FOUND_LIBUNWIND=1, [])
if [[ $FOUND_LIBUNWIND == 1 ]]; then
UNWIND_LIBS="-lunwind-$TARGET_PLATFORM"
AC_SUBST(UNWIND_LIBS)
fi
fi
],
[
FOUND_LIBUNWIND_H=0
FOUND_LIBUNWIND=0
])
if [[ $FOUND_LIBUNWIND == 1 ]] && [[ $FOUND_LIBUNWIND_H == 1 ]]; then
AC_MSG_RESULT([Using libunwind.h for backtrace.])
AC_DEFINE([HAVE_LIBUNWIND],[1],[Lib unwind])
else
AC_MSG_RESULT([Using execinfo.h for backtrace.])
fi
# This code could be used to check for an existing samtools/libbam.a
# But unfortunately we have to compile them ourselves with a patch
#AC_CHECK_PROG([samtools],[samtools],[yes],[no])
#AM_CONDITIONAL([FOUND_SAMTOOLS], [test "x$samtools" = xyes])
#AM_COND_IF([FOUND_SAMTOOLS],,[AC_MSG_ERROR([required program 'samtools' not found.])])
#AC_SEARCH_LIBS([bam_fetch], [bam], [], [AC_MSG_ERROR(["libbam is required."])])
AC_SUBST([LIBZ], [extern/zlib-1.3.1])
AC_SUBST([HTSLIB], [extern/samtools-1.3.1/htslib-1.3.1])
AC_SUBST([LIBBAM], [extern/samtools-1.3.1])
AC_SUBST([BRESEQ], [src/c/breseq])
AC_SUBST([GDTOOLS], [src/c/gdtools])
AC_CHECK_FILE([.git/refs/heads/master],
AC_SUBST(HG_REVISION_STRING, [`eval head -n 1 .git/refs/heads/master | sed 's/^\(.\{12\}\).*/\1/'`]),
AC_SUBST(HG_REVISION_STRING, [])
)
AC_CHECK_FILE([.git/refs/heads/master],
AC_SUBST(HG_REVISION_PREFIX, "revision "),
AC_SUBST(HG_REVISION_PREFIX, [])
)
AC_DEFINE_UNQUOTED([HG_REVISION], ["${HG_REVISION_PREFIX}${HG_REVISION_STRING}"], [Defining HG 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([
extern/samtools-1.3.1/htslib-1.3.1/Makefile
extern/samtools-1.3.1/Makefile
src/c/breseq/Makefile
Makefile
])
AC_OUTPUT