forked from jfarek/xatlas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
85 lines (73 loc) · 3.28 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
dnl If anyone wants to improve on this go right ahead
AC_INIT([xAtlas], 0.1)
AC_PREREQ([2.63])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CXX
dnl is there a good way to check for compiler c++11 support with vanilla autoconf?
CXXFLAGS='-Wall -O2 -std=c++11'
dnl Where is htslib
AC_ARG_WITH([htslib_include],
[AC_HELP_STRING([--with-htslib-include=DIR],
[HTSlib include directory])],
[CPPFLAGS="-I$withval $CPPFLAGS"])
AC_ARG_WITH([htslib_lib],
[AC_HELP_STRING([--with-htslib-lib=DIR],
[HTSlib library directory])],
[LDFLAGS="-L$withval $CPPFLAGS"])
AC_ARG_WITH([htslib],
[AC_HELP_STRING([--with-htslib=DIR],
[HTSlib installation directory])],
[
if test -z "$with_htslib_lib" -a -z "$with_htslib_include" ; then
CPPFLAGS="-I$withval/include $CPPFLAGS"
LDFLAGS="-L$withval/lib $LDFLAGS"
else
AC_MSG_FAILURE([Do not use --with-htslib and --with-htslib-include/--with-htslib-lib options simultaneously.])
fi
])
dnl Where is pthread
AC_ARG_WITH([pthread_include],
[AC_HELP_STRING([--with-pthread-include=DIR],
[pthread include directory])],
[CPPFLAGS="-I$withval $CPPFLAGS"])
AC_ARG_WITH([pthread_lib],
[AC_HELP_STRING([--with-pthread-lib=DIR],
[pthread library directory])],
[LDFLAGS="-L$withval $CPPFLAGS"])
AC_ARG_WITH([pthread],
[AC_HELP_STRING([--with-pthread=DIR],
[pthread installation directory])],
[
if test -z "$with_pthread_lib" -a -z "$with_pthread_include" ; then
CPPFLAGS="-I$withval/include $CPPFLAGS"
LDFLAGS="-L$withval/lib $LDFLAGS"
else
AC_MSG_FAILURE([Do not use --with-pthread and --with-pthread-include/--with-pthread-lib options simultaneously.])
fi
])
dnl Check zlib? htslib should already require this
dnl AC_CHECK_HEADER([zlib.h],
dnl [AC_SEARCH_LIBS([deflate], [z],
dnl [],
dnl [AC_MSG_ERROR([Failed to find zlib library])])],
dnl [AC_MSG_ERROR([Failed to find zlib headers])])
dnl Check htslib
AC_CHECK_HEADER([htslib/hts.h],
[AC_SEARCH_LIBS([hts_open], [hts],
[],
[AC_MSG_ERROR([Failed to find HTSLib library])])],
[AC_MSG_ERROR([Failed to find HTSLib headers])])
dnl Check pthread/pthread_barrier extension needed for -p option
AC_ARG_ENABLE([multithreading],
[AS_HELP_STRING([--enable-multithreading],
[enable multithreading (requires pthread_barrier)])])
AS_IF([test "x$enable_multithreading" = "xyes"], [
AC_CHECK_HEADER([pthread.h],
[AC_SEARCH_LIBS([pthread_create], [pthread],
[AC_SEARCH_LIBS([pthread_barrier_init], [pthread],
[AC_DEFINE([USE_PTHREAD])],
[AC_MSG_WARN([Failed to find function pthread_barrier_init, disabling xAtlas multithreading support])])],
[AC_MSG_WARN([Failed to find pthread library, disabling xAtlas multithreading support])])],
[AC_MSG_WARN([Failed to find pthread headers, disabling xAtlas multithreading support])])
])
AC_OUTPUT([Makefile])