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 | dnl AC_CHECK_PROG(MEX, mex, mex, false) |
---|
39 | MEX= |
---|
40 | if test "$with_matlab" != "no" ; then |
---|
41 | dnl WITH_MATLAB = "yes" |
---|
42 | if test -x "$with_matlab/bin/mex" |
---|
43 | then |
---|
44 | echo Found matlab in $with_matlab/bin/mex |
---|
45 | MEX="$with_matlab/bin/mex" |
---|
46 | else |
---|
47 | if test -x "$with_matlab" |
---|
48 | then |
---|
49 | echo Found mex in $with_matlab |
---|
50 | MEX="$with_matlab" |
---|
51 | else |
---|
52 | AC_PATH_PROG(MEX, mex) |
---|
53 | fi |
---|
54 | fi |
---|
55 | fi |
---|
56 | dnl AM_CONDITIONAL(WITH_MATLAB, test x$MEX != x) |
---|
57 | |
---|
58 | AC_ARG_WITH(octave, [ --with-octave[=DIR] Build Octave bindings if MKOCTFILE compiler is found]) |
---|
59 | dnl AC_CHECK_PROG(MKOCTFILE, mkoctfile, mkoctfile, false) |
---|
60 | MKOCTFILE= |
---|
61 | if test "$with_octave" != "no" ; then |
---|
62 | if test -x "$with_octave/bin/mkoctfile" |
---|
63 | then |
---|
64 | echo Found octave in $with_octave/bin/mkoctfile |
---|
65 | MKOCTFILE="$with_octave/bin/mkoctfile" |
---|
66 | else |
---|
67 | if test -x "$with_octave" |
---|
68 | then |
---|
69 | echo Found mkoctfile in $with_octave |
---|
70 | MKOCTFILE="$with_octave" |
---|
71 | else |
---|
72 | AC_PATH_PROG(MKOCTFILE, mkoctfile) |
---|
73 | fi |
---|
74 | fi |
---|
75 | fi |
---|
76 | dnl AM_CONDITIONAL(WITH_OCTAVE, test x$MKOCTFILE != x) |
---|
77 | |
---|
78 | |
---|
79 | dnl perl and python check borrowed from |
---|
80 | dnl http://www.opensource.apple.com/darwinsource/Current/libxslt-8.1/libxslt/configure.in |
---|
81 | dnl |
---|
82 | dnl Perl is just needed for generating some data for XSLtmark |
---|
83 | dnl |
---|
84 | |
---|
85 | AC_ARG_WITH(perl, [ --with-perl[=DIR] Build Perl bindings if found]) |
---|
86 | dnl AC_CHECK_PROG(PERL, perl, perl, false) |
---|
87 | dnl AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false") |
---|
88 | PERL= |
---|
89 | PERL_INCLUDES= |
---|
90 | if test "$with_perl" != "no" ; then |
---|
91 | if test -x "$with_perl/bin/perl" |
---|
92 | then |
---|
93 | echo Found perl in $with_perl/bin/perl |
---|
94 | PERL="$with_perl/bin/perl" |
---|
95 | else |
---|
96 | if test -x "$with_perl" |
---|
97 | then |
---|
98 | echo Found perl in $with_perl |
---|
99 | PERL="$with_perl" |
---|
100 | else |
---|
101 | AC_PATH_PROG(PERL, perl) |
---|
102 | fi |
---|
103 | fi |
---|
104 | fi |
---|
105 | dnl AM_CONDITIONAL(WITH_PERL, test x$PERL != x) |
---|
106 | |
---|
107 | dnl |
---|
108 | dnl check for python |
---|
109 | dnl |
---|
110 | |
---|
111 | PYTHON= |
---|
112 | PYTHON_VERSION= |
---|
113 | PYTHON_INCLUDES= |
---|
114 | PYTHON_SITE_PACKAGES= |
---|
115 | pythondir= |
---|
116 | AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found]) |
---|
117 | if test "$with_python" != "no" ; then |
---|
118 | if test -x "$with_python/bin/python" |
---|
119 | then |
---|
120 | echo Found python in $with_python/bin/python |
---|
121 | PYTHON="$with_python/bin/python" |
---|
122 | else |
---|
123 | if test -x "$with_python" |
---|
124 | then |
---|
125 | echo Found python in $with_python |
---|
126 | PYTHON="$with_python" |
---|
127 | else |
---|
128 | AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) |
---|
129 | fi |
---|
130 | fi |
---|
131 | if test "$PYTHON" != "" |
---|
132 | then |
---|
133 | PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"` |
---|
134 | echo Using python version $PYTHON_VERSION |
---|
135 | fi |
---|
136 | if test "$PYTHON_VERSION" != "" |
---|
137 | then |
---|
138 | if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \ |
---|
139 | -d $with_python/lib/python$PYTHON_VERSION/site-packages |
---|
140 | then |
---|
141 | PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION |
---|
142 | PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages |
---|
143 | else |
---|
144 | if test -r $prefix/include/python$PYTHON_VERSION/Python.h |
---|
145 | then |
---|
146 | PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)' |
---|
147 | PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
---|
148 | else |
---|
149 | if test -r /usr/include/python$PYTHON_VERSION/Python.h |
---|
150 | then |
---|
151 | PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION |
---|
152 | PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
---|
153 | else |
---|
154 | echo could not find python$PYTHON_VERSION/Python.h |
---|
155 | fi |
---|
156 | fi |
---|
157 | if test ! -d "$PYTHON_SITE_PACKAGES" |
---|
158 | then |
---|
159 | PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"` |
---|
160 | fi |
---|
161 | fi |
---|
162 | fi |
---|
163 | if test "$with_python" != "" |
---|
164 | then |
---|
165 | pythondir='$(PYTHON_SITE_PACKAGES)' |
---|
166 | else |
---|
167 | pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages' |
---|
168 | fi |
---|
169 | fi |
---|
170 | dnl AM_CONDITIONAL(WITH_PYTHON, test x$PYTHON != x) |
---|
171 | |
---|
172 | dnl AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "") |
---|
173 | dnl if test "$PYTHON_INCLUDES" != "" |
---|
174 | dnl then |
---|
175 | dnl PYTHON_SUBDIR=python |
---|
176 | dnl else |
---|
177 | dnl PYTHON_SUBDIR= |
---|
178 | dnl fi |
---|
179 | |
---|
180 | AC_SUBST(pythondir) |
---|
181 | dnl AC_SUBST(PYTHON_SUBDIR) |
---|
182 | |
---|
183 | AC_SUBST(MEX) |
---|
184 | AC_SUBST(MKOCTFILE) |
---|
185 | AC_SUBST(PERL) |
---|
186 | AC_SUBST(PERL_INCLUDES) |
---|
187 | AC_SUBST(PYTHON) |
---|
188 | AC_SUBST(PYTHON_VERSION) |
---|
189 | AC_SUBST(PYTHON_INCLUDES) |
---|
190 | AC_SUBST(PYTHON_SITE_PACKAGES) |
---|
191 | |
---|
192 | AC_SUBST(VERSION) |
---|
193 | |
---|
194 | RP_BASE=`pwd` |
---|
195 | AC_SUBST(RP_BASE) |
---|
196 | |
---|
197 | AC_CONFIG_SUBDIRS( gui ) |
---|
198 | |
---|
199 | dnl read Makefile.in and write Makefile |
---|
200 | AC_OUTPUT( Makefile \ |
---|
201 | examples/demo.bash |
---|
202 | examples/app-fermi/cee/Makefile \ |
---|
203 | examples/app-fermi/fortran/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 | test/Makefile \ |
---|
211 | gui/apps/rappture ) |
---|