[4060] | 1 | AC_PREREQ([2.60]) |
---|
| 2 | AC_INIT([nanovis], [1.2], [rappture@nanohub.org]) |
---|
| 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( |
---|
| 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], |
---|
| 37 | [Version of VTK required @<:@default=6.0@:>@])], |
---|
| 38 | [with_vtk=$withval], |
---|
| 39 | [with_vtk=yes]) |
---|
| 40 | |
---|
| 41 | AC_ARG_WITH( |
---|
| 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( |
---|
| 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 | |
---|
| 59 | if test "${prefix}" = "NONE"; then |
---|
| 60 | prefix=/usr/local |
---|
| 61 | fi |
---|
| 62 | if test "${exec_prefix}" = "NONE"; then |
---|
| 63 | exec_prefix=$prefix |
---|
| 64 | fi |
---|
| 65 | |
---|
| 66 | if test "x${incdir}" == "x"; then |
---|
| 67 | incdir=${exec_prefix}/include |
---|
| 68 | fi |
---|
| 69 | libdir=${exec_prefix}/lib |
---|
| 70 | |
---|
| 71 | if test "${libdir}" != "${prefix}/lib"; then |
---|
| 72 | LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}" |
---|
| 73 | else |
---|
| 74 | LIB_SEARCH_DIRS="-L ${libdir}" |
---|
| 75 | fi |
---|
| 76 | |
---|
| 77 | AC_PROG_INSTALL |
---|
| 78 | AC_PROG_RANLIB |
---|
| 79 | AC_PROG_LN_S |
---|
| 80 | AC_PROG_MKDIR_P |
---|
| 81 | |
---|
| 82 | dnl find and test the C compiler |
---|
| 83 | AC_PROG_CC |
---|
| 84 | AC_PROG_CPP |
---|
| 85 | AC_PROG_CXXCPP |
---|
| 86 | AC_PROG_CXX |
---|
| 87 | AC_LANG_CPLUSPLUS |
---|
| 88 | |
---|
| 89 | AC_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 | |
---|
| 95 | LD_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 | |
---|
| 110 | TCL_VERSION="8.4" |
---|
| 111 | for 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 |
---|
| 121 | done |
---|
| 122 | TCL_INC_SPEC="$TCL_INCLUDE_SPEC" |
---|
| 123 | |
---|
| 124 | if 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}" |
---|
| 130 | fi |
---|
| 131 | if test "x$with_tclinclude" != "x" ; then |
---|
| 132 | TCL_INC_SPEC="-I${with_tclinclude}" |
---|
| 133 | fi |
---|
| 134 | |
---|
| 135 | RP_DIR="" |
---|
| 136 | AC_MSG_CHECKING([for rappture]) |
---|
| 137 | if 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 |
---|
| 148 | else |
---|
| 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" |
---|
| 155 | fi |
---|
| 156 | if test "x${RP_DIR}" = "x" ; then |
---|
| 157 | AC_MSG_ERROR([cannot find rappture.h and librappture2.a, try using --with-rappture]) |
---|
| 158 | else |
---|
| 159 | AC_MSG_RESULT([$with_rappture]) |
---|
| 160 | fi |
---|
| 161 | |
---|
| 162 | # We are assuming that we're using VTK 6.0 |
---|
| 163 | VTK_VERSION=6.0 |
---|
| 164 | VTK_LIB_DIR=${libdir} |
---|
| 165 | VTK_INC_DIR=${incdir} |
---|
| 166 | |
---|
| 167 | if test "x$with_vtk_includes" != "x"; then |
---|
| 168 | VTK_INC_DIR=$with_vtk_includes |
---|
| 169 | fi |
---|
| 170 | |
---|
| 171 | if test "x$with_vtk_libs" != "x"; then |
---|
| 172 | VTK_LIB_DIR=$with_vtk_libs |
---|
| 173 | fi |
---|
| 174 | |
---|
| 175 | dnl Prefer our VTK installation over systems. --with-vtk overrides. |
---|
| 176 | if test "x$with_vtk" != "x" ; then |
---|
| 177 | VTK_VERSION=$with_vtk |
---|
| 178 | fi |
---|
| 179 | |
---|
| 180 | if ! test -d "$VTK_INC_DIR/vtk-${VTK_VERSION}" ; then |
---|
| 181 | AC_ERROR([Couldn't find VTK includes]) |
---|
| 182 | else |
---|
| 183 | VTK_INC_SPEC="-I${VTK_INC_DIR}/vtk-${VTK_VERSION}" |
---|
| 184 | fi |
---|
| 185 | |
---|
| 186 | save_CPPFLAGS=$CPPFLAGS |
---|
| 187 | CPPFLAGS=$VTK_INC_SPEC |
---|
| 188 | AC_CHECK_HEADERS([vtkSmartPointer.h], [], [AC_MSG_WARN([cannot find vtkSmartPointer.h])]) |
---|
| 189 | CPPFLAGS=$save_CPPFLAGS |
---|
| 190 | |
---|
| 191 | AC_CHECK_HEADER([GL/glut.h]) |
---|
| 192 | AC_CHECK_HEADER([GL/glew.h]) |
---|
| 193 | |
---|
| 194 | AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h]) |
---|
| 195 | AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h]) |
---|
| 196 | |
---|
| 197 | AC_CHECK_FUNCS([accept4]) |
---|
| 198 | |
---|
| 199 | #-------------------------------------------------------------------- |
---|
| 200 | # search for ffmpeg executable |
---|
| 201 | #-------------------------------------------------------------------- |
---|
| 202 | if 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 |
---|
| 211 | fi |
---|
| 212 | |
---|
| 213 | AC_MSG_CHECKING([for nVidia Cg installation]) |
---|
| 214 | CG_DIR="" |
---|
| 215 | for dir in \ |
---|
| 216 | /opt/nvidia-cg-toolkit \ |
---|
| 217 | /usr/cg \ |
---|
| 218 | /usr |
---|
| 219 | do |
---|
| 220 | if test -r "$dir/include" ; then |
---|
| 221 | CG_DIR=$dir |
---|
| 222 | break |
---|
| 223 | fi |
---|
| 224 | done |
---|
| 225 | AC_MSG_RESULT([${CG_DIR}]) |
---|
| 226 | |
---|
| 227 | CG_INC_SPEC="-I${CG_DIR}/include" |
---|
| 228 | |
---|
| 229 | save_CPPFLAGS=$CPPFLAGS |
---|
| 230 | CPPFLAGS="${CG_INC_SPEC} $CPPFLAGS" |
---|
| 231 | AC_CHECK_HEADERS([Cg/cgGL.h], [], AC_MSG_WARN([cannot find nVidia Cg headers])) |
---|
| 232 | CPPFLAGS=$save_CPPFLAGS |
---|
| 233 | |
---|
| 234 | CG_LIB_DIR="" |
---|
| 235 | for dir in \ |
---|
| 236 | /opt/nvidia-cg-toolkit \ |
---|
| 237 | /usr/cg \ |
---|
| 238 | /usr |
---|
| 239 | do |
---|
| 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 |
---|
| 248 | done |
---|
| 249 | |
---|
| 250 | if test "${CG_LIB_DIR}" = "/usr/lib" ; then |
---|
| 251 | CG_INC_SPEC="" |
---|
| 252 | CG_LIB_SPEC="-lCg -lCgGL" |
---|
| 253 | else |
---|
| 254 | CG_LIB_SPEC="-L${CG_LIB_DIR} -lCg -lCgGL" |
---|
| 255 | LD_RPATH="$loader_run_path:${CG_LIB_DIR}" |
---|
| 256 | fi |
---|
| 257 | |
---|
| 258 | AC_SUBST(CG_INC_SPEC) |
---|
| 259 | AC_SUBST(CG_LIB_SPEC) |
---|
| 260 | AC_SUBST(FFMPEG) |
---|
| 261 | AC_SUBST(LD_RPATH) |
---|
| 262 | AC_SUBST(RP_DIR) |
---|
| 263 | AC_SUBST(RP_INC_SPEC) |
---|
| 264 | AC_SUBST(RP_LIB_DIR) |
---|
| 265 | AC_SUBST(STATSDIR) |
---|
| 266 | AC_SUBST(TCL_INC_SPEC) |
---|
| 267 | AC_SUBST(TCL_LIB_SPEC) |
---|
| 268 | AC_SUBST(TCL_VERSION) |
---|
| 269 | AC_SUBST(VTK_VERSION) |
---|
| 270 | AC_SUBST(VTK_INC_DIR) |
---|
| 271 | AC_SUBST(VTK_LIB_DIR) |
---|
| 272 | |
---|
| 273 | AC_OUTPUT([ |
---|
| 274 | Doxyfile \ |
---|
| 275 | Makefile \ |
---|
| 276 | graphics/Makefile \ |
---|
| 277 | imgLoaders/Makefile \ |
---|
| 278 | newmat11/Makefile \ |
---|
| 279 | util/Makefile \ |
---|
| 280 | vrmath/Makefile]) |
---|