AC_INIT(vizservers, 0.1, rappture@nanohub.org) VERSION=0.0.1 AC_SUBST(VERSION) #------------------------------------------------------------------------ # 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 "${libdir}" != "${prefix}/lib"; then LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}" else LIB_SEARCH_DIRS="-L ${libdir}" fi AC_SUBST(LIB_SEARCH_DIRS) AC_PROG_INSTALL AC_PROG_MAKE_SET dnl find and test the C compiler AC_PROG_CC AC_LANG_C AC_PROG_RANLIB AC_PROG_CXX AC_LANG_CPLUSPLUS AC_C_BIGENDIAN SUBDIRS="nanoscale nanovis pymolproxy" AC_SUBST(SUBDIRS) 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=/usr/lib]) TCL_LIB_DIR="" TCL_LIB="" TCL_LIB_VERSION="" AC_MSG_CHECKING([for tcl binary libraries]) if test "x$with_tcllib" != "x" ; then if test -f "$with_tcllib" then if test -n `basename $with_tcllib | grep libtcl[0-9]\.[0-9].so` then TCL_LIB_DIR="$with_tcllib" fi else if test -d "$with_tcllib" then if test -x "$with_tcllib/`ls $with_tcllib | grep libtcl[0-9]\.[0-9]\.so$`" then TCL_LIB_DIR="$with_tcllib" else AC_MSG_RESULT([no]) AC_MSG_ERROR([cannot find tcl binary libraries, try using --with-tcllib]) fi else AC_MSG_RESULT([no]) AC_MSG_ERROR([cannot find tcl binary libraries inside $with_tcllib, try using --with-tcllib]) fi fi else AC_CHECK_HEADERS([tcl.h], [], [AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])]) fi # TCL_LIB=$(ls ${TCL_LIB_DIR} | grep -o libtcl[0-9]\.[0-9]) # TCL_LIB=`ls ${TCL_LIB_DIR} | awk '/libtcl([0-9]\.?[0-9])?\.so/ { print }'` # TCL_LIB=`ls ${TCL_LIB_DIR} | sed -e '/libtcl([0-9]\.?[0-9])?\.so$/ {p}'` # TCL_LIB_VERSION=$(echo ${TCL_LIB} | sed -e s/libtcl// -e s/\.so//) AC_MSG_RESULT([${TCL_LIB_DIR}/${TCL_LIB}]) # echo TCL_LIB_DIR = ${TCL_LIB_DIR} # echo TCL_LIB = ${TCL_LIB} # echo TCL_LIB_VERSION = ${TCL_LIB_VERSION} AC_SUBST(TCL_LIB_DIR) AC_SUBST(TCL_LIB) AC_SUBST(TCL_LIB_VERSION) AC_ARG_WITH( [tclinclude], [AS_HELP_STRING([--with-tclinclude[=DIR]], [location of tcl.h header file @<:@default=/usr/include@:>@])], [with_tclinclude=$withval], [with_tclinclude=/usr/include]) TCL_INCL_DIR="" AC_MSG_CHECKING([for tcl.h]) if test "x$with_tclinclude" != "x" ; then if test -f "$with_tclinclude" then if test `basename $with_tclinclude` = "tcl.h" then TCL_INCL_DIR="`dirname $with_tclinclude`" fi else if test -d "$with_tclinclude" then if test -r "$with_tclinclude/tcl.h" then TCL_INCL_DIR="$with_tclinclude" else if test -r "$with_tclinclude/tcl${TCL_LIB_VERSION}/tcl.h" then TCL_INCL_DIR="$with_tclinclude/tcl${TCL_LIB_VERSION}" else AC_MSG_RESULT([no]) AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude]) fi fi else AC_MSG_RESULT([no]) AC_MSG_ERROR([cannot find tcl.h inside $with_tclinclude, try using --with-tclinclude]) fi fi else AC_CHECK_HEADERS([tcl.h], [], [AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])]) fi AC_MSG_RESULT([${TCL_INCL_DIR}]) AC_SUBST(TCL_INCL_DIR) AC_ARG_WITH( [rappture], [AS_HELP_STRING([--with-rappture[=DIR]], [location of rappture files lib/librappture2.a and include/rappture2/rappture2.h @<:@default=/usr@:>@])], [with_rappture=$withval], [with_rappture=/usr]) RP2_INCL_DIR="" RP_DIR="" AC_MSG_CHECKING([for rappture]) if test "x$with_rappture" != "x" ; then if test "x$with_rappture" != "xprefix" ; then if test -f "$with_rappture" then AC_MSG_RESULT([no]) AC_MSG_ERROR([please provide --with-rappture with directory]) else if test -d "$with_rappture" then if test -r "$with_rappture/include/rappture2/rappture2.h" -a -r "$with_rappture/lib/librappture2.a" then RP2_INCL_DIR="$with_rappture/include/rappture2" RP_DIR="$with_rappture" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) AC_MSG_ERROR([cannot find rappture2.h and librappture2.a, try using --with-rappture]) fi else AC_MSG_RESULT([no]) AC_MSG_ERROR([cannot find rappture2.h and librappture2.a inside $with_rappture, try using --with-rappture]) fi fi else RP2_INCL_DIR="$prefix/include/rappture2" RP_DIR="$prefix" AC_MSG_RESULT([set to prefix]) fi else AC_CHECK_HEADERS([rappture.h], [], [AC_MSG_ERROR([cannot find rappture.h, try using --with-rappture])]) fi AC_MSG_RESULT([${RP_DIR}/include]) AC_SUBST(RP2_INCL_DIR) AC_SUBST(RP_DIR) AC_CHECK_HEADER([GL/glui.h]) AC_CHECK_HEADER([glui.h]) AC_CHECK_HEADER([GL/glut.h]) AC_MSG_CHECKING([for DX installation]) DX_DIR="" for dir in \ /apps/rappture \ /usr/dx \ /usr do if test -r "${dir}/include/dx/dx.h" ; then DX_DIR="$dir" break fi done if test "x${DX_DIR}" = "x" ; then AC_MSG_ERROR([can't find OpenDX installation]) fi if test "${DX_DIR}" = "/usr" ; then DX_DIR="" fi AC_SUBST(DX_DIR) AC_MSG_RESULT([${DX_DIR}]) dnl AC_MSG_CHECKING(tcl library version) dnl TCL=`AC_TRY_RUN([#include dnl int main() {printf("tcl%s",TCL_VERSION);return(0);}],, dnl echo "tcl8.4", echo "tcl8.4")` dnl AC_MSG_RESULT($TCL) dnl AC_MSG_CHECKING(tk library version) dnl TK=`AC_TRY_RUN([#include dnl main() {printf("tk%s", TK_VERSION); exit(0);}],, dnl echo "tk8.4", echo "tk8.4")` dnl AC_MSG_RESULT($TK) AC_OUTPUT( Makefile \ nanoscale/Makefile \ nanovis/Makefile \ nanovis/newmat11/Makefile \ nanovis/R2/src/Makefile \ nanovis/imgLoaders/Makefile \ nanovis/transfer-function/Makefile \ pymolproxy/Makefile \ start_viz.sh )