source: nanovis/tags/1.1.4/configure.in @ 5401

Last change on this file since 5401 was 4904, checked in by ldelgass, 10 years ago

Merge serveral changes from trunk. Does not include threading, world space
changes, etc.

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