-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathconfigure.in
88 lines (71 loc) · 2.6 KB
/
configure.in
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT([corset], [1.09], [<[email protected]>])
CXXFLAGS="-O3 -ffast-math -I./ $CXXFLAGS $CPPFLAGS"
AC_PROG_CXX()
AC_LANG(C++)
AC_PROG_MAKE_SET
AC_ARG_WITH(bam-lib, [ --with-bam_lib
specify the directory where the samtools libraries can be found])
AC_ARG_WITH(bam-inc, [ --with-bam_inc
specify the directory where the samtools headers can be found])
AC_ARG_WITH(htslib-dir, [ --with-htslib_dir
specify the directory where the htslib headers and library can be found (default is <samtools directory>/htslib-*.*) ])
SAMTOOLS_INC_DIR=$with_bam_inc
if test "$SAMTOOLS_INC_DIR" != ""
then
CXXFLAGS="-I$SAMTOOLS_INC_DIR $CXXFLAGS"
fi
HTSLIB_DIR=`echo $SAMTOOLS_INC_DIR/htslib-*.*`
if test "$with_htslib_dir" != ""
then
HTSLIB_DIR=$with_htslib_dir
fi
#fix because the static library doens't play nicely in mac OS X.
AC_CHECK_FILE( [$HTSLIB_DIR/libhts.a], [
LIBS="$LIBS $HTSLIB_DIR/libhts.a" &&
CXXFLAGS="-I$HTSLIB_DIR $CXXFLAGS" ] )
SAMTOOLS_LIB_DIR=$SAMTOOLS_INC_DIR
if test "$with_bam_lib" != ""
then
SAMTOOLS_LIB_DIR=$with_bam_lib
fi
LDFLAGS="-L$SAMTOOLS_LIB_DIR $LDFLAGS"
LD_RUN_PATH="$SAMTOOLS_LIB_DIR:$LD_RUN_PATH"
#Checks for samtools libraries and header files
AC_CHECK_HEADERS([bam.h sam.h], [], [
echo "" &&
echo "ERROR: Could not find the samtools headers." &&
echo " Please specify the location with: " &&
echo " './configure --with-bam_inc=<directory containing sam.h, bam.h etc.> " &&
exit -1
])
AC_CHECK_LIB([z], [main], [], [
echo "" &&
echo "ERROR: Could not find the samtools library, libbam." &&
echo " Please specify the location with: " &&
echo " './configure --with-bam_lib=<directory containing bam library> " &&
exit -1
])
AC_CHECK_LIB([bam], [main], [], [
echo "" &&
echo "ERROR: Could not find the samtools library, libbam." &&
echo " Please specify the location with: " &&
echo " './configure --with-bam_lib=<directory containing bam library> " &&
exit -1
])
AC_CHECK_LIB([lzma], [main], [], [])
AC_CHECK_LIB([curl], [main], [], [])
AC_CHECK_LIB([bz2], [main], [], [])
#AC_CHECK_LIB([pthread], [main], [], [])
AC_CONFIG_FILES([Makefile])
my_save_cflags="$CXXFLAGS"
CXXFLAGS=-std=c++0x
AC_MSG_CHECKING([whether compiler supports -std=c++0x])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],[
my_save_cflags="$my_save_cflags -std=c++0x -DUNORDEREDMAP"],
[AC_MSG_RESULT([no])]
)
CXXFLAGS="$my_save_cflags"
AC_SUBST(LD_RUN_PATH,$LD_RUN_PATH)
AC_OUTPUT