AC_PREREQ([2.60]) AC_INIT(vizservers, 0.1, rappture@nanohub.org) AC_CONFIG_AUX_DIR(cf) AC_CONFIG_HEADERS([nanovis/nvconf.h nanoscale/config.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( [vtk-includes], [AS_HELP_STRING([--with-vtk-includes=DIR], [VTK include files are in DIR])], [with_vtk_includes=$withval], [with_vtk_includes=""]) AC_ARG_WITH( [vtk-libs], [AS_HELP_STRING([--with-vtk-libs=DIR], [VTK libraries are in DIR])], [with_vtk_libs=$withval], [with_vtk_libs=""]) AC_ARG_WITH( [vtk], [AS_HELP_STRING([--with-vtk=VERSION], [Version of VTK required])], [with_vtk=$withval], [with_vtk=yes]) RP_LANG_PYTHON VERSION=0.0.1 #------------------------------------------------------------------------ # 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 SC_CONFIG_CFLAGS AC_PATH_X 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 AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(long long, 8) AC_CHECK_SIZEOF(void *, 4) AC_CHECK_SIZEOF(float, 4) # 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 # GLui header and library # GLEW header and library # Cg headers and library # CgGL headers and library # pthread library # DX headers and library (done, sort of) # 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 dnl Prefer our VTK installation over systems. --with-vtk overrides. if test "$with_vtk" != "no" ; then if test "$with_vtk" = "yes" ; then for dir in vtk-5.{9,8,7,6,5,4,3,2,1} ; do if test -d "${libdir}/$dir" -a -d "${incdir}/$dir"; then VTK_LIB_SPEC="-L${libdir}/$dir" VTK_LIB_DIR="${libdir}/$dir" VTK_INC_SPEC="-I${incdir}/$dir" break fi if test -d "/usr/lib/$dir" -a -d "/usr/include/$dir"; then VTK_LIB_SPEC=-L/usr/lib/$dir VTK_LIB_DIR=/usr/lib/$dir VTK_INC_SPEC=-I/usr/include/$dir break fi done fi fi if test "x$with_vtk_includes" != "x"; then VTK_INC_SPEC=-I$with_vtk_includes fi if test "x$with_vtk_libs" != "x"; then VTK_LIB_DIR=$with_vtk_libs VTK_LIB_SPEC="-L$with_vtk_libs" fi save_CPPFLAGS=$CPPFLAGS CPPFLAGS=$VTK_INC_SPEC AC_CHECK_HEADERS([vtkSmartPointer.h], [], [AC_MSG_WARN([cannot find vtkSmartPointer.h])]) CPPFLAGS=$save_CPPFLAGS AC_CHECK_HEADER([GL/glui.h]) AC_CHECK_HEADER([glui.h]) 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]) AC_MSG_CHECKING([for OpenDX headers]) DX_INC_DIR="" for dir in \ /apps/rappture/include \ /usr/dx/include \ /usr/include do if test -r "${dir}/dx/dx.h" ; then DX_INC_DIR="$dir" break fi done if test "x${DX_INC_DIR}" = "x" ; then AC_MSG_WARN([cannot find OpenDX include files]) DX_INC_SPEC="" elif test "${DX_INC_DIR}" = "/usr/include" ; then DX_INC_SPEC="" else DX_INC_SPEC="-I{DX_INC_DIR}" fi AC_MSG_RESULT([${DX_INC_DIR}]) DX_LIB_DIR="" for dir in \ /usr/lib \ /usr/lib64 \ /usr/dx/lib_linux \ /usr/lib/dx/lib_linux \ /usr/lib64/dx/lib_linux \ /apps/rappture/lib do saveLDFLAGS=$LDFLAGS LDFLAGS="-L$dir $LDFLAGS" unset ac_cv_lib_DXcallm_DXGetComponentValue AC_CHECK_LIB([DXcallm], [DXGetComponentValue], [found=yes], [found=no], [-lX11]) LDFLAGS=$saveLDFLAGS if test "$found" = "yes" ; then DX_LIB_DIR="$dir" break fi done if test "x${DX_LIB_DIR}" = "x" ; then AC_MSG_WARN([cannot find OpenDX libraries]) fi AC_MSG_CHECKING([for libDXcallm library]) if test "x${DX_LIB_DIR}" = "x" -o "${DX_LIB_DIR}" = "/usr/lib" -o "${DX_LIB_DIR}" = "/usr/lib64"; then DX_LIB_SPEC="" else DX_LIB_SPEC="-L${DX_LIB_DIR}" fi AC_MSG_RESULT([$DX_LIB_SPEC]) AC_CHECK_HEADERS([opencv/cv.h opencv/highgui.h]) AC_CHECK_LIB([highgui], [cvLoadImage]) save_CPPFLAGS=$CPPFLAGS # Test for redhat-specific location of ffmpeg headers. if test -d "/usr/include/ffmpeg" ; then CPPFLAGS="$CPPFLAGS -I/usr/include/ffmpeg" FF_INC_SPEC="-I/usr/include/ffmpeg" fi AC_CHECK_HEADERS([ffmpeg/avcodec.h libavcodec/avcodec.h ffmpeg/avformat.h libavformat/avformat.h ffmpeg/avutil.h libavutil/avutil.h],,,[ #define SIZEOF_LONG ${ac_cv_sizeof_long} #if SIZEOF_LONG == 8 # define INT64_C(c) c ## L # define UINT64_C(c) c ## UL #else # define INT64_C(c) c ## LL # define UINT64_C(c) c ## ULL #endif ]) CPPFLAGS=$save_CPPFLAGS AC_CHECK_LIB([avcodec], [avcodec_alloc_frame]) # Fallback to deprecated av_alloc_format_context if avformat_alloc_context isn't found AC_CHECK_LIB([avformat], [avformat_alloc_context], [], AC_CHECK_LIB([avformat], [av_alloc_format_context], [], [AC_MSG_WARN([libavformat not usable])])) AC_CHECK_FUNCS([avformat_alloc_context]) AC_CHECK_LIB([avutil], [av_free]) AC_CHECK_FUNCS([img_convert]) 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_DIR="$dir/include" CG_LIB_DIR="$dir/lib" save_CPPFLAGS=$CPPFLAGS CPPFLAGS="-I${CG_INC_DIR} $CPPFLAGS" AC_CHECK_HEADERS([Cg/cgGL.h], [], AC_MSG_WARN([cannot find nVidia Cg headers])) CPPFLAGS=$save_CPPFLAGS if test "${CG_DIR}" = "/usr" ; then CG_DIR="" else LD_RPATH="$loader_run_path:${CG_LIB_DIR}" fi SUBDIRS="nanoscale nanovis pymolproxy vtkvis" AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) AC_SUBST(CG_DIR) AC_SUBST(CG_INC_DIR) AC_SUBST(CG_LIB_DIR) AC_SUBST(DX_INC_SPEC) AC_SUBST(DX_LIB_SPEC) AC_SUBST(FF_INC_SPEC) AC_SUBST(LD_RPATH) AC_SUBST(RP_DIR) AC_SUBST(RP_INC_SPEC) AC_SUBST(RP_LIB_DIR) AC_SUBST(SHLIB_CFLAGS) AC_SUBST(SHLIB_LD) AC_SUBST(SHLIB_LDFLAGS) AC_SUBST(SHLIB_SUFFIX) AC_SUBST(SIZEOF_FLOAT) AC_SUBST(SIZEOF_INT) AC_SUBST(SIZEOF_LONG) AC_SUBST(SIZEOF_LONG_LONG) AC_SUBST(SIZEOF_VOID_P) AC_SUBST(STLIB_LD) AC_SUBST(SUBDIRS) AC_SUBST(PYTHON) AC_SUBST(TCL_INC_SPEC) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_VERSION) AC_SUBST(VERSION) AC_SUBST(VTK_INC_SPEC) AC_SUBST(VTK_LIB_DIR) AC_OUTPUT([ Makefile \ nanoscale/Makefile \ nanoscale/renderservers.tcl \ nanovis/Makefile \ nanovis/newmat11/Makefile \ nanovis/R2/src/Makefile \ nanovis/vrutil/Makefile \ nanovis/vrmath/Makefile \ nanovis/vr3d/Makefile \ nanovis/imgLoaders/Makefile \ nanovis/transfer-function/Makefile \ pymolproxy/Makefile \ pymolproxy/pymol \ vtkvis/Doxyfile \ vtkvis/Makefile \ start_viz.sh \ start_nanoscale.sh])