annotate install-octave.in @ 7948:af10baa63915 ss-3-1-50

3.1.50 snapshot
author John W. Eaton <jwe@octave.org>
date Fri, 18 Jul 2008 17:42:48 -0400
parents 92f4552ea359
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
1 #!/bin/sh
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
2 #
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
3 # install-octave -- install script for binary distributions.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
4 #
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
5 # John W. Eaton
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
6 # jwe@bevo.che.wisc.edu
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
7 # University of Wisconsin-Madison
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
8 # Department of Chemical Engineering
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
9
3474
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
10 # Exit on any error.
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
11
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
12 set -e
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
13
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
14 SED=@SED@
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
15
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
16 # get version
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
17 version=`cat VERSION 2> /dev/null`
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
18
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
19 if test -z "$version"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
20 then
3164
45490c020e47 [project @ 1998-04-14 20:56:48 by jwe]
jwe
parents: 3162
diff changeset
21 cat <<EOF
45490c020e47 [project @ 1998-04-14 20:56:48 by jwe]
jwe
parents: 3162
diff changeset
22 install-octave: no version number!
45490c020e47 [project @ 1998-04-14 20:56:48 by jwe]
jwe
parents: 3162
diff changeset
23
45490c020e47 [project @ 1998-04-14 20:56:48 by jwe]
jwe
parents: 3162
diff changeset
24 Are you sure you have a binary distribution of Octave? If you are
45490c020e47 [project @ 1998-04-14 20:56:48 by jwe]
jwe
parents: 3162
diff changeset
25 trying to install Octave from its sources, please read and follow
45490c020e47 [project @ 1998-04-14 20:56:48 by jwe]
jwe
parents: 3162
diff changeset
26 the directions given in the file INSTALL.OCTAVE.
45490c020e47 [project @ 1998-04-14 20:56:48 by jwe]
jwe
parents: 3162
diff changeset
27 EOF
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
28 exit 1
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
29 fi
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
30
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
31 # get host type
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
32 canonical_host_type=`cat ARCH 2> /dev/null`
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
33
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
34 if test -z "$canonical_host_type"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
35 then
3164
45490c020e47 [project @ 1998-04-14 20:56:48 by jwe]
jwe
parents: 3162
diff changeset
36 cat <<EOF
45490c020e47 [project @ 1998-04-14 20:56:48 by jwe]
jwe
parents: 3162
diff changeset
37 install-octave: host archetecture not found!
45490c020e47 [project @ 1998-04-14 20:56:48 by jwe]
jwe
parents: 3162
diff changeset
38
45490c020e47 [project @ 1998-04-14 20:56:48 by jwe]
jwe
parents: 3162
diff changeset
39 Are you sure you have a binary distribution of Octave? If you are
45490c020e47 [project @ 1998-04-14 20:56:48 by jwe]
jwe
parents: 3162
diff changeset
40 trying to install Octave from its sources, please read and follow
45490c020e47 [project @ 1998-04-14 20:56:48 by jwe]
jwe
parents: 3162
diff changeset
41 the directions given in the file INSTALL.OCTAVE.
45490c020e47 [project @ 1998-04-14 20:56:48 by jwe]
jwe
parents: 3162
diff changeset
42 EOF
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
43 exit 1
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
44 fi
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
45
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
46 # Check whether to use -n or \c to keep echo from printing a newline
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
47 # character. Stolen from autoconf, which borrowed the idea from dist 3.0.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
48
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
49 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
50 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
51 if (echo -n testing; echo 1,2,3) | $SED s/-n/xn/ | grep xn >/dev/null; then
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
52 echo_n=
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
53 echo_c='
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
54 '
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
55 else
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
56 echo_n=-n
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
57 echo_c=
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
58 fi
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
59 else
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
60 echo_n=
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
61 echo_c='\c'
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
62 fi
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
63
3892
56db014d8980 [project @ 2002-04-05 04:08:56 by jwe]
jwe
parents: 3845
diff changeset
64 EXEEXT=@EXEEXT@
3206
d0d2b69dc6c2 [project @ 1998-11-03 02:43:31 by jwe]
jwe
parents: 3177
diff changeset
65 SHLEXT=@SHLEXT@
d0d2b69dc6c2 [project @ 1998-11-03 02:43:31 by jwe]
jwe
parents: 3177
diff changeset
66 SHLEXT_VER=$SHLEXT.$version
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
67
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
68 # ==================== Where To Install Things ====================
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
69
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
70 # The default location for installation. Everything is placed in
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
71 # subdirectories of this directory. The default values for many of
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
72 # the variables below are expressed in terms of this one, so you may
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
73 # not need to change them. This defaults to /usr/local.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
74 prefix=@prefix@
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
75
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
76 alt_dir=false
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
77 if test $# -eq 1
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
78 then
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
79 alt_dir=true
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
80 prefix=$1
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
81 else
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
82 if test $# -gt 1
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
83 then
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
84 echo "usage: install-octave [prefix-directory]"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
85 exit 1
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
86 fi
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
87 fi
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
88
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
89 # Like `prefix', but used for architecture-specific files.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
90 exec_prefix="$prefix"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
91
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
92 # Where to install Octave and other binaries that people will want to
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
93 # run directly.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
94 bindir="$exec_prefix/bin"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
95
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
96 # Where to install architecture-independent data files. ${fcnfiledir}
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
97 # and ${localfcnfiledir} are subdirectories of this.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
98 datadir="$prefix/share"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
99
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
100 libdir="$exec_prefix/lib"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
101
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
102 # Where to install and expect libraries like libcruft.a and liboctave.a.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
103 octlibdir="$libdir/octave-$version"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
104
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
105 # Where to install and expect executable programs to be run by Octave
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
106 # rather than directly by users.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
107 libexecdir="$exec_prefix/libexec"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
108
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
109 includedir="$prefix/include"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
110
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
111 # Where to install Octave's include files. The default is
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
112 # ${prefix}/include/octave-$version
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
113 octincludedir=$includedir/octave-$version
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
114
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
115 # Where to install Octave's man pages, and what extension they should
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
116 # have. The default is ${prefix}/man/man1
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
117 mandir="$prefix/man/man1"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
118 manext="1"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
119
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
120 # Where to install and expect the info files describing Octave..
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
121 infodir="$prefix/info"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
122
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
123 # The fill path to the default info file.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
124 infofile="$infodir/octave.info"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
125
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
126 # ==================== Octave-specific directories ====================
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
127
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
128 # These variables hold the values Octave will actually use. They are
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
129 # based on the values of the standard Make variables above.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
130
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
131 # Where to install the function file distributed with
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
132 # Octave. This includes the Octave version, so that the
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
133 # function files for different versions of Octave will install
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
134 # themselves in separate directories.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
135 fcnfiledir="$datadir/octave/$version/m"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
136
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
137 # Directories Octave should search for function files specific
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
138 # to this site (i.e. customizations), before consulting
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
139 # ${fcnfiledir}. This should be a colon-separated list of
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
140 # directories.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
141 localfcnfiledir="$datadir/octave/site/m"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
142 localfcnfilepath="$localfcnfiledir//"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
143
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
144 # Where to put executables to be run by Octave rather than
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
145 # the user. This path usually includes the Octave version
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
146 # and configuration name, so that multiple configurations
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
147 # for multiple versions of Octave may be installed at once.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
148 archlibdir="$libexecdir/octave/$version/exec/$canonical_host_type"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
149
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
150 # Where to put executables to be run by Octave rather than by the
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
151 # user that are specific to this site.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
152 localarchlibdir="$libexecdir/octave/site/exec/$canonical_host_type"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
153
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
154 # Where to put object files that will by dynamically loaded.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
155 # This path usually includes the Octave version and configuration
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
156 # name, so that multiple configurations for multiple versions of
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
157 # Octave may be installed at once.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
158 octfiledir="$libexecdir/octave/$version/oct/$canonical_host_type"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
159
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
160 # Directories Octave should search for object files that will be
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
161 # dynamically loaded and that are specific to this site
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
162 # (i.e. customizations), before consulting ${octfiledir}. This should
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
163 # be a colon-separated list of directories.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
164 localoctfiledir="$libexecdir/octave/site/oct/$canonical_host_type"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
165 localoctfilepath="$localoctfiledir//"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
166
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
167 # Where Octave will search to find its function files. Before
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
168 # changing this, check to see if your purpose wouldn't
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
169 # better be served by changing localfcnfilepath. This
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
170 # should be a colon-separated list of directories.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
171 fcnfilepath=".:$localoctfilepath:$localfcnfilepath:$octfiledir//:$fcnfiledir//"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
172
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
173 # Where Octave will search to find image files.es.
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
174 imagedir="$datadir/octave/$version/imagelib"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
175 imagepath=".:$imagedir//"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
176
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
177 cat << EOF
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
178 Installing octave in the following subdirectories of
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
179 $prefix:
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
180
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
181 bindir: `echo $bindir | $SED "s,^$prefix/,,"`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
182 datadir: `echo $datadir | $SED "s,^$prefix/,,"`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
183 libdir: `echo $libdir | $SED "s,^$prefix/,,"`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
184 octlibdir: `echo $octlibdir | $SED "s,^$prefix/,,"`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
185 includedir: `echo $includedir | $SED "s,^$prefix/,,"`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
186 octincludedir: `echo $octincludedir | $SED "s,^$prefix/,,"`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
187 mandir: `echo $mandir | $SED "s,^$prefix/,,"`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
188 infodir: `echo $infodir | $SED "s,^$prefix/,,"`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
189 fcnfiledir: `echo $fcnfiledir | $SED "s,^$prefix/,,"`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
190 localfcnfiledir: `echo $localfcnfiledir | $SED "s,^$prefix/,,"`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
191 archlibdir: `echo $archlibdir | $SED "s,^$prefix/,,"`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
192 localarchlibdir: `echo $localarchlibdir | $SED "s,^$prefix/,,"`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
193 octfiledir: `echo $octfiledir | $SED "s,^$prefix/,,"`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
194 localoctfiledir: `echo $localoctfiledir | $SED "s,^$prefix/,,"`
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
195 imagedir: `echo $imagedir | $SED "s,^$prefix/,,"`
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
196
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
197 EOF
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
198
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
199 echo $echo_n "Is this correct [y/N]? " $echo_c
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
200
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
201 read ans
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
202
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
203 case "$ans" in
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
204 y | Y | yes | YES)
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
205 ;;
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
206 *)
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
207 exit 1
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
208 ;;
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
209 esac
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
210
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
211 DIRS_TO_MAKE="$bindir $datadir $libdir $octlibdir $libexecdir \
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
212 $includedir $octincludedir $mandir $infodir $fcnfiledir \
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
213 $localfcnfiledir $archlibdir $localarchlibdir \
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
214 $octfiledir $localoctfiledir $imagedir"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
215
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
216 ./mkinstalldirs $DIRS_TO_MAKE
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
217
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
218 echo "installing octave-bug as $bindir/octave-bug"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
219 cp octave-bug $bindir/octave-bug
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
220 chmod 755 $bindir/octave-bug
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
221
3845
d68c34dc9c25 [project @ 2001-07-26 02:11:05 by jwe]
jwe
parents: 3474
diff changeset
222 echo "installing octave-config as $bindir/octave-config"
d68c34dc9c25 [project @ 2001-07-26 02:11:05 by jwe]
jwe
parents: 3474
diff changeset
223 cp octave-config $bindir/octave-config
d68c34dc9c25 [project @ 2001-07-26 02:11:05 by jwe]
jwe
parents: 3474
diff changeset
224 chmod 755 $bindir/octave-config
d68c34dc9c25 [project @ 2001-07-26 02:11:05 by jwe]
jwe
parents: 3474
diff changeset
225
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
226 if test -f LIBRARIES; then
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
227 echo "installing shared libraries in $octlibdir"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
228 for f in `cat LIBRARIES`
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
229 do
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
230 file=`basename $f`
3209
fbb332b96e4f [project @ 1998-11-03 20:48:54 by jwe]
jwe
parents: 3206
diff changeset
231 cp $f.$SHLEXT_VER $octlibdir/$file.$SHLEXT_VER
3206
d0d2b69dc6c2 [project @ 1998-11-03 02:43:31 by jwe]
jwe
parents: 3177
diff changeset
232 chmod 644 $octlibdir/$file.$SHLEXT_VER
d0d2b69dc6c2 [project @ 1998-11-03 02:43:31 by jwe]
jwe
parents: 3177
diff changeset
233 ( cd $octlibdir
d0d2b69dc6c2 [project @ 1998-11-03 02:43:31 by jwe]
jwe
parents: 3177
diff changeset
234 ln -s $file.$SHLEXT_VER $file.$SHLEXT )
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
235 done
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
236 fi
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
237
3176
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3164
diff changeset
238 oct_files=`find . -name '*.oct' -print`
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3164
diff changeset
239 if test -n "$oct_files"; then
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3164
diff changeset
240 echo "installing .oct files in $octfiledir"
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3164
diff changeset
241 for f in $oct_files
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3164
diff changeset
242 do
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3164
diff changeset
243 file=`basename $f`
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3164
diff changeset
244 cp $f $octfiledir/$file
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3164
diff changeset
245 chmod 755 $octfiledir/$file
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3164
diff changeset
246 done
3177
d81db29f8b2b [project @ 1998-05-28 15:23:50 by jwe]
jwe
parents: 3176
diff changeset
247 if test -f src/links-to-make; then
d81db29f8b2b [project @ 1998-05-28 15:23:50 by jwe]
jwe
parents: 3176
diff changeset
248 cat src/links-to-make | while read src dest
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
249 do
3176
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3164
diff changeset
250 if test -n "$src" && test -n "$dest"; then
3206
d0d2b69dc6c2 [project @ 1998-11-03 02:43:31 by jwe]
jwe
parents: 3177
diff changeset
251 ( cd $octfiledir
d0d2b69dc6c2 [project @ 1998-11-03 02:43:31 by jwe]
jwe
parents: 3177
diff changeset
252 ln $src $dest )
3176
fccab8e7d35f [project @ 1998-05-18 20:33:31 by jwe]
jwe
parents: 3164
diff changeset
253 fi
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
254 done
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
255 fi
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
256 fi
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
257
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
258 echo "installing .m files in $fcnfiledir"
3206
d0d2b69dc6c2 [project @ 1998-11-03 02:43:31 by jwe]
jwe
parents: 3177
diff changeset
259 ( cd scripts
d0d2b69dc6c2 [project @ 1998-11-03 02:43:31 by jwe]
jwe
parents: 3177
diff changeset
260 tar cf - . | ( cd $fcnfiledir ; tar xf - )
d0d2b69dc6c2 [project @ 1998-11-03 02:43:31 by jwe]
jwe
parents: 3177
diff changeset
261 find $fcnfiledir -type f -print | xargs chmod 0644
d0d2b69dc6c2 [project @ 1998-11-03 02:43:31 by jwe]
jwe
parents: 3177
diff changeset
262 find $fcnfiledir -name '*.img' -print | xargs rm -f )
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
263
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
264 echo "installing image files in $imagedir"
3206
d0d2b69dc6c2 [project @ 1998-11-03 02:43:31 by jwe]
jwe
parents: 3177
diff changeset
265 ( cd scripts/image
d0d2b69dc6c2 [project @ 1998-11-03 02:43:31 by jwe]
jwe
parents: 3177
diff changeset
266 cp *.img $imagedir
d0d2b69dc6c2 [project @ 1998-11-03 02:43:31 by jwe]
jwe
parents: 3177
diff changeset
267 chmod 644 $imagedir/*.img )
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
268
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
269 echo "creating ls-R file in $datadir/octave"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
270 ls -LR $datadir/octave > $datadir/octave/ls-R
3162
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 3160
diff changeset
271 chmod 644 $datadir/octave/ls-R
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
272
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
273 echo "creating ls-R file in $libexecdir/octave"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
274 ls -LR $libexecdir/octave > $libexecdir/octave/ls-R
3162
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 3160
diff changeset
275 chmod 644 $libexecdir/octave/ls-R
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
276
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
277 echo "installing info files in $infodir"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
278 for f in doc/interpreter/octave.info*
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
279 do
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
280 file=`basename $f`
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
281 cp $f $infodir/$file
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
282 chmod 644 $infodir/$file
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
283 done
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
284
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
285 echo "installing man page in $mandir"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
286 cp doc/interpreter/octave.1 $mandir/octave.$manext
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
287 chmod 644 $mandir/octave.$manext
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
288
3474
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
289 # Do this last, so that it won't be available if some other error
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
290 # happens earlier. Otherwise, people might try to run Octave with
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
291 # an incomplete installation.
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
292
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
293 if test "$prefix" = /usr/local
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
294 then
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
295 echo "installing src/octave as $bindir/octave"
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
296 cp src/octave $bindir/octave
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
297 chmod 755 $bindir/octave
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
298 else
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
299 echo "installing octave-sh as $bindir/octave"
4084
babc519f245b [project @ 2002-10-03 03:23:14 by jwe]
jwe
parents: 3971
diff changeset
300 $SED "s|@OCTAVE_HOME@|$prefix|; s|@LD_LIBRARY_PATH@|$octlibdir|" octave-sh \
3474
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
301 > $bindir/octave
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
302 chmod 755 $bindir/octave
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
303
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
304 echo "installing src/octave as $bindir/octave.bin"
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
305 cp src/octave $bindir/octave.bin
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
306 chmod 755 $bindir/octave.bin
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
307 fi
9c68cfa263eb [project @ 2000-01-25 10:17:55 by jwe]
jwe
parents: 3209
diff changeset
308
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
309 case "$canonical_host_type" in
4105
92f4552ea359 [project @ 2002-10-16 14:55:38 by jwe]
jwe
parents: 4084
diff changeset
310 *-*-cygwin* | *-*-mingw*)
3160
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
311 if $alt_dir; then
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
312 echo "*** You have specified an installation directory different"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
313 echo "*** from the default. For Octave to run properly, you must"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
314 echo "*** set the environment variable OCTAVE_HOME to"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
315 echo "***"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
316 echo "*** $prefix"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
317 echo "***"
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
318 echo "*** before starting Octave."
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
319 fi
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
320 ;;
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
321 esac
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
322
4696773a14b1 [project @ 1998-03-02 06:18:12 by jwe]
jwe
parents:
diff changeset
323 exit 0