-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
232 lines (204 loc) · 6.29 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
dnl -*- Autoconf -*-
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(CS248, 1.1.0, [email protected])
AC_CONFIG_MACRO_DIRS([m4])
AM_INIT_AUTOMAKE([foreign tar-pax no-exeext])
AC_PROG_MKDIR_P
AC_PROG_LIBTOOL
AC_PROG_INSTALL
dnl
dnl Dependencies
dnl
dnl Etree (Euclid)
AC_ARG_ENABLE([etree],
[AC_HELP_STRING([--enable-etree],
[install Etree library @<:@default=yes@:>@])],
[if test "$enableval" = yes ; then install_etree=yes; else install_etree=no; fi],
[install_etree=yes])
AM_CONDITIONAL([INSTALL_ETREE], [test "$install_etree" = yes])
AC_ARG_WITH([etree-incdir],
[AS_HELP_STRING([--with-etree-incdir], [directory containing Etree header files])],
[with_etree_incdir="$withval"],
[with_etree_incdir=no])
AC_SUBST(with_etree_incdir)
AC_ARG_WITH([etree-libdir],
[AS_HELP_STRING([--with-etree-libdir], [directory containing Etree library])],
[with_etree_libdir="$withval"],
[with_etree_libdir=no])
AC_SUBST(with_etree_libdir)
dnl SQLITE
AC_ARG_ENABLE([sqlite],
[AC_HELP_STRING([--enable-sqlite],
[install Sqlite @<:@default=no@:>@])],
[if test "$enableval" = "yes" ; then install_sqlite=yes; else install_sqlite=no; fi],
[install_sqlite=no])
AM_CONDITIONAL([INSTALL_SQLITE], [test "$install_sqlite" = yes])
AC_ARG_WITH([sqlite-incdir],
[AC_HELP_STRING([--with-sqlite-incdir],
[location of sqlite header files @<:@default=no@:>@])],
[with_sqlite_incdir=$withval],
[with_sqlite_incdir=no])
AC_SUBST(with_sqlite_incdir)
AC_ARG_WITH([sqlite-libdir],
[AC_HELP_STRING([--with-sqlite-libdir],
[location of sqlite library @<:@default=no@:>@])],
[with_sqlite_libdir=$withval],
[with_sqlite_libdir=no])
AC_SUBST(with_sqlite_libdir)
dnl TIFF
AC_ARG_ENABLE([tiff],
[AC_HELP_STRING([--enable-tiff],
[install Tiff @<:@default=no@:>@])],
[if test "$enableval" = "yes" ; then install_tiff=yes; else install_tiff=no; fi],
[install_tiff=no])
AM_CONDITIONAL([INSTALL_TIFF], [test "$install_tiff" = yes])
AC_ARG_WITH([tiff-incdir],
[AC_HELP_STRING([--with-tiff-incdir],
[location of tiff header files @<:@default=no@:>@])],
[with_tiff_incdir=$withval],
[with_tiff_incdir=no])
AC_SUBST(with_tiff_incdir)
AC_ARG_WITH([tiff-libdir],
[AC_HELP_STRING([--with-tiff-libdir],
[location of tiff library @<:@default=no@:>@])],
[with_tiff_libdir=$withval],
[with_tiff_libdir=no])
AC_SUBST(with_tiff_libdir)
dnl PROJ
AC_ARG_ENABLE([proj],
[AC_HELP_STRING([--enable-proj],
[install Proj @<:@default=yes@:>@])],
[if test "$enableval" = "yes" ; then install_proj=yes; else install_proj=no; fi],
[install_proj=yes])
AM_CONDITIONAL([INSTALL_PROJ], [test "$install_proj" = yes])
AC_ARG_WITH([proj-incdir],
[AC_HELP_STRING([--with-proj-incdir], [directory containing Proj header files @<:@default=no@:>@])],
[with_proj_incdir="$withval"],
[with_proj_incdir=no])
AC_SUBST(with_proj_incdir)
AC_ARG_WITH([proj-libdir],
[AC_HELP_STRING([--with-proj-libdir], [directory containing Proj library @<:@default=no@:>@])],
[with_proj_libdir="$withval"],
[with_proj_libdir=no])
AC_SUBST(with_proj_libdir)
dnl
dnl Command line tools
dnl
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MKDIR_P
dnl CURL (used to download model files)
AC_PATH_PROG(CURL, curl)
if test -z "$CURL" ; then
AC_MSG_FAILURE([cannot find 'curl' program.])
CURL=`echo "Error: curl is not installed." ; false`
fi
dnl TAR
AC_PATH_PROG(TAR, tar)
if test -z "$TAR" ; then
AC_MSG_FAILURE([cannot find 'tar' program.])
TAR=`echo "Error: tar is not installed." ; false`
fi
dnl
dnl Setup environment so dependencies are used in build
dnl
CFLAGS="$CFLAGS"
CPPFLAGS="-I$prefix/include $CPPFLAGS"
LDFLAGS="-L$prefix/lib -L$prefix/lib64 $LDFLAGS"
dnl
dnl Verify configuration
dnl
dnl ETREE (required)
if test "$install_etree" = yes ; then
ETREE_INCLUDES=""
ETREE_LDFLAGS="-letree"
else
SCEC_ETREE_HEADER
SCEC_ETREE_LIB
fi
if test "$with_etree_incdir" != no ; then
ETREE_INCLUDES="-I$with_etree_incdir"
fi
if test "$with_etree_libdir" != no ; then
ETREE_LDFLAGS="-L$with_etree_libdir -letree"
fi
AC_SUBST(ETREE_INCLUDES)
AC_SUBST(ETREE_LDFLAGS)
dnl proj (required)
if test "$install_proj" = yes ; then
dnl sqlite (required by proj)
if test "$install_sqlite" = yes ; then
SQLITE3_INCLUDES="-I$prefix/include"
SQLITE3_LDFLAGS="-L$prefix/lib"
else
if test "$with_sqlite_incdir" != no; then
SQLITE3_INCLUDES="-I$with_sqlite_incdir"
fi
if test "$with_sqlite_libdir" != no; then
SQLITE3_LDFLAGS="-L$with_sqlite_libdir"
fi
SCEC_SQLITE3_HEADER
SCEC_SQLITE3_LIB
fi
AC_SUBST(SQLITE3_INCLUDES)
AC_SUBST(SQLITE3_LDFLAGS)
dnl tiff (required by proj)
if test "$install_tiff" = yes ; then
TIFF_INCLUDES="-I$prefix/include"
TIFF_LDFLAGS="-L$prefix/lib"
else
if test "$with_tiff_incdir" != no; then
TIFF_INCLUDES="-I$with_tiff_incdir"
fi
if test "$with_tiff_libdir" != no; then
TIFF_LDFLAGS="-L$with_tiff_libdir"
fi
SCEC_TIFF_HEADER
SCEC_TIFF_LIB
fi
AC_SUBST(TIFF_INCLUDES)
AC_SUBST(TIFF_LDFLAGS)
PROJ_INCLUDES="-I$prefix/include"
PROJ_LDFLAGS="-L$prefix/lib"
else
SCEC_PROJ_HEADER
SCEC_PROJ_LIB
fi
if test "$with_proj_incdir" != no ; then
PROJ_INCLUDES="-I$with_proj_incdir"
fi
if test "$with_proj_libdir" != no ; then
PROJ_LDFLAGS="-L$with_proj_libdir -lproj"
fi
AC_SUBST(PROJ_INCLUDES)
AC_SUBST(PROJ_LDFLAGS)
##check optional large data path
##CS248_LARGEDATA_DIR=$CVM_LARGEDATA_DIR/model/cs248
if test x"$CVM_LARGEDATA_DIR" != x; then
# test directory existence
CS248_LARGEDATA_DIR=$CVM_LARGEDATA_DIR/model/cs248
# In docker container building.. this is not accessible yet
# AC_CHECK_FILE($CVM_LARGEDATA_DIR/model/cs248/vp.dat, [], [AC_MSG_ERROR(["CS248 data not found in cvm_largedata_dir"])])
AM_CONDITIONAL([WITH_CS248_LARGEDATA_DIR], true)
AC_SUBST(CS248_LARGEDATA_DIR)
else
AM_CONDITIONAL(WITH_CS248_LARGEDATA_DIR, false)
fi
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_CONFIG_FILES([
Makefile
src/Makefile
data/Makefile
tests/Makefile
])
AC_OUTPUT
AM_CONDITIONAL([BUILD_SHARED_LIBRARY], [test "$enable_shared" = yes])
if test "$enable_shared" = yes; then
AC_MSG_NOTICE([Building shared libraries. UCVM must be built with shared libraries for plugins to work.])
else
AC_MSG_WARN([Building static libraries. Shared libraries are not enabled.])
fi
dnl End of file