annotate main/netcdf/src/configure.base @ 12698:1a348ee9a848 octave-forge

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