Mercurial > forge
annotate main/sparsersb/src/configure.base @ 8923:ba575291987f octave-forge
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
author | michelemartone |
---|---|
date | Tue, 15 Nov 2011 19:09:20 +0000 |
parents | c47ac161e75d |
children | ffd8edaaa76f |
rev | line source |
---|---|
8849 | 1 dnl The configure script is generated by autogen.sh from configure.base |
2 dnl and the various configure.add files in the source tree. Edit | |
3 dnl configure.base and reprocess rather than modifying ./configure. | |
4 | |
5 dnl autoconf 2.13 certainly doesn't work! What is the minimum requirement? | |
6 AC_PREREQ(2.2) | |
7 | |
8 AC_INIT(configure.base) | |
9 | |
10 PACKAGE=octave-forge | |
11 MAJOR_VERSION=0 | |
12 MINOR_VERSION=1 | |
13 PATCH_LEVEL=0 | |
14 | |
15 dnl Kill caching --- this ought to be the default | |
16 define([AC_CACHE_LOAD], )dnl | |
17 define([AC_CACHE_SAVE], )dnl | |
18 | |
19 dnl uncomment to put support files in another directory | |
20 dnl AC_CONFIG_AUX_DIR(admin) | |
21 | |
22 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL | |
23 AC_SUBST(PACKAGE) | |
24 AC_SUBST(VERSION) | |
25 | |
26 dnl need to find admin files, so keep track of the top dir. | |
27 TOPDIR=`pwd` | |
28 AC_SUBST(TOPDIR) | |
29 | |
30 dnl if mkoctfile doesn't work, then we need the following: | |
31 dnl AC_PROG_CXX | |
32 dnl AC_PROG_F77 | |
33 | |
34 dnl Need C compiler regardless so define it in a way that | |
35 dnl makes autoconf happy and we can override whatever we | |
36 dnl need with mkoctfile -p. | |
37 dnl XXX FIXME XXX should use mkoctfile to get CC and CFLAGS | |
38 AC_PROG_CC | |
39 | |
40 dnl XXX FIXME XXX need tests for -p -c -s in mkoctfile. | |
41 | |
42 dnl ******************************************************************* | |
43 dnl Sort out mkoctfile version number and install paths | |
44 | |
45 dnl XXX FIXME XXX latest octave has octave-config so we don't | |
46 dnl need to discover things here. Doesn't have --exe-site-dir | |
47 dnl but defines --oct-site-dir and --m-site-dir | |
48 | |
49 dnl Check for mkoctfile | |
50 AC_CHECK_PROG(MKOCTFILE,mkoctfile,mkoctfile) | |
51 test -z "$MKOCTFILE" && AC_MSG_WARN([no mkoctfile found on path]) | |
52 | |
53 AC_SUBST(ver) | |
54 AC_SUBST(subver) | |
55 AC_SUBST(mpath) | |
56 AC_SUBST(opath) | |
57 AC_SUBST(xpath) | |
58 AC_SUBST(altpath) | |
59 AC_SUBST(altmpath) | |
60 AC_SUBST(altopath) | |
61 AC_SUBST(LIBRSB_LIBS) | |
62 AC_SUBST(LIBRSB_CXXFLAGS) | |
8923
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
63 AC_SUBST(RSBOI_CXXFLAGS) |
8849 | 64 |
8923
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
65 AC_ARG_WITH(verbosity-level, |
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
66 [ --with-verbosity-level verbosity level (0,1,..)], |
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
67 [ RSBOI_VERBOSE_CONFIG=$withval ]) |
8849 | 68 AC_ARG_WITH(path, |
69 [ --with-path install path prefix], | |
70 [ path=$withval ]) | |
71 AC_ARG_WITH(mpath, | |
72 [ --with-mpath override path for m-files], | |
73 [mpath=$withval]) | |
74 AC_ARG_WITH(opath, | |
75 [ --with-opath override path for oct-files], | |
76 [opath=$withval]) | |
77 AC_ARG_WITH(xpath, | |
78 [ --with-xpath override path for executables], | |
79 [xpath=$withval]) | |
80 AC_ARG_WITH(altpath, | |
81 [ --with-altpath alternative functions install path prefix], | |
82 [ altpath=$withval ]) | |
83 AC_ARG_WITH(altmpath, | |
84 [ --with-altmpath override path for alternative m-files], | |
85 [altmpath=$withval]) | |
86 AC_ARG_WITH(altopath, | |
87 [ --with-altopath override path for alternative oct-files], | |
88 [altopath=$withval]) | |
89 AC_ARG_WITH([swig], | |
90 [AS_HELP_STRING([--with-swig],[use swig wrapper generator [no]])], | |
91 [with_swig=$withval], | |
92 [with_swig=no]) | |
93 | |
94 if test -n "$path" ; then | |
95 test -z "$mpath" && mpath=$path | |
96 test -z "$opath" && opath=$path/oct | |
97 test -z "$xpath" && xpath=$path/bin | |
98 test -z "$altpath" && altpath=$path-alternatives | |
99 fi | |
100 | |
101 if test -n "$altpath" ; then | |
102 test -z "$altmpath" && altmpath=$altpath | |
103 test -z "$altopath" && altopath=$altpath/oct | |
104 fi | |
105 | |
106 dnl Don't query if path/ver are given in the configure environment | |
107 #if test -z "$mpath" || test -z "$opath" || test -z "$xpath" || test -z "$altmpath" || test -z "$altopath" || test -z "$ver" ; then | |
108 if test -z "$mpath" || test -z "$opath" || test -z "$xpath" || test -z "$ver" ; then | |
109 dnl Construct program to get mkoctfile version and local install paths | |
110 cat > conftest.cc <<EOF | |
111 #include <octave/config.h> | |
112 #include <octave/version.h> | |
113 #include <octave/defaults.h> | |
114 | |
115 #define INFOV "\nINFOV=" OCTAVE_VERSION "\n" | |
116 | |
117 #define INFOH "\nINFOH=" OCTAVE_CANONICAL_HOST_TYPE "\n" | |
118 | |
119 #ifdef OCTAVE_LOCALVERFCNFILEDIR | |
120 # define INFOM "\nINFOM=" OCTAVE_LOCALVERFCNFILEDIR "\n" | |
121 #else | |
122 # define INFOM "\nINFOM=" OCTAVE_LOCALFCNFILEPATH "\n" | |
123 #endif | |
124 | |
125 #ifdef OCTAVE_LOCALVEROCTFILEDIR | |
126 # define INFOO "\nINFOO=" OCTAVE_LOCALVEROCTFILEDIR "\n" | |
127 #else | |
128 # define INFOO "\nINFOO=" OCTAVE_LOCALOCTFILEPATH "\n" | |
129 #endif | |
130 | |
131 #ifdef OCTAVE_LOCALVERARCHLIBDIR | |
132 # define INFOX "\nINFOX=" OCTAVE_LOCALVERARCHLIBDIR "\n" | |
133 #else | |
134 # define INFOX "\nINFOX=" OCTAVE_LOCALARCHLIBDIR "\n" | |
135 #endif | |
136 | |
137 const char *infom = INFOM; | |
138 const char *infoo = INFOO; | |
139 const char *infox = INFOX; | |
140 const char *infoh = INFOH; | |
141 const char *infov = INFOV; | |
142 EOF | |
143 | |
144 dnl Compile program perhaps with a special version of mkoctfile | |
145 $MKOCTFILE conftest.cc || AC_MSG_ERROR(Could not run $MKOCTFILE) | |
146 | |
147 dnl Strip the config info from the compiled file | |
148 eval `strings conftest.o | grep "^INFO.=" | sed -e "s,//.*$,,"` | |
149 rm -rf conftest* | |
150 | |
151 dnl set the appropriate variables if they are not already set | |
152 ver=`echo $INFOV | sed -e "s/\.//" -e "s/\..*$//"` | |
153 subver=`echo $INFOV | sed -e "[s/^[^.]*[.][^.]*[.]//]"` | |
154 alt_mbase=`echo $INFOM | sed -e "[s,\/[^\/]*$,,]"` | |
155 alt_obase=`echo $INFOO | sed -e "[s,/site.*$,/site,]"` | |
156 test -z "$mpath" && mpath=$INFOM/octave-forge | |
157 test -z "$opath" && opath=$INFOO/octave-forge | |
158 test -z "$xpath" && xpath=$INFOX | |
159 test -z "$altmpath" && altmpath=$alt_mbase/octave-forge-alternatives/m | |
160 test -z "$altopath" && altopath=$alt_obase/octave-forge-alternatives/oct/$INFOH | |
161 fi | |
162 | |
163 dnl ******************************************************************* | |
164 | |
165 dnl XXX FIXME XXX Should we allow the user to override these? | |
166 dnl Do we even need them? The individual makefiles can call mkoctfile -p | |
167 dnl themselves, so the only reason to keep them is for configure, and | |
168 dnl for those things which are not built using mkoctfile (e.g., aurecord) | |
169 dnl but it is not clear we should be using octave compile flags for those. | |
170 | |
171 dnl C compiler and flags | |
172 AC_MSG_RESULT([retrieving compile and link flags from $MKOCTFILE]) | |
173 CC=`$MKOCTFILE -p CC` | |
174 CFLAGS=`$MKOCTFILE -p CFLAGS` | |
175 CPPFLAGS=`$MKOCTFILE -p CPPFLAGS` | |
176 CPICFLAG=`$MKOCTFILE -p CPICFLAG` | |
177 LDFLAGS=`$MKOCTFILE -p LDFLAGS` | |
178 LIBS=`$MKOCTFILE -p LIBS` | |
179 # add -fPIC or equivalent flags | |
180 FPICFLAG=`$MKOCTFILE -p FPICFLAG` | |
181 CPICFLAG=`$MKOCTFILE -p CPICFLAG` | |
182 FFLAGS="$FFLAGS $FPICFLAG" | |
183 CFLAGS="$CFLAGS $CPICFLAG" | |
184 AC_SUBST(CC) | |
185 AC_SUBST(CFLAGS) | |
186 AC_SUBST(CPPFLAGS) | |
187 AC_SUBST(CPICFLAG) | |
8923
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
188 RSBOI_CXXFLAGS="" |
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
189 if test x$RSBOI_VERBOSE_CONFIG != x ; then |
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
190 RSBOI_CXXFLAGS="$RSBOI_CXXFLAGS -D''RSBOI_VERBOSE_CONFIG=$RSBOI_VERBOSE_CONFIG"; |
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
191 fi |
8849 | 192 |
193 dnl Fortran compiler and flags | |
194 F77=`$MKOCTFILE -p F77` | |
195 FFLAGS=`$MKOCTFILE -p FFLAGS` | |
196 FPICFLAG=`$MKOCTFILE -p FPICFLAG` | |
197 AC_SUBST(F77) | |
198 AC_SUBST(FFLAGS) | |
199 AC_SUBST(FPICFLAG) | |
200 | |
201 dnl C++ compiler and flags | |
202 CXX=`$MKOCTFILE -p CXX` | |
203 CXXFLAGS=`$MKOCTFILE -p CXXFLAGS` | |
204 CXXPICFLAG=`$MKOCTFILE -p CXXPICFLAG` | |
205 CXXFLAGS="$CXXFLAGS $CXXPICFLAG" | |
206 AC_SUBST(CXX) | |
207 AC_SUBST(CXXFLAGS) | |
208 AC_SUBST(CXXPICFLAG) | |
209 | |
210 dnl ******************************************************************* | |
211 | |
212 dnl Check for features of your version of mkoctfile. | |
213 dnl All checks should be designed so that the default | |
214 dnl action if the tests are not performed is to do whatever | |
215 dnl is appropriate for the most recent version of Octave. | |
216 | |
217 dnl Define the following macro: | |
218 dnl OF_CHECK_LIB(lib,fn,true,false,helpers) | |
219 dnl This is just like AC_CHECK_LIB, but it doesn't update LIBS | |
220 AC_DEFUN(OF_CHECK_LIB, | |
221 [save_LIBS="$LIBS" | |
222 AC_CHECK_LIB($1,$2,$3,$4,$5) | |
223 LIBS="$save_LIBS" | |
224 ]) | |
225 | |
226 dnl Define the following macro: | |
227 dnl TRY_MKOCTFILE(msg,program,action_if_true,action_if_false) | |
228 dnl | |
229 AC_DEFUN(TRY_MKOCTFILE, | |
230 [AC_MSG_CHECKING($1) | |
231 cat > conftest.cc << EOF | |
232 #include <octave/config.h> | |
233 $2 | |
234 EOF | |
235 ac_try="$MKOCTFILE -c conftest.cc" | |
236 if AC_TRY_EVAL(ac_try) ; then | |
237 AC_MSG_RESULT(yes) | |
238 $3 | |
239 else | |
240 AC_MSG_RESULT(no) | |
241 $4 | |
242 fi | |
243 ]) | |
244 | |
245 dnl | |
246 dnl Check if F77_FUNC works with MKOCTFILE | |
247 dnl | |
248 TRY_MKOCTFILE([for F77_FUNC], | |
249 [int F77_FUNC (hello, HELLO) (const int &n);],, | |
250 [MKOCTFILE="$MKOCTFILE -DF77_FUNC=F77_FCN"]) | |
251 | |
252 dnl | |
253 dnl Check if octave still uses SLList.h | |
254 dnl | |
255 TRY_MKOCTFILE([for SLList.h],[#include <octave/SLList.h>], | |
256 [MKOCTFILE="$MKOCTFILE -DHAVE_SLLIST_H"],) | |
257 | |
258 dnl | |
259 dnl Check if octave has lo_ieee_nan_value | |
260 dnl | |
261 TRY_MKOCTFILE([for lo_ieee_nan_value], | |
262 [ #include <octave/lo-ieee.h> | |
263 int test(void) { lo_ieee_nan_value(); }],, | |
264 [MKOCTFILE="$MKOCTFILE -DUSE_OCTAVE_NAN"]) | |
265 | |
266 dnl | |
267 dnl Check if octave is needs octave_idx_type | |
268 dnl | |
8882
c47ac161e75d
sparsersb: commented out a (probably) redundant (octave_idx_type) symbol redefinition in configure.base.
michelemartone
parents:
8849
diff
changeset
|
269 dnl TRY_MKOCTFILE([for octave_idx_type], |
c47ac161e75d
sparsersb: commented out a (probably) redundant (octave_idx_type) symbol redefinition in configure.base.
michelemartone
parents:
8849
diff
changeset
|
270 dnl [#include <octave/oct-types.h> |
c47ac161e75d
sparsersb: commented out a (probably) redundant (octave_idx_type) symbol redefinition in configure.base.
michelemartone
parents:
8849
diff
changeset
|
271 dnl octave_idx_type test(void) { octave_idx_type idx = 1; return idx; }],, |
c47ac161e75d
sparsersb: commented out a (probably) redundant (octave_idx_type) symbol redefinition in configure.base.
michelemartone
parents:
8849
diff
changeset
|
272 dnl [MKOCTFILE="$MKOCTFILE -Doctave_idx_type=int"]) |
8849 | 273 |
274 dnl | |
275 dnl Check if octave uses quit.h | |
276 dnl | |
277 TRY_MKOCTFILE([for quit.h],[#include <octave/quit.h>],, | |
278 [MKOCTFILE="$MKOCTFILE -DNEED_OCTAVE_QUIT"]) | |
279 | |
280 dnl ********************************************************** | |
281 | |
282 dnl Evaluate an expression in octave | |
283 dnl | |
284 dnl OCTAVE_EVAL(expr,var) -> var=expr | |
285 dnl | |
286 AC_DEFUN(OCTAVE_EVAL, | |
287 [AC_MSG_CHECKING([for $1 in Octave]) | |
288 $2=`echo "disp($1)" | $OCTAVE -qf` | |
289 AC_MSG_RESULT($$2) | |
290 AC_SUBST($2) | |
291 ]) | |
292 | |
293 dnl Check status of an octave variable | |
294 dnl | |
295 dnl OCTAVE_CHECK_EXIST(variable,action_if_true,action_if_false) | |
296 dnl | |
297 AC_DEFUN(OCTAVE_CHECK_EXIST, | |
298 [AC_MSG_CHECKING([for $1 in Octave]) | |
299 if test `echo 'disp(exist("$1"))' | $OCTAVE -qf`X != 0X ; then | |
300 AC_MSG_RESULT(yes) | |
301 $2 | |
302 else | |
303 AC_MSG_RESULT(no) | |
304 $3 | |
305 fi | |
306 ]) | |
307 | |
308 dnl should check that $(OCTAVE) --version matches $(MKOCTFILE) --version | |
309 AC_CHECK_PROG(OCTAVE,octave,octave) | |
310 OCTAVE_EVAL(OCTAVE_VERSION,OCTAVE_VERSION) | |
311 | |
312 dnl grab canonical host type so we can write system specific install stuff | |
313 OCTAVE_EVAL(octave_config_info('canonical_host_type'),canonical_host_type) | |
314 | |
315 dnl grab SHLEXT from octave config | |
316 OCTAVE_EVAL(octave_config_info('SHLEXT'),SHLEXT) | |
317 | |
318 AC_PROG_LN_S | |
319 | |
320 AC_PROG_RANLIB | |
321 | |
322 dnl Use $(COPY_FLAGS) to set options for cp when installing .oct files. | |
323 COPY_FLAGS="-Rfp" | |
324 case "$canonical_host_type" in | |
325 *-*-linux*) | |
326 COPY_FLAGS="-fdp" | |
327 ;; | |
328 esac | |
329 AC_SUBST(COPY_FLAGS) | |
330 | |
331 OTHERLIBS= | |
332 OF_CHECK_LIB(m,sin,[OTHERLIBS=-lm]) | |
333 AC_SUBST(OTHERLIBS) | |
334 | |
335 OCTAVE_EVAL(octave_config_info('AR'),AR) | |
336 OCTAVE_EVAL(octave_config_info('ARFLAGS'),ARFLAGS) | |
337 | |
338 CPPFLAGS="$CPPFLAGS -DSTATIC_LINKED" | |
339 | |
340 dnl Use $(STRIP) in the makefile to strip executables. If not found, | |
341 dnl STRIP expands to ':', which in the makefile does nothing. | |
342 dnl Don't need this for .oct files since mkoctfile handles them directly | |
343 STRIP=${STRIP-strip} | |
344 AC_CHECK_PROG(STRIP,$STRIP,$STRIP,:) | |
345 | |
346 dnl Strip on windows, don't strip on Mac OS/X or IRIX | |
347 dnl For the rest, you can force strip using MKOCTFILE="mkoctfile -s" | |
348 dnl or avoid strip using STRIP=: before ./configure | |
349 case "$canonical_host_type" in | |
350 powerpc-apple-darwin*|*-sgi-*) | |
351 STRIP=: | |
352 ;; | |
353 *-cygwin-*|*-mingw-*) | |
354 MKOCTFILE="$MKOCTFILE -s" | |
355 ;; | |
356 esac | |
357 | |
358 dnl check for swig and test that it supports octave | |
359 SWIG="" | |
360 if test x"$with_swig" = "xyes"; then | |
361 AC_PATH_PROG(SWIG,swig) | |
362 test -z "$SWIG" && AC_MSG_ERROR(swig not found on path) | |
363 cat > conftest.i <<EOF | |
364 %module conftest | |
365 EOF | |
366 $SWIG -c++ -octave conftest.i || AC_MSG_ERROR(swig doesn't support octave modules) | |
367 rm -f conftest.* | |
368 fi | |
369 | |
370 CONFIGURE_OUTPUTS="Makeconf" | |
371 STATUS_MSG=" | |
372 octave commands will install into the following directories: | |
373 m-files: $mpath | |
374 oct-files: $opath | |
375 binaries: $xpath | |
376 alternatives: | |
377 m-files: $altmpath | |
378 oct-files: $altopath | |
379 | |
380 shell commands will install into the following directories: | |
381 binaries: $bindir | |
382 man pages: $mandir | |
383 libraries: $libdir | |
384 headers: $includedir | |
385 | |
386 octave-forge is configured with | |
387 octave: $OCTAVE (version $OCTAVE_VERSION) | |
388 mkoctfile: $MKOCTFILE for Octave $subver | |
389 swig: $SWIG" |