[4160] | 1 | AC_PREREQ([2.60]) |
---|
[4937] | 2 | AC_INIT([nanovis], [1.2], [rappture@nanohub.org]) |
---|
[4160] | 3 | AC_CONFIG_AUX_DIR(cf) |
---|
| 4 | AC_CONFIG_HEADERS([nvconf.h]) |
---|
| 5 | |
---|
| 6 | AC_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 | |
---|
| 13 | AC_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 | |
---|
| 20 | AC_ARG_WITH( |
---|
[5472] | 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 | |
---|
| 27 | AC_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 | |
---|
| 34 | AC_ARG_WITH( |
---|
| 35 | [vtk], |
---|
| 36 | [AS_HELP_STRING([--with-vtk=VERSION], |
---|
[5842] | 37 | [Version of VTK required @<:@default=6.2@:>@])], |
---|
[5472] | 38 | [with_vtk=$withval], |
---|
| 39 | [with_vtk=""]) |
---|
| 40 | |
---|
| 41 | AC_ARG_WITH( |
---|
[4160] | 42 | [ffmpeg], |
---|
| 43 | [AS_HELP_STRING([--with-ffmpeg[=DIR]], |
---|
| 44 | [location of ffmpeg @<:@default=yes@:>@])], |
---|
| 45 | [], |
---|
| 46 | [with_ffmpeg=yes]) |
---|
| 47 | |
---|
| 48 | AC_ARG_WITH( |
---|
[4904] | 49 | [avconv], |
---|
| 50 | [AS_HELP_STRING([--with-avconv[=DIR]], |
---|
| 51 | [location of avconv @<:@default=yes@:>@])], |
---|
| 52 | [], |
---|
| 53 | [with_avconv=yes]) |
---|
| 54 | |
---|
| 55 | AC_ARG_WITH( |
---|
[4160] | 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 | |
---|
| 66 | if test "${prefix}" = "NONE"; then |
---|
| 67 | prefix=/usr/local |
---|
| 68 | fi |
---|
| 69 | if test "${exec_prefix}" = "NONE"; then |
---|
| 70 | exec_prefix=$prefix |
---|
| 71 | fi |
---|
| 72 | |
---|
| 73 | if test "x${incdir}" == "x"; then |
---|
| 74 | incdir=${exec_prefix}/include |
---|
| 75 | fi |
---|
| 76 | libdir=${exec_prefix}/lib |
---|
| 77 | |
---|
| 78 | if test "${libdir}" != "${prefix}/lib"; then |
---|
| 79 | LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}" |
---|
| 80 | else |
---|
| 81 | LIB_SEARCH_DIRS="-L ${libdir}" |
---|
| 82 | fi |
---|
| 83 | |
---|
| 84 | AC_PROG_INSTALL |
---|
| 85 | AC_PROG_RANLIB |
---|
| 86 | AC_PROG_LN_S |
---|
| 87 | AC_PROG_MKDIR_P |
---|
| 88 | |
---|
| 89 | dnl find and test the C compiler |
---|
| 90 | AC_PROG_CC |
---|
| 91 | AC_PROG_CPP |
---|
| 92 | AC_PROG_CXXCPP |
---|
| 93 | AC_PROG_CXX |
---|
| 94 | AC_LANG_CPLUSPLUS |
---|
| 95 | |
---|
| 96 | AC_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 | |
---|
| 102 | LD_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 | |
---|
| 117 | TCL_VERSION="8.4" |
---|
| 118 | for 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 |
---|
| 128 | done |
---|
| 129 | TCL_INC_SPEC="$TCL_INCLUDE_SPEC" |
---|
| 130 | |
---|
| 131 | if 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}" |
---|
| 137 | fi |
---|
| 138 | if test "x$with_tclinclude" != "x" ; then |
---|
| 139 | TCL_INC_SPEC="-I${with_tclinclude}" |
---|
| 140 | fi |
---|
| 141 | |
---|
| 142 | RP_DIR="" |
---|
| 143 | AC_MSG_CHECKING([for rappture]) |
---|
| 144 | if 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 |
---|
| 155 | else |
---|
| 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" |
---|
| 162 | fi |
---|
| 163 | if test "x${RP_DIR}" = "x" ; then |
---|
| 164 | AC_MSG_ERROR([cannot find rappture.h and librappture2.a, try using --with-rappture]) |
---|
| 165 | else |
---|
| 166 | AC_MSG_RESULT([$with_rappture]) |
---|
| 167 | fi |
---|
| 168 | |
---|
[5472] | 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 |
---|
[5842] | 172 | VTK_VERSION=6.2 |
---|
[5472] | 173 | VTK_LIB_DIR=${libdir} |
---|
| 174 | VTK_INC_DIR=${incdir} |
---|
| 175 | |
---|
| 176 | if test "x$with_vtk_includes" != "x"; then |
---|
| 177 | VTK_INC_DIR=$with_vtk_includes |
---|
| 178 | fi |
---|
| 179 | |
---|
| 180 | if test "x$with_vtk_libs" != "x"; then |
---|
| 181 | VTK_LIB_DIR=$with_vtk_libs |
---|
| 182 | fi |
---|
| 183 | |
---|
| 184 | if test "x$with_vtk" != "x" ; then |
---|
| 185 | VTK_VERSION=$with_vtk |
---|
| 186 | fi |
---|
| 187 | |
---|
| 188 | if ! test -d "$VTK_INC_DIR/vtk-${VTK_VERSION}" ; then |
---|
| 189 | AC_ERROR([Couldn't find VTK includes]) |
---|
| 190 | else |
---|
| 191 | VTK_INC_SPEC="-I${VTK_INC_DIR}/vtk-${VTK_VERSION}" |
---|
| 192 | fi |
---|
| 193 | |
---|
| 194 | save_CPPFLAGS=$CPPFLAGS |
---|
| 195 | CPPFLAGS=$VTK_INC_SPEC |
---|
| 196 | AC_CHECK_HEADERS([vtkSmartPointer.h], [], [AC_MSG_WARN([cannot find vtkSmartPointer.h])]) |
---|
| 197 | CPPFLAGS=$save_CPPFLAGS |
---|
| 198 | |
---|
[4160] | 199 | AC_CHECK_HEADER([GL/glut.h]) |
---|
| 200 | AC_CHECK_HEADER([GL/glew.h]) |
---|
| 201 | |
---|
| 202 | AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h]) |
---|
| 203 | AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h]) |
---|
| 204 | |
---|
| 205 | AC_CHECK_FUNCS([accept4]) |
---|
| 206 | |
---|
| 207 | #-------------------------------------------------------------------- |
---|
[4904] | 208 | # search for avconv executable |
---|
| 209 | #-------------------------------------------------------------------- |
---|
| 210 | if 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 |
---|
| 219 | fi |
---|
| 220 | |
---|
| 221 | #-------------------------------------------------------------------- |
---|
[4160] | 222 | # search for ffmpeg executable |
---|
| 223 | #-------------------------------------------------------------------- |
---|
| 224 | if 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 |
---|
| 233 | fi |
---|
| 234 | |
---|
| 235 | AC_MSG_CHECKING([for nVidia Cg installation]) |
---|
| 236 | CG_DIR="" |
---|
| 237 | for dir in \ |
---|
| 238 | /opt/nvidia-cg-toolkit \ |
---|
| 239 | /usr/cg \ |
---|
| 240 | /usr |
---|
| 241 | do |
---|
| 242 | if test -r "$dir/include" ; then |
---|
| 243 | CG_DIR=$dir |
---|
| 244 | break |
---|
| 245 | fi |
---|
| 246 | done |
---|
| 247 | AC_MSG_RESULT([${CG_DIR}]) |
---|
| 248 | |
---|
| 249 | CG_INC_SPEC="-I${CG_DIR}/include" |
---|
| 250 | |
---|
| 251 | save_CPPFLAGS=$CPPFLAGS |
---|
| 252 | CPPFLAGS="${CG_INC_SPEC} $CPPFLAGS" |
---|
| 253 | AC_CHECK_HEADERS([Cg/cgGL.h], [], AC_MSG_WARN([cannot find nVidia Cg headers])) |
---|
| 254 | CPPFLAGS=$save_CPPFLAGS |
---|
| 255 | |
---|
| 256 | CG_LIB_DIR="" |
---|
| 257 | for dir in \ |
---|
| 258 | /opt/nvidia-cg-toolkit \ |
---|
| 259 | /usr/cg \ |
---|
| 260 | /usr |
---|
| 261 | do |
---|
| 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 |
---|
| 270 | done |
---|
| 271 | |
---|
| 272 | if test "${CG_LIB_DIR}" = "/usr/lib" ; then |
---|
| 273 | CG_INC_SPEC="" |
---|
| 274 | CG_LIB_SPEC="-lCg -lCgGL" |
---|
| 275 | else |
---|
| 276 | CG_LIB_SPEC="-L${CG_LIB_DIR} -lCg -lCgGL" |
---|
| 277 | LD_RPATH="$loader_run_path:${CG_LIB_DIR}" |
---|
| 278 | fi |
---|
| 279 | |
---|
| 280 | AC_SUBST(CG_INC_SPEC) |
---|
| 281 | AC_SUBST(CG_LIB_SPEC) |
---|
[4904] | 282 | AC_SUBST(AVCONV) |
---|
[4160] | 283 | AC_SUBST(FFMPEG) |
---|
| 284 | AC_SUBST(LD_RPATH) |
---|
| 285 | AC_SUBST(RP_DIR) |
---|
| 286 | AC_SUBST(RP_INC_SPEC) |
---|
| 287 | AC_SUBST(RP_LIB_DIR) |
---|
| 288 | AC_SUBST(STATSDIR) |
---|
| 289 | AC_SUBST(TCL_INC_SPEC) |
---|
| 290 | AC_SUBST(TCL_LIB_SPEC) |
---|
| 291 | AC_SUBST(TCL_VERSION) |
---|
[5472] | 292 | AC_SUBST(VTK_VERSION) |
---|
| 293 | AC_SUBST(VTK_INC_DIR) |
---|
| 294 | AC_SUBST(VTK_LIB_DIR) |
---|
[4160] | 295 | |
---|
| 296 | AC_OUTPUT([ |
---|
| 297 | Doxyfile \ |
---|
| 298 | Makefile \ |
---|
| 299 | graphics/Makefile \ |
---|
| 300 | imgLoaders/Makefile \ |
---|
| 301 | newmat11/Makefile \ |
---|
| 302 | util/Makefile \ |
---|
| 303 | vrmath/Makefile]) |
---|