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