annotate mkoctfile.in @ 12312:b10ea6efdc58 release-3-4-x ss-3-3-91

version is now 3.3.91
author John W. Eaton <jwe@octave.org>
date Mon, 31 Jan 2011 08:36:58 -0500
parents 23385f2c90b7
children 402456ba3f61
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2163
8901e415035a [project @ 1996-05-13 10:35:04 by jwe]
jwe
parents:
diff changeset
1 #! /bin/sh
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
2 ##
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
3 ## mkoctfile -- create a .oct file suitable for dynamic linking by
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
4 ## Octave.
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
5 ##
11523
fd0a3ac60b0e update copyright notices
John W. Eaton <jwe@octave.org>
parents: 11450
diff changeset
6 ## Copyright (C) 1996-2011 John W. Eaton
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
7 ##
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
8 ## This file is part of Octave.
9187
a3237ae32c0d eliminate last remnants of F2C variables
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
9 ##
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
10 ## Octave is free software; you can redistribute it and/or modify it
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
11 ## under the terms of the GNU General Public License as published by the
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
12 ## Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
13 ## your option) any later version.
9187
a3237ae32c0d eliminate last remnants of F2C variables
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
14 ##
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
15 ## Octave is distributed in the hope that it will be useful, but WITHOUT
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
16 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
17 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
18 ## for more details.
9187
a3237ae32c0d eliminate last remnants of F2C variables
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
19 ##
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
20 ## You should have received a copy of the GNU General Public License
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
21 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6782
diff changeset
22 ## <http://www.gnu.org/licenses/>.
2163
8901e415035a [project @ 1996-05-13 10:35:04 by jwe]
jwe
parents:
diff changeset
23
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
24 # Exit immediately on any error.
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
25
2163
8901e415035a [project @ 1996-05-13 10:35:04 by jwe]
jwe
parents:
diff changeset
26 set -e
8901e415035a [project @ 1996-05-13 10:35:04 by jwe]
jwe
parents:
diff changeset
27
6311
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
28 : ${SED=%OCTAVE_CONF_SED%}
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
29
6086
4278b170b9f9 [project @ 2006-10-25 15:11:40 by jwe]
jwe
parents: 6009
diff changeset
30 OCTAVE_VERSION=%OCTAVE_CONF_VERSION%
6311
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
31 OCTAVE_PREFIX=%OCTAVE_CONF_PREFIX%
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
32
6682
1e440ccda1ca [project @ 2007-06-01 19:34:56 by jwe]
jwe
parents: 6319
diff changeset
33 DEFAULT_BINDIR=%OCTAVE_BINDIR%
1e440ccda1ca [project @ 2007-06-01 19:34:56 by jwe]
jwe
parents: 6319
diff changeset
34 DEFAULT_INCLUDEDIR=%OCTAVE_CONF_INCLUDEDIR%
6710
95ecf87531ca [project @ 2007-06-13 06:57:27 by jwe]
jwe
parents: 6682
diff changeset
35 DEFAULT_LIBDIR=%OCTAVE_CONF_LIBDIR%
6311
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
36 DEFAULT_OCTINCLUDEDIR=%OCTAVE_CONF_OCTINCLUDEDIR%
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
37 DEFAULT_OCTLIBDIR=%OCTAVE_CONF_OCTLIBDIR%
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
38
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
39 if [ -n "$OCTAVE_HOME" ]; then
6682
1e440ccda1ca [project @ 2007-06-01 19:34:56 by jwe]
jwe
parents: 6319
diff changeset
40 DEFAULT_BINDIR="`echo $DEFAULT_BINDIR | $SED "s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`"
1e440ccda1ca [project @ 2007-06-01 19:34:56 by jwe]
jwe
parents: 6319
diff changeset
41 DEFAULT_INCLUDEDIR="`echo $DEFAULT_INCLUDEDIR | $SED "s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`"
6710
95ecf87531ca [project @ 2007-06-13 06:57:27 by jwe]
jwe
parents: 6682
diff changeset
42 DEFAULT_LIBDIR="`echo $DEFAULT_LIBDIR | $SED "s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`"
6319
e7e7c338bf99 [project @ 2007-02-16 11:14:44 by jwe]
jwe
parents: 6311
diff changeset
43 DEFAULT_OCTINCLUDEDIR="`echo $DEFAULT_OCTINCLUDEDIR | $SED "s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`"
e7e7c338bf99 [project @ 2007-02-16 11:14:44 by jwe]
jwe
parents: 6311
diff changeset
44 DEFAULT_OCTLIBDIR="`echo $DEFAULT_OCTLIBDIR | $SED "s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`"
6311
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
45 fi
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
46
6682
1e440ccda1ca [project @ 2007-06-01 19:34:56 by jwe]
jwe
parents: 6319
diff changeset
47 : ${BINDIR=$DEFAULT_BINDIR}
1e440ccda1ca [project @ 2007-06-01 19:34:56 by jwe]
jwe
parents: 6319
diff changeset
48 : ${INCLUDEDIR=$DEFAULT_INCLUDEDIR}
6710
95ecf87531ca [project @ 2007-06-13 06:57:27 by jwe]
jwe
parents: 6682
diff changeset
49 : ${LIBDIR=$DEFAULT_LIBDIR}
6311
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
50 : ${OCTINCLUDEDIR=$DEFAULT_OCTINCLUDEDIR}
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
51 : ${OCTLIBDIR=$DEFAULT_OCTLIBDIR}
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
52
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9538
diff changeset
53 DEFAULT_INCFLAGS="-I$OCTINCLUDEDIR/.. -I$OCTINCLUDEDIR"
6311
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
54 if [ "$INCLUDEDIR" != /usr/include ]; then
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
55 DEFAULT_INCFLAGS="$DEFAULT_INCFLAGS -I$INCLUDEDIR"
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
56 fi
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
57
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
58 DEFAULT_LFLAGS="-L$OCTLIBDIR"
6710
95ecf87531ca [project @ 2007-06-13 06:57:27 by jwe]
jwe
parents: 6682
diff changeset
59 if [ "$LIBDIR" != /usr/lib ]; then
95ecf87531ca [project @ 2007-06-13 06:57:27 by jwe]
jwe
parents: 6682
diff changeset
60 DEFAULT_LFLAGS="$DEFAULT_LFLAGS -L$LIBDIR"
95ecf87531ca [project @ 2007-06-13 06:57:27 by jwe]
jwe
parents: 6682
diff changeset
61 fi
5285
fe5ee25a5e6c [project @ 2005-04-19 15:02:49 by jwe]
jwe
parents: 5199
diff changeset
62
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
63 # Default values for these variables are filled in when Octave is
9187
a3237ae32c0d eliminate last remnants of F2C variables
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
64 # compiled.
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
65
6682
1e440ccda1ca [project @ 2007-06-01 19:34:56 by jwe]
jwe
parents: 6319
diff changeset
66 : ${EXEEXT=%OCTAVE_CONF_EXEEXT%}
1e440ccda1ca [project @ 2007-06-01 19:34:56 by jwe]
jwe
parents: 6319
diff changeset
67
3590
a31ee5c3b66c [project @ 2000-02-08 10:09:05 by jwe]
jwe
parents: 3233
diff changeset
68 : ${CPPFLAGS=%OCTAVE_CONF_CPPFLAGS%}
6311
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
69 : ${INCFLAGS=$DEFAULT_INCFLAGS}
3590
a31ee5c3b66c [project @ 2000-02-08 10:09:05 by jwe]
jwe
parents: 3233
diff changeset
70 : ${F77=%OCTAVE_CONF_F77%}
a31ee5c3b66c [project @ 2000-02-08 10:09:05 by jwe]
jwe
parents: 3233
diff changeset
71 : ${FFLAGS=%OCTAVE_CONF_FFLAGS%}
a31ee5c3b66c [project @ 2000-02-08 10:09:05 by jwe]
jwe
parents: 3233
diff changeset
72 : ${FPICFLAG=%OCTAVE_CONF_FPICFLAG%}
a31ee5c3b66c [project @ 2000-02-08 10:09:05 by jwe]
jwe
parents: 3233
diff changeset
73 : ${CC=%OCTAVE_CONF_CC%}
a31ee5c3b66c [project @ 2000-02-08 10:09:05 by jwe]
jwe
parents: 3233
diff changeset
74 : ${CFLAGS=%OCTAVE_CONF_CFLAGS%}
a31ee5c3b66c [project @ 2000-02-08 10:09:05 by jwe]
jwe
parents: 3233
diff changeset
75 : ${CPICFLAG=%OCTAVE_CONF_CPICFLAG%}
a31ee5c3b66c [project @ 2000-02-08 10:09:05 by jwe]
jwe
parents: 3233
diff changeset
76 : ${CXX=%OCTAVE_CONF_CXX%}
a31ee5c3b66c [project @ 2000-02-08 10:09:05 by jwe]
jwe
parents: 3233
diff changeset
77 : ${CXXFLAGS=%OCTAVE_CONF_CXXFLAGS%}
a31ee5c3b66c [project @ 2000-02-08 10:09:05 by jwe]
jwe
parents: 3233
diff changeset
78 : ${CXXPICFLAG=%OCTAVE_CONF_CXXPICFLAG%}
a31ee5c3b66c [project @ 2000-02-08 10:09:05 by jwe]
jwe
parents: 3233
diff changeset
79 : ${XTRA_CFLAGS=%OCTAVE_CONF_XTRA_CFLAGS%}
a31ee5c3b66c [project @ 2000-02-08 10:09:05 by jwe]
jwe
parents: 3233
diff changeset
80 : ${XTRA_CXXFLAGS=%OCTAVE_CONF_XTRA_CXXFLAGS%}
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
81
3846
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
82 : ${DEPEND_FLAGS=%OCTAVE_CONF_DEPEND_FLAGS%}
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
83 : ${DEPEND_EXTRA_SED_PATTERN=%OCTAVE_CONF_DEPEND_EXTRA_SED_PATTERN%}
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
84
4759
364bbf35dbfa [project @ 2004-02-15 00:08:06 by jwe]
jwe
parents: 4229
diff changeset
85 : ${DL_LD=%OCTAVE_CONF_DL_LD%}
364bbf35dbfa [project @ 2004-02-15 00:08:06 by jwe]
jwe
parents: 4229
diff changeset
86 : ${DL_LDFLAGS=%OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%}
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
87
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
88 : ${RLD_FLAG=%OCTAVE_CONF_RLD_FLAG%}
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
89 : ${RDYNAMIC_FLAG=%OCTAVE_CONF_RDYNAMIC_FLAG%}
4228
309e799edc5a [project @ 2002-12-18 18:10:13 by jwe]
jwe
parents: 4206
diff changeset
90 : ${LIBOCTAVE=-loctave}
309e799edc5a [project @ 2002-12-18 18:10:13 by jwe]
jwe
parents: 4206
diff changeset
91 : ${LIBOCTINTERP=-loctinterp}
9515
eee9b3150446 more configure tweaks
John W. Eaton <jwe@octave.org>
parents: 9245
diff changeset
92 : ${READLINE_LIBS=-lreadline}
4228
309e799edc5a [project @ 2002-12-18 18:10:13 by jwe]
jwe
parents: 4206
diff changeset
93 : ${LIBCRUFT=-lcruft}
11450
5eb10763069f substitute and use LAPACK_LIBS in mkoctfile script
John W. Eaton <jwe@octave.org>
parents: 10901
diff changeset
94 : ${LAPACK_LIBS=%OCTAVE_CONF_LAPACK_LIBS%}
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
95 : ${BLAS_LIBS=%OCTAVE_CONF_BLAS_LIBS%}
9538
d0239bddf621 use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
96 : ${FFTW3_LDFLAGS=%OCTAVE_CONF_FFTW3_LDFLAGS%}
d0239bddf621 use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
97 : ${FFTW3_LIBS=%OCTAVE_CONF_FFTW3_LIBS%}
d0239bddf621 use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
98 : ${FFTW3F_LDFLAGS=%OCTAVE_CONF_FFTW3F_LDFLAGS%}
d0239bddf621 use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
99 : ${FFTW3F_LIBS=%OCTAVE_CONF_FFTW3F_LIBS%}
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
100 : ${LIBS=%OCTAVE_CONF_LIBS%}
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
101 : ${FLIBS=%OCTAVE_CONF_FLIBS%}
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
102 : ${LD_CXX=%OCTAVE_CONF_LD_CXX%}
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
103 : ${LDFLAGS=%OCTAVE_CONF_LDFLAGS%}
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
104 : ${LD_STATIC_FLAG=%OCTAVE_CONF_LD_STATIC_FLAG%}
6311
e2a1aca62551 [project @ 2007-02-15 21:18:34 by jwe]
jwe
parents: 6294
diff changeset
105 : ${LFLAGS=$DEFAULT_LFLAGS}
10773
cd16c1c3bc73 fix F77_INTEGER_8_FLAG problem in mkoctfile.in
Jaroslav Hajek <highegg@gmail.com>
parents: 10721
diff changeset
106 : ${F77_INTEGER_8_FLAG=%OCTAVE_CONF_F77_INTEGER_8_FLAG%}
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
107
10721
4906ccf5d95e use F77_INTEGER8_FLAG in BLAS checking as well as ALL_FFLAGS in mkoctfile
Jaroslav Hajek <highegg@gmail.com>
parents: 9957
diff changeset
108 : ${ALL_FFLAGS="$FFLAGS $F77_INTEGER_8_FLAG"}
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
109
3131
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3088
diff changeset
110 : ${ALL_CFLAGS="$INCFLAGS $XTRA_CFLAGS $CFLAGS"}
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
111
3131
9c5160c83bd2 [project @ 1998-01-29 04:46:33 by jwe]
jwe
parents: 3088
diff changeset
112 : ${ALL_CXXFLAGS="$INCFLAGS $XTRA_CXXFLAGS $CXXFLAGS"}
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
113
3887
7da18459c08b [project @ 2002-04-04 00:44:21 by jwe]
jwe
parents: 3860
diff changeset
114 : ${ALL_LDFLAGS="$LD_STATIC_FLAG $CPICFLAG $LDFLAGS"}
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
115
4228
309e799edc5a [project @ 2002-12-18 18:10:13 by jwe]
jwe
parents: 4206
diff changeset
116 : ${OCTAVE_LIBS="$LIBOCTINTERP $LIBOCTAVE $SPECIAL_MATH_LIB $LIBCRUFT"}
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
117
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
118 # Local variables.
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
119
9538
d0239bddf621 use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
120 FFTW_LIBS="$FFTW3_LDFLAGS $FFTW3_LIBS $FFTW3F_LDFLAGS $FFTW3F_LIBS"
d0239bddf621 use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
121
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
122 usage_msg="usage: mkoctfile [options] file ..."
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
123
5285
fe5ee25a5e6c [project @ 2005-04-19 15:02:49 by jwe]
jwe
parents: 5199
diff changeset
124 version_msg="mkoctfile, version $OCTAVE_VERSION"
fe5ee25a5e6c [project @ 2005-04-19 15:02:49 by jwe]
jwe
parents: 5199
diff changeset
125
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
126 cfiles=
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
127 ccfiles=
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
128 f77files=
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
129 objfiles=
6294
fa02b0b467b5 [project @ 2007-02-09 22:01:37 by jwe]
jwe
parents: 6187
diff changeset
130 libfiles=
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
131 octfiles=
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
132 octfile=
3860
23f6e22426d6 [project @ 2001-11-09 18:11:48 by jwe]
jwe
parents: 3859
diff changeset
133 outputfile=
3088
f33738510eb2 [project @ 1997-10-02 06:38:36 by jwe]
jwe
parents: 3087
diff changeset
134 incflags=
3180
c17387059fd3 [project @ 1998-09-24 18:59:11 by jwe]
jwe
parents: 3176
diff changeset
135 defs=
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
136 ldflags=
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
137 dbg=:
4873
0358ed4394f5 [project @ 2004-04-22 05:51:20 by jwe]
jwe
parents: 4793
diff changeset
138 pass_on_options=
3058
2688b68dd9c1 [project @ 1997-06-20 19:27:36 by jwe]
jwe
parents: 3052
diff changeset
139 strip=false
4199
35ec3b95a3ca [project @ 2002-11-21 20:47:49 by jwe]
jwe
parents: 4102
diff changeset
140 no_oct_file_strip_on_this_platform=%NO_OCT_FILE_STRIP%
3735
cf69dbe17e59 [project @ 2000-11-04 05:29:09 by jwe]
jwe
parents: 3734
diff changeset
141 link=true
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
142 link_stand_alone=false
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5669
diff changeset
143 output_ext=".oct"
3846
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
144 depend=false
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
145 compile=true
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
146
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
147 if [ $# -eq 0 ]; then
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
148 echo $usage_msg 1>&2
3846
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
149 exit 1
2163
8901e415035a [project @ 1996-05-13 10:35:04 by jwe]
jwe
parents:
diff changeset
150 fi
8901e415035a [project @ 1996-05-13 10:35:04 by jwe]
jwe
parents:
diff changeset
151
5285
fe5ee25a5e6c [project @ 2005-04-19 15:02:49 by jwe]
jwe
parents: 5199
diff changeset
152 if [ $# -eq 1 ]; then
fe5ee25a5e6c [project @ 2005-04-19 15:02:49 by jwe]
jwe
parents: 5199
diff changeset
153 case "$1" in
9954
de6b6173c990 mkoctfile.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
154 -v | -version | --version)
5285
fe5ee25a5e6c [project @ 2005-04-19 15:02:49 by jwe]
jwe
parents: 5199
diff changeset
155 echo $version_msg 1>&2
fe5ee25a5e6c [project @ 2005-04-19 15:02:49 by jwe]
jwe
parents: 5199
diff changeset
156 exit 0
fe5ee25a5e6c [project @ 2005-04-19 15:02:49 by jwe]
jwe
parents: 5199
diff changeset
157 ;;
fe5ee25a5e6c [project @ 2005-04-19 15:02:49 by jwe]
jwe
parents: 5199
diff changeset
158 esac
fe5ee25a5e6c [project @ 2005-04-19 15:02:49 by jwe]
jwe
parents: 5199
diff changeset
159 fi
fe5ee25a5e6c [project @ 2005-04-19 15:02:49 by jwe]
jwe
parents: 5199
diff changeset
160
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
161 while [ $# -gt 0 ]; do
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
162 file=
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
163 case "$1" in
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
164 *.c)
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
165 file=$1
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
166 cfiles="$cfiles $file"
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
167 ;;
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
168 *.cc | *.C | *.cpp)
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
169 file=$1
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
170 ccfiles="$ccfiles $file"
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
171 ;;
5970
af3407589a89 [project @ 2006-08-25 18:24:40 by jwe]
jwe
parents: 5904
diff changeset
172 *.f | *.F | *.f90 | *.F90)
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
173 file=$1
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
174 f77files="$f77files $file"
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
175 ;;
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
176 *.o)
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
177 file=$1
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
178 objfiles="$objfiles $file"
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
179 ;;
6294
fa02b0b467b5 [project @ 2007-02-09 22:01:37 by jwe]
jwe
parents: 6187
diff changeset
180 *.a)
fa02b0b467b5 [project @ 2007-02-09 22:01:37 by jwe]
jwe
parents: 6187
diff changeset
181 file=$1
fa02b0b467b5 [project @ 2007-02-09 22:01:37 by jwe]
jwe
parents: 6187
diff changeset
182 libfiles="$libfiles $file"
fa02b0b467b5 [project @ 2007-02-09 22:01:37 by jwe]
jwe
parents: 6187
diff changeset
183 ;;
9954
de6b6173c990 mkoctfile.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
184 -d | -debug | --debug | -v | -verbose | --verbose)
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
185 dbg=echo
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
186 ;;
9954
de6b6173c990 mkoctfile.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
187 -h | -\? | -help | --help)
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
188 echo $usage_msg 1>&2
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
189 cat << EOF
2163
8901e415035a [project @ 1996-05-13 10:35:04 by jwe]
jwe
parents:
diff changeset
190
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
191 Options:
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
192
3233
98d0ee053ba4 [project @ 1999-01-27 20:23:40 by jwe]
jwe
parents: 3180
diff changeset
193 -h, -?, --help Print this message.
3734
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
194
3088
f33738510eb2 [project @ 1997-10-02 06:38:36 by jwe]
jwe
parents: 3087
diff changeset
195 -IDIR Add -IDIR to compile commands.
3734
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
196
5483
d2df058c4319 [project @ 2005-10-05 07:52:10 by dbateman]
dbateman
parents: 5285
diff changeset
197 -idirafter DIR Add -idirafter DIR to compile commands.
d2df058c4319 [project @ 2005-10-05 07:52:10 by dbateman]
dbateman
parents: 5285
diff changeset
198
3180
c17387059fd3 [project @ 1998-09-24 18:59:11 by jwe]
jwe
parents: 3176
diff changeset
199 -DDEF Add -DDEF to compile commands.
3734
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
200
3058
2688b68dd9c1 [project @ 1997-06-20 19:27:36 by jwe]
jwe
parents: 3052
diff changeset
201 -lLIB Add library LIB to link command.
3734
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
202
3087
dd4a9ab9c2bd [project @ 1997-09-25 16:51:17 by jwe]
jwe
parents: 3058
diff changeset
203 -LDIR Add -LDIR to link command.
3734
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
204
3846
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
205 -M, --depend Generate dependency files (.d) for C and C++
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
206 source files.
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
207
5199
16a6247730d9 [project @ 2005-03-10 20:24:45 by jwe]
jwe
parents: 5159
diff changeset
208 -RDIR Add -RDIR to link command.
16a6247730d9 [project @ 2005-03-10 20:24:45 by jwe]
jwe
parents: 5159
diff changeset
209
6153
e60688a1ea07 [project @ 2006-11-13 17:30:54 by jwe]
jwe
parents: 6086
diff changeset
210 -Wl,... Pass flags though the linker like -Wl,-rpath=...
e60688a1ea07 [project @ 2006-11-13 17:30:54 by jwe]
jwe
parents: 6086
diff changeset
211
e60688a1ea07 [project @ 2006-11-13 17:30:54 by jwe]
jwe
parents: 6086
diff changeset
212 -W... Pass flags though the compiler like -Wa,OPTION.
5199
16a6247730d9 [project @ 2005-03-10 20:24:45 by jwe]
jwe
parents: 5159
diff changeset
213
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
214 -c, --compile Compile, but do not link.
3735
cf69dbe17e59 [project @ 2000-11-04 05:29:09 by jwe]
jwe
parents: 3734
diff changeset
215
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
216 -o FILE, --output FILE Output file name. Default extension is .oct
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5669
diff changeset
217 (or .mex if --mex is specified) unless linking
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5669
diff changeset
218 a stand-alone executable.
3734
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
219
5904
80d3933fb8b6 [project @ 2006-07-26 17:19:10 by jwe]
jwe
parents: 5864
diff changeset
220 -g Enable debugging options for compilers.
80d3933fb8b6 [project @ 2006-07-26 17:19:10 by jwe]
jwe
parents: 5864
diff changeset
221
3734
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
222 -p VAR, --print VAR Print configuration variable VAR. Recognized
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
223 variables are:
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
224
12254
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
225 ALL_CFLAGS FLIBS
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
226 ALL_CXXFLAGS FPICFLAG
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
227 ALL_FFLAGS INCFLAGS
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
228 ALL_LDFLAGS LAPACK_LIBS
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
229 BLAS_LIBS LDFLAGS
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
230 CC LD_CXX
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
231 CFLAGS LD_STATIC_FLAG
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
232 CPICFLAG LFLAGS
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
233 CPPFLAGS LIBCRUFT
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
234 CXX LIBOCTAVE
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
235 CXXFLAGS LIBOCTINTERP
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
236 CXXPICFLAG LIBS
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
237 DEPEND_EXTRA_SED_PATTERN OCTAVE_LIBS
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
238 DEPEND_FLAGS RDYNAMIC_FLAG
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
239 DL_LD READLINE_LIBS
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
240 DL_LDFLAGS RLD_FLAG
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
241 F77 SED
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
242 FFLAGS XTRA_CFLAGS
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
243 FFTW_LIBS XTRA_CXXFLAGS
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
244
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
245 --link-stand-alone Link a stand-alone executable file.
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
246
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5669
diff changeset
247 --mex Assume we are creating a MEX file. Set the
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5669
diff changeset
248 default output extension to ".mex".
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5669
diff changeset
249
3058
2688b68dd9c1 [project @ 1997-06-20 19:27:36 by jwe]
jwe
parents: 3052
diff changeset
250 -s, --strip Strip output file.
3734
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
251
3058
2688b68dd9c1 [project @ 1997-06-20 19:27:36 by jwe]
jwe
parents: 3052
diff changeset
252 -v, --verbose Echo commands as they are executed.
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
253
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
254 FILE Compile or link FILE. Recognized file types are:
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
255
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
256 .c C source
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
257 .cc C++ source
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
258 .C C++ source
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
259 .cpp C++ source
5970
af3407589a89 [project @ 2006-08-25 18:24:40 by jwe]
jwe
parents: 5904
diff changeset
260 .f Fortran source (fixed form)
af3407589a89 [project @ 2006-08-25 18:24:40 by jwe]
jwe
parents: 5904
diff changeset
261 .F Fortran source (fixed form)
af3407589a89 [project @ 2006-08-25 18:24:40 by jwe]
jwe
parents: 5904
diff changeset
262 .f90 Fortran source (free form)
af3407589a89 [project @ 2006-08-25 18:24:40 by jwe]
jwe
parents: 5904
diff changeset
263 .F90 Fortran source (free form)
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
264 .o object file
6294
fa02b0b467b5 [project @ 2007-02-09 22:01:37 by jwe]
jwe
parents: 6187
diff changeset
265 .a library file
2163
8901e415035a [project @ 1996-05-13 10:35:04 by jwe]
jwe
parents:
diff changeset
266
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
267 EOF
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
268 exit 0
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
269 ;;
3088
f33738510eb2 [project @ 1997-10-02 06:38:36 by jwe]
jwe
parents: 3087
diff changeset
270 -I*)
3176
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3131
diff changeset
271 incflags="$incflags $1"
3088
f33738510eb2 [project @ 1997-10-02 06:38:36 by jwe]
jwe
parents: 3087
diff changeset
272 ;;
5483
d2df058c4319 [project @ 2005-10-05 07:52:10 by dbateman]
dbateman
parents: 5285
diff changeset
273 -idirafter)
d2df058c4319 [project @ 2005-10-05 07:52:10 by dbateman]
dbateman
parents: 5285
diff changeset
274 shift
d2df058c4319 [project @ 2005-10-05 07:52:10 by dbateman]
dbateman
parents: 5285
diff changeset
275 if [ $# -gt 0 ]; then
d2df058c4319 [project @ 2005-10-05 07:52:10 by dbateman]
dbateman
parents: 5285
diff changeset
276 incflags="$incflags -idirafter $1"
d2df058c4319 [project @ 2005-10-05 07:52:10 by dbateman]
dbateman
parents: 5285
diff changeset
277 else
6782
e3f06290847c [project @ 2007-07-20 16:08:21 by jwe]
jwe
parents: 6710
diff changeset
278 echo "mkoctfile: include directory name missing" 1>&2
5483
d2df058c4319 [project @ 2005-10-05 07:52:10 by dbateman]
dbateman
parents: 5285
diff changeset
279 fi
d2df058c4319 [project @ 2005-10-05 07:52:10 by dbateman]
dbateman
parents: 5285
diff changeset
280 ;;
3180
c17387059fd3 [project @ 1998-09-24 18:59:11 by jwe]
jwe
parents: 3176
diff changeset
281 -D*)
c17387059fd3 [project @ 1998-09-24 18:59:11 by jwe]
jwe
parents: 3176
diff changeset
282 defs="$defs $1"
c17387059fd3 [project @ 1998-09-24 18:59:11 by jwe]
jwe
parents: 3176
diff changeset
283 ;;
6153
e60688a1ea07 [project @ 2006-11-13 17:30:54 by jwe]
jwe
parents: 6086
diff changeset
284 -[lLR]* | -Wl,*)
3176
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3131
diff changeset
285 ldflags="$ldflags $1"
3058
2688b68dd9c1 [project @ 1997-06-20 19:27:36 by jwe]
jwe
parents: 3052
diff changeset
286 ;;
10901
860427ac9b77 Add ability to pass -pthread through to linker in mkoctfile.
Rik <octave@nomad.inbox5.com>
parents: 10773
diff changeset
287 -pthread)
860427ac9b77 Add ability to pass -pthread through to linker in mkoctfile.
Rik <octave@nomad.inbox5.com>
parents: 10773
diff changeset
288 ldflags="$ldflags $1"
860427ac9b77 Add ability to pass -pthread through to linker in mkoctfile.
Rik <octave@nomad.inbox5.com>
parents: 10773
diff changeset
289 ;;
9954
de6b6173c990 mkoctfile.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
290 -M | -depend | --depend)
3846
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
291 depend=true
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
292 compile=false
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
293 ;;
9954
de6b6173c990 mkoctfile.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
294 -o | -ouput | --output)
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
295 shift
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
296 if [ $# -gt 0 ]; then
3860
23f6e22426d6 [project @ 2001-11-09 18:11:48 by jwe]
jwe
parents: 3859
diff changeset
297 outputfile="$1"
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
298 else
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
299 echo "mkoctfile: output file name missing" 1>&2
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
300 fi
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
301 ;;
9954
de6b6173c990 mkoctfile.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
302 -p | -print | --print)
3734
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
303 shift
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
304 if [ $# -gt 0 ]; then
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
305 eval echo \${$1}
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
306 exit 0
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
307 else
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
308 echo "mkoctfile: --print requires argument" 1>&2
3734
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
309 exit 1
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
310 fi
40574699e4ec [project @ 2000-11-02 01:47:55 by jwe]
jwe
parents: 3733
diff changeset
311 ;;
9954
de6b6173c990 mkoctfile.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
312 -s | -strip | --strip)
4199
35ec3b95a3ca [project @ 2002-11-21 20:47:49 by jwe]
jwe
parents: 4102
diff changeset
313 if $no_oct_file_strip_on_this_platform; then
35ec3b95a3ca [project @ 2002-11-21 20:47:49 by jwe]
jwe
parents: 4102
diff changeset
314 echo "mkoctfile: stripping disabled on this platform" 1>&2
35ec3b95a3ca [project @ 2002-11-21 20:47:49 by jwe]
jwe
parents: 4102
diff changeset
315 else
35ec3b95a3ca [project @ 2002-11-21 20:47:49 by jwe]
jwe
parents: 4102
diff changeset
316 strip=true
35ec3b95a3ca [project @ 2002-11-21 20:47:49 by jwe]
jwe
parents: 4102
diff changeset
317 fi
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
318 ;;
9954
de6b6173c990 mkoctfile.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
319 -c | -compile | --compile)
3735
cf69dbe17e59 [project @ 2000-11-04 05:29:09 by jwe]
jwe
parents: 3734
diff changeset
320 link=false
cf69dbe17e59 [project @ 2000-11-04 05:29:09 by jwe]
jwe
parents: 3734
diff changeset
321 ;;
5904
80d3933fb8b6 [project @ 2006-07-26 17:19:10 by jwe]
jwe
parents: 5864
diff changeset
322 -g)
80d3933fb8b6 [project @ 2006-07-26 17:19:10 by jwe]
jwe
parents: 5864
diff changeset
323 ALL_CFLAGS="$ALL_CFLAGS -g"
80d3933fb8b6 [project @ 2006-07-26 17:19:10 by jwe]
jwe
parents: 5864
diff changeset
324 ALL_CXXFLAGS="$ALL_CXXFLAGS -g"
80d3933fb8b6 [project @ 2006-07-26 17:19:10 by jwe]
jwe
parents: 5864
diff changeset
325 ALL_FFLAGS="$ALL_FFLAGS -g"
80d3933fb8b6 [project @ 2006-07-26 17:19:10 by jwe]
jwe
parents: 5864
diff changeset
326 ;;
9954
de6b6173c990 mkoctfile.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
327 -link-stand-alone | --link-stand-alone)
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
328 link_stand_alone=true
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
329 ;;
9954
de6b6173c990 mkoctfile.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
330 -mex | --mex)
6009
1f5d31edb459 [project @ 2006-09-27 15:42:01 by jwe]
jwe
parents: 5970
diff changeset
331 incflags="$incflags -I."
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5669
diff changeset
332 output_ext=".mex"
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5669
diff changeset
333 ;;
4873
0358ed4394f5 [project @ 2004-04-22 05:51:20 by jwe]
jwe
parents: 4793
diff changeset
334 -W*)
0358ed4394f5 [project @ 2004-04-22 05:51:20 by jwe]
jwe
parents: 4793
diff changeset
335 pass_on_options="$pass_on_options $1"
0358ed4394f5 [project @ 2004-04-22 05:51:20 by jwe]
jwe
parents: 4793
diff changeset
336 ;;
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
337 *)
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
338 echo "mkoctfile: unrecognized argument $1" 1>&2
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
339 exit 1
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
340 ;;
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
341 esac
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
342 if [ -n "$file" ]; then
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
343 if [ -z "$octfile" ]; then
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
344 octfile="$file"
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
345 fi
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
346 fi
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
347 shift
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
348 done
2163
8901e415035a [project @ 1996-05-13 10:35:04 by jwe]
jwe
parents:
diff changeset
349
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
350 if $link_stand_alone; then
3860
23f6e22426d6 [project @ 2001-11-09 18:11:48 by jwe]
jwe
parents: 3859
diff changeset
351 if [ -n "$outputfile" ]; then
23f6e22426d6 [project @ 2001-11-09 18:11:48 by jwe]
jwe
parents: 3859
diff changeset
352 output_option="-o $outputfile"
23f6e22426d6 [project @ 2001-11-09 18:11:48 by jwe]
jwe
parents: 3859
diff changeset
353 fi
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
354 else
3860
23f6e22426d6 [project @ 2001-11-09 18:11:48 by jwe]
jwe
parents: 3859
diff changeset
355 if [ -n "$outputfile" ]; then
23f6e22426d6 [project @ 2001-11-09 18:11:48 by jwe]
jwe
parents: 3859
diff changeset
356 octfile="$outputfile"
9957
59ed11557715 mkoctfile: if output file is specified and it does not end in output_ext, append output_ext
John W. Eaton <jwe@octave.org>
parents: 9956
diff changeset
357 case "$octfile" in
59ed11557715 mkoctfile: if output file is specified and it does not end in output_ext, append output_ext
John W. Eaton <jwe@octave.org>
parents: 9956
diff changeset
358 *$output_ext)
59ed11557715 mkoctfile: if output file is specified and it does not end in output_ext, append output_ext
John W. Eaton <jwe@octave.org>
parents: 9956
diff changeset
359 ;;
59ed11557715 mkoctfile: if output file is specified and it does not end in output_ext, append output_ext
John W. Eaton <jwe@octave.org>
parents: 9956
diff changeset
360 *)
59ed11557715 mkoctfile: if output file is specified and it does not end in output_ext, append output_ext
John W. Eaton <jwe@octave.org>
parents: 9956
diff changeset
361 octfile="$octfile$output_ext"
59ed11557715 mkoctfile: if output file is specified and it does not end in output_ext, append output_ext
John W. Eaton <jwe@octave.org>
parents: 9956
diff changeset
362 ;;
59ed11557715 mkoctfile: if output file is specified and it does not end in output_ext, append output_ext
John W. Eaton <jwe@octave.org>
parents: 9956
diff changeset
363 esac
3860
23f6e22426d6 [project @ 2001-11-09 18:11:48 by jwe]
jwe
parents: 3859
diff changeset
364 else
6187
2a8922007c12 [project @ 2006-11-29 01:59:59 by jwe]
jwe
parents: 6153
diff changeset
365 octfile=`basename $octfile`
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5669
diff changeset
366 octfile=`echo $octfile | $SED 's,\.[^.]*$,,'`$output_ext
3860
23f6e22426d6 [project @ 2001-11-09 18:11:48 by jwe]
jwe
parents: 3859
diff changeset
367 fi
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
368 fi
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
369
3846
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
370 # Generate dependency files for C and C++ files.
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
371
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
372 if $depend; then
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
373 if [ -n "$cfiles" ]; then
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
374 for f in $cfiles; do
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3887
diff changeset
375 b=`echo $f | $SED 's,\.c$,,'`
3846
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
376 d=$b.d
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
377 cmd="rm -f $d"
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
378 $dbg $cmd
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
379 eval $cmd
4206
fc514e47666e [project @ 2002-11-29 20:13:01 by jwe]
jwe
parents: 4201
diff changeset
380 cmd="$CC $DEPEND_FLAGS $CPPFLAGS $ALL_CFLAGS $incflags $def $f | $SED $DEPEND_EXTRA_SED_PATTERN -e 's,^[^:]*/\(.*\.o\):,\1:,' -e 's,$b\.o,pic/& & $d,g' > $d-t && mv $d-t $d"
3846
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
381 $dbg $cmd
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
382 eval $cmd
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
383 done
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
384 fi
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
385
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
386 if [ -n "$ccfiles" ]; then
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
387 for f in $ccfiles; do
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
388 case $f in
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
389 *.cc)
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3887
diff changeset
390 b=`echo $f | $SED 's,\.cc$,,'`
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
391 ;;
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
392 *.C)
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3887
diff changeset
393 b=`echo $f | $SED 's,\.C$,,'`
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
394 ;;
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
395 *.cpp)
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3887
diff changeset
396 b=`echo $f | $SED 's,\.cpp$,,'`
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
397 ;;
3846
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
398 esac
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
399 d=$b.d
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
400 cmd="rm -f $d"
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
401 $dbg $cmd
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
402 eval $cmd
4206
fc514e47666e [project @ 2002-11-29 20:13:01 by jwe]
jwe
parents: 4201
diff changeset
403 cmd="$CXX $DEPEND_FLAGS $CPPFLAGS $ALL_CXXFLAGS $incflags $defs $f | $SED $DEPEND_EXTRA_SED_PATTERN -e 's,^[^:]*/\(.*\.o\):,\1:,' -e 's,$b\.o,pic/& & $d,g' > $d-t && mv $d-t $d"
3846
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
404 $dbg $cmd
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
405 eval $cmd
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
406 done
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
407 fi
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
408 # If generating dependencies, that's all we do.
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
409 exit 0
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
410 fi
08cd791cd613 [project @ 2001-07-27 18:19:48 by jwe]
jwe
parents: 3735
diff changeset
411
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
412 # Compile Fortran, C, and C++ files. Add the name of each object file
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
413 # that is produced to the overall list of object files.
2163
8901e415035a [project @ 1996-05-13 10:35:04 by jwe]
jwe
parents:
diff changeset
414
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
415 if [ -n "$f77files" ]; then
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
416 for f in $f77files; do
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
417 case $f in
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
418 *.f)
9956
f26a33e21db9 mkoctfile: when compiling files in subdirectories, place object files in current directory by default
John W. Eaton <jwe@octave.org>
parents: 9954
diff changeset
419 b=`echo $f | $SED 's,.*/,,; s,\.f$,,'`
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
420 ;;
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
421 *.F)
9956
f26a33e21db9 mkoctfile: when compiling files in subdirectories, place object files in current directory by default
John W. Eaton <jwe@octave.org>
parents: 9954
diff changeset
422 b=`echo $f | $SED 's,.*/,,; s,\.F$,,'`
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
423 ;;
5970
af3407589a89 [project @ 2006-08-25 18:24:40 by jwe]
jwe
parents: 5904
diff changeset
424 *.f90)
9956
f26a33e21db9 mkoctfile: when compiling files in subdirectories, place object files in current directory by default
John W. Eaton <jwe@octave.org>
parents: 9954
diff changeset
425 b=`echo $f | $SED 's,.*/,,; s,\.f90$,,'`
5970
af3407589a89 [project @ 2006-08-25 18:24:40 by jwe]
jwe
parents: 5904
diff changeset
426 ;;
af3407589a89 [project @ 2006-08-25 18:24:40 by jwe]
jwe
parents: 5904
diff changeset
427 *.F90)
9956
f26a33e21db9 mkoctfile: when compiling files in subdirectories, place object files in current directory by default
John W. Eaton <jwe@octave.org>
parents: 9954
diff changeset
428 b=`echo $f | $SED 's,.*/,,; s,\.F90$,,'`
5970
af3407589a89 [project @ 2006-08-25 18:24:40 by jwe]
jwe
parents: 5904
diff changeset
429 ;;
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
430 esac
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
431 if [ -n "$F77" ]; then
5159
f0f3ccba4388 [project @ 2005-02-23 00:57:13 by jwe]
jwe
parents: 4873
diff changeset
432 if [ -n "$outputfile" ]; then
12254
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
433 if $link; then
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
434 o=$b.o
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
435 else
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
436 o=$outputfile
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
437 fi
5159
f0f3ccba4388 [project @ 2005-02-23 00:57:13 by jwe]
jwe
parents: 4873
diff changeset
438 else
f0f3ccba4388 [project @ 2005-02-23 00:57:13 by jwe]
jwe
parents: 4873
diff changeset
439 o=$b.o
f0f3ccba4388 [project @ 2005-02-23 00:57:13 by jwe]
jwe
parents: 4873
diff changeset
440 fi
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
441 objfiles="$objfiles $o"
5970
af3407589a89 [project @ 2006-08-25 18:24:40 by jwe]
jwe
parents: 5904
diff changeset
442 cmd="$F77 -c $FPICFLAG $ALL_FFLAGS $incflags $defs $pass_on_options $f -o $o"
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
443 $dbg $cmd
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
444 eval $cmd
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
445 else
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
446 echo "mkoctfile: no way to compile Fortran file $f" 1>&2
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
447 fi
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
448 done
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
449 fi
2163
8901e415035a [project @ 1996-05-13 10:35:04 by jwe]
jwe
parents:
diff changeset
450
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
451 if [ -n "$cfiles" ]; then
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
452 for f in $cfiles; do
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
453 if [ -n "$CC" ]; then
9956
f26a33e21db9 mkoctfile: when compiling files in subdirectories, place object files in current directory by default
John W. Eaton <jwe@octave.org>
parents: 9954
diff changeset
454 b=`echo $f | $SED 's,.*/,,; s,\.c$,,'`
5159
f0f3ccba4388 [project @ 2005-02-23 00:57:13 by jwe]
jwe
parents: 4873
diff changeset
455 if [ -n "$outputfile" ]; then
12254
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
456 if $link; then
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
457 o=$b.o
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
458 else
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
459 o=$outputfile
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
460 fi
5159
f0f3ccba4388 [project @ 2005-02-23 00:57:13 by jwe]
jwe
parents: 4873
diff changeset
461 else
12254
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
462 o=$b.o
5159
f0f3ccba4388 [project @ 2005-02-23 00:57:13 by jwe]
jwe
parents: 4873
diff changeset
463 fi
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
464 objfiles="$objfiles $o"
4873
0358ed4394f5 [project @ 2004-04-22 05:51:20 by jwe]
jwe
parents: 4793
diff changeset
465 cmd="$CC -c $CPPFLAGS $CPICFLAG $ALL_CFLAGS $pass_on_options $incflags $defs $f -o $o"
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
466 $dbg $cmd
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
467 eval $cmd
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
468 else
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
469 echo "mkoctfile: no way to compile C++ file $f" 1>&2
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
470 fi
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
471 done
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
472 fi
2163
8901e415035a [project @ 1996-05-13 10:35:04 by jwe]
jwe
parents:
diff changeset
473
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
474 if [ -n "$ccfiles" ]; then
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
475 for f in $ccfiles; do
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
476 if [ -n "$CXX" ]; then
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
477 case $f in
12254
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
478 *.cc)
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
479 b=`echo $f | $SED 's,.*/,,; s,\.cc$,,'`
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
480 ;;
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
481 *.C)
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
482 b=`echo $f | $SED 's,.*/,,; s,\.C$,,'`
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
483 ;;
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
484 *.cpp)
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
485 b=`echo $f | $SED 's,.*/,,; s,\.cpp$,,'`
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
486 ;;
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
487 esac
5159
f0f3ccba4388 [project @ 2005-02-23 00:57:13 by jwe]
jwe
parents: 4873
diff changeset
488 if [ -n "$outputfile" ]; then
12254
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
489 if $link; then
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
490 o=$b.o
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
491 else
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
492 o=$outputfile
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
493 fi
5159
f0f3ccba4388 [project @ 2005-02-23 00:57:13 by jwe]
jwe
parents: 4873
diff changeset
494 else
12254
23385f2c90b7 whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
495 o=$b.o
5159
f0f3ccba4388 [project @ 2005-02-23 00:57:13 by jwe]
jwe
parents: 4873
diff changeset
496 fi
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
497 objfiles="$objfiles $o"
4873
0358ed4394f5 [project @ 2004-04-22 05:51:20 by jwe]
jwe
parents: 4793
diff changeset
498 cmd="$CXX -c $CPPFLAGS $CXXPICFLAG $ALL_CXXFLAGS $pass_on_options $incflags $defs $f -o $o"
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
499 $dbg $cmd
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
500 eval $cmd
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
501 else
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
502 echo "mkoctfile: no way to compile C++ file $f" 1>&2
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
503 fi
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
504 done
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
505 fi
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
506
3660
2dc265765850 [project @ 2000-04-20 08:22:33 by jwe]
jwe
parents: 3659
diff changeset
507 ## Uncomment the following group of lines if you get `Text file busy'
2dc265765850 [project @ 2000-04-20 08:22:33 by jwe]
jwe
parents: 3659
diff changeset
508 ## errors from ld. This may happen if the .oct file is currently
2dc265765850 [project @ 2000-04-20 08:22:33 by jwe]
jwe
parents: 3659
diff changeset
509 ## running while you are trying to recompile it. We try moving first,
3733
9265596fe0d1 [project @ 2000-11-01 18:59:44 by jwe]
jwe
parents: 3663
diff changeset
510 ## since on some systems (HP-UX, maybe others) it is possible to
3660
2dc265765850 [project @ 2000-04-20 08:22:33 by jwe]
jwe
parents: 3659
diff changeset
511 ## rename running programs but not remove them.
2dc265765850 [project @ 2000-04-20 08:22:33 by jwe]
jwe
parents: 3659
diff changeset
512
3663
719cc61d6dc6 [project @ 2000-04-25 08:44:18 by jwe]
jwe
parents: 3660
diff changeset
513 ## if [ -f "$octfile" ]; then
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
514 ## cmd="mv $octfile $octfile.bak"
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
515 ## $dbg $cmd
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
516 ## eval $cmd
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
517 ## cmd="rm -f $octfile.bak"
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
518 ## $dbg $cmd
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
519 ## eval $cmd
3663
719cc61d6dc6 [project @ 2000-04-25 08:44:18 by jwe]
jwe
parents: 3660
diff changeset
520 ## fi
3659
e68976912bb5 [project @ 2000-04-19 16:43:56 by jwe]
jwe
parents: 3591
diff changeset
521
3051
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
522 # Link all the object files.
8bc313194436 [project @ 1997-06-11 21:31:31 by jwe]
jwe
parents: 3049
diff changeset
523
5285
fe5ee25a5e6c [project @ 2005-04-19 15:02:49 by jwe]
jwe
parents: 5199
diff changeset
524 if $link && [ -n "$objfiles" ]; then
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
525 if $link_stand_alone; then
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
526 if [ -n "$LD_CXX" ]; then
11450
5eb10763069f substitute and use LAPACK_LIBS in mkoctfile script
John W. Eaton <jwe@octave.org>
parents: 10901
diff changeset
527 cmd="$LD_CXX $CPPFLAGS $ALL_CXXFLAGS $RDYNAMIC_FLAG $ALL_LDFLAGS $pass_on_options $output_option $objfiles $libfiles $ldflags $LFLAGS $RLD_FLAG $OCTAVE_LIBS $LAPACK_LIBS $BLAS_LIBS $FFTW_LIBS $READLINE_LIBS $LIBS $FLIBS"
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
528 $dbg $cmd
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
529 eval $cmd
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
530 else
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
531 echo "mkoctfile: no way to link stand-alone executable file" 1>&2
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
532 exit 1
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
533 fi
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
534 else
11450
5eb10763069f substitute and use LAPACK_LIBS in mkoctfile script
John W. Eaton <jwe@octave.org>
parents: 10901
diff changeset
535 LINK_DEPS="$LFLAGS $OCTAVE_LIBS $LDFLAGS $LAPACK_LIBS $BLAS_LIBS $FFTW_LIBS $LIBS $FLIBS"
6294
fa02b0b467b5 [project @ 2007-02-09 22:01:37 by jwe]
jwe
parents: 6187
diff changeset
536 cmd="$DL_LD $DL_LDFLAGS $pass_on_options -o $octfile $objfiles $libfiles $ldflags $LINK_DEPS"
3859
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
537 $dbg $cmd
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
538 eval $cmd
890a7e4c1362 [project @ 2001-11-09 17:05:08 by jwe]
jwe
parents: 3847
diff changeset
539 fi
3058
2688b68dd9c1 [project @ 1997-06-20 19:27:36 by jwe]
jwe
parents: 3052
diff changeset
540
2688b68dd9c1 [project @ 1997-06-20 19:27:36 by jwe]
jwe
parents: 3052
diff changeset
541 # Maybe strip it.
2688b68dd9c1 [project @ 1997-06-20 19:27:36 by jwe]
jwe
parents: 3052
diff changeset
542
3847
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
543 if $strip; then
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
544 cmd="strip $octfile"
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
545 $dbg $cmd
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
546 eval $cmd
92fb162eba24 [project @ 2001-08-10 17:18:17 by jwe]
jwe
parents: 3846
diff changeset
547 fi
3735
cf69dbe17e59 [project @ 2000-11-04 05:29:09 by jwe]
jwe
parents: 3734
diff changeset
548 fi
3058
2688b68dd9c1 [project @ 1997-06-20 19:27:36 by jwe]
jwe
parents: 3052
diff changeset
549
2688b68dd9c1 [project @ 1997-06-20 19:27:36 by jwe]
jwe
parents: 3052
diff changeset
550 exit 0