source: trunk/packages/vizservers/configure.in @ 2461

Last change on this file since 2461 was 2461, checked in by ldelgass, 13 years ago

Remove default for --with-vtk-includes|libs

File size: 8.7 KB
Line 
1AC_PREREQ([2.60])
2AC_INIT(vizservers, 0.1, rappture@nanohub.org)
3AC_CONFIG_HEADERS([nanovis/nvconf.h nanoscale/config.h])
4
5AC_ARG_WITH(
6    [tcllib],
7    [AS_HELP_STRING([--with-tcllib[=DIR]],
8        [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])],
9    [with_tcllib=$withval],
10    [with_tcllib=""])
11
12AC_ARG_WITH(
13    [rappture],
14    [AS_HELP_STRING([--with-rappture[=DIR]],
15        [location of rappture files lib/librappture.a and include/rappture.h @<:@default=/usr@:>@])],
16    [with_rappture=$withval],
17    [with_rappture=yes])
18
19AC_ARG_WITH(
20    [vtk-includes],
21    [AS_HELP_STRING([--with-vtk-includes=DIR],
22        [VTK include files are in DIR])],
23    [with_vtk_includes=$withval],
24    [with_vtk_includes=""])
25
26AC_ARG_WITH(
27    [vtk-libs],
28    [AS_HELP_STRING([--with-vtk-libs=DIR],
29        [VTK libraries are in DIR])],
30    [with_vtk_libs=$withval],
31    [with_vtk_libs=""])
32
33AC_ARG_WITH(
34    [vtk],
35    [AS_HELP_STRING([--with-vtk=VERSION],
36        [Version of VTK required])],
37    [with_vtk=$withval],
38    [with_vtk=yes])
39
40VERSION=0.0.1
41
42#------------------------------------------------------------------------
43# Handle the --prefix=... option
44#------------------------------------------------------------------------
45
46if test "${prefix}" = "NONE"; then
47    prefix=/usr/local
48fi
49if test "${exec_prefix}" = "NONE"; then
50    exec_prefix=$prefix
51fi
52
53if test "x${incdir}" == "x"; then
54  incdir=${exec_prefix}/include
55fi
56libdir=${exec_prefix}/lib
57
58if test "${libdir}" != "${prefix}/lib"; then
59    LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}"
60else
61    LIB_SEARCH_DIRS="-L ${libdir}"
62fi
63
64SC_CONFIG_CFLAGS
65
66
67AC_PATH_X
68
69AC_PROG_INSTALL
70AC_PROG_RANLIB
71AC_PROG_LN_S
72AC_PROG_MKDIR_P
73
74dnl find and test the C compiler
75AC_PROG_CC
76AC_PROG_CPP
77AC_PROG_CXXCPP
78AC_PROG_CXX
79AC_LANG_CPLUSPLUS
80
81AC_C_BIGENDIAN
82AC_CHECK_SIZEOF(int, 4)
83AC_CHECK_SIZEOF(long, 4)
84AC_CHECK_SIZEOF(long long, 8)
85AC_CHECK_SIZEOF(void *, 4)
86AC_CHECK_SIZEOF(float, 4)
87
88# Save the values as shell variables so that we can substitute them
89# into bltHash.h for situtations where there's no bltInt.h.
90
91
92LD_RPATH="";
93
94#
95# Need to check for the following dependencies:
96#       Rappture headers and library (done)
97#       Tcl headers and library (done)
98#       GL headers and library
99#       GLuT headers and library
100#       GLui header and library
101#       GLEW header and library
102#       Cg headers and library
103#       CgGL headers and library
104#       pthread library
105#       DX headers and library (done, sort of)
106#       ffmpeg headers and library (started)
107#
108
109TCL_VERSION="8.4"
110for dir in \
111 ${exec_prefix} \
112 ${exec_prefix}/lib \
113 ${with_rappture} \
114 ${with_rappture}/lib ; do
115  tclconfig="${dir}/tclConfig.sh"
116  if test -f "$tclconfig" ; then
117    . $tclconfig
118    break
119  fi
120done
121TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
122
123if test "x$with_tcllib" != "x" ; then
124   tclconfig="${with_tcllib}/tclConfig.sh"
125   if test -f "$tclconfig" ; then
126    . $tclconfig
127   fi
128   TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}"
129fi
130if test "x$with_tclinclude" != "x" ; then
131   TCL_INC_SPEC="-I${with_tclinclude}"
132fi
133
134RP_DIR=""
135AC_MSG_CHECKING([for rappture])
136if test "$with_rappture" == "yes" ; then
137  for dir in "$exec_prefix" "/usr" ; do
138    if test -r "$dir/include/rappture2/rappture2.h" -a \
139     -r "$dir/lib/librappture.a"; then
140      RP_DIR="$dir"
141      RP_INC_SPEC="-I$dir/include -I$dir/include/rappture2"
142      RP_LIB_DIR="$dir/lib"
143      AC_MSG_RESULT([$dir])
144      break
145    fi
146  done
147else
148  if test ! -d "$with_rappture" ; then
149    AC_MSG_ERROR([--with-rappture: no such directory $with_rappture])
150  fi
151  RP_DIR=$with_rappture
152  RP_INC_SPEC="-I$with_rappture/include -I$with_rappture/include/rappture2"
153  RP_LIB_DIR="$with_rappture/lib"
154fi
155if test "x${RP_DIR}" = "x" ; then
156  AC_MSG_ERROR([cannot find rappture.h and librappture2.a, try using --with-rappture])
157else
158  AC_MSG_RESULT([$with_rappture])
159fi
160
161dnl Prefer our VTK installation over systems. --with-vtk overrides.
162if test "$with_vtk" != "no" ; then
163  if test "$with_vtk" = "yes" ; then
164    for dir in vtk-5.{9,8,7,6,5,4,3,2,1} ; do
165      if test -d "${libdir}/$dir" -a -d "${incdir}/$dir"; then
166        VTK_LIB_SPEC="-L${libdir}/$dir"
167        VTK_LIB_DIR="${libdir}/$dir"
168        VTK_INC_SPEC="-I${incdir}/$dir"
169        break
170      fi
171      if test -d "/usr/lib/$dir" -a -d "/usr/include/$dir"; then
172        VTK_LIB_SPEC=-L/usr/lib/$dir
173        VTK_LIB_DIR=/usr/lib/$dir
174        VTK_INC_SPEC=-I/usr/include/$dir
175        break
176      fi
177    done
178  fi
179fi
180
181if test "x$with_vtk_includes" != "x"; then
182   VTK_INC_SPEC=-I$with_vtk_includes
183fi
184
185if test "x$with_vtk_libs" != "x"; then
186   VTK_LIB_DIR=$with_vtk_libs
187fi
188
189save_CPPFLAGS=$CPPFLAGS
190CPPFLAGS=$VTK_INC_SPEC
191AC_CHECK_HEADERS([vtkSmartPointer.h], [], [AC_MSG_WARN([cannot find vtkSmartPointer.h])])
192CPPFLAGS=$save_CPPFLAGS
193
194AC_CHECK_HEADER([GL/glui.h])
195AC_CHECK_HEADER([glui.h])
196AC_CHECK_HEADER([GL/glut.h])
197AC_CHECK_HEADER([GL/glew.h])
198
199AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h])
200AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h])
201
202AC_CHECK_FUNCS([accept4])
203
204AC_MSG_CHECKING([for OpenDX headers])
205DX_INC_DIR=""
206for dir in \
207 /apps/rappture/include \
208 /usr/dx/include \
209 /usr/include
210do
211  if test -r "${dir}/dx/dx.h" ; then
212    DX_INC_DIR="$dir"
213    break
214  fi
215done
216if test "x${DX_INC_DIR}" = "x" ; then
217  AC_MSG_WARN([cannot find OpenDX include files])
218  DX_INC_SPEC=""
219elif test "${DX_INC_DIR}" = "/usr/include" ; then
220  DX_INC_SPEC=""
221else
222  DX_INC_SPEC="-I{DX_INC_DIR}"
223fi
224AC_MSG_RESULT([${DX_INC_DIR}])
225
226DX_LIB_DIR=""
227for dir in \
228 /usr/lib \
229 /usr/lib64 \
230 /usr/dx/lib_linux \
231 /usr/lib/dx/lib_linux \
232 /usr/lib64/dx/lib_linux \
233 /apps/rappture/lib
234do
235  saveLDFLAGS=$LDFLAGS
236  LDFLAGS="-L$dir $LDFLAGS"
237  unset ac_cv_lib_DXcallm_DXGetComponentValue
238  AC_CHECK_LIB([DXcallm], [DXGetComponentValue], [found=yes], [found=no], [-lX11])
239  LDFLAGS=$saveLDFLAGS
240  if test "$found" = "yes" ; then
241    DX_LIB_DIR="$dir"
242    break
243  fi
244done
245if test "x${DX_LIB_DIR}" = "x" ; then
246  AC_MSG_WARN([cannot find OpenDX libraries])
247fi
248
249AC_MSG_CHECKING([for libDXcallm library])
250if test "x${DX_LIB_DIR}" = "x" -o "${DX_LIB_DIR}" = "/usr/lib" -o "${DX_LIB_DIR}" = "/usr/lib64"; then
251  DX_LIB_SPEC=""
252else
253  DX_LIB_SPEC="-L${DX_LIB_DIR}"
254fi
255AC_MSG_RESULT([$DX_LIB_SPEC])
256
257AC_CHECK_HEADERS([opencv/cv.h opencv/highgui.h])
258AC_CHECK_LIB([highgui], [cvLoadImage])
259
260save_CPPFLAGS=$CPPFLAGS
261# Test for redhat-specific location of ffmpeg headers.
262if test -d "/usr/include/ffmpeg" ; then
263  CPPFLAGS="$CPPFLAGS -I/usr/include/ffmpeg"
264  FF_INC_SPEC="-I/usr/include/ffmpeg"
265fi
266
267AC_CHECK_HEADERS([ffmpeg/avcodec.h libavcodec/avcodec.h ffmpeg/avformat.h libavformat/avformat.h ffmpeg/avutil.h libavutil/avutil.h],,,[
268#define SIZEOF_LONG ${ac_cv_sizeof_long}
269#if SIZEOF_LONG == 8
270#  define INT64_C(c)  c ## L
271#  define UINT64_C(c) c ## UL
272#else
273#  define INT64_C(c)  c ## LL
274#  define UINT64_C(c) c ## ULL
275#endif
276])
277CPPFLAGS=$save_CPPFLAGS
278
279AC_CHECK_LIB([avcodec], [avcodec_alloc_frame])
280# Fallback to deprecated av_alloc_format_context if avformat_alloc_context isn't found
281AC_CHECK_LIB([avformat], [avformat_alloc_context], [],
282    AC_CHECK_LIB([avformat], [av_alloc_format_context], [],
283        [AC_MSG_WARN([libavformat not usable])]))
284AC_CHECK_FUNCS([avformat_alloc_context])
285AC_CHECK_LIB([avutil], [av_free])
286AC_CHECK_FUNCS([img_convert])
287
288
289AC_MSG_CHECKING([for nVidia Cg installation])
290CG_DIR=""
291for dir in \
292 /opt/nvidia-cg-toolkit \
293 /usr/cg \
294 /usr
295do
296  if test -r "$dir/include" ; then
297    CG_DIR=$dir
298    break
299  fi
300done
301AC_MSG_RESULT([${CG_DIR}])
302
303CG_INC_DIR="$dir/include"
304CG_LIB_DIR="$dir/lib"
305
306save_CPPFLAGS=$CPPFLAGS
307CPPFLAGS="-I${CG_INC_DIR} $CPPFLAGS"
308AC_CHECK_HEADERS([Cg/cgGL.h], [], AC_MSG_WARN([cannot find nVidia Cg headers]))
309CPPFLAGS=$save_CPPFLAGS
310
311if test "${CG_DIR}" = "/usr" ; then
312  CG_DIR=""
313else
314  LD_RPATH="$loader_run_path:${CG_LIB_DIR}"
315fi
316
317SUBDIRS="nanoscale nanovis pymolproxy vtkvis"
318
319AC_SUBST(CFLAGS_DEBUG)
320AC_SUBST(CFLAGS_OPTIMIZE)
321AC_SUBST(CG_DIR)
322AC_SUBST(CG_INC_DIR)
323AC_SUBST(CG_LIB_DIR)
324AC_SUBST(DX_INC_SPEC)
325AC_SUBST(DX_LIB_SPEC)
326AC_SUBST(FF_INC_SPEC)
327AC_SUBST(LD_RPATH)
328AC_SUBST(RP_DIR)
329AC_SUBST(RP_INC_SPEC)
330AC_SUBST(RP_LIB_DIR)
331AC_SUBST(SHLIB_CFLAGS)
332AC_SUBST(SHLIB_LD)
333AC_SUBST(SHLIB_LDFLAGS)
334AC_SUBST(SHLIB_SUFFIX)
335AC_SUBST(SIZEOF_FLOAT)
336AC_SUBST(SIZEOF_INT)
337AC_SUBST(SIZEOF_LONG)
338AC_SUBST(SIZEOF_LONG_LONG)
339AC_SUBST(SIZEOF_VOID_P)
340AC_SUBST(STLIB_LD)
341AC_SUBST(SUBDIRS)
342AC_SUBST(TCL_INC_SPEC)
343AC_SUBST(TCL_LIB_SPEC)
344AC_SUBST(TCL_VERSION)
345AC_SUBST(VERSION)
346AC_SUBST(VTK_INC_SPEC)
347AC_SUBST(VTK_LIB_DIR)
348
349AC_OUTPUT([
350   Makefile \
351   nanoscale/Makefile \
352   nanoscale/renderservers.tcl \
353   nanovis/Makefile \
354   nanovis/newmat11/Makefile \
355   nanovis/R2/src/Makefile \
356   nanovis/vrutil/Makefile \
357   nanovis/vrmath/Makefile \
358   nanovis/vr3d/Makefile \
359   nanovis/imgLoaders/Makefile \
360   nanovis/transfer-function/Makefile \
361   pymolproxy/Makefile \
362   vtkvis/Doxyfile \
363   vtkvis/Makefile \
364   start_viz.sh \
365   start_nanoscale.sh])
Note: See TracBrowser for help on using the repository browser.