[749] | 1 | AC_INIT(vizservers, 0.1, rappture@nanohub.org) |
---|
[1115] | 2 | AC_CONFIG_HEADER(nanoscale/config.h) |
---|
[749] | 3 | |
---|
| 4 | VERSION=0.0.1 |
---|
| 5 | AC_SUBST(VERSION) |
---|
| 6 | |
---|
| 7 | #------------------------------------------------------------------------ |
---|
| 8 | # Handle the --prefix=... option |
---|
| 9 | #------------------------------------------------------------------------ |
---|
| 10 | |
---|
| 11 | if test "${prefix}" = "NONE"; then |
---|
| 12 | prefix=/usr/local |
---|
| 13 | fi |
---|
| 14 | if test "${exec_prefix}" = "NONE"; then |
---|
| 15 | exec_prefix=$prefix |
---|
| 16 | fi |
---|
| 17 | |
---|
| 18 | if test "${libdir}" != "${prefix}/lib"; then |
---|
| 19 | LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}" |
---|
| 20 | else |
---|
| 21 | LIB_SEARCH_DIRS="-L ${libdir}" |
---|
| 22 | fi |
---|
| 23 | |
---|
[1113] | 24 | SC_CONFIG_CFLAGS |
---|
[749] | 25 | |
---|
[1113] | 26 | AC_SUBST(CFLAGS_DEBUG) |
---|
| 27 | AC_SUBST(CFLAGS_OPTIMIZE) |
---|
| 28 | AC_SUBST(STLIB_LD) |
---|
| 29 | AC_SUBST(SHLIB_LD) |
---|
| 30 | AC_SUBST(SHLIB_CFLAGS) |
---|
| 31 | AC_SUBST(SHLIB_LDFLAGS) |
---|
| 32 | AC_SUBST(SHLIB_SUFFIX) |
---|
| 33 | |
---|
[749] | 34 | AC_PROG_INSTALL |
---|
[1111] | 35 | AC_PROG_RANLIB |
---|
| 36 | AC_PROG_LN_S |
---|
| 37 | AC_PROG_MKDIR_P |
---|
[749] | 38 | |
---|
| 39 | dnl find and test the C compiler |
---|
| 40 | AC_PROG_CC |
---|
[1113] | 41 | AC_PROG_CPP |
---|
| 42 | AC_PROG_CXXCPP |
---|
[749] | 43 | AC_PROG_CXX |
---|
| 44 | AC_LANG_CPLUSPLUS |
---|
| 45 | |
---|
[940] | 46 | AC_C_BIGENDIAN |
---|
| 47 | |
---|
[749] | 48 | SUBDIRS="nanoscale nanovis pymolproxy" |
---|
| 49 | AC_SUBST(SUBDIRS) |
---|
| 50 | |
---|
| 51 | AC_ARG_WITH( |
---|
| 52 | [tcllib], |
---|
| 53 | [AS_HELP_STRING([--with-tcllib[=DIR]], |
---|
| 54 | [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])], |
---|
| 55 | [with_tcllib=$withval], |
---|
[1114] | 56 | [with_tcllib=""]) |
---|
[749] | 57 | |
---|
[948] | 58 | # |
---|
| 59 | # Need to check for the following dependencies: |
---|
| 60 | # Rappture headers and library (done) |
---|
| 61 | # Tcl headers and library (done) |
---|
| 62 | # GL headers and library |
---|
| 63 | # GLuT headers and library |
---|
| 64 | # GLui header and library |
---|
| 65 | # GLEW header and library |
---|
| 66 | # Cg headers and library |
---|
| 67 | # CgGL headers and library |
---|
| 68 | # pthread library |
---|
| 69 | # DX headers and library (done, sort of) |
---|
| 70 | # |
---|
| 71 | |
---|
[1114] | 72 | TCL_VERSION="8.4" |
---|
| 73 | for dir in \ |
---|
| 74 | ${exec_prefix} \ |
---|
| 75 | ${exec_prefix}/lib \ |
---|
| 76 | ${with_rappture} \ |
---|
| 77 | ${with_rappture}/lib ; do |
---|
| 78 | tclconfig="${dir}/tclConfig.sh" |
---|
| 79 | if test -f "$tclconfig" ; then |
---|
[1113] | 80 | . $tclconfig |
---|
| 81 | break |
---|
| 82 | fi |
---|
| 83 | done |
---|
[1114] | 84 | TCL_INC_SPEC="$TCL_INCLUDE_SPEC" |
---|
[1113] | 85 | |
---|
[749] | 86 | if test "x$with_tcllib" != "x" ; then |
---|
[1114] | 87 | tclconfig="${with_tcllib}/tclConfig.sh" |
---|
| 88 | if test -f "$tclconfig" ; then |
---|
| 89 | . $tclconfig |
---|
| 90 | fi |
---|
| 91 | TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}" |
---|
[749] | 92 | fi |
---|
| 93 | if test "x$with_tclinclude" != "x" ; then |
---|
[1114] | 94 | TCL_INC_SPEC="-I${with_tclinclude}" |
---|
[749] | 95 | fi |
---|
| 96 | |
---|
[1114] | 97 | AC_SUBST(TCL_VERSION) |
---|
| 98 | AC_SUBST(TCL_INC_SPEC) |
---|
| 99 | AC_SUBST(TCL_LIB_SPEC) |
---|
| 100 | |
---|
[749] | 101 | AC_ARG_WITH( |
---|
| 102 | [rappture], |
---|
| 103 | [AS_HELP_STRING([--with-rappture[=DIR]], |
---|
| 104 | [location of rappture files lib/librappture2.a and include/rappture2/rappture2.h @<:@default=/usr@:>@])], |
---|
| 105 | [with_rappture=$withval], |
---|
| 106 | [with_rappture=/usr]) |
---|
| 107 | |
---|
| 108 | RP2_INCL_DIR="" |
---|
| 109 | RP_DIR="" |
---|
| 110 | AC_MSG_CHECKING([for rappture]) |
---|
| 111 | if test "x$with_rappture" != "x" ; then |
---|
[751] | 112 | if test "x$with_rappture" != "xprefix" ; then |
---|
| 113 | if test -f "$with_rappture" |
---|
[749] | 114 | then |
---|
[751] | 115 | AC_MSG_RESULT([no]) |
---|
| 116 | AC_MSG_ERROR([please provide --with-rappture with directory]) |
---|
| 117 | else |
---|
| 118 | if test -d "$with_rappture" |
---|
[749] | 119 | then |
---|
[751] | 120 | if test -r "$with_rappture/include/rappture2/rappture2.h" -a -r "$with_rappture/lib/librappture2.a" |
---|
| 121 | then |
---|
| 122 | RP2_INCL_DIR="$with_rappture/include/rappture2" |
---|
| 123 | RP_DIR="$with_rappture" |
---|
| 124 | AC_MSG_RESULT([yes]) |
---|
| 125 | else |
---|
| 126 | AC_MSG_RESULT([no]) |
---|
| 127 | AC_MSG_ERROR([cannot find rappture2.h and librappture2.a, try using --with-rappture]) |
---|
| 128 | fi |
---|
[749] | 129 | else |
---|
| 130 | AC_MSG_RESULT([no]) |
---|
[751] | 131 | AC_MSG_ERROR([cannot find rappture2.h and librappture2.a inside $with_rappture, try using --with-rappture]) |
---|
[749] | 132 | fi |
---|
| 133 | fi |
---|
[751] | 134 | else |
---|
| 135 | RP2_INCL_DIR="$prefix/include/rappture2" |
---|
| 136 | RP_DIR="$prefix" |
---|
| 137 | AC_MSG_RESULT([set to prefix]) |
---|
[749] | 138 | fi |
---|
| 139 | else |
---|
| 140 | AC_CHECK_HEADERS([rappture.h], [], |
---|
| 141 | [AC_MSG_ERROR([cannot find rappture.h, try using --with-rappture])]) |
---|
[944] | 142 | |
---|
| 143 | |
---|
[749] | 144 | fi |
---|
| 145 | AC_MSG_RESULT([${RP_DIR}/include]) |
---|
| 146 | AC_SUBST(RP2_INCL_DIR) |
---|
| 147 | AC_SUBST(RP_DIR) |
---|
| 148 | |
---|
[944] | 149 | AC_CHECK_HEADER([GL/glui.h]) |
---|
| 150 | AC_CHECK_HEADER([glui.h]) |
---|
| 151 | AC_CHECK_HEADER([GL/glut.h]) |
---|
| 152 | |
---|
[1115] | 153 | AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h]) |
---|
| 154 | AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h]) |
---|
| 155 | |
---|
[944] | 156 | AC_MSG_CHECKING([for DX installation]) |
---|
| 157 | DX_DIR="" |
---|
| 158 | for dir in \ |
---|
| 159 | /apps/rappture \ |
---|
| 160 | /usr/dx \ |
---|
| 161 | /usr |
---|
| 162 | do |
---|
| 163 | if test -r "${dir}/include/dx/dx.h" ; then |
---|
| 164 | DX_DIR="$dir" |
---|
| 165 | break |
---|
| 166 | fi |
---|
| 167 | done |
---|
| 168 | if test "x${DX_DIR}" = "x" ; then |
---|
| 169 | AC_MSG_ERROR([can't find OpenDX installation]) |
---|
| 170 | fi |
---|
| 171 | if test "${DX_DIR}" = "/usr" ; then |
---|
| 172 | DX_DIR="" |
---|
| 173 | fi |
---|
| 174 | AC_SUBST(DX_DIR) |
---|
| 175 | AC_MSG_RESULT([${DX_DIR}]) |
---|
| 176 | |
---|
[749] | 177 | dnl AC_MSG_CHECKING(tcl library version) |
---|
| 178 | dnl TCL=`AC_TRY_RUN([#include <tcl.h> |
---|
| 179 | dnl int main() {printf("tcl%s",TCL_VERSION);return(0);}],, |
---|
| 180 | dnl echo "tcl8.4", echo "tcl8.4")` |
---|
| 181 | dnl AC_MSG_RESULT($TCL) |
---|
| 182 | dnl AC_MSG_CHECKING(tk library version) |
---|
| 183 | dnl TK=`AC_TRY_RUN([#include <tk.h> |
---|
| 184 | dnl main() {printf("tk%s", TK_VERSION); exit(0);}],, |
---|
| 185 | dnl echo "tk8.4", echo "tk8.4")` |
---|
| 186 | dnl AC_MSG_RESULT($TK) |
---|
| 187 | |
---|
| 188 | |
---|
[760] | 189 | AC_OUTPUT( Makefile \ |
---|
| 190 | nanoscale/Makefile \ |
---|
| 191 | nanovis/Makefile \ |
---|
[914] | 192 | nanovis/newmat11/Makefile \ |
---|
| 193 | nanovis/R2/src/Makefile \ |
---|
[916] | 194 | nanovis/imgLoaders/Makefile \ |
---|
[940] | 195 | nanovis/transfer-function/Makefile \ |
---|
[760] | 196 | pymolproxy/Makefile \ |
---|
| 197 | start_viz.sh ) |
---|