source: nanovis/trunk/configure.in @ 5722

Last change on this file since 5722 was 5483, checked in by ldelgass, 4 years ago

whitespace/comment

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