File: configure.ac

package info (click to toggle)
probabel 0.5.0+dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 12,680 kB
  • sloc: cpp: 6,357; sh: 2,355; ansic: 1,676; makefile: 934; asm: 284; perl: 263; awk: 47
file content (226 lines) | stat: -rw-r--r-- 6,745 bytes parent folder | download
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.67])
AC_INIT(ProbABEL, 0.5.0, genabel-devel@r-forge.wu-wien.ac.at)
AM_INIT_AUTOMAKE([silent-rules subdir-objects])
AM_SILENT_RULES([yes])
AC_CONFIG_SRCDIR([src/mlinfo.h])
AC_CONFIG_HEADERS([src/config.h])

# Add the --disable-maintainer-mode option used by e.g. Debian and
# Gentoo to disable rebuilding the autotools-generated files after
# e.g. a patch has been applied to them. The default is 'disabled', we
# change it here to keep the old behaviour by default.
AM_MAINTAINER_MODE([enable])

# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LN_S


# Add an option to enable some default compiler options used during
# development
AC_ARG_ENABLE([dev-options],
    [AS_HELP_STRING([--enable-dev-options], [enable compile options
    for developers])],
    [devoptions=yes],
    [devoptions=no])

if test "x$devoptions" = "xyes"; then
   AC_MSG_NOTICE([Building with developer options enabled])
   if test -z "$CXXFLAGS"; then
      # User did not set CXXFLAGS, so we can put in our own defaults
      CXXFLAGS=""
   fi
   if test -z "$CPPFLAGS"; then
      # User did not set CPPFLAGS, so we can put in our own defaults
      CPPFLAGS="-Wall"
   fi
   CXXFLAGS+=" -g"
fi

if test "x$devoptions" = "xno"; then
   if test -z "$CXXFLAGS"; then
      # User did not set CXXFLAGS, so we can put in our own defaults
      CXXFLAGS="-O2"
   fi
   if test -z "$CPPFLAGS"; then
      # User did not set CPPFLAGS, so we can put in our own defaults
      CPPFLAGS+="-Wall -DNDEBUG"
   fi
fi

# If CXXFLAGS/CPPFLAGS are already set AC_PROG_CXX will not overwrite them
# with its own defaults
AC_PROG_CXX

# Tell the compiler to build not R version of filevector
AC_SUBST(CPPFLAGS, "$CPPFLAGS -D_NOT_R_FILEVECTOR")


# Since most of our code is in C++, set that language as the default
# for the subsequent checks
AC_LANG_PUSH([C++])

# Checks for libraries.

# Checks for header files.
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([float.h inttypes.h libintl.h limits.h stddef.h \
                          stdint.h stdlib.h string.h sys/param.h \
                          wchar.h wctype.h])

# Option that lets the user specify a path to the EIGEN include files.
AC_ARG_WITH([eigen-include-path],
    [AS_HELP_STRING([--with-eigen-include-path],
      [location of the Eigen headers, defaults to src/eigen-3.2.1])],
    [EIGEN_PATH=${withval}; EXTERNAL_EIGEN=yes],
    [EIGEN_PATH="src/eigen-3.2.1"])

# Inform AutoMake that an eigen path has been specified using the
# --with-eigen-include-dir option so that AutoMake doesn't prepend
# ${top_srcdir} to the path
AM_CONDITIONAL([EXTERNAL_EIGEN], test -n "$EXTERNAL_EIGEN")

AC_SUBST(EIGEN_PATH)

# Check for the EIGEN header files (make backup of CPPFLAGS first)
CPPFLAGS_BACKUP=${CPPFLAGS}
if test -z "$EXTERNAL_EIGEN"; then
  CPPFLAGS+=" -I${srcdir}/${EIGEN_PATH}"
else
  CPPFLAGS+=" -I${EIGEN_PATH}"
fi
AC_CHECK_HEADERS([Eigen/Dense Eigen/LU],
                 [],
                 [AC_MSG_ERROR([Could not find the Eigen header files. \
Did you specify --with-eigen-include-path correctly?])]
                 )
CPPFLAGS=${CPPFLAGS_BACKUP}


# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T

# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
# Disabled the next line to make cross compiling for Windows work.
#AC_FUNC_MALLOC
AC_CHECK_FUNCS([pow putenv sqrt strdup strncasecmp floor])
AC_FUNC_STRTOD

# Check if we can use large (>2GB) files on 32 bit platforms
AC_SYS_LARGEFILE
if test $ac_cv_sys_file_offset_bits != 'no'; then
    CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
fi
AC_FUNC_FSEEKO


# Check for presence of sed. Needed to replace path to /etc in probabel.pl
AC_PROG_SED

# Check for the presence of awk. Needed in the test suite
AC_PROG_AWK

# Check for presence of R
AC_CHECK_PROGS(R, R)
if test -z "$R"; then
  AC_MSG_NOTICE([R not found - Unable to do tests comparing ProbABEL output against R output])
fi
AM_CONDITIONAL([HAVE_R], test -n "$R")

# The user can disable building of the PDF of the manual, for example
# if the required LaTeX packages are not installed
AC_ARG_ENABLE([latex-doc],
    [AS_HELP_STRING([--disable-latex-doc], [disable building the PDF
    documentation from LaTeX source])],
    [latexdoc=no],
    [latexdoc=yes])

if test "x$latexdoc" = "xyes"; then
   AC_MSG_NOTICE([building of the PDF of the user manual from LaTeX source is enabled])
   # Check for presence of pdfLaTeX
   AC_CHECK_PROGS(PDFLATEX, pdflatex)
   if test -z "$PDFLATEX"; then
      AC_MSG_NOTICE([pdflatex not found - Unable to create PDF version of the user manual])
   fi
fi
AM_CONDITIONAL([HAVE_PDFLATEX], test -n "$PDFLATEX")
AM_CONDITIONAL([BUILD_latexdoc], test "x$latexdoc" = "xyes")


# Check for the presence of Doxygen
AC_CHECK_PROGS([DOXYGEN], doxygen)
if test -z "$DOXYGEN"; then
   AC_MSG_NOTICE([Doxygen not found - Not generating code documentation])
fi
AM_CONDITIONAL([HAVE_DOXYGEN],
               [test -n "$DOXYGEN"]) AM_COND_IF([HAVE_DOXYGEN],
               [AC_CONFIG_FILES([doc/Doxyfile])])


# Building of each of the three modules can be disabled on request
AC_ARG_ENABLE([palinear],
    [AS_HELP_STRING([--disable-palinear], [disable building the palinear program])],
    [palinear=no],
    [palinear=yes])

if test "x$palinear" = "xyes"; then
   AC_MSG_NOTICE([building of palinear is enabled])
fi
AM_CONDITIONAL([BUILD_palinear], test "x$palinear" = "xyes")

AC_ARG_ENABLE([palogist],
    [AS_HELP_STRING([--disable-palogist], [disable building the palogist program])],
    [palogist=no],
    [palogist=yes])

if test "x$palogist" = "xyes"; then
   AC_MSG_NOTICE([building of palogist is enabled])
fi

AM_CONDITIONAL([BUILD_palogist], test "x$palogist" = "xyes")

AC_ARG_ENABLE([pacoxph],
    [AS_HELP_STRING([--disable-pacoxph], [disable building the pacoxph program])],
    [pacoxph=no],
    [pacoxph=yes])

if test "x$pacoxph" = "xyes"; then
   AC_MSG_NOTICE([building of pacoxph is enabled])
fi

AM_CONDITIONAL([BUILD_pacoxph], test "x$pacoxph" = "xyes")


AC_ARG_ENABLE([extract-snp],
    [AS_HELP_STRING([--enable-extract-snp], [enable building the
    extract-snp program. NOTE: this program is not finished yet!])],
    [extractsnp=yes],
    [extractsnp=no])

if test "x$extractsnp" = "xyes"; then
   AC_MSG_NOTICE([building of extract-snp is enabled])
fi

AM_CONDITIONAL([BUILD_extractsnp], test "x$extractsnp" = "xyes")


# Files to be generated by autotools
AC_CONFIG_FILES([
        Makefile
        src/Makefile
        doc/Makefile
        examples/Makefile
        checks/Makefile
        checks/R-tests/Makefile
])

# Create output files
AC_OUTPUT