source: nanovis/branches/1.1/configure.in @ 4804

Last change on this file since 4804 was 4600, checked in by ldelgass, 5 years ago

Nanovis 1.1 doesn't depend on VTK, so remove VTK search from configure

File size: 5.3 KB
Line 
1AC_PREREQ([2.60])
2AC_INIT([nanovis], [1.1], [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    [ffmpeg],
22    [AS_HELP_STRING([--with-ffmpeg[=DIR]],
23      [location of ffmpeg @<:@default=yes@:>@])],
24    [],
25    [with_ffmpeg=yes])
26
27AC_ARG_WITH(
28    [statsdir],
29    [AS_HELP_STRING([--with-statsdir=DIR],
30        [Write statistics in DIR])],
31    [STATSDIR=$withval],
32    [STATSDIR="/var/tmp/visservers"])
33
34#------------------------------------------------------------------------
35# Handle the --prefix=... option
36#------------------------------------------------------------------------
37
38if test "${prefix}" = "NONE"; then
39    prefix=/usr/local
40fi
41if test "${exec_prefix}" = "NONE"; then
42    exec_prefix=$prefix
43fi
44
45if test "x${incdir}" == "x"; then
46  incdir=${exec_prefix}/include
47fi
48libdir=${exec_prefix}/lib
49
50if test "${libdir}" != "${prefix}/lib"; then
51    LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}"
52else
53    LIB_SEARCH_DIRS="-L ${libdir}"
54fi
55
56AC_PROG_INSTALL
57AC_PROG_RANLIB
58AC_PROG_LN_S
59AC_PROG_MKDIR_P
60
61dnl find and test the C compiler
62AC_PROG_CC
63AC_PROG_CPP
64AC_PROG_CXXCPP
65AC_PROG_CXX
66AC_LANG_CPLUSPLUS
67
68AC_C_BIGENDIAN
69
70# Save the values as shell variables so that we can substitute them
71# into bltHash.h for situtations where there's no bltInt.h.
72
73
74LD_RPATH="";
75
76#
77# Need to check for the following dependencies:
78#       Rappture headers and library (done)
79#       Tcl headers and library (done)
80#       GL headers and library
81#       GLuT headers and library
82#       GLEW header and library
83#       Cg headers and library
84#       CgGL headers and library
85#       pthread library
86#       ffmpeg headers and library (started)
87#
88
89TCL_VERSION="8.4"
90for dir in \
91 ${exec_prefix} \
92 ${exec_prefix}/lib \
93 ${with_rappture} \
94 ${with_rappture}/lib ; do
95  tclconfig="${dir}/tclConfig.sh"
96  if test -f "$tclconfig" ; then
97    . $tclconfig
98    break
99  fi
100done
101TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
102
103if test "x$with_tcllib" != "x" ; then
104   tclconfig="${with_tcllib}/tclConfig.sh"
105   if test -f "$tclconfig" ; then
106    . $tclconfig
107   fi
108   TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}"
109fi
110if test "x$with_tclinclude" != "x" ; then
111   TCL_INC_SPEC="-I${with_tclinclude}"
112fi
113
114RP_DIR=""
115AC_MSG_CHECKING([for rappture])
116if test "$with_rappture" == "yes" ; then
117  for dir in "$exec_prefix" "/usr" ; do
118    if test -r "$dir/include/rappture2/rappture2.h" -a \
119     -r "$dir/lib/librappture.a"; then
120      RP_DIR="$dir"
121      RP_INC_SPEC="-I$dir/include -I$dir/include/rappture2"
122      RP_LIB_DIR="$dir/lib"
123      AC_MSG_RESULT([$dir])
124      break
125    fi
126  done
127else
128  if test ! -d "$with_rappture" ; then
129    AC_MSG_ERROR([--with-rappture: no such directory $with_rappture])
130  fi
131  RP_DIR=$with_rappture
132  RP_INC_SPEC="-I$with_rappture/include -I$with_rappture/include/rappture2"
133  RP_LIB_DIR="$with_rappture/lib"
134fi
135if test "x${RP_DIR}" = "x" ; then
136  AC_MSG_ERROR([cannot find rappture.h and librappture2.a, try using --with-rappture])
137else
138  AC_MSG_RESULT([$with_rappture])
139fi
140
141AC_CHECK_HEADER([GL/glut.h])
142AC_CHECK_HEADER([GL/glew.h])
143
144AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h])
145AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h])
146
147AC_CHECK_FUNCS([accept4])
148
149#--------------------------------------------------------------------
150# search for ffmpeg executable
151#--------------------------------------------------------------------
152if test "${with_ffmpeg}" != "no" ; then
153  if test "${with_ffmpeg}" = "yes" ; then
154    AC_PATH_PROG(FFMPEG, ffmpeg)
155  else
156    AC_PATH_PROG(FFMPEG, ffmpeg, [], [${with_ffmpeg}/bin:${with_ffmpeg}])
157  fi
158  if test "${FFMPEG}x" != "x" ; then
159    AC_DEFINE(HAVE_FFMPEG, 1, [nanovis can use ffmpeg to create videos.])
160  fi
161fi
162
163AC_MSG_CHECKING([for nVidia Cg installation])
164CG_DIR=""
165for dir in \
166 /opt/nvidia-cg-toolkit \
167 /usr/cg \
168 /usr
169do
170  if test -r "$dir/include" ; then
171    CG_DIR=$dir
172    break
173  fi
174done
175AC_MSG_RESULT([${CG_DIR}])
176
177CG_INC_SPEC="-I${CG_DIR}/include"
178
179save_CPPFLAGS=$CPPFLAGS
180CPPFLAGS="${CG_INC_SPEC} $CPPFLAGS"
181AC_CHECK_HEADERS([Cg/cgGL.h], [], AC_MSG_WARN([cannot find nVidia Cg headers]))
182CPPFLAGS=$save_CPPFLAGS
183
184CG_LIB_DIR=""
185for dir in \
186 /opt/nvidia-cg-toolkit \
187 /usr/cg \
188 /usr
189do
190  if test -r "$dir/lib" ; then
191    CG_LIB_DIR=$dir/lib
192    break
193  fi
194  if test -r "$dir/lib64" ; then
195    CG_LIB_DIR=$dir/lib64
196    break
197  fi
198done
199
200if test "${CG_LIB_DIR}" = "/usr/lib" ; then
201  CG_INC_SPEC=""
202  CG_LIB_SPEC="-lCg -lCgGL"
203else
204  CG_LIB_SPEC="-L${CG_LIB_DIR} -lCg -lCgGL"
205  LD_RPATH="$loader_run_path:${CG_LIB_DIR}"
206fi
207
208AC_SUBST(CG_INC_SPEC)
209AC_SUBST(CG_LIB_SPEC)
210AC_SUBST(FFMPEG)
211AC_SUBST(LD_RPATH)
212AC_SUBST(RP_DIR)
213AC_SUBST(RP_INC_SPEC)
214AC_SUBST(RP_LIB_DIR)
215AC_SUBST(STATSDIR)
216AC_SUBST(TCL_INC_SPEC)
217AC_SUBST(TCL_LIB_SPEC)
218AC_SUBST(TCL_VERSION)
219
220AC_OUTPUT([
221   Doxyfile \
222   Makefile \
223   graphics/Makefile \
224   imgLoaders/Makefile \
225   newmat11/Makefile \
226   util/Makefile \
227   vrmath/Makefile])
Note: See TracBrowser for help on using the repository browser.