-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
81 lines (67 loc) · 4.7 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT(aletsch, 1.1.2, shaomingfu@gmail.com)
AM_INIT_AUTOMAKE()
AC_CONFIG_SRCDIR([aletsch.cc])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_RANLIB
# Check environmental variables
#AS_IF([test "s$HTSLIB" = "s"],[AC_MSG_ERROR([*** Please set environment variable HTSLIB ***])])
#AS_IF([test "s$CLP_HOME" = "s"],[AC_MSG_ERROR([*** Please set environment variable CLP_HOME ***])])
#AS_IF([test "s$BOOST_HOME" = "s"],[AC_MSG_ERROR([*** Please set environment variable BOOST_HOME ***])])
# Check home directories for external libraries
AC_ARG_WITH(boost, AS_HELP_STRING([--with-boost], [home directory for boost]), BOOST_HOME=$withval, BOOST_HOME=)
AC_ARG_WITH(htslib, AS_HELP_STRING([--with-htslib], [home directory for htslib]), HTSLIB_HOME=$withval, HTSLIB_HOME=)
AC_ARG_WITH(zlib, AS_HELP_STRING([--with-zlib], [home directory for zlib]), ZLIB_HOME=$withval, ZLIB_HOME=)
AC_ARG_WITH(fortran, AS_HELP_STRING([--with-fortran], [home directory for fortran]), FORTRAN_HOME=$withval, FORTRAN_HOME=)
AC_ARG_WITH(clp, AS_HELP_STRING([--with-clp], [home directory for clp]), CLP_HOME=$withval, CLP_HOME=)
AC_ARG_WITH(lapack, AS_HELP_STRING([--with-lapack], [home directory for lapack]), LAPACK_HOME=$withval, LAPACK_HOME=)
# Check whether enable USECLP
AC_ARG_ENABLE([useclp], [AS_HELP_STRING([--enable-useclp], ["use LP to decompose unsplitable vertices"])])
AS_IF([test "x$enable_useclp" = "xyes"], [AC_SUBST([CXXFLAGS], ["-DUSECLP $CXXFLAGS"])])
#add -pg to debug
#AC_SUBST([CXXFLAGS], ["-pg $CXXFLAGS"])
# Assign CXXFLAGS
AS_IF([test "x$CLP_HOME" != "x"], [AC_SUBST([CXXFLAGS], ["-I$CLP_HOME/include/coin $CXXFLAGS"])], [])
AS_IF([test "x$BOOST_HOME" != "x"], [AC_SUBST([CXXFLAGS], ["-I$BOOST_HOME $CXXFLAGS"])], [])
AS_IF([test "x$HTSLIB_HOME" != "x"], [AC_SUBST([CXXFLAGS], ["-I$HTSLIB_HOME/include $CXXFLAGS"])], [])
# Check whether static is enabled
AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static], [enable static linking])])
# If statis is enabled, directly assign .a files to LIBS
#AS_IF([test "x$enable_static" = xyes], [AC_SUBST([LIBS], ["/usr/lib/gcc/x86_64-linux-gnu/4.8/libgfortran.a $LIBS"])])
AS_IF([test "x$enable_static" = xyes], AS_IF([test "x$FORTRAN_HOME" != "x"], [AC_SUBST([LIBS], ["$FORTRAN_HOME/libgfortran.a $LIBS"])]))
AS_IF([test "x$enable_static" = xyes], AS_IF([test "x$ZLIB_HOME" != "x"], [AC_SUBST([LIBS], ["$ZLIB_HOME/libz.a $LIBS"])]))
AS_IF([test "x$enable_static" = xyes], AS_IF([test "x$HTSLIB_HOME" != "x"], [AC_SUBST([LIBS], ["$HTSLIB_HOME/lib/libhts.a $LIBS"])]))
AS_IF([test "x$enable_static" = xyes], AS_IF([test "x$enable_useclp" = "xyes"], AS_IF([test "x$LAPACK_HOME" != "x"], [AC_SUBST([LIBS], ["$LAPACK_HOME/libtmglib.a $LIBS"])])))
AS_IF([test "x$enable_static" = xyes], AS_IF([test "x$enable_useclp" = "xyes"], AS_IF([test "x$LAPACK_HOME" != "x"], [AC_SUBST([LIBS], ["$LAPACK_HOME/librefblas.a $LIBS"])])))
AS_IF([test "x$enable_static" = xyes], AS_IF([test "x$enable_useclp" = "xyes"], AS_IF([test "x$LAPACK_HOME" != "x"], [AC_SUBST([LIBS], ["$LAPACK_HOME/liblapack.a $LIBS"])])))
AS_IF([test "x$enable_static" = xyes], AS_IF([test "x$enable_useclp" = "xyes"], AS_IF([test "x$CLP_HOME" != "x"], [AC_SUBST([LIBS], ["$CLP_HOME/lib/libCoinUtils.a $LIBS"])])))
AS_IF([test "x$enable_static" = xyes], AS_IF([test "x$enable_useclp" = "xyes"], AS_IF([test "x$CLP_HOME" != "x"], [AC_SUBST([LIBS], ["$CLP_HOME/lib/libClp.a $LIBS"])])))
# If static is NOT enabled, assign LDFLAGS and LIBS
AS_IF([test "x$enable_static" != xyes], AS_IF([test "x$HTSLIB_HOME" != "x"], [AC_SUBST([LDFLAGS], ["-L$HTSLIB_HOME/lib $LDFLAGS"])]))
AS_IF([test "x$enable_static" != xyes], AC_CHECK_LIB([hts], [hts_open], [], [AC_MSG_ERROR([could not find htslib])]))
AS_IF([test "x$enable_static" != xyes], AS_IF([test "x$enable_useclp" = "xyes"], AS_IF([test "x$CLP_HOME" != "x"], [AC_SUBST([LDFLAGS], ["-L$CLP_HOME/lib $LDFLAGS"])])))
AS_IF([test "x$enable_static" != xyes], AS_IF([test "x$enable_useclp" = "xyes"], AC_CHECK_LIB([Clp], [Clp_dual], [], [AC_MSG_ERROR([could not find libClp])])))
AS_IF([test "x$enable_static" != xyes], AS_IF([test "x$enable_useclp" = "xyes"], AC_CHECK_LIB([CoinUtils], [_Z9CoinIsnand], [], [AC_MSG_ERROR([could not find libCoinUtils])])))
# Checks for header files.
AC_CHECK_HEADERS([stdint.h])
# Checks for typedefs, structures, and compiler characteristics.
#AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT32_T
# Checks for library functions.
AC_CONFIG_FILES([Makefile
util/Makefile
gtf/Makefile
graph/Makefile
rnacore/Makefile
scallop/Makefile
bridge/Makefile
meta/Makefile])
AC_OUTPUT