1 | AC_PREREQ([2.60]) |
---|
2 | AC_INIT([nanovis], [1.1], [rappture@nanohub.org]) |
---|
3 | AC_CONFIG_AUX_DIR(cf) |
---|
4 | AC_CONFIG_HEADERS([nvconf.h]) |
---|
5 | |
---|
6 | AC_ARG_WITH( |
---|
7 | [tcllib], |
---|
8 | [AS_HELP_STRING([--with-tcllib[=DIR]], |
---|
9 | [location of Tcl binary library libtclstubs.a @<:@default=/usr/lib@:>@])], |
---|
10 | [with_tcllib=$withval], |
---|
11 | [with_tcllib=""]) |
---|
12 | |
---|
13 | AC_ARG_WITH( |
---|
14 | [rappture], |
---|
15 | [AS_HELP_STRING([--with-rappture[=DIR]], |
---|
16 | [location of rappture files lib/librappture.a and include/rappture.h @<:@default=/usr@:>@])], |
---|
17 | [with_rappture=$withval], |
---|
18 | [with_rappture=yes]) |
---|
19 | |
---|
20 | AC_ARG_WITH( |
---|
21 | [ffmpeg], |
---|
22 | [AS_HELP_STRING([--with-ffmpeg[=DIR]], |
---|
23 | [location of ffmpeg @<:@default=yes@:>@])], |
---|
24 | [], |
---|
25 | [with_ffmpeg=yes]) |
---|
26 | |
---|
27 | AC_ARG_WITH( |
---|
28 | [statsdir], |
---|
29 | [AS_HELP_STRING([--with-statsdir=DIR], |
---|
30 | [Write statistics in DIR])], |
---|
31 | [STATSDIR=$withval], |
---|
32 | [STATSDIR="/var/tmp/visservers"]) |
---|
33 | |
---|
34 | #------------------------------------------------------------------------ |
---|
35 | # Handle the --prefix=... option |
---|
36 | #------------------------------------------------------------------------ |
---|
37 | |
---|
38 | if test "${prefix}" = "NONE"; then |
---|
39 | prefix=/usr/local |
---|
40 | fi |
---|
41 | if test "${exec_prefix}" = "NONE"; then |
---|
42 | exec_prefix=$prefix |
---|
43 | fi |
---|
44 | |
---|
45 | if test "x${incdir}" == "x"; then |
---|
46 | incdir=${exec_prefix}/include |
---|
47 | fi |
---|
48 | libdir=${exec_prefix}/lib |
---|
49 | |
---|
50 | if test "${libdir}" != "${prefix}/lib"; then |
---|
51 | LIB_SEARCH_DIRS="-L ${prefix}/lib -L ${libdir}" |
---|
52 | else |
---|
53 | LIB_SEARCH_DIRS="-L ${libdir}" |
---|
54 | fi |
---|
55 | |
---|
56 | AC_PROG_INSTALL |
---|
57 | AC_PROG_RANLIB |
---|
58 | AC_PROG_LN_S |
---|
59 | AC_PROG_MKDIR_P |
---|
60 | |
---|
61 | dnl find and test the C compiler |
---|
62 | AC_PROG_CC |
---|
63 | AC_PROG_CPP |
---|
64 | AC_PROG_CXXCPP |
---|
65 | AC_PROG_CXX |
---|
66 | AC_LANG_CPLUSPLUS |
---|
67 | |
---|
68 | AC_C_BIGENDIAN |
---|
69 | |
---|
70 | # Save the values as shell variables so that we can substitute them |
---|
71 | # into bltHash.h for situtations where there's no bltInt.h. |
---|
72 | |
---|
73 | |
---|
74 | LD_RPATH=""; |
---|
75 | |
---|
76 | # |
---|
77 | # Need to check for the following dependencies: |
---|
78 | # Rappture headers and library (done) |
---|
79 | # Tcl headers and library (done) |
---|
80 | # GL headers and library |
---|
81 | # GLuT headers and library |
---|
82 | # GLEW header and library |
---|
83 | # Cg headers and library |
---|
84 | # CgGL headers and library |
---|
85 | # pthread library |
---|
86 | # ffmpeg headers and library (started) |
---|
87 | # |
---|
88 | |
---|
89 | TCL_VERSION="8.4" |
---|
90 | for dir in \ |
---|
91 | ${exec_prefix} \ |
---|
92 | ${exec_prefix}/lib \ |
---|
93 | ${with_rappture} \ |
---|
94 | ${with_rappture}/lib ; do |
---|
95 | tclconfig="${dir}/tclConfig.sh" |
---|
96 | if test -f "$tclconfig" ; then |
---|
97 | . $tclconfig |
---|
98 | break |
---|
99 | fi |
---|
100 | done |
---|
101 | TCL_INC_SPEC="$TCL_INCLUDE_SPEC" |
---|
102 | |
---|
103 | if test "x$with_tcllib" != "x" ; then |
---|
104 | tclconfig="${with_tcllib}/tclConfig.sh" |
---|
105 | if test -f "$tclconfig" ; then |
---|
106 | . $tclconfig |
---|
107 | fi |
---|
108 | TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}" |
---|
109 | fi |
---|
110 | if test "x$with_tclinclude" != "x" ; then |
---|
111 | TCL_INC_SPEC="-I${with_tclinclude}" |
---|
112 | fi |
---|
113 | |
---|
114 | RP_DIR="" |
---|
115 | AC_MSG_CHECKING([for rappture]) |
---|
116 | if test "$with_rappture" == "yes" ; then |
---|
117 | for dir in "$exec_prefix" "/usr" ; do |
---|
118 | if test -r "$dir/include/rappture2/rappture2.h" -a \ |
---|
119 | -r "$dir/lib/librappture.a"; then |
---|
120 | RP_DIR="$dir" |
---|
121 | RP_INC_SPEC="-I$dir/include -I$dir/include/rappture2" |
---|
122 | RP_LIB_DIR="$dir/lib" |
---|
123 | AC_MSG_RESULT([$dir]) |
---|
124 | break |
---|
125 | fi |
---|
126 | done |
---|
127 | else |
---|
128 | if test ! -d "$with_rappture" ; then |
---|
129 | AC_MSG_ERROR([--with-rappture: no such directory $with_rappture]) |
---|
130 | fi |
---|
131 | RP_DIR=$with_rappture |
---|
132 | RP_INC_SPEC="-I$with_rappture/include -I$with_rappture/include/rappture2" |
---|
133 | RP_LIB_DIR="$with_rappture/lib" |
---|
134 | fi |
---|
135 | if test "x${RP_DIR}" = "x" ; then |
---|
136 | AC_MSG_ERROR([cannot find rappture.h and librappture2.a, try using --with-rappture]) |
---|
137 | else |
---|
138 | AC_MSG_RESULT([$with_rappture]) |
---|
139 | fi |
---|
140 | |
---|
141 | AC_CHECK_HEADER([GL/glut.h]) |
---|
142 | AC_CHECK_HEADER([GL/glew.h]) |
---|
143 | |
---|
144 | AC_CHECK_HEADERS([stdio.h unistd.h stdlib.h string.h sys/types.h]) |
---|
145 | AC_CHECK_HEADERS([sys/socket.h sys/time.h netinet/in.h arpa/inet.h netdb.h]) |
---|
146 | |
---|
147 | AC_CHECK_FUNCS([accept4]) |
---|
148 | |
---|
149 | #-------------------------------------------------------------------- |
---|
150 | # search for ffmpeg executable |
---|
151 | #-------------------------------------------------------------------- |
---|
152 | if test "${with_ffmpeg}" != "no" ; then |
---|
153 | if test "${with_ffmpeg}" = "yes" ; then |
---|
154 | AC_PATH_PROG(FFMPEG, ffmpeg) |
---|
155 | else |
---|
156 | AC_PATH_PROG(FFMPEG, ffmpeg, [], [${with_ffmpeg}/bin:${with_ffmpeg}]) |
---|
157 | fi |
---|
158 | if test "${FFMPEG}x" != "x" ; then |
---|
159 | AC_DEFINE(HAVE_FFMPEG, 1, [nanovis can use ffmpeg to create videos.]) |
---|
160 | fi |
---|
161 | fi |
---|
162 | |
---|
163 | AC_MSG_CHECKING([for nVidia Cg installation]) |
---|
164 | CG_DIR="" |
---|
165 | for dir in \ |
---|
166 | /opt/nvidia-cg-toolkit \ |
---|
167 | /usr/cg \ |
---|
168 | /usr |
---|
169 | do |
---|
170 | if test -r "$dir/include" ; then |
---|
171 | CG_DIR=$dir |
---|
172 | break |
---|
173 | fi |
---|
174 | done |
---|
175 | AC_MSG_RESULT([${CG_DIR}]) |
---|
176 | |
---|
177 | CG_INC_SPEC="-I${CG_DIR}/include" |
---|
178 | |
---|
179 | save_CPPFLAGS=$CPPFLAGS |
---|
180 | CPPFLAGS="${CG_INC_SPEC} $CPPFLAGS" |
---|
181 | AC_CHECK_HEADERS([Cg/cgGL.h], [], AC_MSG_WARN([cannot find nVidia Cg headers])) |
---|
182 | CPPFLAGS=$save_CPPFLAGS |
---|
183 | |
---|
184 | CG_LIB_DIR="" |
---|
185 | for dir in \ |
---|
186 | /opt/nvidia-cg-toolkit \ |
---|
187 | /usr/cg \ |
---|
188 | /usr |
---|
189 | do |
---|
190 | if test -r "$dir/lib" ; then |
---|
191 | CG_LIB_DIR=$dir/lib |
---|
192 | break |
---|
193 | fi |
---|
194 | if test -r "$dir/lib64" ; then |
---|
195 | CG_LIB_DIR=$dir/lib64 |
---|
196 | break |
---|
197 | fi |
---|
198 | done |
---|
199 | |
---|
200 | if test "${CG_LIB_DIR}" = "/usr/lib" ; then |
---|
201 | CG_INC_SPEC="" |
---|
202 | CG_LIB_SPEC="-lCg -lCgGL" |
---|
203 | else |
---|
204 | CG_LIB_SPEC="-L${CG_LIB_DIR} -lCg -lCgGL" |
---|
205 | LD_RPATH="$loader_run_path:${CG_LIB_DIR}" |
---|
206 | fi |
---|
207 | |
---|
208 | AC_SUBST(CG_INC_SPEC) |
---|
209 | AC_SUBST(CG_LIB_SPEC) |
---|
210 | AC_SUBST(FFMPEG) |
---|
211 | AC_SUBST(LD_RPATH) |
---|
212 | AC_SUBST(RP_DIR) |
---|
213 | AC_SUBST(RP_INC_SPEC) |
---|
214 | AC_SUBST(RP_LIB_DIR) |
---|
215 | AC_SUBST(STATSDIR) |
---|
216 | AC_SUBST(TCL_INC_SPEC) |
---|
217 | AC_SUBST(TCL_LIB_SPEC) |
---|
218 | AC_SUBST(TCL_VERSION) |
---|
219 | |
---|
220 | AC_OUTPUT([ |
---|
221 | Doxyfile \ |
---|
222 | Makefile \ |
---|
223 | graphics/Makefile \ |
---|
224 | imgLoaders/Makefile \ |
---|
225 | newmat11/Makefile \ |
---|
226 | util/Makefile \ |
---|
227 | vrmath/Makefile]) |
---|