[749] | 1 | AC_INIT(vizservers, 0.1, rappture@nanohub.org) |
---|
| 2 | |
---|
| 3 | VERSION=0.0.1 |
---|
| 4 | AC_SUBST(VERSION) |
---|
| 5 | |
---|
| 6 | #------------------------------------------------------------------------ |
---|
| 7 | # Handle the --prefix=... option |
---|
| 8 | #------------------------------------------------------------------------ |
---|
| 9 | |
---|
| 10 | if test "${prefix}" = "NONE"; then |
---|
| 11 | prefix=/usr/local |
---|
| 12 | fi |
---|
| 13 | if test "${exec_prefix}" = "NONE"; then |
---|
| 14 | exec_prefix=$prefix |
---|
| 15 | fi |
---|
| 16 | |
---|
| 17 | if test "${libdir}" != "${prefix}/lib"; then |
---|
| 18 | LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}" |
---|
| 19 | else |
---|
| 20 | LIB_SEARCH_DIRS="-L ${libdir}" |
---|
| 21 | fi |
---|
| 22 | |
---|
| 23 | AC_SUBST(LIB_SEARCH_DIRS) |
---|
| 24 | |
---|
| 25 | AC_PROG_INSTALL |
---|
| 26 | AC_PROG_MAKE_SET |
---|
| 27 | |
---|
| 28 | dnl find and test the C compiler |
---|
| 29 | AC_PROG_CC |
---|
| 30 | AC_LANG_C |
---|
| 31 | |
---|
[914] | 32 | AC_PROG_RANLIB |
---|
| 33 | |
---|
[749] | 34 | AC_PROG_CXX |
---|
| 35 | AC_LANG_CPLUSPLUS |
---|
| 36 | |
---|
[940] | 37 | AC_C_BIGENDIAN |
---|
| 38 | |
---|
[749] | 39 | SUBDIRS="nanoscale nanovis pymolproxy" |
---|
| 40 | AC_SUBST(SUBDIRS) |
---|
| 41 | |
---|
| 42 | AC_ARG_WITH( |
---|
| 43 | [tcllib], |
---|
| 44 | [AS_HELP_STRING([--with-tcllib[=DIR]], |
---|
| 45 | [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])], |
---|
| 46 | [with_tcllib=$withval], |
---|
| 47 | [with_tcllib=/usr/lib]) |
---|
| 48 | |
---|
[948] | 49 | # |
---|
| 50 | # Need to check for the following dependencies: |
---|
| 51 | # Rappture headers and library (done) |
---|
| 52 | # Tcl headers and library (done) |
---|
| 53 | # GL headers and library |
---|
| 54 | # GLuT headers and library |
---|
| 55 | # GLui header and library |
---|
| 56 | # GLEW header and library |
---|
| 57 | # Cg headers and library |
---|
| 58 | # CgGL headers and library |
---|
| 59 | # pthread library |
---|
| 60 | # DX headers and library (done, sort of) |
---|
| 61 | # |
---|
| 62 | |
---|
[749] | 63 | TCL_LIB_DIR="" |
---|
| 64 | TCL_LIB="" |
---|
| 65 | TCL_LIB_VERSION="" |
---|
| 66 | AC_MSG_CHECKING([for tcl binary libraries]) |
---|
| 67 | if test "x$with_tcllib" != "x" ; then |
---|
| 68 | if test -f "$with_tcllib" |
---|
| 69 | then |
---|
| 70 | if test -n `basename $with_tcllib | grep libtcl[0-9]\.[0-9].so` |
---|
| 71 | then |
---|
| 72 | TCL_LIB_DIR="$with_tcllib" |
---|
| 73 | fi |
---|
| 74 | else |
---|
| 75 | if test -d "$with_tcllib" |
---|
| 76 | then |
---|
| 77 | if test -x "$with_tcllib/`ls $with_tcllib | grep libtcl[0-9]\.[0-9]\.so$`" |
---|
| 78 | then |
---|
| 79 | TCL_LIB_DIR="$with_tcllib" |
---|
| 80 | else |
---|
| 81 | AC_MSG_RESULT([no]) |
---|
| 82 | AC_MSG_ERROR([cannot find tcl binary libraries, try using --with-tcllib]) |
---|
| 83 | fi |
---|
| 84 | else |
---|
| 85 | AC_MSG_RESULT([no]) |
---|
| 86 | AC_MSG_ERROR([cannot find tcl binary libraries inside $with_tcllib, try using --with-tcllib]) |
---|
| 87 | fi |
---|
| 88 | fi |
---|
| 89 | else |
---|
| 90 | AC_CHECK_HEADERS([tcl.h], [], |
---|
| 91 | [AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])]) |
---|
| 92 | fi |
---|
| 93 | # TCL_LIB=$(ls ${TCL_LIB_DIR} | grep -o libtcl[0-9]\.[0-9]) |
---|
| 94 | # TCL_LIB=`ls ${TCL_LIB_DIR} | awk '/libtcl([0-9]\.?[0-9])?\.so/ { print }'` |
---|
| 95 | # TCL_LIB=`ls ${TCL_LIB_DIR} | sed -e '/libtcl([0-9]\.?[0-9])?\.so$/ {p}'` |
---|
| 96 | # TCL_LIB_VERSION=$(echo ${TCL_LIB} | sed -e s/libtcl// -e s/\.so//) |
---|
| 97 | AC_MSG_RESULT([${TCL_LIB_DIR}/${TCL_LIB}]) |
---|
| 98 | # echo TCL_LIB_DIR = ${TCL_LIB_DIR} |
---|
| 99 | # echo TCL_LIB = ${TCL_LIB} |
---|
| 100 | # echo TCL_LIB_VERSION = ${TCL_LIB_VERSION} |
---|
| 101 | AC_SUBST(TCL_LIB_DIR) |
---|
| 102 | AC_SUBST(TCL_LIB) |
---|
| 103 | AC_SUBST(TCL_LIB_VERSION) |
---|
| 104 | |
---|
| 105 | AC_ARG_WITH( |
---|
| 106 | [tclinclude], |
---|
| 107 | [AS_HELP_STRING([--with-tclinclude[=DIR]], |
---|
| 108 | [location of tcl.h header file @<:@default=/usr/include@:>@])], |
---|
| 109 | [with_tclinclude=$withval], |
---|
| 110 | [with_tclinclude=/usr/include]) |
---|
| 111 | |
---|
| 112 | TCL_INCL_DIR="" |
---|
| 113 | AC_MSG_CHECKING([for tcl.h]) |
---|
| 114 | if test "x$with_tclinclude" != "x" ; then |
---|
| 115 | if test -f "$with_tclinclude" |
---|
| 116 | then |
---|
| 117 | if test `basename $with_tclinclude` = "tcl.h" |
---|
| 118 | then |
---|
| 119 | TCL_INCL_DIR="`dirname $with_tclinclude`" |
---|
| 120 | fi |
---|
| 121 | else |
---|
| 122 | if test -d "$with_tclinclude" |
---|
| 123 | then |
---|
| 124 | if test -r "$with_tclinclude/tcl.h" |
---|
| 125 | then |
---|
| 126 | TCL_INCL_DIR="$with_tclinclude" |
---|
| 127 | else |
---|
| 128 | if test -r "$with_tclinclude/tcl${TCL_LIB_VERSION}/tcl.h" |
---|
| 129 | then |
---|
| 130 | TCL_INCL_DIR="$with_tclinclude/tcl${TCL_LIB_VERSION}" |
---|
| 131 | else |
---|
| 132 | AC_MSG_RESULT([no]) |
---|
| 133 | AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude]) |
---|
| 134 | fi |
---|
| 135 | fi |
---|
| 136 | else |
---|
| 137 | AC_MSG_RESULT([no]) |
---|
| 138 | AC_MSG_ERROR([cannot find tcl.h inside $with_tclinclude, try using --with-tclinclude]) |
---|
| 139 | fi |
---|
| 140 | fi |
---|
| 141 | else |
---|
| 142 | AC_CHECK_HEADERS([tcl.h], [], |
---|
| 143 | [AC_MSG_ERROR([cannot find tcl.h, try using --with-tclinclude])]) |
---|
| 144 | fi |
---|
| 145 | AC_MSG_RESULT([${TCL_INCL_DIR}]) |
---|
| 146 | AC_SUBST(TCL_INCL_DIR) |
---|
| 147 | |
---|
| 148 | AC_ARG_WITH( |
---|
| 149 | [rappture], |
---|
| 150 | [AS_HELP_STRING([--with-rappture[=DIR]], |
---|
| 151 | [location of rappture files lib/librappture2.a and include/rappture2/rappture2.h @<:@default=/usr@:>@])], |
---|
| 152 | [with_rappture=$withval], |
---|
| 153 | [with_rappture=/usr]) |
---|
| 154 | |
---|
| 155 | RP2_INCL_DIR="" |
---|
| 156 | RP_DIR="" |
---|
| 157 | AC_MSG_CHECKING([for rappture]) |
---|
| 158 | if test "x$with_rappture" != "x" ; then |
---|
[751] | 159 | if test "x$with_rappture" != "xprefix" ; then |
---|
| 160 | if test -f "$with_rappture" |
---|
[749] | 161 | then |
---|
[751] | 162 | AC_MSG_RESULT([no]) |
---|
| 163 | AC_MSG_ERROR([please provide --with-rappture with directory]) |
---|
| 164 | else |
---|
| 165 | if test -d "$with_rappture" |
---|
[749] | 166 | then |
---|
[751] | 167 | if test -r "$with_rappture/include/rappture2/rappture2.h" -a -r "$with_rappture/lib/librappture2.a" |
---|
| 168 | then |
---|
| 169 | RP2_INCL_DIR="$with_rappture/include/rappture2" |
---|
| 170 | RP_DIR="$with_rappture" |
---|
| 171 | AC_MSG_RESULT([yes]) |
---|
| 172 | else |
---|
| 173 | AC_MSG_RESULT([no]) |
---|
| 174 | AC_MSG_ERROR([cannot find rappture2.h and librappture2.a, try using --with-rappture]) |
---|
| 175 | fi |
---|
[749] | 176 | else |
---|
| 177 | AC_MSG_RESULT([no]) |
---|
[751] | 178 | AC_MSG_ERROR([cannot find rappture2.h and librappture2.a inside $with_rappture, try using --with-rappture]) |
---|
[749] | 179 | fi |
---|
| 180 | fi |
---|
[751] | 181 | else |
---|
| 182 | RP2_INCL_DIR="$prefix/include/rappture2" |
---|
| 183 | RP_DIR="$prefix" |
---|
| 184 | AC_MSG_RESULT([set to prefix]) |
---|
[749] | 185 | fi |
---|
| 186 | else |
---|
| 187 | AC_CHECK_HEADERS([rappture.h], [], |
---|
| 188 | [AC_MSG_ERROR([cannot find rappture.h, try using --with-rappture])]) |
---|
[944] | 189 | |
---|
| 190 | |
---|
[749] | 191 | fi |
---|
| 192 | AC_MSG_RESULT([${RP_DIR}/include]) |
---|
| 193 | AC_SUBST(RP2_INCL_DIR) |
---|
| 194 | AC_SUBST(RP_DIR) |
---|
| 195 | |
---|
[944] | 196 | AC_CHECK_HEADER([GL/glui.h]) |
---|
| 197 | AC_CHECK_HEADER([glui.h]) |
---|
| 198 | AC_CHECK_HEADER([GL/glut.h]) |
---|
| 199 | |
---|
| 200 | AC_MSG_CHECKING([for DX installation]) |
---|
| 201 | DX_DIR="" |
---|
| 202 | for dir in \ |
---|
| 203 | /apps/rappture \ |
---|
| 204 | /usr/dx \ |
---|
| 205 | /usr |
---|
| 206 | do |
---|
| 207 | if test -r "${dir}/include/dx/dx.h" ; then |
---|
| 208 | DX_DIR="$dir" |
---|
| 209 | break |
---|
| 210 | fi |
---|
| 211 | done |
---|
| 212 | if test "x${DX_DIR}" = "x" ; then |
---|
| 213 | AC_MSG_ERROR([can't find OpenDX installation]) |
---|
| 214 | fi |
---|
| 215 | if test "${DX_DIR}" = "/usr" ; then |
---|
| 216 | DX_DIR="" |
---|
| 217 | fi |
---|
| 218 | AC_SUBST(DX_DIR) |
---|
| 219 | AC_MSG_RESULT([${DX_DIR}]) |
---|
| 220 | |
---|
[749] | 221 | dnl AC_MSG_CHECKING(tcl library version) |
---|
| 222 | dnl TCL=`AC_TRY_RUN([#include <tcl.h> |
---|
| 223 | dnl int main() {printf("tcl%s",TCL_VERSION);return(0);}],, |
---|
| 224 | dnl echo "tcl8.4", echo "tcl8.4")` |
---|
| 225 | dnl AC_MSG_RESULT($TCL) |
---|
| 226 | dnl AC_MSG_CHECKING(tk library version) |
---|
| 227 | dnl TK=`AC_TRY_RUN([#include <tk.h> |
---|
| 228 | dnl main() {printf("tk%s", TK_VERSION); exit(0);}],, |
---|
| 229 | dnl echo "tk8.4", echo "tk8.4")` |
---|
| 230 | dnl AC_MSG_RESULT($TK) |
---|
| 231 | |
---|
| 232 | |
---|
[760] | 233 | AC_OUTPUT( Makefile \ |
---|
| 234 | nanoscale/Makefile \ |
---|
| 235 | nanovis/Makefile \ |
---|
[914] | 236 | nanovis/newmat11/Makefile \ |
---|
| 237 | nanovis/R2/src/Makefile \ |
---|
[916] | 238 | nanovis/imgLoaders/Makefile \ |
---|
[940] | 239 | nanovis/transfer-function/Makefile \ |
---|
[760] | 240 | pymolproxy/Makefile \ |
---|
| 241 | start_viz.sh ) |
---|