1 | AC_INIT(vizservers, 0.1, rappture@nanohub.org) |
---|
2 | AC_CONFIG_HEADER(nanovis/nvconf.h nanoscale/config.h) |
---|
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 | |
---|
24 | SC_CONFIG_CFLAGS |
---|
25 | |
---|
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 | |
---|
34 | AC_PROG_INSTALL |
---|
35 | AC_PROG_RANLIB |
---|
36 | AC_PROG_LN_S |
---|
37 | AC_PROG_MKDIR_P |
---|
38 | |
---|
39 | dnl find and test the C compiler |
---|
40 | AC_PROG_CC |
---|
41 | AC_PROG_CPP |
---|
42 | AC_PROG_CXXCPP |
---|
43 | AC_PROG_CXX |
---|
44 | AC_LANG_CPLUSPLUS |
---|
45 | |
---|
46 | AC_C_BIGENDIAN |
---|
47 | |
---|
48 | LD_RPATH=""; |
---|
49 | |
---|
50 | SUBDIRS="nanoscale nanovis pymolproxy" |
---|
51 | AC_SUBST(SUBDIRS) |
---|
52 | |
---|
53 | AC_ARG_WITH( |
---|
54 | [tcllib], |
---|
55 | [AS_HELP_STRING([--with-tcllib[=DIR]], |
---|
56 | [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])], |
---|
57 | [with_tcllib=$withval], |
---|
58 | [with_tcllib=""]) |
---|
59 | |
---|
60 | # |
---|
61 | # Need to check for the following dependencies: |
---|
62 | # Rappture headers and library (done) |
---|
63 | # Tcl headers and library (done) |
---|
64 | # GL headers and library |
---|
65 | # GLuT headers and library |
---|
66 | # GLui header and library |
---|
67 | # GLEW header and library |
---|
68 | # Cg headers and library |
---|
69 | # CgGL headers and library |
---|
70 | # pthread library |
---|
71 | # DX headers and library (done, sort of) |
---|
72 | # ffmpeg headers and library (started) |
---|
73 | # |
---|
74 | |
---|
75 | TCL_VERSION="8.4" |
---|
76 | for dir in \ |
---|
77 | ${exec_prefix} \ |
---|
78 | ${exec_prefix}/lib \ |
---|
79 | ${with_rappture} \ |
---|
80 | ${with_rappture}/lib ; do |
---|
81 | tclconfig="${dir}/tclConfig.sh" |
---|
82 | if test -f "$tclconfig" ; then |
---|
83 | . $tclconfig |
---|
84 | break |
---|
85 | fi |
---|
86 | done |
---|
87 | TCL_INC_SPEC="$TCL_INCLUDE_SPEC" |
---|
88 | |
---|
89 | if test "x$with_tcllib" != "x" ; then |
---|
90 | tclconfig="${with_tcllib}/tclConfig.sh" |
---|
91 | if test -f "$tclconfig" ; then |
---|
92 | . $tclconfig |
---|
93 | fi |
---|
94 | TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}" |
---|
95 | fi |
---|
96 | if test "x$with_tclinclude" != "x" ; then |
---|
97 | TCL_INC_SPEC="-I${with_tclinclude}" |
---|
98 | fi |
---|
99 | |
---|
100 | AC_SUBST(TCL_VERSION) |
---|
101 | AC_SUBST(TCL_INC_SPEC) |
---|
102 | AC_SUBST(TCL_LIB_SPEC) |
---|
103 | |
---|
104 | AC_ARG_WITH( |
---|
105 | [rappture], |
---|
106 | [AS_HELP_STRING([--with-rappture[=DIR]], |
---|
107 | [location of rappture files lib/librappture2.a and include/rappture2/rappture2.h @<:@default=/usr@:>@])], |
---|
108 | [with_rappture=$withval], |
---|
109 | [with_rappture=/usr]) |
---|
110 | |
---|
111 | RP2_INCL_DIR="" |
---|
112 | RP_DIR="" |
---|
113 | AC_MSG_CHECKING([for rappture]) |
---|
114 | if test "x$with_rappture" != "x" ; then |
---|
115 | if test "x$with_rappture" != "xprefix" ; then |
---|
116 | if test -f "$with_rappture" |
---|
117 | then |
---|
118 | AC_MSG_RESULT([no]) |
---|
119 | AC_MSG_ERROR([please provide --with-rappture with directory]) |
---|
120 | else |
---|
121 | if test -d "$with_rappture" |
---|
122 | then |
---|
123 | if test -r "$with_rappture/include/rappture2/rappture2.h" -a -r "$with_rappture/lib/librappture2.a" |
---|
124 | then |
---|
125 | RP2_INCL_DIR="$with_rappture/include/rappture2" |
---|
126 | RP_DIR="$with_rappture" |
---|
127 | AC_MSG_RESULT([yes]) |
---|
128 | else |
---|
129 | AC_MSG_RESULT([no]) |
---|
130 | AC_MSG_ERROR([cannot find rappture2.h and librappture2.a, try using --with-rappture]) |
---|
131 | fi |
---|
132 | else |
---|
133 | AC_MSG_RESULT([no]) |
---|
134 | AC_MSG_ERROR([cannot find rappture2.h and librappture2.a inside $with_rappture, try using --with-rappture]) |
---|
135 | fi |
---|
136 | fi |
---|
137 | else |
---|
138 | RP2_INCL_DIR="$prefix/include/rappture2" |
---|
139 | RP_DIR="$prefix" |
---|
140 | AC_MSG_RESULT([set to prefix]) |
---|
141 | fi |
---|
142 | else |
---|
143 | AC_CHECK_HEADERS([rappture.h], [], |
---|
144 | [AC_MSG_ERROR([cannot find rappture.h, try using --with-rappture])]) |
---|
145 | |
---|
146 | |
---|
147 | fi |
---|
148 | AC_MSG_RESULT([${RP_DIR}/include]) |
---|
149 | AC_SUBST(RP2_INCL_DIR) |
---|
150 | AC_SUBST(RP_DIR) |
---|
151 | |
---|
152 | AC_CHECK_HEADER([GL/glui.h]) |
---|
153 | AC_CHECK_HEADER([glui.h]) |
---|
154 | AC_CHECK_HEADER([GL/glut.h]) |
---|
155 | AC_CHECK_HEADER([GL/glew.h]) |
---|
156 | AC_CHECK_HEADER([Cg/cgGL.h]) |
---|
157 | |
---|
158 | AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h]) |
---|
159 | AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h]) |
---|
160 | |
---|
161 | AC_MSG_CHECKING([for OpenDX headers]) |
---|
162 | DX_INC_DIR="" |
---|
163 | for dir in \ |
---|
164 | /apps/rappture/include \ |
---|
165 | /usr/dx/include \ |
---|
166 | /usr/include |
---|
167 | do |
---|
168 | if test -r "${dir}/dx/dx.h" ; then |
---|
169 | DX_INC_DIR="$dir" |
---|
170 | break |
---|
171 | fi |
---|
172 | done |
---|
173 | if test "x${DX_INC_DIR}" = "x" ; then |
---|
174 | AC_MSG_ERROR([can't find OpenDX include files]) |
---|
175 | fi |
---|
176 | |
---|
177 | if test "${DX_INC_DIR}" = "/usr/include" ; then |
---|
178 | DX_INC_SPEC="" |
---|
179 | else |
---|
180 | DX_INC_SPEC="-I{DX_INC_DIR}" |
---|
181 | fi |
---|
182 | AC_SUBST(DX_INC_SPEC) |
---|
183 | AC_MSG_RESULT([${DX_INC_DIR}]) |
---|
184 | |
---|
185 | AC_MSG_CHECKING([for OpenDX libraries]) |
---|
186 | DX_LIB_DIR="" |
---|
187 | for dir in \ |
---|
188 | /apps/rappture/lib \ |
---|
189 | /usr/lib/dx/lib_linux \ |
---|
190 | /usr/dx/lib_linux \ |
---|
191 | /usr/lib |
---|
192 | do |
---|
193 | if test -r "${dir}/libDXcallm.a" ; then |
---|
194 | DX_LIB_DIR="$dir" |
---|
195 | break |
---|
196 | fi |
---|
197 | done |
---|
198 | if test "x${DX_LIB_DIR}" = "x" ; then |
---|
199 | AC_MSG_ERROR([can't find OpenDX libraries]) |
---|
200 | fi |
---|
201 | |
---|
202 | if test "${DX_LIB_DIR}" = "/usr" ; then |
---|
203 | DX_LIB_SPEC="" |
---|
204 | else |
---|
205 | DX_LIB_SPEC="-L${DX_LIB_DIR}" |
---|
206 | fi |
---|
207 | |
---|
208 | AC_SUBST(DX_LIB_SPEC) |
---|
209 | AC_MSG_RESULT([${DX_LIB_DIR}]) |
---|
210 | |
---|
211 | AC_CHECK_HEADERS([ffmpeg/avcodec.h libavcodec/avcodec.h ffmpeg/avformat.h libavformat/avformat.h ffmpeg/avutil.h libavutil/avutil.h]) |
---|
212 | |
---|
213 | oldLIBS=$LIBS |
---|
214 | LIBS=-lavcodec |
---|
215 | AC_CHECK_FUNCS(img_convert) |
---|
216 | LIBS=-lavformat |
---|
217 | AC_CHECK_FUNCS(avformat_alloc_context) |
---|
218 | LIBS=$oldLIBS |
---|
219 | |
---|
220 | AC_MSG_CHECKING([for nVidia Cg installation]) |
---|
221 | CG_DIR="" |
---|
222 | for dir in \ |
---|
223 | /opt/nvidia-cg-toolkit \ |
---|
224 | /usr/cg \ |
---|
225 | /usr |
---|
226 | do |
---|
227 | if test -r "${dir}/include/Cg/cgGL.h" ; then |
---|
228 | CG_DIR="$dir" |
---|
229 | break |
---|
230 | fi |
---|
231 | done |
---|
232 | if test "x${CG_DIR}" = "x" ; then |
---|
233 | AC_MSG_ERROR([can't find nVidia Cg installation]) |
---|
234 | fi |
---|
235 | |
---|
236 | if test "${CG_DIR}" = "/usr" ; then |
---|
237 | CG_DIR="" |
---|
238 | else |
---|
239 | LD_RPATH="$loader_run_path:${CG_DIR}/lib" |
---|
240 | fi |
---|
241 | |
---|
242 | AC_SUBST(CG_DIR) |
---|
243 | AC_MSG_RESULT([${CG_DIR}]) |
---|
244 | AC_SUBST(LD_RPATH) |
---|
245 | |
---|
246 | dnl AC_MSG_CHECKING(tcl library version) |
---|
247 | dnl TCL=`AC_TRY_RUN([#include <tcl.h> |
---|
248 | dnl int main() {printf("tcl%s",TCL_VERSION);return(0);}],, |
---|
249 | dnl echo "tcl8.4", echo "tcl8.4")` |
---|
250 | dnl AC_MSG_RESULT($TCL) |
---|
251 | dnl AC_MSG_CHECKING(tk library version) |
---|
252 | dnl TK=`AC_TRY_RUN([#include <tk.h> |
---|
253 | dnl main() {printf("tk%s", TK_VERSION); exit(0);}],, |
---|
254 | dnl echo "tk8.4", echo "tk8.4")` |
---|
255 | dnl AC_MSG_RESULT($TK) |
---|
256 | |
---|
257 | |
---|
258 | AC_OUTPUT( Makefile \ |
---|
259 | nanoscale/Makefile \ |
---|
260 | nanovis/Makefile \ |
---|
261 | nanovis/newmat11/Makefile \ |
---|
262 | nanovis/R2/src/Makefile \ |
---|
263 | nanovis/vrutil/Makefile \ |
---|
264 | nanovis/vrmath/Makefile \ |
---|
265 | nanovis/vr3d/Makefile \ |
---|
266 | nanovis/imgLoaders/Makefile \ |
---|
267 | nanovis/transfer-function/Makefile \ |
---|
268 | pymolproxy/Makefile \ |
---|
269 | start_viz.sh ) |
---|