This repository has been archived by the owner on May 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure.ac
253 lines (220 loc) · 8.63 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
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
dnl Copyright © 2017, 2018, 2019, 2020 Roel Janssen <[email protected]>
dnl
dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation, either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
dnl -*- Autoconf -*-
AC_INIT(sparqling-genomics, 0.99.11)
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([color-tests -Wall -Wno-portability foreign])
AM_SILENT_RULES([yes])
LT_INIT([dlopen win32-dll])
AC_SUBST([LIBTOOL_DEPS])
AC_PROG_CC
AM_PROG_CC_C_O
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h stdio.h])
AC_CHECK_LIB(guile, scm_with_guile)
GUILE_PKG([3.0 2.2 2.0])
GUILE_PROGS
GUILE_SITE_DIR
dnl Installation directories for .scm and .go files.
moddir="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION"
godir="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache"
extdir="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/extensions"
AC_SUBST([moddir])
AC_SUBST([godir])
AC_SUBST([extdir])
if $GUILE_TOOLS | grep -q compile; then
true
else
AC_MSG_ERROR([Guile 3.0, 2.2, or 2.0 required.])
fi
AC_MSG_CHECKING([whether to enable optimizations for guild])
AC_SUBST([ENABLE_GUILE_OPTIMIZATIONS])
AS_IF([test "x$GUILE_EFFECTIVE_VERSION" = "x2.0"],
[AM_CONDITIONAL([ENABLE_GUILE_OPTIMIZATIONS], [false])
AC_MSG_RESULT([no])],
[AM_CONDITIONAL([ENABLE_GUILE_OPTIMIZATIONS], [true])
AC_MSG_RESULT([yes])])
dnl Infer the distribution's package name on the GUILE_EFFECTIVE_VERSION.
dnl An improved mechanism to check the distribution's package name for Guile
dnl is very welcome.
AC_MSG_CHECKING([what the RPM package name for Guile would be])
if test "x$GUILE_EFFECTIVE_VERSION" = "x2.2"; then
GUILE_RPM_PACKAGE_NAME="guile22"
else
GUILE_RPM_PACKAGE_NAME="guile"
fi
AC_SUBST([GUILE_RPM_PACKAGE_NAME])
AC_MSG_RESULT($GUILE_RPM_PACKAGE_NAME)
dnl This macro is used to resolve the absolute path to @datarootdir@ so that
dnl the absolute path can be used in the configuration file for the web
dnl interface.
dnl ---------------------------------------------------------------------------
AC_DEFUN([AC_DEFINE_DIR], [
prefix_NONE=
exec_prefix_NONE=
test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
dnl refers to ${prefix}. Thus we have to use `eval' twice.
eval ac_define_dir="\"[$]$2\""
eval ac_define_dir="\"$ac_define_dir\""
AC_SUBST($1, "$ac_define_dir")
AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
test "$prefix_NONE" && prefix=NONE
test "$exec_prefix_NONE" && exec_prefix=NONE
])
dnl The SYSCONFDIR is left configurable on 'make'. However, the 'sg-web'
dnl script needs no 'make' step, so we expand the variable here.
SYSCONFDIR=`test "$prefix" = NONE && prefix=$ac_default_prefix; eval echo "${sysconfdir}"`
AC_SUBST([sysconfdir], [$SYSCONFDIR])
webconfdir=$SYSCONFDIR/sparqling-genomics
AC_SUBST([webconfdir])
dnl Use the above macro to define a resolved path for the web root.
dnl ---------------------------------------------------------------------------
AC_DEFINE_DIR([WEB_ROOT], [datarootdir], [Data directory for web resources.])
dnl Also resolve the absolute paths to the Guile moddir and godir.
dnl ---------------------------------------------------------------------------
AC_DEFINE_DIR([MODDIR], [moddir], [Path to installed Guile modules.])
AC_DEFINE_DIR([GODIR], [godir], [Path to installed Guile objects.])
AC_DEFINE_DIR([EXTDIR], [extdir], [Path to installed Guile extensions.])
AC_CONFIG_FILES([env], [chmod +x env])
AC_CONFIG_FILES([tools/folder2rdf/folder2rdf],
[chmod +x tools/folder2rdf/folder2rdf])
AC_CONFIG_FILES([tools/virtuoso-config/virtuoso-config],
[chmod +x tools/virtuoso-config/virtuoso-config])
AC_CONFIG_FILES([tools/ega2rdf/ega2rdf],
[chmod +x tools/ega2rdf/ega2rdf])
AC_CONFIG_FILES([
Makefile
doc/Makefile
doc/sparqling-genomics.sty
rpmbuild/sparqling-genomics.spec
tools/Makefile
tools/bam2rdf/Makefile
tools/ega2rdf/Makefile
tools/folder2rdf/Makefile
tools/json2rdf/Makefile
tools/sgfs/Makefile
tools/sgfs/guile/Makefile
tools/sgfs/include/config.h
tools/table2rdf/Makefile
tools/virtuoso-config/Makefile
tools/vcf2rdf/Makefile
tools/xml2rdf/Makefile
web/Makefile
web/extensions/Makefile
web/extensions/hashing/Makefile
web/extensions/pdf_report/Makefile
web/extensions/pdf_report/include/pdf_report.h
web/extensions/r_report/Makefile
web/extensions/r_report/include/r_report.h
web/ldap/authenticate.scm
web/www/hashing.scm
web/www/reports.scm
web/sg-web.c
web/sg-web-test.c
web/sg-web.service
web/sg-auth-manager.c
web/sg-auth-manager.service
web/www/config.scm
])
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([htslib], [htslib])
PKG_CHECK_MODULES([raptor2], [raptor2])
PKG_CHECK_MODULES([libxml2], [libxml-2.0])
PKG_CHECK_MODULES([gnutls], [gnutls])
PKG_CHECK_MODULES([zlib], [zlib])
PKG_CHECK_MODULES([png], [libpng])
PKG_CHECK_MODULES([guile], [guile-$GUILE_EFFECTIVE_VERSION])
dnl Find GnuTLS Guile paths.
dnl ---------------------------------------------------------------------------
AC_SUBST([GNUTLS_PREFIX],[$(pkg-config gnutls --variable=prefix)])
if test "x$GNUTLS_PREFIX" = "x"; then
AC_MSG_WARN([Unable to determine the GnuTLS Guile load path.])
AC_SUBST([GNUTLS_GUILE_LOAD_PATH], [])
else
AC_SUBST([GNUTLS_GUILE_LOAD_PATH],
[$GNUTLS_PREFIX/share/guile/site/$GUILE_EFFECTIVE_VERSION])
fi
AC_SUBST([GNUTLS_LIBDIR],[$(pkg-config gnutls --variable=libdir)])
if test "x$GNUTLS_LIBDIR" = "x"; then
AC_MSG_WARN([Unable to determine the GnuTLS Guile libdir.])
AC_SUBST([GNUTLS_GUILE_CCACHE], [])
else
AC_SUBST([GNUTLS_GUILE_CCACHE],
[$GNUTLS_LIBDIR/guile/$GUILE_EFFECTIVE_VERSION/site-ccache])
fi
dnl When FUSE is available, build the SGFS part of the project.
dnl ---------------------------------------------------------------------------
AC_SUBST([BUILD_SGFS])
PKG_CHECK_MODULES([fuse], [fuse],
[AM_CONDITIONAL([BUILD_SGFS], [true])],
[AM_CONDITIONAL([BUILD_SGFS], [false])
AC_MSG_WARN([Unable to find FUSE. Disabled building SGFS.])])
dnl When R is available, build the R support for reporting.
dnl ---------------------------------------------------------------------------
AC_SUBST([ENABLE_R])
PKG_CHECK_MODULES([libr], [libR],
[PKG_CHECK_VAR([R_HOME], [libR], [rhome])
AM_CONDITIONAL([ENABLE_R], [true])],
[AM_CONDITIONAL([ENABLE_R], [false])
AC_MSG_WARN([Unable to find an R installation. Disabling it.])])
dnl Let users provide a path to the libldap library because there is
dnl no portable way to find the path to libldap.
dnl ---------------------------------------------------------------------------
AC_ARG_WITH([libldap-prefix],
[AS_HELP_STRING([--with-libldap-prefix=DIR], [search for libldap in DIR])],
[case "$withval" in
yes|no)
;;
*)
LIBLDAP="$withval/lib/libldap"
LIBLDAP_PREFIX="$withval"
LIBLDAP_LIBDIR="$withval/lib"
;;
esac])
dnl Library name suitable for `dynamic-link'.
AC_MSG_CHECKING([for libldap shared library name])
AS_IF([test "x$LIBLDAP" = "x"],
[AC_MSG_RESULT([not specified])],
[AC_MSG_RESULT([$LIBLDAP])])
AC_SUBST([LIBLDAP])
AC_SUBST([LIBLDAP_PREFIX])
AC_SUBST([LIBLDAP_LIBDIR])
dnl Check for presence of 'pdflatex', 'bibtex', and 'htlatex'.
dnl ---------------------------------------------------------------------------
AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex)
AC_CHECK_PROG(BIBTEX, bibtex, bibtex)
AC_CHECK_PROG(HTLATEX, htlatex, htlatex)
if test "x$BIBTEX" = "x"; then
AC_MSG_WARN([Unable to create the user manual.])
else
if test "x$PDFLATEX" = "x"; then
AC_MSG_WARN([Unable to create PDF version of the user manual.])
fi
if test "x$HTLATEX" = "x"; then
AC_MSG_WARN([Unable to create HTML version of the user manual.])
fi
fi
AC_SUBST(ENABLE_MTRACE_OPTION)
AC_ARG_ENABLE([mtrace],
AC_HELP_STRING([--enable-mtrace],
[enable mtrace support @<:@default=no@:>@]),
AM_CONDITIONAL([ENABLE_MTRACE_OPTION], [true]),
AM_CONDITIONAL([ENABLE_MTRACE_OPTION], [false]))
AM_CONDITIONAL([HAVE_PDFLATEX], test -n "$PDFLATEX")
AM_CONDITIONAL([HAVE_HTLATEX], test -n "$HTLATEX")
AM_CONDITIONAL([HAVE_BIBTEX], test -n "$BIBTEX")
AC_OUTPUT