AC_PREREQ([2.60]) AC_INIT([nanovis], [1.1], [rappture@nanohub.org]) AC_CONFIG_AUX_DIR(cf) AC_CONFIG_HEADERS([nvconf.h]) AC_ARG_WITH( [tcllib], [AS_HELP_STRING([--with-tcllib[=DIR]], [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])], [with_tcllib=$withval], [with_tcllib=""]) AC_ARG_WITH( [rappture], [AS_HELP_STRING([--with-rappture[=DIR]], [location of rappture files lib/librappture.a and include/rappture.h @<:@default=/usr@:>@])], [with_rappture=$withval], [with_rappture=yes]) AC_ARG_WITH( [ffmpeg], [AS_HELP_STRING([--with-ffmpeg[=DIR]], [location of ffmpeg @<:@default=yes@:>@])], [], [with_ffmpeg=yes]) AC_ARG_WITH( [statsdir], [AS_HELP_STRING([--with-statsdir=DIR], [Write statistics in DIR])], [STATSDIR=$withval], [STATSDIR="/var/tmp/visservers"]) #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ if test "${prefix}" = "NONE"; then prefix=/usr/local fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi if test "x${incdir}" == "x"; then incdir=${exec_prefix}/include fi libdir=${exec_prefix}/lib if test "${libdir}" != "${prefix}/lib"; then LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}" else LIB_SEARCH_DIRS="-L ${libdir}" fi AC_PROG_INSTALL AC_PROG_RANLIB AC_PROG_LN_S AC_PROG_MKDIR_P dnl find and test the C compiler AC_PROG_CC AC_PROG_CPP AC_PROG_CXXCPP AC_PROG_CXX AC_LANG_CPLUSPLUS AC_C_BIGENDIAN # Save the values as shell variables so that we can substitute them # into bltHash.h for situtations where there's no bltInt.h. LD_RPATH=""; # # Need to check for the following dependencies: # Rappture headers and library (done) # Tcl headers and library (done) # GL headers and library # GLuT headers and library # GLEW header and library # Cg headers and library # CgGL headers and library # pthread library # ffmpeg headers and library (started) # TCL_VERSION="8.4" for dir in \ ${exec_prefix} \ ${exec_prefix}/lib \ ${with_rappture} \ ${with_rappture}/lib ; do tclconfig="${dir}/tclConfig.sh" if test -f "$tclconfig" ; then . $tclconfig break fi done TCL_INC_SPEC="$TCL_INCLUDE_SPEC" if test "x$with_tcllib" != "x" ; then tclconfig="${with_tcllib}/tclConfig.sh" if test -f "$tclconfig" ; then . $tclconfig fi TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}" fi if test "x$with_tclinclude" != "x" ; then TCL_INC_SPEC="-I${with_tclinclude}" fi RP_DIR="" AC_MSG_CHECKING([for rappture]) if test "$with_rappture" == "yes" ; then for dir in "$exec_prefix" "/usr" ; do if test -r "$dir/include/rappture2/rappture2.h" -a \ -r "$dir/lib/librappture.a"; then RP_DIR="$dir" RP_INC_SPEC="-I$dir/include -I$dir/include/rappture2" RP_LIB_DIR="$dir/lib" AC_MSG_RESULT([$dir]) break fi done else if test ! -d "$with_rappture" ; then AC_MSG_ERROR([--with-rappture: no such directory $with_rappture]) fi RP_DIR=$with_rappture RP_INC_SPEC="-I$with_rappture/include -I$with_rappture/include/rappture2" RP_LIB_DIR="$with_rappture/lib" fi if test "x${RP_DIR}" = "x" ; then AC_MSG_ERROR([cannot find rappture.h and librappture2.a, try using --with-rappture]) else AC_MSG_RESULT([$with_rappture]) fi AC_CHECK_HEADER([GL/glut.h]) AC_CHECK_HEADER([GL/glew.h]) AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h]) AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h]) AC_CHECK_FUNCS([accept4]) #-------------------------------------------------------------------- # search for ffmpeg executable #-------------------------------------------------------------------- if test "${with_ffmpeg}" != "no" ; then if test "${with_ffmpeg}" = "yes" ; then AC_PATH_PROG(FFMPEG, ffmpeg) else AC_PATH_PROG(FFMPEG, ffmpeg, [], [${with_ffmpeg}/bin:${with_ffmpeg}]) fi if test "${FFMPEG}x" != "x" ; then AC_DEFINE(HAVE_FFMPEG, 1, [nanovis can use ffmpeg to create videos.]) fi fi AC_MSG_CHECKING([for nVidia Cg installation]) CG_DIR="" for dir in \ /opt/nvidia-cg-toolkit \ /usr/cg \ /usr do if test -r "$dir/include" ; then CG_DIR=$dir break fi done AC_MSG_RESULT([${CG_DIR}]) CG_INC_SPEC="-I${CG_DIR}/include" save_CPPFLAGS=$CPPFLAGS CPPFLAGS="${CG_INC_SPEC} $CPPFLAGS" AC_CHECK_HEADERS([Cg/cgGL.h], [], AC_MSG_WARN([cannot find nVidia Cg headers])) CPPFLAGS=$save_CPPFLAGS CG_LIB_DIR="" for dir in \ /opt/nvidia-cg-toolkit \ /usr/cg \ /usr do if test -r "$dir/lib" ; then CG_LIB_DIR=$dir/lib break fi if test -r "$dir/lib64" ; then CG_LIB_DIR=$dir/lib64 break fi done if test "${CG_LIB_DIR}" = "/usr/lib" ; then CG_INC_SPEC="" CG_LIB_SPEC="-lCg -lCgGL" else CG_LIB_SPEC="-L${CG_LIB_DIR} -lCg -lCgGL" LD_RPATH="$loader_run_path:${CG_LIB_DIR}" fi AC_SUBST(CG_INC_SPEC) AC_SUBST(CG_LIB_SPEC) AC_SUBST(FFMPEG) AC_SUBST(LD_RPATH) AC_SUBST(RP_DIR) AC_SUBST(RP_INC_SPEC) AC_SUBST(RP_LIB_DIR) AC_SUBST(STATSDIR) AC_SUBST(TCL_INC_SPEC) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_VERSION) AC_OUTPUT([ Doxyfile \ Makefile \ graphics/Makefile \ imgLoaders/Makefile \ newmat11/Makefile \ util/Makefile \ vrmath/Makefile])