source: trunk/packages/vizservers/nanovis/configure.in @ 4060

Last change on this file since 4060 was 4060, checked in by ldelgass, 6 years ago

Add separate configure scripts for nanovis and vtkvis, remove them from the
vizservers configure (which now only configures nanoscale and pymolproxy).

File size: 6.5 KB
Line 
1AC_PREREQ([2.60])
2AC_INIT([nanovis], [1.2], [rappture@nanohub.org])
3AC_CONFIG_AUX_DIR(cf)
4AC_CONFIG_HEADERS([nvconf.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 @<:@default=6.0@:>@])],
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
48AC_ARG_WITH(
49    [statsdir],
50    [AS_HELP_STRING([--with-statsdir=DIR],
51        [Write statistics in DIR])],
52    [STATSDIR=$withval],
53    [STATSDIR="/var/tmp/visservers"])
54
55#------------------------------------------------------------------------
56# Handle the --prefix=... option
57#------------------------------------------------------------------------
58
59if test "${prefix}" = "NONE"; then
60    prefix=/usr/local
61fi
62if test "${exec_prefix}" = "NONE"; then
63    exec_prefix=$prefix
64fi
65
66if test "x${incdir}" == "x"; then
67  incdir=${exec_prefix}/include
68fi
69libdir=${exec_prefix}/lib
70
71if test "${libdir}" != "${prefix}/lib"; then
72    LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}"
73else
74    LIB_SEARCH_DIRS="-L ${libdir}"
75fi
76
77AC_PROG_INSTALL
78AC_PROG_RANLIB
79AC_PROG_LN_S
80AC_PROG_MKDIR_P
81
82dnl find and test the C compiler
83AC_PROG_CC
84AC_PROG_CPP
85AC_PROG_CXXCPP
86AC_PROG_CXX
87AC_LANG_CPLUSPLUS
88
89AC_C_BIGENDIAN
90
91# Save the values as shell variables so that we can substitute them
92# into bltHash.h for situtations where there's no bltInt.h.
93
94
95LD_RPATH="";
96
97#
98# Need to check for the following dependencies:
99#       Rappture headers and library (done)
100#       Tcl headers and library (done)
101#       GL headers and library
102#       GLuT headers and library
103#       GLEW header and library
104#       Cg headers and library
105#       CgGL headers and library
106#       pthread library
107#       ffmpeg headers and library (started)
108#
109
110TCL_VERSION="8.4"
111for dir in \
112 ${exec_prefix} \
113 ${exec_prefix}/lib \
114 ${with_rappture} \
115 ${with_rappture}/lib ; do
116  tclconfig="${dir}/tclConfig.sh"
117  if test -f "$tclconfig" ; then
118    . $tclconfig
119    break
120  fi
121done
122TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
123
124if test "x$with_tcllib" != "x" ; then
125   tclconfig="${with_tcllib}/tclConfig.sh"
126   if test -f "$tclconfig" ; then
127    . $tclconfig
128   fi
129   TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}"
130fi
131if test "x$with_tclinclude" != "x" ; then
132   TCL_INC_SPEC="-I${with_tclinclude}"
133fi
134
135RP_DIR=""
136AC_MSG_CHECKING([for rappture])
137if test "$with_rappture" == "yes" ; then
138  for dir in "$exec_prefix" "/usr" ; do
139    if test -r "$dir/include/rappture2/rappture2.h" -a \
140     -r "$dir/lib/librappture.a"; then
141      RP_DIR="$dir"
142      RP_INC_SPEC="-I$dir/include -I$dir/include/rappture2"
143      RP_LIB_DIR="$dir/lib"
144      AC_MSG_RESULT([$dir])
145      break
146    fi
147  done
148else
149  if test ! -d "$with_rappture" ; then
150    AC_MSG_ERROR([--with-rappture: no such directory $with_rappture])
151  fi
152  RP_DIR=$with_rappture
153  RP_INC_SPEC="-I$with_rappture/include -I$with_rappture/include/rappture2"
154  RP_LIB_DIR="$with_rappture/lib"
155fi
156if test "x${RP_DIR}" = "x" ; then
157  AC_MSG_ERROR([cannot find rappture.h and librappture2.a, try using --with-rappture])
158else
159  AC_MSG_RESULT([$with_rappture])
160fi
161
162# We are assuming that we're using VTK 6.0
163VTK_VERSION=6.0
164VTK_LIB_DIR=${libdir}
165VTK_INC_DIR=${incdir}
166
167if test "x$with_vtk_includes" != "x"; then
168   VTK_INC_DIR=$with_vtk_includes
169fi
170
171if test "x$with_vtk_libs" != "x"; then
172   VTK_LIB_DIR=$with_vtk_libs
173fi
174
175dnl Prefer our VTK installation over systems. --with-vtk overrides.
176if test "x$with_vtk" != "x" ; then
177   VTK_VERSION=$with_vtk
178fi
179
180if ! test -d "$VTK_INC_DIR/vtk-${VTK_VERSION}" ; then
181   AC_ERROR([Couldn't find VTK includes])
182else
183   VTK_INC_SPEC="-I${VTK_INC_DIR}/vtk-${VTK_VERSION}"
184fi
185
186save_CPPFLAGS=$CPPFLAGS
187CPPFLAGS=$VTK_INC_SPEC
188AC_CHECK_HEADERS([vtkSmartPointer.h], [], [AC_MSG_WARN([cannot find vtkSmartPointer.h])])
189CPPFLAGS=$save_CPPFLAGS
190
191AC_CHECK_HEADER([GL/glut.h])
192AC_CHECK_HEADER([GL/glew.h])
193
194AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h])
195AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h])
196
197AC_CHECK_FUNCS([accept4])
198
199#--------------------------------------------------------------------
200# search for ffmpeg executable
201#--------------------------------------------------------------------
202if test "${with_ffmpeg}" != "no" ; then
203  if test "${with_ffmpeg}" = "yes" ; then
204    AC_PATH_PROG(FFMPEG, ffmpeg)
205  else
206    AC_PATH_PROG(FFMPEG, ffmpeg, [], [${with_ffmpeg}/bin:${with_ffmpeg}])
207  fi
208  if test "${FFMPEG}x" != "x" ; then
209    AC_DEFINE(HAVE_FFMPEG, 1, [nanovis can use ffmpeg to create videos.])
210  fi
211fi
212
213AC_MSG_CHECKING([for nVidia Cg installation])
214CG_DIR=""
215for dir in \
216 /opt/nvidia-cg-toolkit \
217 /usr/cg \
218 /usr
219do
220  if test -r "$dir/include" ; then
221    CG_DIR=$dir
222    break
223  fi
224done
225AC_MSG_RESULT([${CG_DIR}])
226
227CG_INC_SPEC="-I${CG_DIR}/include"
228
229save_CPPFLAGS=$CPPFLAGS
230CPPFLAGS="${CG_INC_SPEC} $CPPFLAGS"
231AC_CHECK_HEADERS([Cg/cgGL.h], [], AC_MSG_WARN([cannot find nVidia Cg headers]))
232CPPFLAGS=$save_CPPFLAGS
233
234CG_LIB_DIR=""
235for dir in \
236 /opt/nvidia-cg-toolkit \
237 /usr/cg \
238 /usr
239do
240  if test -r "$dir/lib" ; then
241    CG_LIB_DIR=$dir/lib
242    break
243  fi
244  if test -r "$dir/lib64" ; then
245    CG_LIB_DIR=$dir/lib64
246    break
247  fi
248done
249
250if test "${CG_LIB_DIR}" = "/usr/lib" ; then
251  CG_INC_SPEC=""
252  CG_LIB_SPEC="-lCg -lCgGL"
253else
254  CG_LIB_SPEC="-L${CG_LIB_DIR} -lCg -lCgGL"
255  LD_RPATH="$loader_run_path:${CG_LIB_DIR}"
256fi
257
258AC_SUBST(CG_INC_SPEC)
259AC_SUBST(CG_LIB_SPEC)
260AC_SUBST(FFMPEG)
261AC_SUBST(LD_RPATH)
262AC_SUBST(RP_DIR)
263AC_SUBST(RP_INC_SPEC)
264AC_SUBST(RP_LIB_DIR)
265AC_SUBST(STATSDIR)
266AC_SUBST(TCL_INC_SPEC)
267AC_SUBST(TCL_LIB_SPEC)
268AC_SUBST(TCL_VERSION)
269AC_SUBST(VTK_VERSION)
270AC_SUBST(VTK_INC_DIR)
271AC_SUBST(VTK_LIB_DIR)
272
273AC_OUTPUT([
274   Doxyfile \
275   Makefile \
276   graphics/Makefile \
277   imgLoaders/Makefile \
278   newmat11/Makefile \
279   util/Makefile \
280   vrmath/Makefile])
Note: See TracBrowser for help on using the repository browser.