forked from klokantech/iiifserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
executable file
·267 lines (172 loc) · 6.88 KB
/
configure.in
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
254
255
256
257
258
259
260
261
262
263
264
265
266
# Process this file with autoconf to produce a configure script.
AC_INIT(iipsrv,1.0,[email protected])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
AC_PREFIX_DEFAULT( `pwd` )
# Checks for programs.
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_LN_S
AC_PROG_MAKE_SET
AM_PROG_CC_C_O
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_SIZE_T
LT_INIT
# Checks for header files.
AC_CHECK_HEADERS(glob.h)
AC_CHECK_HEADERS(time.h)
AC_CHECK_HEADERS(sys/time.h)
AC_FUNC_MALLOC
AC_CHECK_LIB(m, log2, AC_DEFINE(HAVE_LOG2))
AC_CHECK_FUNCS([setenv])
# For our windows build
AC_CHECK_HEADERS(windows.h)
# we want largefile support, if possible
AC_SYS_LARGEFILE
#************************************************************
# Check for compile options.
# AC_ARG_ENABLE(debug,
# [ --enable-debug compile with debugging on],
# , )
# AC_DEFINE(DEBUG))
#************************************************************
# Check for a user specified location for libjpeg
# AC_ARG_WITH(libjpeg-incl,
# [ --with-libjpeg-incl=DIR location of the jpeg library include files],
# jpeg_incl=-I$withval)
# AC_ARG_WITH(libjpeg-lib,
# [ --with-libjpeg-lib=DIR location of the jpeg library files],
# jpeg_lib=-L$withval)
# AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
# LIBJPEG_INCL=$jpeg_incl; LIBJPEG_LIB="$jpeg_lib -ljpeg",
# AC_MSG_ERROR(unable to find libjpeg),
# $jpeg_lib)
FIND_JPEG(,[AC_MSG_ERROR([libjpeg not found])])
#************************************************************
# Check for a standard libz
AC_CHECK_LIB(z, gzopen)
#************************************************************
#************************************************************
# Check for libmemecached
AC_CHECK_HEADERS(libmemcached/memcached.h, AC_CHECK_LIB(memcached, memcached_create, LIBS="${LIBS} -lmemcached";AC_DEFINE(HAVE_MEMCACHED) ) )
#************************************************************
# Check for user specified location for libtiff
# AC_ARG_WITH(libtiff-incl,
# [ --with-libtiff-incl=DIR location of the tiff library include files],
# tiff_incl=-I$withval)
# AC_ARG_WITH(libtiff-lib,
# [ --with-libtiff-lib=DIR location of the tiff library files],
# tiff_lib=-L$withval)
# AC_CHECK_LIB(tiff, TIFFReadScanline,
# LIBTIFF_INCL=$tiff_incl; LIBTIFF_LIB="$tiff_lib -ltiff -ljpeg -lm",
# AC_MSG_ERROR(unable to find libtiff),
# $tiff_lib -ljpeg -lm)
FIND_TIFF(,[AC_MSG_ERROR([libtiff not found])])
#************************************************************
# Check for little cms library
AC_CHECK_HEADERS(lcms/lcms.h, AC_CHECK_LIB(lcms, cmsOpenProfileFromMem, LIBS="${LIBS} -llcms";AC_DEFINE(LCMS) ) )
#************************************************************
# Check for user specified locations for fast cgi library
AC_ARG_WITH( fcgi-incl,
[ --with-fcgi-incl=DIR location of the fcgi include files],
fcgi_include_path=$withval)
AC_ARG_WITH( fcgi-lib,
[ --with-fcgi-lib=DIR location of the fcgi libraries],
fcgi_lib_path=$withval)
AC_CHECK_LIB( fcgi, FCGI_Accept,
AC_MSG_RESULT([configure: found fcgi]);
LIBFCGI_INCLUDES="-I$fcgi_include_path";
# LIBFCGI_LDFLAGS="-L$fcgi_lib_path";
LIBFCGI_LIBS="-lfcgi",
AC_MSG_RESULT([configure: unable to find user installed libfcgi - using bundled version]);
LIBFCGI_INCLUDES="-I../fcgi/include -I../fcgi";
LIBFCGI_LIBS="../fcgi/libfcgi/libfcgi.a" )
AC_SUBST(LIBFCGI_INCLUDES)
AC_SUBST(LIBFCGI_LDFLAGS)
AC_SUBST(LIBFCGI_LIBS)
#************************************************************
# Check for libdl for dynamic library loading
AC_ARG_ENABLE(modules,
[ --enable-modules enable dynamic module loading] )
if test "$enable_modules" = "yes"; then
modules=true
AC_CHECK_HEADERS(dlfcn.h)
AC_CHECK_LIB(dl, dlopen, \
DL_LIBS="-ldl"; AC_DEFINE(ENABLE_DL), \
AC_MSG_ERROR(unable to find libdl) )
else
modules=false
AC_MSG_WARN( optional dynamic module loading not enabled)
fi
AM_CONDITIONAL( ENABLE_MODULES, test x$modules = xtrue )
AC_SUBST(DL_LIBS)
#************************************************************
# Check for Kakadu JPEG2000 library
AC_ARG_WITH( kakadu,
[ --with-kakadu=DIR location of the kakadu source files],
kakadu_path=$withval)
AC_CHECK_FILE($kakadu_path/managed/all_includes/jpx.h,AC_MSG_RESULT([configure: Found Kakadu sources. Will compile JPEG2000 support]);kakadu=true,AC_MSG_RESULT([configure: No Kakadu JPEG2000 Sources Found]))
AM_CONDITIONAL(ENABLE_KAKADU, test x$kakadu = xtrue)
if test "$kakadu" = "true"; then
AC_DEFINE(HAVE_KAKADU)
INCLUDES="$INCLUDES -I$kakadu_path/managed/all_includes/"
EXTRAS="KakaduImage.o"
LIBS="$LIBS $kakadu_path/apps/make/jpx.o $kakadu_path/apps/make/jp2.o $kakadu_path/apps/make/kdu_stripe_decompressor.o $kakadu_path/apps/make/*.so -lpthread"
fi
INCLUDES="$INCLUDES -I."
AC_SUBST(INCLUDES)
AC_SUBST(EXTRAS)
AC_CHECK_LIB(c,get_nprocs_conf,AC_DEFINE(NPROCS))
AC_SUBST(LIBS)
#************************************************************
# FCGI library configure
#************************************************************
AC_LANG([C++])
# autoconf defaults CXX to 'g++', so its unclear whether it exists/works
AC_MSG_CHECKING([whether $CXX works])
AC_TRY_COMPILE([#include <iostream>],
[std::cout << "ok";],
[AC_MSG_RESULT(yes)
LIBFCGIXX=libfcgi++.la
ECHO_CPP=echo-cpp${EXEEXT}
AC_MSG_CHECKING([whether cin has a streambuf assignment operator])
AC_TRY_COMPILE([#include <iostream>],
[cin = static_cast<streambuf *>(0);],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_IOSTREAM_WITHASSIGN_STREAMBUF], [1],
[Define if cin/cout/cerr has a streambuf assignment operator])],
[AC_MSG_RESULT(no)])
AC_MSG_CHECKING([whether char_type is defined in the context of streambuf])
AC_TRY_COMPILE([#include <iostream>],
[class fcgi_streambuf : public std::streambuf { char_type ct; }],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_STREAMBUF_CHAR_TYPE], [1],
[Define if char_type is defined in the context of streambuf])],
[AC_MSG_RESULT(no)])],
[AC_MSG_RESULT(no)])
AC_SUBST(LIBFCGIXX)
AC_SUBST(ECHO_CPP)
AC_LANG([C])
AC_CHECK_LIB([nsl], [gethostbyname])
AC_CHECK_LIB([socket], [socket])
ACX_PTHREAD([THREADED=threaded${EXEEXT}])
AC_SUBST([THREADED])
FCGI_COMMON_CHECKS
AC_REPLACE_FUNCS([strerror])
AC_C_INLINE
SYSTEM=unix
AC_SUBST([SYSTEM])
AC_PROG_CC_WARNINGS
AC_PROG_MAKE_SET
AC_CONFIG_FILES([Makefile \
src/Makefile \
man/Makefile \
fcgi/Makefile \
fcgi/include/Makefile \
fcgi/libfcgi/Makefile])
AC_OUTPUT