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