1 | AC_INIT(rappture, 1.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 | |
---|
32 | AC_HEADER_STDC |
---|
33 | AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?)) |
---|
34 | |
---|
35 | AC_PROG_CXX |
---|
36 | AC_LANG_CPLUSPLUS |
---|
37 | |
---|
38 | AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(librappture requires libstdc++)) |
---|
39 | AC_CHECK_HEADERS(stack,,AC_MSG_WARN(STL classes missing ?)) |
---|
40 | AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?)) |
---|
41 | AC_CHECK_HEADERS(list,,AC_MSG_WARN(STL classes missing ?)) |
---|
42 | AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?)) |
---|
43 | |
---|
44 | AC_PROG_F77([g77 f77 fort77 f90 xlf xlf90 fl32]) |
---|
45 | |
---|
46 | |
---|
47 | |
---|
48 | |
---|
49 | dnl AC_ARG_ENABLE( |
---|
50 | dnl [tcl], |
---|
51 | dnl [AS_HELP_STRING([--enable-tcl], [build tcl bindings @<:@default=check@:>@])], |
---|
52 | dnl [], |
---|
53 | dnl [enable_tcl=check]) |
---|
54 | dnl |
---|
55 | dnl BUILD_TCL=yes |
---|
56 | dnl AC_SUBST(BUILD_TCL) |
---|
57 | |
---|
58 | |
---|
59 | dnl AC_ARG_ENABLE ( |
---|
60 | dnl [matlab], |
---|
61 | dnl [AS_HELP_STRING([--enable-matlab], [build matlab bindings @<:@default=check@:>@])], |
---|
62 | dnl [], |
---|
63 | dnl [enable_matlab=check]) |
---|
64 | dnl BUILD_MATLAB=yes |
---|
65 | dnl AC_SUBST(BUILD_MATLAB) |
---|
66 | |
---|
67 | AC_ARG_WITH( |
---|
68 | [matlab], |
---|
69 | [AS_HELP_STRING([--with-matlab[=DIR]], |
---|
70 | [location of matlab and mex compiler @<:@default=check@:>@])], |
---|
71 | [], |
---|
72 | [with_matlab=check]) |
---|
73 | |
---|
74 | AC_ARG_WITH( |
---|
75 | [matlab_arch], |
---|
76 | [AS_HELP_STRING([--with-matlab-arch[=ARCH]], |
---|
77 | [build Matlab bindings for ARCH architecture @<:@default=check@:>@])], |
---|
78 | [], |
---|
79 | [with_matlab_arch=check]) |
---|
80 | |
---|
81 | AC_ARG_WITH( |
---|
82 | [mexext], |
---|
83 | [AS_HELP_STRING([--with-mexext[=ARCH]], |
---|
84 | [fallback extension for building mex files @<:@default=check@:>@])], |
---|
85 | [], |
---|
86 | [with_mexext=check]) |
---|
87 | |
---|
88 | MEX= |
---|
89 | MEX_ARCH= |
---|
90 | MEXEXT= |
---|
91 | dnl if test "$enable_matlab" != "no" ; then |
---|
92 | AC_MSG_CHECKING([for mex]) |
---|
93 | if test "$with_matlab" != "no" ; then |
---|
94 | dnl WITH_MATLAB = "yes" |
---|
95 | if test -x "$with_matlab/bin/mex" |
---|
96 | then |
---|
97 | echo Found mex in $with_matlab/bin/mex |
---|
98 | MEX="$with_matlab/bin/mex" |
---|
99 | else |
---|
100 | if test -x "$with_matlab" |
---|
101 | then |
---|
102 | echo Found mex in $with_matlab |
---|
103 | MEX="$with_matlab" |
---|
104 | else |
---|
105 | AC_PATH_PROG(MEX, mex) |
---|
106 | fi |
---|
107 | fi |
---|
108 | AC_MSG_RESULT([${MEX}]) |
---|
109 | if test "$with_matlab_arch" = "check" ; then |
---|
110 | dnl still need to write the code to check the arch type |
---|
111 | with_matlab_arch="" |
---|
112 | fi |
---|
113 | if test "x$with_matlab_arch" != "x" ; then |
---|
114 | echo "using matlab architecture \"$with_matlab_arch\"" |
---|
115 | MEX_ARCH="-arch=$with_matlab_arch" |
---|
116 | dnl else |
---|
117 | dnl # if $with_matlab_arch is blank, get the os name from uname |
---|
118 | fi |
---|
119 | if test "x$MEX" != "x" ; then |
---|
120 | mexext_fxn=`dirname $MEX`/mexext |
---|
121 | if test -x "$mexext_fxn" ; then |
---|
122 | MEXEXT=`$mexext_fxn` |
---|
123 | if test "x${MEXEXT}" = "x" ; then |
---|
124 | dnl not even mexext can figure out what extension to use.... |
---|
125 | dnl # we should be doing an os type check instead of default mexglx |
---|
126 | dnl # use $with_matlab_arch |
---|
127 | if test "$with_mexext" != "check" ; then |
---|
128 | MEXEXT="mexglx" |
---|
129 | fi |
---|
130 | fi |
---|
131 | else |
---|
132 | if test "$with_mexext" != "check" ; then |
---|
133 | MEXEXT="mexglx" |
---|
134 | fi |
---|
135 | fi |
---|
136 | echo "Using mex file extension \"$MEXEXT\"" |
---|
137 | AC_MSG_RESULT([${MEXEXT}]) |
---|
138 | else |
---|
139 | echo "can't find the matlab compiler \"mex\"" |
---|
140 | echo "use --with-matlab=DIR to specify the location of a matlab installation" |
---|
141 | exit 1 |
---|
142 | fi |
---|
143 | fi |
---|
144 | dnl fi |
---|
145 | AC_SUBST(MEX) |
---|
146 | AC_SUBST(MEX_ARCH) |
---|
147 | AC_SUBST(MEXEXT) |
---|
148 | |
---|
149 | |
---|
150 | dnl AC_ARG_ENABLE( |
---|
151 | dnl [octave], |
---|
152 | dnl [AS_HELP_STRING([--enable-octave], [build octave bindings @<:@default=check@:>@])], |
---|
153 | dnl [], |
---|
154 | dnl [enable_octave=check]) |
---|
155 | dnl BUILD_OCTAVE=yes |
---|
156 | dnl AC_SUBST(BUILD_OCTAVE) |
---|
157 | |
---|
158 | |
---|
159 | AC_ARG_WITH( |
---|
160 | [octave], |
---|
161 | [AS_HELP_STRING([--with-octave[=DIR]], |
---|
162 | [location of octave compiler MKOCTFILE @<:@default=check@:>@])], |
---|
163 | [], |
---|
164 | [with_octave=check]) |
---|
165 | |
---|
166 | MKOCTFILE= |
---|
167 | dnl if test "$enable_octave" != "no" ; then |
---|
168 | AC_MSG_CHECKING([for mkoctfile]) |
---|
169 | if test "$with_octave" != "no" ; then |
---|
170 | if test -x "$with_octave/bin/mkoctfile" |
---|
171 | then |
---|
172 | echo Found octave in $with_octave/bin/mkoctfile |
---|
173 | MKOCTFILE="$with_octave/bin/mkoctfile" |
---|
174 | else |
---|
175 | if test -x "$with_octave" |
---|
176 | then |
---|
177 | echo Found mkoctfile in $with_octave |
---|
178 | MKOCTFILE="$with_octave" |
---|
179 | else |
---|
180 | AC_PATH_PROG(MKOCTFILE, mkoctfile) |
---|
181 | fi |
---|
182 | fi |
---|
183 | fi |
---|
184 | AC_MSG_RESULT([${MKOCTFILE}]) |
---|
185 | dnl fi |
---|
186 | AC_SUBST(MKOCTFILE) |
---|
187 | |
---|
188 | |
---|
189 | dnl perl and python check borrowed from |
---|
190 | dnl http://www.opensource.apple.com/darwinsource/Current/libxslt-8.1/libxslt/configure.in |
---|
191 | dnl |
---|
192 | dnl Perl is just needed for generating some data for XSLtmark |
---|
193 | dnl |
---|
194 | |
---|
195 | dnl AC_ARG_ENABLE( |
---|
196 | dnl [perl], |
---|
197 | dnl [AS_HELP_STRING([--enable-perl], [build perl bindings @<:@default=check@:>@])], |
---|
198 | dnl [], |
---|
199 | dnl [enable_perl=check]) |
---|
200 | |
---|
201 | dnl BUILD_PERL=yes |
---|
202 | dnl AC_SUBST(BUILD_PERL) |
---|
203 | |
---|
204 | AC_ARG_WITH( |
---|
205 | [perl], |
---|
206 | [AS_HELP_STRING([--with-perl[=DIR]], [location of perl @<:@default=check@:>@])], |
---|
207 | [], |
---|
208 | [with_perl=check]) |
---|
209 | |
---|
210 | PERL= |
---|
211 | PERL_INCLUDES= |
---|
212 | PERL_SITE_PACKAGES= |
---|
213 | AC_MSG_CHECKING([for mkoctfile]) |
---|
214 | if test "$with_perl" != "no" ; then |
---|
215 | if test -x "$with_perl/bin/perl" |
---|
216 | then |
---|
217 | echo Found perl in $with_perl/bin/perl |
---|
218 | PERL="$with_perl/bin/perl" |
---|
219 | else |
---|
220 | if test -x "$with_perl" |
---|
221 | then |
---|
222 | echo Found perl in $with_perl |
---|
223 | PERL="$with_perl" |
---|
224 | else |
---|
225 | AC_PATH_PROG(PERL, perl) |
---|
226 | fi |
---|
227 | fi |
---|
228 | PERL_SITE_PACKAGES='$(libdir)/perl5' |
---|
229 | fi |
---|
230 | AC_MSG_RESULT([${PERL}]) |
---|
231 | AC_SUBST(PERL) |
---|
232 | AC_SUBST(PERL_INCLUDES) |
---|
233 | AC_SUBST(PERL_SITE_PACKAGES) |
---|
234 | |
---|
235 | dnl |
---|
236 | dnl check for python |
---|
237 | dnl |
---|
238 | |
---|
239 | dnl AC_ARG_ENABLE( |
---|
240 | dnl [python], |
---|
241 | dnl [AS_HELP_STRING([--enable-pyton], [build python bindings @<:@default=check@:>@])], |
---|
242 | dnl [], |
---|
243 | dnl [enable_python=check]) |
---|
244 | dnl |
---|
245 | dnl BUILD_PYTHON=yes |
---|
246 | dnl AC_SUBST(BUILD_PYTHON) |
---|
247 | |
---|
248 | PYTHON= |
---|
249 | PYTHON_VERSION= |
---|
250 | PYTHON_INCLUDES= |
---|
251 | PYTHON_SITE_PACKAGES= |
---|
252 | pythondir= |
---|
253 | AC_ARG_WITH( |
---|
254 | [python], |
---|
255 | [AS_HELP_STRING([--with-python[=DIR]],[location of python @<:@default=check@:>@])], |
---|
256 | [], |
---|
257 | [with_python=check]) |
---|
258 | |
---|
259 | if test "$with_python" != "no" ; then |
---|
260 | if test -x "$with_python/bin/python" |
---|
261 | then |
---|
262 | echo Found python in $with_python/bin/python |
---|
263 | PYTHON="$with_python/bin/python" |
---|
264 | else |
---|
265 | if test -x "$with_python" |
---|
266 | then |
---|
267 | echo Found python in $with_python |
---|
268 | PYTHON="$with_python" |
---|
269 | else |
---|
270 | AC_PATH_PROG(PYTHON, python python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) |
---|
271 | fi |
---|
272 | fi |
---|
273 | if test "$PYTHON" != "" |
---|
274 | then |
---|
275 | PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"` |
---|
276 | echo Using python version $PYTHON_VERSION |
---|
277 | fi |
---|
278 | if test "$PYTHON_VERSION" != "" |
---|
279 | then |
---|
280 | if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \ |
---|
281 | -d $with_python/lib/python$PYTHON_VERSION/site-packages |
---|
282 | then |
---|
283 | PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION |
---|
284 | PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages |
---|
285 | else |
---|
286 | if test -r $prefix/include/python$PYTHON_VERSION/Python.h |
---|
287 | then |
---|
288 | PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)' |
---|
289 | PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
---|
290 | else |
---|
291 | if test -r /usr/include/python$PYTHON_VERSION/Python.h |
---|
292 | then |
---|
293 | PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION |
---|
294 | PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
---|
295 | else |
---|
296 | echo could not find python$PYTHON_VERSION/Python.h |
---|
297 | fi |
---|
298 | fi |
---|
299 | if test ! -d "$PYTHON_SITE_PACKAGES" |
---|
300 | then |
---|
301 | PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"` |
---|
302 | fi |
---|
303 | fi |
---|
304 | fi |
---|
305 | if test "$with_python" != "" |
---|
306 | then |
---|
307 | pythondir='$(PYTHON_SITE_PACKAGES)' |
---|
308 | else |
---|
309 | pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages' |
---|
310 | fi |
---|
311 | fi |
---|
312 | |
---|
313 | AC_SUBST(pythondir) |
---|
314 | dnl AC_SUBST(PYTHON_SUBDIR) |
---|
315 | |
---|
316 | AC_SUBST(PYTHON) |
---|
317 | AC_SUBST(PYTHON_VERSION) |
---|
318 | AC_SUBST(PYTHON_INCLUDES) |
---|
319 | AC_SUBST(PYTHON_SITE_PACKAGES) |
---|
320 | |
---|
321 | |
---|
322 | RP_BASE=`pwd` |
---|
323 | AC_SUBST(RP_BASE) |
---|
324 | |
---|
325 | AC_CONFIG_SUBDIRS( gui ) |
---|
326 | AC_CONFIG_SUBDIRS( src/tcl ) |
---|
327 | |
---|
328 | dnl read Makefile.in and write Makefile |
---|
329 | AC_OUTPUT( Makefile \ |
---|
330 | examples/demo.bash |
---|
331 | examples/app-fermi/cee/Makefile \ |
---|
332 | examples/app-fermi/fortran/Makefile \ |
---|
333 | examples/app-fermi/wrapper/cee/Makefile \ |
---|
334 | examples/c-example/Makefile \ |
---|
335 | perl/Makefile.PL \ |
---|
336 | python/setup.py \ |
---|
337 | src/Makefile \ |
---|
338 | src/matlab/Makefile \ |
---|
339 | src/octave/Makefile \ |
---|
340 | src2/core/Makefile \ |
---|
341 | test/Makefile \ |
---|
342 | gui/apps/simsim \ |
---|
343 | gui/apps/rappture \ |
---|
344 | gui/apps/rappture.env ) |
---|