forked from TGAC/KAT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
132 lines (91 loc) · 3.79 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
AC_INIT([Kmer Analysis Toolkit (KAT)], [1.0.1], [[email protected]], [kat], [http://www.tgac.ac.uk])
AM_INIT_AUTOMAKE([1.11 -Wall no-define])
AC_CONFIG_MACRO_DIR([m4])
AC_LANG_CPLUSPLUS
# store current user given compiler flags to avoid default setup via AC_PROG_CXX
OLD_CXXFLAGS=$CXXFLAGS
# check for C++ preprocessor and compiler and the library compiler
# (might change the compiler flags)
AC_PROG_CXXCPP
AC_PROG_CXX
# reset compiler flags to initial flags
CXXFLAGS=$OLD_CXXFLAGS
AC_PROG_INSTALL
##########################################################################
# debug compilation support
##########################################################################
AC_MSG_CHECKING([whether to build with debug information])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[enable debug data generation (def=no)])],
[debugit="$enableval"],
[debugit=no])
AC_MSG_RESULT([$debugit])
if test x"$debugit" = x"yes"; then
AC_DEFINE([DEBUG],[],[Debug Mode])
AM_CXXFLAGS="$AM_CXXFLAGS -g -Wno-uninitialized -O0"
else
AC_DEFINE([NDEBUG],[],[No-debug Mode])
AM_CXXFLAGS="$AM_CXXFLAGS -O3"
fi
##########################################################################
######################################################################
# DOXYGEN SUPPORT
######################################################################
DX_HTML_FEATURE(ON)
DX_CHM_FEATURE(OFF)
DX_CHI_FEATURE(OFF)
DX_MAN_FEATURE(ON)
DX_RTF_FEATURE(OFF)
DX_XML_FEATURE(OFF)
DX_PDF_FEATURE(ON)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN([$PACKAGE_NAME],[doxygen.cfg])
######################################################################
######################################################################
# Configure External Libraries
######################################################################
# Allow users to specify custom directories for jellyfish, boost and seqan
seqan_dir=":"
boost_dir=":"
doxygen_dir=":"
PKG_CHECK_MODULES([JELLYFISH], [jellyfish-1.1 >= 1.1.10])
AC_ARG_WITH(seqan,
[ --with-seqan=LIB_DIR seqan root directory is here. ],
[ seqan_dir=$withval], [ seqan_dir=":"])
AC_ARG_WITH(boost,
[ --with-boost=LIB_DIR boost root directory is here... (boost is only required for running unit tests) ],
[ boost_dir=$withval], [ boost_dir=":"])
AC_ARG_WITH(doxygen,
[ --with-doxygen=LIB_DIR doxygen root directory is here... (doxygen is only required for generating source code documentation) ],
[ doxygen_dir=$withval], [ doxygen_dir=":"])
# Modify environment variables as appropriate
if test "${boost_dir}" != ":"; then
CPPFLAGS="$CPPFLAGS -I${boost_dir}/include"
LIBS="$LIBS ${boost_dir}/lib/libboost_unit_test_framework.so"
fi
if test "${seqan_dir}" != ":"; then
CPPFLAGS="$CPPFLAGS -I${seqan_dir}/include"
fi
if test "${doxygen_dir}" != ":"; then
PATH="$PATH ${doxygen_dir}/bin"
fi
# Only jellyfish and seqan are required. boost is only used for unit testing
# if the tests fail it's not the end of the world, and doxygen is only required
# for generating source code documentation.
AC_CHECK_HEADER([seqan/sequence.h], [], [
echo "Seqan is required to compile and run KAT. Please make sure seqan is installed on your system."
echo "If seqan is installed but the headers are not currently available through the CPPFLAGS environment"
echo "variable then please re-run \"./configure\" with the \"--with-seqan\" argument to specify the root"
echo "directory of your seqan installation"
exit -1],
[])
# distribute the changed variables among the Makefiles
AC_SUBST([JELLYFISH_CFLAGS])
AC_SUBST([JELLYFISH_LIBS])
AC_SUBST([LIBS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile])
AC_OUTPUT