annotate install-octave.in @ 3892:56db014d8980

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