1 | AC_PREREQ([2.60]) |
---|
2 | AC_INIT(vizservers, 0.1, rappture@nanohub.org) |
---|
3 | AC_CONFIG_AUX_DIR(cf) |
---|
4 | AC_CONFIG_HEADERS([nanovis/nvconf.h nanoscale/config.h]) |
---|
5 | |
---|
6 | AC_ARG_WITH( |
---|
7 | [tcllib], |
---|
8 | [AS_HELP_STRING([--with-tcllib[=DIR]], |
---|
9 | [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])], |
---|
10 | [with_tcllib=$withval], |
---|
11 | [with_tcllib=""]) |
---|
12 | |
---|
13 | AC_ARG_WITH( |
---|
14 | [rappture], |
---|
15 | [AS_HELP_STRING([--with-rappture[=DIR]], |
---|
16 | [location of rappture files lib/librappture.a and include/rappture.h @<:@default=/usr@:>@])], |
---|
17 | [with_rappture=$withval], |
---|
18 | [with_rappture=yes]) |
---|
19 | |
---|
20 | AC_ARG_WITH( |
---|
21 | [vtk-includes], |
---|
22 | [AS_HELP_STRING([--with-vtk-includes=DIR], |
---|
23 | [VTK include files are in DIR])], |
---|
24 | [with_vtk_includes=$withval], |
---|
25 | [with_vtk_includes=""]) |
---|
26 | |
---|
27 | AC_ARG_WITH( |
---|
28 | [vtk-libs], |
---|
29 | [AS_HELP_STRING([--with-vtk-libs=DIR], |
---|
30 | [VTK libraries are in DIR])], |
---|
31 | [with_vtk_libs=$withval], |
---|
32 | [with_vtk_libs=""]) |
---|
33 | |
---|
34 | AC_ARG_WITH( |
---|
35 | [vtk], |
---|
36 | [AS_HELP_STRING([--with-vtk=VERSION], |
---|
37 | [Version of VTK required])], |
---|
38 | [with_vtk=$withval], |
---|
39 | [with_vtk=yes]) |
---|
40 | |
---|
41 | AC_ARG_WITH( |
---|
42 | [ffmpeg], |
---|
43 | [AS_HELP_STRING([--with-ffmpeg[=DIR]], |
---|
44 | [location of ffmpeg @<:@default=yes@:>@])], |
---|
45 | [], |
---|
46 | [with_ffmpeg=yes]) |
---|
47 | |
---|
48 | RP_LANG_PYTHON |
---|
49 | |
---|
50 | AC_ARG_WITH( |
---|
51 | [statsdir], |
---|
52 | [AS_HELP_STRING([--with-statsdir=DIR], |
---|
53 | [Write statics in DIR])], |
---|
54 | [STATSDIR=$withval], |
---|
55 | [STATSDIR="/var/tmp/visservers"]) |
---|
56 | |
---|
57 | VERSION=0.0.1 |
---|
58 | |
---|
59 | #------------------------------------------------------------------------ |
---|
60 | # Handle the --prefix=... option |
---|
61 | #------------------------------------------------------------------------ |
---|
62 | |
---|
63 | if test "${prefix}" = "NONE"; then |
---|
64 | prefix=/usr/local |
---|
65 | fi |
---|
66 | if test "${exec_prefix}" = "NONE"; then |
---|
67 | exec_prefix=$prefix |
---|
68 | fi |
---|
69 | |
---|
70 | if test "x${incdir}" == "x"; then |
---|
71 | incdir=${exec_prefix}/include |
---|
72 | fi |
---|
73 | libdir=${exec_prefix}/lib |
---|
74 | |
---|
75 | if test "${libdir}" != "${prefix}/lib"; then |
---|
76 | LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}" |
---|
77 | else |
---|
78 | LIB_SEARCH_DIRS="-L ${libdir}" |
---|
79 | fi |
---|
80 | |
---|
81 | SC_CONFIG_CFLAGS |
---|
82 | |
---|
83 | |
---|
84 | AC_PATH_X |
---|
85 | |
---|
86 | AC_PROG_INSTALL |
---|
87 | AC_PROG_RANLIB |
---|
88 | AC_PROG_LN_S |
---|
89 | AC_PROG_MKDIR_P |
---|
90 | |
---|
91 | dnl find and test the C compiler |
---|
92 | AC_PROG_CC |
---|
93 | AC_PROG_CPP |
---|
94 | AC_PROG_CXXCPP |
---|
95 | AC_PROG_CXX |
---|
96 | AC_LANG_CPLUSPLUS |
---|
97 | |
---|
98 | AC_C_BIGENDIAN |
---|
99 | AC_CHECK_SIZEOF(int, 4) |
---|
100 | AC_CHECK_SIZEOF(long, 4) |
---|
101 | AC_CHECK_SIZEOF(long long, 8) |
---|
102 | AC_CHECK_SIZEOF(void *, 4) |
---|
103 | AC_CHECK_SIZEOF(float, 4) |
---|
104 | |
---|
105 | # Save the values as shell variables so that we can substitute them |
---|
106 | # into bltHash.h for situtations where there's no bltInt.h. |
---|
107 | |
---|
108 | |
---|
109 | LD_RPATH=""; |
---|
110 | |
---|
111 | # |
---|
112 | # Need to check for the following dependencies: |
---|
113 | # Rappture headers and library (done) |
---|
114 | # Tcl headers and library (done) |
---|
115 | # GL headers and library |
---|
116 | # GLuT headers and library |
---|
117 | # GLEW header and library |
---|
118 | # Cg headers and library |
---|
119 | # CgGL headers and library |
---|
120 | # pthread library |
---|
121 | # ffmpeg headers and library (started) |
---|
122 | # |
---|
123 | |
---|
124 | TCL_VERSION="8.4" |
---|
125 | for dir in \ |
---|
126 | ${exec_prefix} \ |
---|
127 | ${exec_prefix}/lib \ |
---|
128 | ${with_rappture} \ |
---|
129 | ${with_rappture}/lib ; do |
---|
130 | tclconfig="${dir}/tclConfig.sh" |
---|
131 | if test -f "$tclconfig" ; then |
---|
132 | . $tclconfig |
---|
133 | break |
---|
134 | fi |
---|
135 | done |
---|
136 | TCL_INC_SPEC="$TCL_INCLUDE_SPEC" |
---|
137 | |
---|
138 | if test "x$with_tcllib" != "x" ; then |
---|
139 | tclconfig="${with_tcllib}/tclConfig.sh" |
---|
140 | if test -f "$tclconfig" ; then |
---|
141 | . $tclconfig |
---|
142 | fi |
---|
143 | TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}" |
---|
144 | fi |
---|
145 | if test "x$with_tclinclude" != "x" ; then |
---|
146 | TCL_INC_SPEC="-I${with_tclinclude}" |
---|
147 | fi |
---|
148 | |
---|
149 | RP_DIR="" |
---|
150 | AC_MSG_CHECKING([for rappture]) |
---|
151 | if test "$with_rappture" == "yes" ; then |
---|
152 | for dir in "$exec_prefix" "/usr" ; do |
---|
153 | if test -r "$dir/include/rappture2/rappture2.h" -a \ |
---|
154 | -r "$dir/lib/librappture.a"; then |
---|
155 | RP_DIR="$dir" |
---|
156 | RP_INC_SPEC="-I$dir/include -I$dir/include/rappture2" |
---|
157 | RP_LIB_DIR="$dir/lib" |
---|
158 | AC_MSG_RESULT([$dir]) |
---|
159 | break |
---|
160 | fi |
---|
161 | done |
---|
162 | else |
---|
163 | if test ! -d "$with_rappture" ; then |
---|
164 | AC_MSG_ERROR([--with-rappture: no such directory $with_rappture]) |
---|
165 | fi |
---|
166 | RP_DIR=$with_rappture |
---|
167 | RP_INC_SPEC="-I$with_rappture/include -I$with_rappture/include/rappture2" |
---|
168 | RP_LIB_DIR="$with_rappture/lib" |
---|
169 | fi |
---|
170 | if test "x${RP_DIR}" = "x" ; then |
---|
171 | AC_MSG_ERROR([cannot find rappture.h and librappture2.a, try using --with-rappture]) |
---|
172 | else |
---|
173 | AC_MSG_RESULT([$with_rappture]) |
---|
174 | fi |
---|
175 | |
---|
176 | # This could be temporary. We are assuming that we're using VTK 6+. |
---|
177 | # Since VTK 6 hasn't been released, we will look it only in the |
---|
178 | # Rappture build directories. |
---|
179 | VTK_LIB_DIR=${libdir} |
---|
180 | dnl Prefer our VTK installation over systems. --with-vtk overrides. |
---|
181 | if test "$with_vtk" != "no" ; then |
---|
182 | if test "$with_vtk" = "yes" ; then |
---|
183 | for dir in vtk-6.{10,9,8,7,6,5,4,3,2,1,0} ; do |
---|
184 | if test -d "${incdir}/$dir"; then |
---|
185 | VTK_INC_SPEC="-I${incdir}/$dir" |
---|
186 | break |
---|
187 | fi |
---|
188 | done |
---|
189 | fi |
---|
190 | fi |
---|
191 | |
---|
192 | if test "x$with_vtk_includes" != "x"; then |
---|
193 | VTK_INC_SPEC=-I$with_vtk_includes |
---|
194 | fi |
---|
195 | |
---|
196 | if test "x$with_vtk_libs" != "x"; then |
---|
197 | VTK_LIB_DIR=$with_vtk_libs |
---|
198 | VTK_LIB_SPEC="-L$with_vtk_libs" |
---|
199 | fi |
---|
200 | |
---|
201 | save_CPPFLAGS=$CPPFLAGS |
---|
202 | CPPFLAGS=$VTK_INC_SPEC |
---|
203 | AC_CHECK_HEADERS([vtkSmartPointer.h], [], [AC_MSG_WARN([cannot find vtkSmartPointer.h])]) |
---|
204 | CPPFLAGS=$save_CPPFLAGS |
---|
205 | |
---|
206 | AC_CHECK_HEADER([GL/glut.h]) |
---|
207 | AC_CHECK_HEADER([GL/glew.h]) |
---|
208 | |
---|
209 | AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h]) |
---|
210 | AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h]) |
---|
211 | |
---|
212 | AC_CHECK_FUNCS([accept4]) |
---|
213 | |
---|
214 | save_CPPFLAGS=$CPPFLAGS |
---|
215 | |
---|
216 | |
---|
217 | #-------------------------------------------------------------------- |
---|
218 | # search for ffmpeg executable |
---|
219 | #-------------------------------------------------------------------- |
---|
220 | if test "${with_ffmpeg}" != "no" ; then |
---|
221 | if test "${with_ffmpeg}" = "yes" ; then |
---|
222 | AC_PATH_PROG(FFMPEG, ffmpeg) |
---|
223 | else |
---|
224 | AC_PATH_PROG(FFMPEG, ffmpeg, [], [${with_ffmpeg}/bin:${with_ffmpeg}]) |
---|
225 | fi |
---|
226 | if test "${FFMPEG}x" != "x" ; then |
---|
227 | AC_DEFINE(HAVE_FFMPEG, 1, [nanovis can use ffmpeg to create videos.]) |
---|
228 | fi |
---|
229 | fi |
---|
230 | |
---|
231 | AC_MSG_CHECKING([for nVidia Cg installation]) |
---|
232 | CG_DIR="" |
---|
233 | for dir in \ |
---|
234 | /opt/nvidia-cg-toolkit \ |
---|
235 | /usr/cg \ |
---|
236 | /usr |
---|
237 | do |
---|
238 | if test -r "$dir/include" ; then |
---|
239 | CG_DIR=$dir |
---|
240 | break |
---|
241 | fi |
---|
242 | done |
---|
243 | AC_MSG_RESULT([${CG_DIR}]) |
---|
244 | |
---|
245 | CG_INC_SPEC="-I${CG_DIR}/include" |
---|
246 | |
---|
247 | save_CPPFLAGS=$CPPFLAGS |
---|
248 | CPPFLAGS="${CG_INC_SPEC} $CPPFLAGS" |
---|
249 | AC_CHECK_HEADERS([Cg/cgGL.h], [], AC_MSG_WARN([cannot find nVidia Cg headers])) |
---|
250 | CPPFLAGS=$save_CPPFLAGS |
---|
251 | |
---|
252 | CG_LIB_DIR="" |
---|
253 | for dir in \ |
---|
254 | /opt/nvidia-cg-toolkit \ |
---|
255 | /usr/cg \ |
---|
256 | /usr |
---|
257 | do |
---|
258 | if test -r "$dir/lib" ; then |
---|
259 | CG_LIB_DIR=$dir/lib |
---|
260 | break |
---|
261 | fi |
---|
262 | if test -r "$dir/lib64" ; then |
---|
263 | CG_LIB_DIR=$dir/lib64 |
---|
264 | break |
---|
265 | fi |
---|
266 | done |
---|
267 | |
---|
268 | if test "${CG_LIB_DIR}" = "/usr/lib" ; then |
---|
269 | CG_INC_SPEC="" |
---|
270 | CG_LIB_SPEC="-lCg -lCgGL" |
---|
271 | else |
---|
272 | CG_LIB_SPEC="-L${CG_LIB_DIR} -lCg -lCgGL" |
---|
273 | LD_RPATH="$loader_run_path:${CG_LIB_DIR}" |
---|
274 | fi |
---|
275 | |
---|
276 | SUBDIRS="nanoscale nanovis pymolproxy vtkvis" |
---|
277 | |
---|
278 | AC_SUBST(CFLAGS_DEBUG) |
---|
279 | AC_SUBST(CFLAGS_OPTIMIZE) |
---|
280 | AC_SUBST(CG_INC_SPEC) |
---|
281 | AC_SUBST(CG_LIB_SPEC) |
---|
282 | AC_SUBST(FFMPEG) |
---|
283 | AC_SUBST(FF_INC_SPEC) |
---|
284 | AC_SUBST(LD_RPATH) |
---|
285 | AC_SUBST(RP_DIR) |
---|
286 | AC_SUBST(RP_INC_SPEC) |
---|
287 | AC_SUBST(RP_LIB_DIR) |
---|
288 | AC_SUBST(SHLIB_CFLAGS) |
---|
289 | AC_SUBST(SHLIB_LD) |
---|
290 | AC_SUBST(SHLIB_LDFLAGS) |
---|
291 | AC_SUBST(SHLIB_SUFFIX) |
---|
292 | AC_SUBST(SIZEOF_FLOAT) |
---|
293 | AC_SUBST(SIZEOF_INT) |
---|
294 | AC_SUBST(SIZEOF_LONG) |
---|
295 | AC_SUBST(SIZEOF_LONG_LONG) |
---|
296 | AC_SUBST(SIZEOF_VOID_P) |
---|
297 | AC_SUBST(STATSDIR) |
---|
298 | AC_SUBST(STLIB_LD) |
---|
299 | AC_SUBST(SUBDIRS) |
---|
300 | AC_SUBST(PYTHON) |
---|
301 | AC_SUBST(TCL_INC_SPEC) |
---|
302 | AC_SUBST(TCL_LIB_SPEC) |
---|
303 | AC_SUBST(TCL_VERSION) |
---|
304 | AC_SUBST(VERSION) |
---|
305 | AC_SUBST(VTK_INC_SPEC) |
---|
306 | AC_SUBST(VTK_LIB_DIR) |
---|
307 | |
---|
308 | AC_OUTPUT([ |
---|
309 | Makefile \ |
---|
310 | nanoscale/Makefile \ |
---|
311 | nanoscale/renderservers.tcl \ |
---|
312 | nanovis/Doxyfile \ |
---|
313 | nanovis/Makefile \ |
---|
314 | nanovis/graphics/Makefile \ |
---|
315 | nanovis/imgLoaders/Makefile \ |
---|
316 | nanovis/newmat11/Makefile \ |
---|
317 | nanovis/util/Makefile \ |
---|
318 | nanovis/vrmath/Makefile \ |
---|
319 | pymolproxy/Makefile \ |
---|
320 | vtkvis/Doxyfile \ |
---|
321 | vtkvis/Makefile \ |
---|
322 | start_viz.sh \ |
---|
323 | start_nanoscale.sh]) |
---|