1 | AC_INIT(rappture, 1.1, rappture@nanohub.org) |
---|
2 | |
---|
3 | VERSION=0.0.1 |
---|
4 | |
---|
5 | #------------------------------------------------------------------------ |
---|
6 | # Handle the --prefix=... option |
---|
7 | #------------------------------------------------------------------------ |
---|
8 | |
---|
9 | if test "${prefix}" = "NONE"; then |
---|
10 | prefix=/usr/local |
---|
11 | fi |
---|
12 | if test "${exec_prefix}" = "NONE"; then |
---|
13 | exec_prefix=$prefix |
---|
14 | fi |
---|
15 | |
---|
16 | # AC_PROG_INSTALL |
---|
17 | AC_PROG_MAKE_SET |
---|
18 | |
---|
19 | dnl find and test the C compiler |
---|
20 | AC_PROG_CC |
---|
21 | AC_LANG_C |
---|
22 | |
---|
23 | AC_HEADER_STDC |
---|
24 | AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?)) |
---|
25 | |
---|
26 | AC_PROG_CXX |
---|
27 | AC_LANG_CPLUSPLUS |
---|
28 | |
---|
29 | AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(librappture requires libstdc++)) |
---|
30 | AC_CHECK_HEADERS(stack,,AC_MSG_WARN(STL classes missing ?)) |
---|
31 | AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?)) |
---|
32 | AC_CHECK_HEADERS(list,,AC_MSG_WARN(STL classes missing ?)) |
---|
33 | AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?)) |
---|
34 | |
---|
35 | AC_PROG_F77([f77 fort77 g77 f90 xlf xlf90 fl32]) |
---|
36 | |
---|
37 | AC_ARG_WITH(matlab, [ --with-matlab[=DIR] Build Matlab bindings if MEX compiler is found]) |
---|
38 | AC_ARG_WITH(matlab_arch, [ --with-matlab-arch[=ARCH] Build Matlab bindings for ARCH architecture]) |
---|
39 | dnl AC_CHECK_PROG(MEX, mex, mex, false) |
---|
40 | MEX= |
---|
41 | MEX_ARCH= |
---|
42 | if test "$with_matlab" != "no" ; then |
---|
43 | dnl WITH_MATLAB = "yes" |
---|
44 | if test -x "$with_matlab/bin/mex" |
---|
45 | then |
---|
46 | echo Found matlab in $with_matlab/bin/mex |
---|
47 | MEX="$with_matlab/bin/mex" |
---|
48 | else |
---|
49 | if test -x "$with_matlab" |
---|
50 | then |
---|
51 | echo Found mex in $with_matlab |
---|
52 | MEX="$with_matlab" |
---|
53 | else |
---|
54 | AC_PATH_PROG(MEX, mex) |
---|
55 | fi |
---|
56 | fi |
---|
57 | fi |
---|
58 | if test "x$with_matlab_arch" != "x" ; then |
---|
59 | MEX_ARCH="-arch=$with_matlab_arch" |
---|
60 | fi |
---|
61 | dnl AM_CONDITIONAL(WITH_MATLAB, test x$MEX != x) |
---|
62 | |
---|
63 | AC_ARG_WITH(octave, [ --with-octave[=DIR] Build Octave bindings if MKOCTFILE compiler is found]) |
---|
64 | dnl AC_CHECK_PROG(MKOCTFILE, mkoctfile, mkoctfile, false) |
---|
65 | MKOCTFILE= |
---|
66 | if test "$with_octave" != "no" ; then |
---|
67 | if test -x "$with_octave/bin/mkoctfile" |
---|
68 | then |
---|
69 | echo Found octave in $with_octave/bin/mkoctfile |
---|
70 | MKOCTFILE="$with_octave/bin/mkoctfile" |
---|
71 | else |
---|
72 | if test -x "$with_octave" |
---|
73 | then |
---|
74 | echo Found mkoctfile in $with_octave |
---|
75 | MKOCTFILE="$with_octave" |
---|
76 | else |
---|
77 | AC_PATH_PROG(MKOCTFILE, mkoctfile) |
---|
78 | fi |
---|
79 | fi |
---|
80 | fi |
---|
81 | dnl AM_CONDITIONAL(WITH_OCTAVE, test x$MKOCTFILE != x) |
---|
82 | |
---|
83 | |
---|
84 | dnl perl and python check borrowed from |
---|
85 | dnl http://www.opensource.apple.com/darwinsource/Current/libxslt-8.1/libxslt/configure.in |
---|
86 | dnl |
---|
87 | dnl Perl is just needed for generating some data for XSLtmark |
---|
88 | dnl |
---|
89 | |
---|
90 | AC_ARG_WITH(perl, [ --with-perl[=DIR] Build Perl bindings if found]) |
---|
91 | dnl AC_CHECK_PROG(PERL, perl, perl, false) |
---|
92 | dnl AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false") |
---|
93 | PERL= |
---|
94 | PERL_INCLUDES= |
---|
95 | if test "$with_perl" != "no" ; then |
---|
96 | if test -x "$with_perl/bin/perl" |
---|
97 | then |
---|
98 | echo Found perl in $with_perl/bin/perl |
---|
99 | PERL="$with_perl/bin/perl" |
---|
100 | else |
---|
101 | if test -x "$with_perl" |
---|
102 | then |
---|
103 | echo Found perl in $with_perl |
---|
104 | PERL="$with_perl" |
---|
105 | else |
---|
106 | AC_PATH_PROG(PERL, perl) |
---|
107 | fi |
---|
108 | fi |
---|
109 | fi |
---|
110 | dnl AM_CONDITIONAL(WITH_PERL, test x$PERL != x) |
---|
111 | |
---|
112 | dnl |
---|
113 | dnl check for python |
---|
114 | dnl |
---|
115 | |
---|
116 | PYTHON= |
---|
117 | PYTHON_VERSION= |
---|
118 | PYTHON_INCLUDES= |
---|
119 | PYTHON_SITE_PACKAGES= |
---|
120 | pythondir= |
---|
121 | AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found]) |
---|
122 | if test "$with_python" != "no" ; then |
---|
123 | if test -x "$with_python/bin/python" |
---|
124 | then |
---|
125 | echo Found python in $with_python/bin/python |
---|
126 | PYTHON="$with_python/bin/python" |
---|
127 | else |
---|
128 | if test -x "$with_python" |
---|
129 | then |
---|
130 | echo Found python in $with_python |
---|
131 | PYTHON="$with_python" |
---|
132 | else |
---|
133 | AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) |
---|
134 | fi |
---|
135 | fi |
---|
136 | if test "$PYTHON" != "" |
---|
137 | then |
---|
138 | PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"` |
---|
139 | echo Using python version $PYTHON_VERSION |
---|
140 | fi |
---|
141 | if test "$PYTHON_VERSION" != "" |
---|
142 | then |
---|
143 | if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \ |
---|
144 | -d $with_python/lib/python$PYTHON_VERSION/site-packages |
---|
145 | then |
---|
146 | PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION |
---|
147 | PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages |
---|
148 | else |
---|
149 | if test -r $prefix/include/python$PYTHON_VERSION/Python.h |
---|
150 | then |
---|
151 | PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)' |
---|
152 | PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
---|
153 | else |
---|
154 | if test -r /usr/include/python$PYTHON_VERSION/Python.h |
---|
155 | then |
---|
156 | PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION |
---|
157 | PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
---|
158 | else |
---|
159 | echo could not find python$PYTHON_VERSION/Python.h |
---|
160 | fi |
---|
161 | fi |
---|
162 | if test ! -d "$PYTHON_SITE_PACKAGES" |
---|
163 | then |
---|
164 | PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"` |
---|
165 | fi |
---|
166 | fi |
---|
167 | fi |
---|
168 | if test "$with_python" != "" |
---|
169 | then |
---|
170 | pythondir='$(PYTHON_SITE_PACKAGES)' |
---|
171 | else |
---|
172 | pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages' |
---|
173 | fi |
---|
174 | fi |
---|
175 | dnl AM_CONDITIONAL(WITH_PYTHON, test x$PYTHON != x) |
---|
176 | |
---|
177 | AC_SUBST(pythondir) |
---|
178 | dnl AC_SUBST(PYTHON_SUBDIR) |
---|
179 | |
---|
180 | AC_SUBST(MEX) |
---|
181 | AC_SUBST(MEX_ARCH) |
---|
182 | AC_SUBST(MKOCTFILE) |
---|
183 | AC_SUBST(PERL) |
---|
184 | AC_SUBST(PERL_INCLUDES) |
---|
185 | AC_SUBST(PYTHON) |
---|
186 | AC_SUBST(PYTHON_VERSION) |
---|
187 | AC_SUBST(PYTHON_INCLUDES) |
---|
188 | AC_SUBST(PYTHON_SITE_PACKAGES) |
---|
189 | |
---|
190 | AC_SUBST(VERSION) |
---|
191 | |
---|
192 | RP_BASE=`pwd` |
---|
193 | AC_SUBST(RP_BASE) |
---|
194 | |
---|
195 | AC_CONFIG_SUBDIRS( gui ) |
---|
196 | AC_CONFIG_SUBDIRS( src/tcl ) |
---|
197 | |
---|
198 | dnl read Makefile.in and write Makefile |
---|
199 | AC_OUTPUT( Makefile \ |
---|
200 | examples/demo.bash |
---|
201 | examples/app-fermi/cee/Makefile \ |
---|
202 | examples/app-fermi/fortran/Makefile \ |
---|
203 | examples/app-fermi/wrapper/cee/Makefile \ |
---|
204 | examples/c-example/Makefile \ |
---|
205 | perl/Makefile.PL \ |
---|
206 | python/setup.py \ |
---|
207 | src/Makefile \ |
---|
208 | src/matlab/Makefile \ |
---|
209 | src/octave/Makefile \ |
---|
210 | src2/core/Makefile \ |
---|
211 | test/Makefile \ |
---|
212 | gui/apps/rappture \ |
---|
213 | gui/apps/rappture.env ) |
---|