1# This file is part of Autoconf.                       -*- Autoconf -*-
2
3# ViennaRNA Package 2011 Ronny Lorenz
4#
5
6
7##----------------##
8## Public macros. ##
9##----------------##
10
11AC_DEFUN([AC_RNA_INIT],[
12
13AX_COMPILER_VENDOR
14AC_CANONICAL_HOST
15
16AC_ARG_VAR([PERL],[The perl interpreter])
17AC_PATH_PROGS([PERL],[$PERL perl],[no])
18AS_IF([test "$PERL" == "no"],[
19  AC_MSG_ERROR([Perl is required to install and run the ViennaRNA Package])
20])
21
22##--------------------------##
23## Additional Compile Flags ##
24##--------------------------##
25
26AC_LANG_PUSH([C])
27AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing], [
28  AX_APPEND_FLAG(["-fno-strict-aliasing"], [RNA_CFLAGS])
29],[],[],[])
30AC_LANG_POP([C])
31
32AC_LANG_PUSH([C++])
33AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing], [
34  AX_APPEND_FLAG(["-fno-strict-aliasing"], [RNA_CXXFLAGS])
35],[],[],[])
36AC_LANG_POP([C++])
37
38AX_CHECK_LINK_FLAG([-fno-strict-aliasing], [
39  AX_APPEND_FLAG(["-fno-strict-aliasing"], [RNA_LDFLAGS])
40], [],[], [])
41
42##------------------##
43## Enable Features  ##
44##------------------##
45
46RNA_ENABLE_C11
47RNA_ENABLE_OSX
48RNA_ENABLE_LTO
49RNA_ENABLE_SVM
50RNA_ENABLE_JSON
51RNA_ENABLE_GSL
52RNA_ENABLE_OPENMP
53RNA_ENABLE_PTHREADS
54RNA_ENABLE_BOUSTROPHEDON
55RNA_ENABLE_NR_SAMPLE_HASH
56RNA_ENABLE_FLOATPF
57RNA_ENABLE_DEPRECATION_WARNINGS
58RNA_ENABLE_COLORED_TTY
59RNA_ENABLE_STATIC_BIN
60RNA_ENABLE_SIMD
61RNA_ENABLE_VECTORIZE
62RNA_ENABLE_MPFR
63
64## Set post conditions for feature
65## settings
66
67RNA_FEATURE_POST
68
69##--------------------##
70## Enable scripting   ##
71## language interface ##
72##--------------------##
73
74RNA_ENABLE_SWIG_INTERFACES
75
76##------------------##
77## Enable Reference ##
78## Manual           ##
79##------------------##
80
81RNA_ENABLE_DOXYGEN_REFMAN([RNAlib])
82
83##--------------------##
84## Enable Tutorial    ##
85##--------------------##
86RNA_ENABLE_TUTORIAL([tutorial])
87
88##--------------------##
89## Enable Unit tests  ##
90##--------------------##
91RNA_ENABLE_UNIT_TESTS
92
93##----------------------------------##
94## Check general build dependencies ##
95##----------------------------------##
96RNA_CHECK_BUILD_REQUIREMENTS
97
98##--------------------##
99## Enable Subpackages ##
100##--------------------##
101
102RNA_ENABLE_PKG_KINFOLD
103RNA_ENABLE_PKG_FORESTER
104RNA_ENABLE_PKG_CLUSTER
105RNA_ENABLE_PKG_KINWALKER
106RNA_ENABLE_PKG_RNALOCMIN
107
108##--------------------##
109## Prepare Version    ##
110## Macros             ##
111##--------------------##
112VRNA_VERSION_MAJOR=vrna_version_major
113VRNA_VERSION_MINOR=vrna_version_minor
114VRNA_VERSION_PATCH=vrna_version_patch
115
116AC_SUBST(VRNA_VERSION_MAJOR)
117AC_SUBST(VRNA_VERSION_MINOR)
118AC_SUBST(VRNA_VERSION_PATCH)
119
120##------------------##
121## Prepare files    ##
122##------------------##
123
124AC_CONFIG_FILES([src/ViennaRNA/vrna_config.h])
125AC_CONFIG_FILES([misc/Makefile])
126AC_CONFIG_FILES([interfaces/Makefile])
127AC_CONFIG_FILES([Makefile RNAlib2.pc])
128AC_CONFIG_FILES([src/Utils/Makefile src/bin/Makefile src/Makefile src/ViennaRNA/Makefile])
129AC_CONFIG_FILES([src/ViennaRNA/static/Makefile])
130AC_CONFIG_FILES([man/Makefile doc/Makefile RNA-Tutorial/Makefile])
131AC_CONFIG_FILES([man/cmdlopt.sh],[chmod +x man/cmdlopt.sh])
132AC_CONFIG_FILES([examples/Makefile])
133AC_CONFIG_FILES([packaging/viennarna.spec packaging/PKGBUILD])
134AC_CONFIG_FILES([packaging/win_installer_archlinux_i686.nsi packaging/win_installer_archlinux_x86_64.nsi])
135AC_CONFIG_FILES([packaging/win_installer_fedora_i686.nsi packaging/win_installer_fedora_x86_64.nsi])
136
137])
138
139AC_DEFUN([AC_RNA_NOTICE],[
140
141# get directory paths
142
143eval _bindir=$(eval printf "%s" $bindir)
144eval _libdir=$(eval printf "%s" $libdir)
145eval _includedir=$(eval printf "%s" $includedir)
146eval _datadir=$(eval printf "%s" $datadir)
147eval _mandir=$(eval printf "%s" $mandir)
148
149AS_IF([test $with_perl = "yes"],[
150  eval _perl_arch_dir=$(eval printf "%s" "$prefix" ${PERL_ARCH_RELATIVE_INSTALL_DIR})
151  eval _perl_lib_dir=$(eval printf "%s" "$prefix" ${PERL_LIB_RELATIVE_INSTALL_DIR})
152  ], [
153  _perl_arch_dir=""
154  _perl_lib_dir=""
155  _perl_install="Not to be installed"
156])
157AS_IF([test $with_python = "yes"],[
158  eval _python2_arch_dir=$(eval printf "%s" ${py2execdir})
159  eval _python2_lib_dir=$(eval printf "%s" ${python2dir})
160  ],[
161    _python2_arch_dir=""
162    _python2_lib_dir=""
163    _python2_install="Not to be installed $python2_enabled_but_failed"
164])
165AS_IF([test $with_python3 = "yes"],[
166  eval _python3_arch_dir=$(eval printf "%s" ${py3execdir})
167  eval _python3_lib_dir=$(eval printf "%s" ${python3dir})
168  ],[
169    _python3_arch_dir=""
170    _python3_lib_dir=""
171    _python3_install="Not to be installed $python3_enabled_but_failed"
172])
173AS_IF([test "x$enable_universal_binary" != "xno"],[
174  _osx_arch=$osx_arch
175  ],[
176  osx_arch="no"
177])
178
179AS_IF([test "x$with_doc" != "xno"],[
180  eval _docdir=$(eval printf "%s" $docdir)
181  AS_IF([test "x$with_doc_html" != "xno"],[
182    eval _htmldir=$(eval printf "%s" $htmldir)],[
183    _htmldir=""
184    ])
185  AS_IF([test "x$with_doc_pdf" != "xno"],[
186    eval _pdfdir=$(eval printf "%s" $pdfdir)
187    eval _pdfdir2=$(eval printf "%s" $_pdfdir)],[
188    _pdfdir=""
189  ])
190  ],[
191  _docdir="Not to be installed"
192])
193
194AS_IF([test "x$with_tutorial" != "xno"],[
195  eval _pdfdir=$(eval printf "%s" $pdfdir)],[
196  _pdfdir=""
197])
198
199
200AS_IF([test "x$ac_rna_warning" != "x"],[
201  ac_rna_warning="
202==================================================
203Warning:
204$ac_rna_warning
205==================================================
206"
207])
208
209
210m4_map_args([ AC_RNA_COLOR_RESULT_PACKAGE],
211            [kinfold],
212            [forester],
213            [cluster],
214            [rnalocmin],
215            [kinwalker],
216            [svm],
217            [gsl],
218            [json],
219            [perl],
220            [python],
221            [python3],
222            [doc_pdf],
223            [doc_html],
224            [tutorial_pdf],
225            [tutorial_html],
226            [check])
227
228m4_map_args([ AC_RNA_COLOR_RESULT_FEATURE],
229            [mpfr],
230            [boustrophedon],
231            [NRhash],
232            [c11],
233            [tty_colors],
234            [floatpf],
235            [warn_deprecated],
236            [vectorize],
237            [simd],
238            [lto],
239            [pthreads],
240            [openmp],
241            [unittests],
242            [check_perl],
243            [check_python],
244            [check_python3],
245            [macosx_installer],
246            [macosx_sdk])
247
248m4_map_args([ AC_RNA_COLOR_RESULT_SIMPLE],
249            [osx_arch],
250            [_bindir],
251            [_libdir],
252            [_includedir],
253            [_mandir],
254            [_datadir],
255            [_docdir],
256            [_htmldir],
257            [_pdfdir2],
258            [_perl_install],
259            [_perl_arch_dir],
260            [_perl_lib_dir],
261            [_python2_install],
262            [_python2_arch_dir],
263            [_python2_lib_dir],
264            [_python3_install],
265            [_python3_arch_dir],
266            [_python3_lib_dir])
267
268# Notify the user
269
270AC_RNA_STRING_APPEND_FORMAT_BOLD([ac_rna_name_string], [ViennaRNA Package ${PACKAGE_VERSION}])
271AC_RNA_STRING_APPEND_FORMAT_BOLD([ac_rna_final_msg], [You can run 'make', 'make check', and 'make install' now!])
272
273AC_MSG_NOTICE([
274
275======================================
276    $ac_rna_name_string
277======================================
278
279Successfully configured with the following options:
280
281Sub Packages
282------------
283  * Kinfold                   : ${result_kinfold}
284  * RNAforester               : ${result_forester}
285  * Analyse{Dists,Seqs}       : ${result_cluster}
286  * RNAlocmin                 : ${result_rnalocmin}
287  * Kinwalker                 : ${result_kinwalker}
288
289Extra Libraries
290---------------
291  * Support Vector Machine    : ${result_svm}
292  * GNU Scientific Library    : ${result_gsl}
293  * GNU MPFR                  : ${result_mpfr}
294  * JSON                      : ${result_json}
295
296Features
297--------
298  * Boustrophedon             : ${result_boustrophedon}
299  * Use hash for NR Sampling  : ${result_NRhash}
300  * C11 features              : ${result_c11}
301  * TTY colors                : ${result_tty_colors}
302  * Float Precision(PF}       : ${result_floatpf}
303  * Deprecation Warnings      : ${result_warn_deprecated}
304
305Optimizations
306-------------
307  * Auto Vectorization        : ${result_vectorize}
308  * Explicit SIMD Extension   : ${result_simd} ${simd_failed}
309  * Link Time Optimization    : ${result_lto}
310  * POSIX Threads             : ${result_pthreads}
311  * OpenMP                    : ${result_openmp}
312
313Scripting Language Interfaces
314-----------------------------
315  * Perl 5                    : ${result_perl}
316  * Python 2                  : ${result_python}
317  * Python 3                  : ${result_python3}
318
319Documentation
320-------------
321  * Reference Manual (PDF)    : ${result_doc_pdf} ${doc_pdf_failed}
322  * Reference Manual (HTML)   : ${result_doc_html} ${doc_html_failed}
323  * Tutorial (PDF)            : ${result_tutorial_pdf} ${tutorial_pdf_failed}
324  * Tutorial (HTML)           : ${result_tutorial_html} ${tutorial_html_failed}
325
326Unit Tests
327----------
328  * Executable Programs       : ${result_unittests}
329  * C-Library                 : ${result_check}
330  * Perl 5 Interface          : ${result_check_perl}
331  * Python 2 Interface        : ${result_check_python}
332  * Python 3 Interface        : ${result_check_python3}
333
334MacOS X
335-------
336  * Universal Binary          : ${result_osx_arch}
337  * Installer                 : ${result_macosx_installer}
338  * SDK                       : ${result_macosx_sdk}
339
340Install Directories
341-------------------
342  * Executables               : $result__bindir
343  * Libraries                 : $result__libdir
344  * Header files              : $result__includedir
345  * Extra Data                : $result__datadir
346  * Man pages                 : $result__mandir
347  * Documentation             : $result__docdir
348      (HTML)                  : $result__htmldir
349      (PDF)                   : $result__pdfdir2
350  * Perl5 Interface           : $result__perl_install
351      (binaries)              : $result__perl_arch_dir
352      (scripts)               : $result__perl_lib_dir
353  * Python2 Interface         : $result__python2_install
354      (binaries)              : $result__python2_arch_dir
355      (scripts)               : $result__python2_lib_dir
356  * Python3 Interface         : $result__python3_install
357      (binaries)              : $result__python3_arch_dir
358      (scripts)               : $result__python3_lib_dir
359$ac_rna_warning
360$ac_rna_final_msg])
361])
362
363
364
365