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

Last change on this file since 3563 was 3563, checked in by ldelgass, 11 years ago

Remove vestigal FFMPEG include/lib defines and the Makefile rule for removed
C++ implementation.

File size: 7.4 KB
Line 
1AC_PREREQ([2.60])
2AC_INIT(vizservers, 0.1, rappture@nanohub.org)
3AC_CONFIG_AUX_DIR(cf)
4AC_CONFIG_HEADERS([nanovis/nvconf.h nanoscale/config.h])
5
6AC_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
13AC_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
20AC_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
27AC_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
34AC_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
41AC_ARG_WITH(
42    [ffmpeg],
43    [AS_HELP_STRING([--with-ffmpeg[=DIR]],
44      [location of ffmpeg @<:@default=yes@:>@])],
45    [],
46    [with_ffmpeg=yes])
47
48RP_LANG_PYTHON
49
50AC_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
57VERSION=0.0.1
58
59#------------------------------------------------------------------------
60# Handle the --prefix=... option
61#------------------------------------------------------------------------
62
63if test "${prefix}" = "NONE"; then
64    prefix=/usr/local
65fi
66if test "${exec_prefix}" = "NONE"; then
67    exec_prefix=$prefix
68fi
69
70if test "x${incdir}" == "x"; then
71  incdir=${exec_prefix}/include
72fi
73libdir=${exec_prefix}/lib
74
75if test "${libdir}" != "${prefix}/lib"; then
76    LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}"
77else
78    LIB_SEARCH_DIRS="-L ${libdir}"
79fi
80
81SC_CONFIG_CFLAGS
82
83
84AC_PATH_X
85
86AC_PROG_INSTALL
87AC_PROG_RANLIB
88AC_PROG_LN_S
89AC_PROG_MKDIR_P
90
91dnl find and test the C compiler
92AC_PROG_CC
93AC_PROG_CPP
94AC_PROG_CXXCPP
95AC_PROG_CXX
96AC_LANG_CPLUSPLUS
97
98AC_C_BIGENDIAN
99AC_CHECK_SIZEOF(int, 4)
100AC_CHECK_SIZEOF(long, 4)
101AC_CHECK_SIZEOF(long long, 8)
102AC_CHECK_SIZEOF(void *, 4)
103AC_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
109LD_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
124TCL_VERSION="8.4"
125for 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
135done
136TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
137
138if 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}"
144fi
145if test "x$with_tclinclude" != "x" ; then
146   TCL_INC_SPEC="-I${with_tclinclude}"
147fi
148
149RP_DIR=""
150AC_MSG_CHECKING([for rappture])
151if 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
162else
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"
169fi
170if test "x${RP_DIR}" = "x" ; then
171  AC_MSG_ERROR([cannot find rappture.h and librappture2.a, try using --with-rappture])
172else
173  AC_MSG_RESULT([$with_rappture])
174fi
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.
179VTK_LIB_DIR=${libdir}
180dnl Prefer our VTK installation over systems. --with-vtk overrides.
181if 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
190fi
191
192if test "x$with_vtk_includes" != "x"; then
193   VTK_INC_SPEC=-I$with_vtk_includes
194fi
195
196if test "x$with_vtk_libs" != "x"; then
197   VTK_LIB_DIR=$with_vtk_libs
198   VTK_LIB_SPEC="-L$with_vtk_libs"
199fi
200
201save_CPPFLAGS=$CPPFLAGS
202CPPFLAGS=$VTK_INC_SPEC
203AC_CHECK_HEADERS([vtkSmartPointer.h], [], [AC_MSG_WARN([cannot find vtkSmartPointer.h])])
204CPPFLAGS=$save_CPPFLAGS
205
206AC_CHECK_HEADER([GL/glut.h])
207AC_CHECK_HEADER([GL/glew.h])
208
209AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h])
210AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h])
211
212AC_CHECK_FUNCS([accept4])
213
214save_CPPFLAGS=$CPPFLAGS
215
216
217#--------------------------------------------------------------------
218# search for ffmpeg executable
219#--------------------------------------------------------------------
220if 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
229fi
230
231AC_MSG_CHECKING([for nVidia Cg installation])
232CG_DIR=""
233for dir in \
234 /opt/nvidia-cg-toolkit \
235 /usr/cg \
236 /usr
237do
238  if test -r "$dir/include" ; then
239    CG_DIR=$dir
240    break
241  fi
242done
243AC_MSG_RESULT([${CG_DIR}])
244
245CG_INC_SPEC="-I${CG_DIR}/include"
246
247save_CPPFLAGS=$CPPFLAGS
248CPPFLAGS="${CG_INC_SPEC} $CPPFLAGS"
249AC_CHECK_HEADERS([Cg/cgGL.h], [], AC_MSG_WARN([cannot find nVidia Cg headers]))
250CPPFLAGS=$save_CPPFLAGS
251
252CG_LIB_DIR=""
253for dir in \
254 /opt/nvidia-cg-toolkit \
255 /usr/cg \
256 /usr
257do
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
266done
267
268if test "${CG_LIB_DIR}" = "/usr/lib" ; then
269  CG_INC_SPEC=""
270  CG_LIB_SPEC="-lCg -lCgGL"
271else
272  CG_LIB_SPEC="-L${CG_LIB_DIR} -lCg -lCgGL"
273  LD_RPATH="$loader_run_path:${CG_LIB_DIR}"
274fi
275
276SUBDIRS="nanoscale nanovis pymolproxy vtkvis"
277
278AC_SUBST(CFLAGS_DEBUG)
279AC_SUBST(CFLAGS_OPTIMIZE)
280AC_SUBST(CG_INC_SPEC)
281AC_SUBST(CG_LIB_SPEC)
282AC_SUBST(FFMPEG)
283AC_SUBST(LD_RPATH)
284AC_SUBST(RP_DIR)
285AC_SUBST(RP_INC_SPEC)
286AC_SUBST(RP_LIB_DIR)
287AC_SUBST(SHLIB_CFLAGS)
288AC_SUBST(SHLIB_LD)
289AC_SUBST(SHLIB_LDFLAGS)
290AC_SUBST(SHLIB_SUFFIX)
291AC_SUBST(SIZEOF_FLOAT)
292AC_SUBST(SIZEOF_INT)
293AC_SUBST(SIZEOF_LONG)
294AC_SUBST(SIZEOF_LONG_LONG)
295AC_SUBST(SIZEOF_VOID_P)
296AC_SUBST(STATSDIR)
297AC_SUBST(STLIB_LD)
298AC_SUBST(SUBDIRS)
299AC_SUBST(PYTHON)
300AC_SUBST(TCL_INC_SPEC)
301AC_SUBST(TCL_LIB_SPEC)
302AC_SUBST(TCL_VERSION)
303AC_SUBST(VERSION)
304AC_SUBST(VTK_INC_SPEC)
305AC_SUBST(VTK_LIB_DIR)
306
307AC_OUTPUT([
308   Makefile \
309   nanoscale/Makefile \
310   nanoscale/renderservers.tcl \
311   nanovis/Doxyfile \
312   nanovis/Makefile \
313   nanovis/graphics/Makefile \
314   nanovis/imgLoaders/Makefile \
315   nanovis/newmat11/Makefile \
316   nanovis/util/Makefile \
317   nanovis/vrmath/Makefile \
318   pymolproxy/Makefile \
319   vtkvis/Doxyfile \
320   vtkvis/Makefile \
321   start_viz.sh \
322   start_nanoscale.sh])
Note: See TracBrowser for help on using the repository browser.