annotate kpathsea/klibtool @ 3000:86d3a6fc4c84

[project @ 1997-05-23 03:09:13 by jwe]
author jwe
date Fri, 23 May 1997 03:10:11 +0000
parents
children 1f0b06020e36
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3000
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
1 #!/bin/sh
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
2 # This purports to allow distributions to be built with shared libraries.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
3 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
4 # I wrote it for Kpathsea and friends, but I don't think there's
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
5 # anything TeX-specific in here.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
6 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
7 # There is a much fancier libtool project underway by
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
8 # <gord@enci.ucalgary.ca>, but I did not want to wait for that to be
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
9 # completed, stable, and portable before releasing Web2c. The ideas are
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
10 # based on Gord's Libtool, though, and you may find its documentation
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
11 # interesting/useful reading.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
12 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
13 # Porting this to other systems shouldn't be too hard, mostly because I
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
14 # don't try to take advantage of all the fancy features offered by some
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
15 # os's (like multiple version compatibility, encoding directory paths in
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
16 # the binary, etc.) See the configure mode. I can send you the
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
17 # hello,world Makefile I used for testing if you want it.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
18 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
19 rcs_version='$Id: klibtool,v 1.1 1997-05-23 03:09:13 jwe Exp $'
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
20 version=0.1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
21 maint=tex-k@mail.tug.org
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
22 help="Usage: $0 [OPTION]... MODE [ARG]...
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
23 Help for building and linking with shared libraries.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
24
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
25 Modes: Environment variables used:
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
26 configure [HOSTTYPE] RANLIB, LIBTOOL_OBJTYPES
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
27 compile CC SOURCEFILE ARG...
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
28 archive AR ARFLAGS LIBNAME ARG...
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
29 link CC ARG...
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
30 install-lib DIR LIBNAME... INSTALL_DATA
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
31 install-prog DIR PROGNAME... INSTALL_PROGRAM
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
32 version
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
33
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
34 Options:
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
35 --config-dir DIR
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
36 -n, --dry-run
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
37 --help
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
38 --quiet, --silent
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
39 -v, --verbose
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
40 --version
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
41
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
42 Email bugs to $maint.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
43 "
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
44
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
45 bug_report="$0: Please report this bug to $maint.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
46 Please mention this is Klibtool version $version ($rcs_version),
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
47 and your hardware/operating system (`uname -a`, at least).
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
48
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
49 Running this same command ($0 $*) with --verbose and including the
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
50 resulting output would be nice, but is not required."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
51
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
52 verbose=:
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
53 chicken=
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
54 show=echo
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
55 config_dir=
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
56
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
57 # Yes, this option parsing is imperfect, e.g., -xcruddy will be
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
58 # recognized as --config-dir. I don't think it's worth the trouble to
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
59 # program correctly until somebody besides me uses this.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
60 while test $# -gt 0; do
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
61 case "$1" in
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
62 configure|compile|archive|link|install-lib|install-prog|version)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
63 mode=$1; break;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
64 -*c*) # --config-dir
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
65 shift; config_dir=$1;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
66 -n|-*d*) # -n, --dry-run
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
67 chicken=echo;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
68 -*help) # --help
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
69 echo "$help"; exit 0;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
70 -*q|-*s) # --quiet, --silent
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
71 show=:; verbose=:;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
72 -v|-*verb*) # --verbose
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
73 verbose=echo;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
74 -*version) # --version
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
75 echo "$0 version $version ($rcs_version)"; exit 0;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
76 -*)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
77 echo "$0: Unknown option \`$1'. Try --help for info." >&2; exit 1;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
78 *)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
79 echo "$0: Unknown mode \`$1'. Try --help for info." >&2; exit 1;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
80 esac
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
81 shift
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
82 done
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
83
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
84 # Read all the arguments. Peel off the mode.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
85 shift
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
86
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
87 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
88 # Read the configuration file unless we're configuring.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
89 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
90 if test $mode != configure; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
91 # Read configuration file. If we have it in the current directory, or
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
92 # the user told us where it is, great. More likely, though, it's only
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
93 # in the directory with the library that we're eventually going to
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
94 # link with. We have no way of knowing what that is, so let's use the
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
95 # location of this script itself as the default.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
96 if test -z "$config_dir"; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
97 if test -r ./klibtool.config; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
98 config_dir=.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
99 else
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
100 dir=`echo $0 | sed 's,/[^/]*$,,'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
101 test -r $dir/klibtool.config && config_dir=$dir
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
102 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
103 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
104 if test -z "$config_dir"; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
105 echo "$0: Cannot find klibtool.config in . or $dir," >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
106 echo "$0: and no --config-dir option specified." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
107 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
108 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
109 # Read the file.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
110 . $config_dir/klibtool.config
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
111
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
112 if test -z "$LIBTOOL_OBJTYPES"; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
113 echo "$0: Impossibly empty LIBTOOL_OBJTYPES!" >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
114 echo "$bug_report" >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
115 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
116 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
117 # Copy the valid object type names from LIBTOOL_OBJTYPES into objtypes.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
118 $verbose "$0: checking LIBTOOL_OBJTYPES = $LIBTOOL_OBJTYPES."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
119 objtypes=
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
120 for ot in `echo $LIBTOOL_OBJTYPES | tr : " "`; do
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
121 case $ot in
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
122 SHARED)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
123 if $shared_support; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
124 objtypes=$objtypes:$ot
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
125 else
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
126 echo "$0: Shared libraries not supported on this system." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
127 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
128 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
129 STATIC)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
130 objtypes=$objtypes:$ot;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
131 "") true;; # don't worry about empty object types.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
132 *)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
133 echo "$0: Ignoring unknown libtool object type $objtype." >&2;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
134 esac
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
135 done
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
136 # Remove the extra trailing colon from our list-building.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
137 objtypes=`echo $objtypes | sed 's/^://'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
138 if test -z $objtypes; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
139 # If they just took the default, we started with STATIC and so
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
140 # wouldn't be here.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
141 echo "$0: No valid object types in $LIBTOOL_OBJTYPES, quitting." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
142 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
143 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
144 $verbose "$0: final objtypes = $objtypes."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
145 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
146
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
147
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
148 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
149 # Do the deed.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
150 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
151 # I wish we had subroutines so we could make this readable, but shell
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
152 # functions aren't portable enough, even nowadays.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
153 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
154 $verbose "$0: mode = $mode."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
155 case $mode in
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
156
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
157
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
158 # configure mode: [HOSTTYPE]
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
159 configure)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
160 # If no config dir specified, use the script location.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
161 if test -z "$config_dir"; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
162 if echo $0 | grep / >/dev/null; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
163 config_dir=`echo $0 | sed 's,/[^/]*$,,'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
164 else
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
165 config_dir=. # $0 is just the script name, no directory part.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
166 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
167 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
168 config_file=$config_dir/klibtool.config
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
169 $verbose "$0: writing to config_file = $config_file."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
170
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
171 # If no specified HOSTTYPE, guess it.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
172 if test $# -eq 0; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
173 config_guess=$config_dir/config.guess
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
174 if test ! -r $config_guess; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
175 echo "$0: config.guess not in $config_dir." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
176 echo "$0: Either specify a host type or get the scripts." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
177 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
178 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
179 host_alias=`$config_guess`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
180 else
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
181 test $# -eq 1 \
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
182 || echo "$0: Using $1 as host alias, ignoring other arguments ($*)." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
183 host_alias=$1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
184 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
185
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
186 # Convert the original host type to canonical form.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
187 config_sub=$config_dir/config.sub
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
188 if test ! -r $config_sub; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
189 echo "$0: config.sub missing from $config_dir; it's required." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
190 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
191 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
192 host_type=`$config_sub $host_alias`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
193 if test -z "$host_type"; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
194 echo "$0: $host_alias not a recognizable host type." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
195 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
196 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
197
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
198 # Finally, we'll be creating something.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
199 rm -f $config_file
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
200
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
201 # Define defaults, to be overridden in the system-specific cases.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
202 config_vars="LIBTOOL_OBJTYPES shared_support shared_ext libpath_var CC
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
203 args_STATIC_compile args_SHARED_compile
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
204 args_STATIC_archive STATIC_ranlib args_SHARED_archive
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
205 args_SHARED_link
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
206 SHARED_postinstall"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
207 for v in $config_vars; do
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
208 # Preserve existing value of a couple variables.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
209 case $v in
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
210 LIBTOOL_OBJTYPES|CC) true;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
211 *) eval $v=;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
212 esac
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
213 done
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
214 test -z "$LIBTOOL_OBJTYPES" && LIBTOOL_OBJTYPES=STATIC
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
215 shared_ext=so
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
216 libpath_var=LD_LIBRARY_PATH
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
217 STATIC_ranlib=$RANLIB
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
218
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
219 # The compiler. If the user set CC, take that, else use gcc if we
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
220 # can find it, else use cc. Up to the user to avoid /usr/ucb/cc.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
221 if test -z "$CC"; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
222 for dir in `echo $PATH | tr : ' '`; do
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
223 test -z "$dir" && dir=.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
224 if test -f $dir/gcc; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
225 CC=gcc
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
226 break
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
227 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
228 done
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
229 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
230 test -z "$CC" && CC=cc
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
231 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
232 # But the real question is not the name of the command, it's whether
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
233 # it is GNU C. We only distinguish gcc and system cc. We have to
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
234 # assume that they use the same compiler at `klibtool compile' time
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
235 # as we determine here; the whole point is that we don't want to do
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
236 # this check before compiling every file (for speed).
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
237 rm -f conftest.c
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
238 (
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
239 echo "#ifdef __GNUC__"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
240 echo "yes;"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
241 echo "#endif"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
242 ) >conftest.c
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
243 if eval "$CC -E conftest.c" | grep yes >/dev/null 2>&1; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
244 compiler=gcc
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
245 args_SHARED_compile=-fPIC # should we have an option for -fpic?
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
246 args_SHARED_archive=-shared
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
247 else
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
248 compiler=cc
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
249 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
250 rm -f conftest.c
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
251
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
252 # Override defaults for this system.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
253 case $host_type in
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
254 *-*-linux*)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
255 shared_support=true
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
256 SHARED_postinstall='ldconfig $libdir'
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
257 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
258
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
259 *-*-solaris2*)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
260 shared_support=true
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
261 if test $compiler = cc; then # /opt/SUNWspro/cc, that is.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
262 args_SHARED_compile=-KPIC
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
263 args_SHARED_archive="-G -z text" # Perhaps should have -h.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
264 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
265 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
266
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
267 *-*-sunos4*)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
268 shared_support=true
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
269 STATIC_ranlib=ranlib
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
270 SHARED_postinstall='ldconfig $libdir'
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
271 if test $compiler = cc; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
272 args_SHARED_compile=-PIC
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
273 prog_SHARED_archive=ld
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
274 args_SHARED_archive="-assert pure-text" # gord has -Bstatic?
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
275 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
276 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
277
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
278 *)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
279 echo "$0: $host_type not explicitly supported, using defaults." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
280 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
281 esac
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
282
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
283 # Output values.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
284 for v in $config_vars; do
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
285 config_line=$v=\'`eval echo '$'$v`\'
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
286 $verbose "$0: writing config line $config_line."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
287 echo $config_line >>$config_file
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
288 done
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
289 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
290
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
291
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
292 # compile mode: CC SOURCEFILE [ARG]...
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
293 compile)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
294 compiler=$1; shift # must assume it's what configure found
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
295 sourcefile=$1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
296 objname=`basename $sourcefile | sed 's/\.[^./]*$//'`.o
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
297 $verbose "$0: object basename for source file $sourcefile = $objname."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
298 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
299 for ot in `echo $objtypes | tr : " "`; do
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
300 # Snarf arguments for this object type.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
301 ot_args=`eval echo '$'args_${ot}_${mode}`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
302 $verbose "$0: args_${ot}_${mode} = $ot_args."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
303
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
304 # Have to output into a subdirectory of current directory (not
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
305 # source directory, which might be read-only).
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
306 output_arg="-o $ot/$objname"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
307 if test ! -d $ot; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
308 $show mkdir $ot
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
309 $chicken mkdir $ot
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
310 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
311
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
312 # Construct and run the cmd.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
313 cmd="$compiler ""$@"" $ot_args $output_arg"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
314 $show $cmd
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
315 $chicken $cmd
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
316 status=$?
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
317 test $status -eq 0 || break
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
318 done # end of objtypes loop for compile mode
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
319 test $status -eq 0 && date >./"`echo $objname | sed 's/o$/lo/'`"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
320 exit $status
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
321 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
322
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
323
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
324 # archive mode
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
325 archive)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
326 cmdname=$1; shift # the archiver
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
327 for ot in `echo $objtypes | tr : " "`; do
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
328 libname=
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
329 args=
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
330 if test $ot = SHARED; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
331 # Can't generally use ar to make a shared library.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
332 old_ar="$cmdname $1"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
333 shift
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
334 ot_args=`eval echo '$'args_SHARED_archive`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
335 ot_prog=`eval echo '$'prog_SHARED_archive`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
336 test -z "$ot_prog" && ot_prog=$CC
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
337 cmdname="$ot_prog $ot_args -o"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
338 $verbose "$0: replaced $old_ar with $cmdname."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
339 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
340
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
341 # Now transform remaining arguments (presumably filenames).
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
342 for arg in "$@"; do
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
343 case "$arg" in
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
344 *.l[ao]) # Remove the `l' from a .la or .lo filename.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
345 newarg=`echo $arg | sed 's/l\(.\)$/\1/'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
346 $verbose "$0: transformed arg $arg to $newarg."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
347 # First .la file is the output library.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
348 if test -z "$libname" && echo $newarg | grep '\.a$'>/dev/null; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
349 if test $ot = SHARED; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
350 $verbose "$0: running $0 version $newarg."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
351 verstring=`$0 version $newarg`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
352 $verbose "$0: got version $verstring."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
353 libname=`echo $newarg | sed 's/\.a$/\.'$shared_ext$verstring/`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
354 else
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
355 libname=$newarg
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
356 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
357 if echo $libname | grep / >/dev/null; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
358 lib_dir=`echo $libname | sed 's,/[^/]*$,,'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
359 else
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
360 lib_dir=.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
361 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
362 lib_basename=`basename $libname`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
363 lib_base=`echo $lib_basename | sed 's/[.0-9]*$//'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
364
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
365 # We might have to run a command after making the library.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
366 post=
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
367 if test $ot = SHARED; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
368 # If it supports shared libraries, it supports symlinks.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
369 # Although this is unnecessary on (e.g.) SunOS, it
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
370 # doesn't hurt, and it is necessary on (e.g.) Solaris.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
371 post="&& ln -s $lib_basename $lib_base"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
372 elif test $ot = STATIC; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
373 ranlib=`eval echo '$'${ot}_ranlib`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
374 $verbose "${ot}_ranlib = $ranlib."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
375 test -n "$ranlib" && post="&& $ranlib $lib_basename"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
376 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
377
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
378 $verbose "$0: output library dir = $lib_dir."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
379 $verbose "$0: output library basename = $lib_basename."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
380 $verbose "$0: output library base = $lib_base."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
381 newarg=$lib_basename
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
382 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
383 arg=$newarg
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
384 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
385 esac
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
386 args="$args $arg"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
387 done
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
388 if test -z "$libname"; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
389 # FIXME: should check that the .la file was second arg.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
390 echo "$0 archive: .la (libtool archive) argument missing." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
391 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
392 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
393
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
394 # Remove old archive file because we recommend `ar q', not `r',
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
395 # and the user can't necessarily know the library name.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
396 cmd="cd $lib_dir/$ot && rm -f $lib_base* && $cmdname $args $post"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
397 $show $cmd
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
398 $chicken eval "($cmd)"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
399 status=$?
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
400 test $status -eq 0 || break
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
401
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
402 # If making both objtypes, need original arguments next time through.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
403 if test $ot = SHARED; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
404 cmdname=$old_ar
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
405 else
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
406 true # Don't think we failed to make the library just because
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
407 # the last objtype was not SHARED.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
408 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
409 done # end of objtypes loop for archive mode
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
410 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
411 # Create the .la file we claimed that we would.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
412 test $status -eq 0 && date >./"`echo $libname | sed 's/\.[^/]*$/.la/'`"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
413 exit $status
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
414 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
415
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
416
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
417 # link mode
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
418 link)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
419 cmdname=$1; shift # the linker
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
420 # Do links using the first object type.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
421 linktype=`echo $objtypes | sed 's/:.*//'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
422 $verbose "$0: linktype = $linktype."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
423 if test -z "$linktype"; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
424 echo "$0: Impossibly empty linktype?!" >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
425 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
426 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
427 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
428 # Need to know the output name if we generate the wrapper.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
429 looking_for_output=false
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
430 real_output_name=
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
431 libpath=
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
432 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
433 for arg in "$@"; do
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
434 if $looking_for_output; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
435 real_output_name=$arg
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
436 arg=$real_output_name.exe
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
437 looking_for_output=false
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
438 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
439 case "$arg" in
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
440 -o)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
441 test $linktype = SHARED && looking_for_output=true
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
442 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
443 *.l[ao]) # Find .la files in the linktype subdir
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
444 # of the given directory, e.g., if the user says
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
445 # ../foo/libfoo.la, transform into
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
446 # ../foo/$linktype/libfoo.{a,so...}. We do the same for
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
447 # libtool archive, although it's not as often necessary.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
448 newarg=`echo $arg | sed -e 's,\([^/]*\)$,'$linktype'/\1,' \
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
449 -e 's/l\(.\)$/\1/'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
450 if test $linktype = SHARED \
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
451 && echo $newarg | grep '\.a$' >/dev/null; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
452 # If shared, transform dir/foo.la into -Ldir -lfoo.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
453 dir=`echo $newarg | sed 's,/[^/]*$,,'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
454 lib=`echo $newarg | sed -e 's,.*/\([^/]*\),\1,' \
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
455 -e 's/^lib//' -e 's/\.a$//'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
456 newarg="-L$dir -l$lib"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
457 # Remember we will need this directory in LD_LIBRARY_PATH.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
458 if echo $dir | grep -v '^/' >/dev/null; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
459 dir=`pwd`/$dir
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
460 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
461 # Maybe had previous directories.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
462 test -n "$libpath" && libpath=$libpath:
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
463 libpath=$libpath$dir
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
464 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
465 $verbose "$0: transformed .la arg $arg to $newarg."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
466 arg=$newarg
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
467 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
468 *.lo) # .lo files have no directory stripping or suffix changing.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
469 newarg=`echo $arg | sed -e 's,\([^/]*\)$,'$linktype'/\1,' \
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
470 -e 's/l\(.\)$/\1/'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
471 $verbose "$0: transformed .lo arg $arg to $newarg."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
472 arg=$newarg
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
473 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
474 esac
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
475 args="$args $arg"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
476 done
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
477
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
478 # Set up to generate wrapper shell script if shared.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
479 if test $linktype = SHARED; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
480 if $looking_for_output; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
481 echo "$0 link: -o requires an argument." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
482 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
483 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
484 if test -z "$real_output_name"; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
485 # If they didn't give -o at all, default to a.out.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
486 real_output_name=a.out
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
487 args="$args -o $real_output_name.exe"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
488 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
489 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
490
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
491 # Do the link.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
492 cmd="$cmdname $args"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
493 $show $cmd
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
494 $chicken $cmd
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
495
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
496 status=$?
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
497 if test $status -eq 0 && test -n "$real_output_name"; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
498 $verbose "$0: creating wrapper $real_output_name."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
499 # We created the binary, so create the wrapper script.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
500 # Use as short a temporary suffix as we can to minimize the chance
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
501 # of collisions on deficient systems.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
502 rm -f ${real_output_name} ${real_output_name}T
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
503 (
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
504 libpath_var_val='$'$libpath_var
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
505 echo "#! /bin/sh"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
506 echo "# Generated `date` by $0."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
507 echo "# Do not install this wrapper script."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
508 echo "# It's only here to enable running $real_output_name"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
509 echo "# before it's installed. (Use $0 install-progs to install it.)"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
510 echo
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
511 echo "if test -z \"$libpath_var_val\"; then"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
512 echo " $libpath_var=\"$libpath\""
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
513 echo "else"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
514 echo " $libpath_var=\"$libpath:$libpath_var_val\""
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
515 echo "fi"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
516 echo "export $libpath_var"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
517 echo
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
518 echo "thisdir=\`echo $""0 | sed 's%/[^/]*$%%'\`"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
519 echo 'test "x$thisdir" = "x$0" && thisdir=.'
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
520 echo
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
521 echo "exec \$thisdir/$real_output_name.exe \"\$@\""
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
522 ) >${real_output_name}T
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
523 chmod +x ${real_output_name}T
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
524 mv ${real_output_name}T ${real_output_name}
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
525 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
526 exit $status
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
527 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
528
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
529
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
530 # install-lib mode: DIR LIBNAME...
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
531 install-lib)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
532 if test $# -lt 2; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
533 echo "$0 install-lib: Need directory and at least one library." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
534 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
535 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
536 libdir=$1; shift
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
537 if test ! -d $libdir; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
538 echo "$0 install-lib: $1 not a directory." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
539 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
540 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
541 for arg in "$@"; do # for each library...
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
542 # Always having a directory part simplifies the code below.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
543 echo $arg | grep / >/dev/null || arg="./$arg"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
544 for ot in `echo $objtypes | tr : " "`; do # for each object type...
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
545 case $ot in
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
546 SHARED) # needs shared extension and version number.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
547 verstring=`$0 version $arg`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
548 libname=`echo $arg | sed 's/\.la$/\.'$shared_ext$verstring/`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
549 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
550 STATIC) # just get rid of the `l'.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
551 libname=`echo $arg | sed 's/l\(.\)$/\1/'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
552 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
553 *)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
554 echo "$0: Impossible object type $ot!" >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
555 echo "$bug_report" >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
556 exit 1;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
557 esac
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
558 # Have to insert the object type directory.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
559 libname=`echo $libname | sed 's,\(/[^/]*\)$,/'$ot'\1,'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
560 lib_basename=`basename $libname`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
561 $verbose "$0: library name = $libname."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
562 $verbose "$0: installation name = $libdir/$lib_basename."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
563 cmd="${INSTALL_DATA-cp} $libname $libdir/$lib_basename"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
564 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
565 if test $ot = SHARED; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
566 # Link libfoo.so to libfoo.so.1.2.3.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
567 lib_base=`echo $lib_basename | sed 's/[.0-9]*$//'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
568 $verbose "$0: linking $libdir/$lib_base to $lib_basename"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
569 (cd $libdir && ln -s $lib_basename $lib_base)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
570 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
571 #
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
572 # Run ldconfig, etc.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
573 postinstall=`eval echo '$'${ot}_postinstall`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
574 test -n "$postinstall" && cmd="$cmd && $postinstall"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
575 $show $cmd
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
576 $chicken eval "$cmd"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
577 done
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
578 done
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
579 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
580
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
581
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
582 # install-prog mode: DIR PROGNAME...
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
583 install-prog)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
584 if test $# -lt 2; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
585 echo "$0 install-prog: Need directory and at least one program." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
586 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
587 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
588 dir=$1; shift
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
589 if test ! -d $dir; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
590 echo "$0 install-prog: $1 not a directory." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
591 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
592 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
593 # The program got linked using the first object type, so
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
594 # installation of the program will proceed accordingly.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
595 linktype=`echo $objtypes | sed 's/:.*//'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
596 $verbose "$0: linktype = $linktype."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
597 if test -z "$linktype"; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
598 echo "$0: Impossibly empty linktype?!" >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
599 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
600 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
601 if test $linktype = SHARED; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
602 # Install the binary, not the wrapper script.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
603 suffix=.exe
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
604 else
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
605 suffix=
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
606 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
607 for arg in "$@"; do # for each program...
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
608 # FIXME: On SunOS, AIX, and HP-UX, relink to avoid hardwired libdirs.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
609 cmd="${INSTALL_PROGRAM-cp} $arg$suffix $dir/$arg"
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
610 $show $cmd
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
611 $chicken $cmd
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
612 done
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
613 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
614
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
615
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
616 # version mode
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
617 version)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
618 if test $# -ne 1; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
619 echo "$0 version: Exactly one argument needed, not $# ($*)." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
620 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
621 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
622 # Strip directory name, `lib' prefix, and any .suffix.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
623 dir=`echo $1 | sed 's,/[^/]*$,,'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
624 test "x$dir" = "x$1" && dir=.
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
625 libname=`basename $1 | sed -e 's,^lib,,' -e s',\..*$,,'`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
626 verfile=$dir/klibtool.version
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
627 if test ! -r $verfile; then
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
628 echo "$0 version: No file $verfile for $libname version info." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
629 echo "$0 version: Original argument was $1." >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
630 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
631 fi
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
632 $verbose "$0: dir = $dir, libname = $libname."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
633 version=`awk '$1 == "'$libname'" { print "." $2 "." $3 "." $4 }' $verfile`
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
634 $verbose "$0: version for $libname = $version."
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
635 echo $version
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
636 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
637
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
638
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
639 # unknown mode
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
640 *)
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
641 echo "$0: Impossible mode \`$mode'!" >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
642 echo "$bug_report" >&2
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
643 exit 1
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
644 ;;
86d3a6fc4c84 [project @ 1997-05-23 03:09:13 by jwe]
jwe
parents:
diff changeset
645 esac