1 | AC_INIT(Rappture Core and Bindings, 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 | if test "$with_matlab" != "no" ; then |
---|
93 | AC_MSG_CHECKING([for matlab's mex]) |
---|
94 | if test "$with_matlab" != "no" ; then |
---|
95 | dnl WITH_MATLAB = "yes" |
---|
96 | if test -x "$with_matlab/bin/mex" |
---|
97 | then |
---|
98 | dnl # echo Found mex in $with_matlab/bin/mex |
---|
99 | MEX="$with_matlab/bin/mex" |
---|
100 | else |
---|
101 | if test -x "$with_matlab" |
---|
102 | then |
---|
103 | dnl # echo Found mex in $with_matlab |
---|
104 | MEX="$with_matlab" |
---|
105 | else |
---|
106 | AC_PATH_PROG(MEX, mex) |
---|
107 | fi |
---|
108 | fi |
---|
109 | matlab_path=`dirname $MEX`/matlab |
---|
110 | if test -x "$matlab_path" |
---|
111 | then |
---|
112 | MEX=${MEX} |
---|
113 | else |
---|
114 | MEX= |
---|
115 | fi |
---|
116 | AC_MSG_RESULT([${MEX}]) |
---|
117 | if test "$with_matlab_arch" = "check" ; then |
---|
118 | dnl still need to write the code to check the arch type |
---|
119 | with_matlab_arch="" |
---|
120 | fi |
---|
121 | if test "x$with_matlab_arch" != "x" ; then |
---|
122 | echo "using matlab architecture \"$with_matlab_arch\"" |
---|
123 | MEX_ARCH="-arch=$with_matlab_arch" |
---|
124 | dnl else |
---|
125 | dnl # if $with_matlab_arch is blank, get the os name from uname |
---|
126 | fi |
---|
127 | if test "x$MEX" != "x" ; then |
---|
128 | mexext_fxn=`dirname $MEX`/mexext |
---|
129 | if test -x "$mexext_fxn" ; then |
---|
130 | MEXEXT=`$mexext_fxn` |
---|
131 | if test "x${MEXEXT}" = "x" ; then |
---|
132 | dnl not even mexext can figure out what extension to use.... |
---|
133 | dnl # we should be doing an os type check instead of default mexglx |
---|
134 | dnl # use $with_matlab_arch |
---|
135 | if test "$with_mexext" != "check" ; then |
---|
136 | MEXEXT="mexglx" |
---|
137 | fi |
---|
138 | fi |
---|
139 | else |
---|
140 | if test "$with_mexext" != "check" ; then |
---|
141 | MEXEXT="mexglx" |
---|
142 | fi |
---|
143 | fi |
---|
144 | echo "Using mex file extension \"$MEXEXT\"" |
---|
145 | AC_MSG_RESULT([${MEXEXT}]) |
---|
146 | else |
---|
147 | dnl we shouldn't bother the user if we dont find matlab |
---|
148 | dnl just put out the message and don't compile matlab bindings |
---|
149 | echo "can't find the matlab compiler \"mex\"" |
---|
150 | echo "use --with-matlab=DIR to specify the location of a matlab installation" |
---|
151 | dnl # exit 1 |
---|
152 | fi |
---|
153 | fi |
---|
154 | fi |
---|
155 | AC_SUBST(MEX) |
---|
156 | AC_SUBST(MEX_ARCH) |
---|
157 | AC_SUBST(MEXEXT) |
---|
158 | |
---|
159 | |
---|
160 | dnl AC_ARG_ENABLE( |
---|
161 | dnl [octave], |
---|
162 | dnl [AS_HELP_STRING([--enable-octave], [build octave bindings @<:@default=check@:>@])], |
---|
163 | dnl [], |
---|
164 | dnl [enable_octave=check]) |
---|
165 | dnl BUILD_OCTAVE=yes |
---|
166 | dnl AC_SUBST(BUILD_OCTAVE) |
---|
167 | |
---|
168 | |
---|
169 | AC_ARG_WITH( |
---|
170 | [octave], |
---|
171 | [AS_HELP_STRING([--with-octave[=DIR]], |
---|
172 | [location of octave compiler MKOCTFILE @<:@default=check@:>@])], |
---|
173 | [], |
---|
174 | [with_octave=check]) |
---|
175 | |
---|
176 | MKOCTFILE= |
---|
177 | dnl if test "$enable_octave" != "no" ; then |
---|
178 | if test "$with_octave" != "no" ; then |
---|
179 | AC_MSG_CHECKING([for mkoctfile]) |
---|
180 | if test "$with_octave" != "no" ; then |
---|
181 | if test -x "$with_octave/bin/mkoctfile" |
---|
182 | then |
---|
183 | dnl echo Found octave in $with_octave/bin/mkoctfile |
---|
184 | MKOCTFILE="$with_octave/bin/mkoctfile" |
---|
185 | else |
---|
186 | if test -x "$with_octave" |
---|
187 | then |
---|
188 | echo Found mkoctfile in $with_octave |
---|
189 | MKOCTFILE="$with_octave" |
---|
190 | else |
---|
191 | AC_PATH_PROG(MKOCTFILE, mkoctfile) |
---|
192 | if test "x$MKOCTFILE" == "x" ; then |
---|
193 | dnl we shouldn't bother the user if we dont find mkoctfile |
---|
194 | dnl just put out the message and don't compile octave bindings |
---|
195 | echo "can't find the matlab compiler \"mkoctfile\"" |
---|
196 | echo "use --with-octave=DIR to specify the location of a mkoctfile installation" |
---|
197 | dnl # exit 1 |
---|
198 | fi |
---|
199 | fi |
---|
200 | fi |
---|
201 | fi |
---|
202 | AC_MSG_RESULT([${MKOCTFILE}]) |
---|
203 | fi |
---|
204 | AC_SUBST(MKOCTFILE) |
---|
205 | |
---|
206 | |
---|
207 | dnl perl and python check borrowed from |
---|
208 | dnl http://www.opensource.apple.com/darwinsource/Current/libxslt-8.1/libxslt/configure.in |
---|
209 | dnl |
---|
210 | dnl Perl is just needed for generating some data for XSLtmark |
---|
211 | dnl |
---|
212 | |
---|
213 | dnl AC_ARG_ENABLE( |
---|
214 | dnl [perl], |
---|
215 | dnl [AS_HELP_STRING([--enable-perl], [build perl bindings @<:@default=check@:>@])], |
---|
216 | dnl [], |
---|
217 | dnl [enable_perl=check]) |
---|
218 | |
---|
219 | dnl BUILD_PERL=yes |
---|
220 | dnl AC_SUBST(BUILD_PERL) |
---|
221 | |
---|
222 | AC_ARG_WITH( |
---|
223 | [perl], |
---|
224 | [AS_HELP_STRING([--with-perl[=DIR]], [location of perl @<:@default=check@:>@])], |
---|
225 | [], |
---|
226 | [with_perl=check]) |
---|
227 | |
---|
228 | PERL= |
---|
229 | PERL_INCLUDES= |
---|
230 | PERL_SITE_PACKAGES= |
---|
231 | if test "$with_perl" != "no" ; then |
---|
232 | AC_MSG_CHECKING([for perl]) |
---|
233 | if test -x "$with_perl/bin/perl" |
---|
234 | then |
---|
235 | echo Found perl in $with_perl/bin/perl |
---|
236 | PERL="$with_perl/bin/perl" |
---|
237 | else |
---|
238 | if test -x "$with_perl" |
---|
239 | then |
---|
240 | echo Found perl in $with_perl |
---|
241 | PERL="$with_perl" |
---|
242 | else |
---|
243 | AC_PATH_PROG(PERL, perl) |
---|
244 | fi |
---|
245 | fi |
---|
246 | PERL_SITE_PACKAGES='$(libdir)/perl5' |
---|
247 | fi |
---|
248 | AC_MSG_RESULT([${PERL}]) |
---|
249 | AC_SUBST(PERL) |
---|
250 | AC_SUBST(PERL_INCLUDES) |
---|
251 | AC_SUBST(PERL_SITE_PACKAGES) |
---|
252 | |
---|
253 | dnl |
---|
254 | dnl check for python |
---|
255 | dnl |
---|
256 | |
---|
257 | dnl AC_ARG_ENABLE( |
---|
258 | dnl [python], |
---|
259 | dnl [AS_HELP_STRING([--enable-pyton], [build python bindings @<:@default=check@:>@])], |
---|
260 | dnl [], |
---|
261 | dnl [enable_python=check]) |
---|
262 | dnl |
---|
263 | dnl BUILD_PYTHON=yes |
---|
264 | dnl AC_SUBST(BUILD_PYTHON) |
---|
265 | |
---|
266 | PYTHON= |
---|
267 | PYTHON_VERSION= |
---|
268 | PYTHON_INCLUDES= |
---|
269 | PYTHON_SITE_PACKAGES= |
---|
270 | pythondir= |
---|
271 | AC_ARG_WITH( |
---|
272 | [python], |
---|
273 | [AS_HELP_STRING([--with-python[=DIR]],[location of python @<:@default=check@:>@])], |
---|
274 | [], |
---|
275 | [with_python=check]) |
---|
276 | |
---|
277 | if test "$with_python" != "no" ; then |
---|
278 | AC_MSG_CHECKING([for python]) |
---|
279 | if test -x "$with_python/bin/python" |
---|
280 | then |
---|
281 | echo Found python in $with_python/bin/python |
---|
282 | PYTHON="$with_python/bin/python" |
---|
283 | else |
---|
284 | if test -x "$with_python" |
---|
285 | then |
---|
286 | echo Found python in $with_python |
---|
287 | PYTHON="$with_python" |
---|
288 | else |
---|
289 | AC_PATH_PROG(PYTHON, python python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) |
---|
290 | fi |
---|
291 | fi |
---|
292 | if test "$PYTHON" != "" |
---|
293 | then |
---|
294 | PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"` |
---|
295 | echo Using python version $PYTHON_VERSION |
---|
296 | fi |
---|
297 | if test "$PYTHON_VERSION" != "" |
---|
298 | then |
---|
299 | if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \ |
---|
300 | -d $with_python/lib/python$PYTHON_VERSION/site-packages |
---|
301 | then |
---|
302 | PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION |
---|
303 | PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages |
---|
304 | else |
---|
305 | if test -r $prefix/include/python$PYTHON_VERSION/Python.h |
---|
306 | then |
---|
307 | PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)' |
---|
308 | PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
---|
309 | else |
---|
310 | if test -r /usr/include/python$PYTHON_VERSION/Python.h |
---|
311 | then |
---|
312 | PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION |
---|
313 | PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
---|
314 | else |
---|
315 | echo could not find python$PYTHON_VERSION/Python.h |
---|
316 | fi |
---|
317 | fi |
---|
318 | if test ! -d "$PYTHON_SITE_PACKAGES" |
---|
319 | then |
---|
320 | PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"` |
---|
321 | fi |
---|
322 | fi |
---|
323 | fi |
---|
324 | if test "$with_python" != "" |
---|
325 | then |
---|
326 | pythondir='$(PYTHON_SITE_PACKAGES)' |
---|
327 | else |
---|
328 | pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages' |
---|
329 | fi |
---|
330 | fi |
---|
331 | |
---|
332 | AC_SUBST(pythondir) |
---|
333 | dnl AC_SUBST(PYTHON_SUBDIR) |
---|
334 | |
---|
335 | AC_SUBST(PYTHON) |
---|
336 | AC_SUBST(PYTHON_VERSION) |
---|
337 | AC_SUBST(PYTHON_INCLUDES) |
---|
338 | AC_SUBST(PYTHON_SITE_PACKAGES) |
---|
339 | |
---|
340 | |
---|
341 | RP_BASE=`pwd` |
---|
342 | AC_SUBST(RP_BASE) |
---|
343 | |
---|
344 | AC_CONFIG_SUBDIRS( gui ) |
---|
345 | AC_CONFIG_SUBDIRS( src/tcl ) |
---|
346 | |
---|
347 | dnl read Makefile.in and write Makefile |
---|
348 | AC_OUTPUT( Makefile \ |
---|
349 | examples/demo.bash |
---|
350 | examples/app-fermi/cee/Makefile \ |
---|
351 | examples/app-fermi/fortran/Makefile \ |
---|
352 | examples/app-fermi/wrapper/cee/Makefile \ |
---|
353 | examples/c-example/Makefile \ |
---|
354 | perl/Makefile.PL \ |
---|
355 | python/setup.py \ |
---|
356 | src/Makefile \ |
---|
357 | src/matlab/Makefile \ |
---|
358 | src/octave/Makefile \ |
---|
359 | src2/core/Makefile \ |
---|
360 | test/Makefile \ |
---|
361 | gui/apps/simsim \ |
---|
362 | gui/apps/rappture \ |
---|
363 | gui/apps/rappture.env ) |
---|