annotate libtool @ 83:2b5ba7f33840

Stopped using SDL_OutOfMemory().
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 25 Sep 2001 21:25:14 +0000
parents cee26d04d0ca
children
rev   line source
65
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1 #! /bin/sh
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3 # libtool - Provide generalized library-building support services.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4 # Generated automatically by ltconfig (GNU libtool 1.3.5 (1.385.2.206 2000/05/27 11:12:27))
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
5 # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
6 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
7 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
8 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
9 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
10 # This program is free software; you can redistribute it and/or modify
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
11 # it under the terms of the GNU General Public License as published by
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
12 # the Free Software Foundation; either version 2 of the License, or
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
13 # (at your option) any later version.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
14 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
15 # This program is distributed in the hope that it will be useful, but
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
18 # General Public License for more details.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
19 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
20 # You should have received a copy of the GNU General Public License
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
21 # along with this program; if not, write to the Free Software
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
22 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
23 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
24 # As a special exception to the GNU General Public License, if you
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
25 # distribute this file as part of a program that contains a
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
26 # configuration script generated by Autoconf, you may include it under
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
27 # the same distribution terms that you use for the rest of that program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
28
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
29 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
30 Xsed="sed -e s/^X//"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
31
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
32 # The HP-UX ksh and POSIX shell print the target directory to stdout
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
33 # if CDPATH is set.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
34 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
35
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
36 ### BEGIN LIBTOOL CONFIG
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
37 # Libtool was configured as follows, on host gemini:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
38 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
39 # CC="gcc" CFLAGS="-g -O2" CPPFLAGS="" \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
40 # LD="/usr/local/i686-pc-linux-gnu/bin/ld" LDFLAGS="" LIBS="" \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
41 # NM="/usr/local/bin/nm -B" RANLIB="ranlib" LN_S="ln -s" \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
42 # DLLTOOL="" OBJDUMP="" AS="" \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
43 # ./ltconfig --cache-file=./config.cache --with-gcc --with-gnu-ld --no-verify ./ltmain.sh i686-pc-linux-gnu
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
44 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
45 # Compiler and other test output produced by ltconfig, useful for
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
46 # debugging ltconfig, is in ./config.log if it exists.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
47
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
48 # The version of ltconfig that generated this script.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
49 LTCONFIG_VERSION="1.3.5"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
50
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
51 # Shell to use when invoking shell scripts.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
52 SHELL="/bin/sh"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
53
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
54 # Whether or not to build shared libraries.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
55 build_libtool_libs=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
56
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
57 # Whether or not to build static libraries.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
58 build_old_libs=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
59
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
60 # Whether or not to optimize for fast installation.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
61 fast_install=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
62
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
63 # The host system.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
64 host_alias=i686-pc-linux-gnu
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
65 host=i686-pc-linux-gnu
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
66
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
67 # An echo program that does not interpret backslashes.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
68 echo="echo"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
69
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
70 # The archiver.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
71 AR="ar"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
72
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
73 # The default C compiler.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
74 CC="gcc"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
75
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
76 # The linker used to build libraries.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
77 LD="/usr/local/i686-pc-linux-gnu/bin/ld"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
78
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
79 # Whether we need hard or soft links.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
80 LN_S="ln -s"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
81
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
82 # A BSD-compatible nm program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
83 NM="/usr/local/bin/nm -B"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
84
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
85 # Used on cygwin: DLL creation program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
86 DLLTOOL="dlltool"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
87
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
88 # Used on cygwin: object dumper.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
89 OBJDUMP="objdump"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
90
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
91 # Used on cygwin: assembler.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
92 AS="as"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
93
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
94 # The name of the directory that contains temporary libtool files.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
95 objdir=.libs
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
96
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
97 # How to create reloadable object files.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
98 reload_flag=" -r"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
99 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
100
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
101 # How to pass a linker flag through the compiler.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
102 wl="-Wl,"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
103
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
104 # Object file suffix (normally "o").
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
105 objext="o"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
106
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
107 # Old archive suffix (normally "a").
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
108 libext="a"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
109
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
110 # Executable file suffix (normally "").
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
111 exeext=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
112
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
113 # Additional compiler flags for building library objects.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
114 pic_flag=" -fPIC"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
115
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
116 # Does compiler simultaneously support -c and -o options?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
117 compiler_c_o="yes"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
118
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
119 # Can we write directly to a .lo ?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
120 compiler_o_lo="yes"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
121
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
122 # Must we lock files when doing compilation ?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
123 need_locks="no"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
124
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
125 # Do we need the lib prefix for modules?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
126 need_lib_prefix=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
127
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
128 # Do we need a version for libraries?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
129 need_version=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
130
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
131 # Whether dlopen is supported.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
132 dlopen=unknown
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
133
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
134 # Whether dlopen of programs is supported.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
135 dlopen_self=unknown
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
136
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
137 # Whether dlopen of statically linked programs is supported.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
138 dlopen_self_static=unknown
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
139
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
140 # Compiler flag to prevent dynamic linking.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
141 link_static_flag="-static"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
142
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
143 # Compiler flag to turn off builtin functions.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
144 no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
145
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
146 # Compiler flag to allow reflexive dlopens.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
147 export_dynamic_flag_spec="\${wl}--export-dynamic"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
148
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
149 # Compiler flag to generate shared objects directly from archives.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
150 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
151
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
152 # Compiler flag to generate thread-safe objects.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
153 thread_safe_flag_spec=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
154
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
155 # Library versioning type.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
156 version_type=linux
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
157
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
158 # Format of library name prefix.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
159 libname_spec="lib\$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
160
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
161 # List of archive names. First name is the real one, the rest are links.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
162 # The last name is the one that the linker finds with -lNAME.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
163 library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
164
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
165 # The coded name of the library, if different from the real name.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
166 soname_spec="\${libname}\${release}.so\$major"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
167
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
168 # Commands used to build and install an old-style archive.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
169 RANLIB="ranlib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
170 old_archive_cmds="\$AR cru \$oldlib\$oldobjs~\$RANLIB \$oldlib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
171 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
172 old_postuninstall_cmds=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
173
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
174 # Create an old-style archive from a shared archive.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
175 old_archive_from_new_cmds=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
176
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
177 # Commands used to build and install a shared archive.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
178 archive_cmds="\$CC -shared \$libobjs \$deplibs \$linkopts \${wl}-soname \$wl\$soname -o \$lib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
179 archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$linkopts \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
180 postinstall_cmds=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
181 postuninstall_cmds=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
182
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
183 # Method to check whether dependent libraries are shared objects.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
184 deplibs_check_method="pass_all"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
185
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
186 # Command to use when deplibs_check_method == file_magic.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
187 file_magic_cmd=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
188
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
189 # Flag that allows shared libraries with undefined symbols to be built.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
190 allow_undefined_flag=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
191
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
192 # Flag that forces no undefined symbols.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
193 no_undefined_flag=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
194
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
195 # Commands used to finish a libtool library installation in a directory.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
196 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
197
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
198 # Same as above, but a single script fragment to be evaled but not shown.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
199 finish_eval=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
200
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
201 # Take the output of nm and produce a listing of raw symbols and C names.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
202 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW]\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
203
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
204 # Transform the output of nm in a proper C declaration
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
205 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
206
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
207 # This is the shared library runtime path variable.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
208 runpath_var=LD_RUN_PATH
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
209
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
210 # This is the shared library path variable.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
211 shlibpath_var=LD_LIBRARY_PATH
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
212
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
213 # Is shlibpath searched before the hard-coded library search path?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
214 shlibpath_overrides_runpath=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
215
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
216 # How to hardcode a shared library path into an executable.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
217 hardcode_action=immediate
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
218
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
219 # Flag to hardcode $libdir into a binary during linking.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
220 # This must work even if $libdir does not exist.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
221 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
222
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
223 # Whether we need a single -rpath flag with a separated argument.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
224 hardcode_libdir_separator=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
225
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
226 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
227 # resulting binary.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
228 hardcode_direct=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
229
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
230 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
231 # resulting binary.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
232 hardcode_minus_L=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
233
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
234 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
235 # the resulting binary.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
236 hardcode_shlibpath_var=unsupported
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
237
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
238 # Compile-time system search path for libraries
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
239 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
240
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
241 # Run-time system search path for libraries
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
242 sys_lib_dlsearch_path_spec="/lib /usr/lib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
243
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
244 # Fix the shell variable $srcfile for the compiler.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
245 fix_srcfile_path=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
246
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
247 # Set to yes if exported symbols are required.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
248 always_export_symbols=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
249
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
250 # The commands to list exported symbols.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
251 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
252
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
253 # Symbols that should not be listed in the preloaded symbols.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
254 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
255
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
256 # Symbols that must always be exported.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
257 include_expsyms=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
258
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
259 ### END LIBTOOL CONFIG
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
260
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
261 # ltmain.sh - Provide generalized library-building support services.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
262 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
263 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
264 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
265 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
266 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
267 # This program is free software; you can redistribute it and/or modify
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
268 # it under the terms of the GNU General Public License as published by
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
269 # the Free Software Foundation; either version 2 of the License, or
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
270 # (at your option) any later version.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
271 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
272 # This program is distributed in the hope that it will be useful, but
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
273 # WITHOUT ANY WARRANTY; without even the implied warranty of
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
274 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
275 # General Public License for more details.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
276 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
277 # You should have received a copy of the GNU General Public License
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
278 # along with this program; if not, write to the Free Software
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
279 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
280 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
281 # As a special exception to the GNU General Public License, if you
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
282 # distribute this file as part of a program that contains a
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
283 # configuration script generated by Autoconf, you may include it under
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
284 # the same distribution terms that you use for the rest of that program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
285
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
286 # Check that we have a working $echo.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
287 if test "X$1" = X--no-reexec; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
288 # Discard the --no-reexec flag, and continue.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
289 shift
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
290 elif test "X$1" = X--fallback-echo; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
291 # Avoid inline document here, it may be left over
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
292 :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
293 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
294 # Yippee, $echo works!
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
295 :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
296 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
297 # Restart under the correct shell, and then maybe $echo will work.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
298 exec $SHELL "$0" --no-reexec ${1+"$@"}
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
299 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
300
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
301 if test "X$1" = X--fallback-echo; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
302 # used as fallback echo
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
303 shift
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
304 cat <<EOF
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
305 $*
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
306 EOF
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
307 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
308 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
309
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
310 # The name of this program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
311 progname=`$echo "$0" | sed 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
312 modename="$progname"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
313
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
314 # Constants.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
315 PROGRAM=ltmain.sh
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
316 PACKAGE=libtool
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
317 VERSION=1.3.5
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
318 TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
319
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
320 default_mode=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
321 help="Try \`$progname --help' for more information."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
322 magic="%%%MAGIC variable%%%"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
323 mkdir="mkdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
324 mv="mv -f"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
325 rm="rm -f"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
326
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
327 # Sed substitution that helps us do robust quoting. It backslashifies
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
328 # metacharacters that are still active within double-quoted strings.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
329 Xsed='sed -e 1s/^X//'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
330 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
331 SP2NL='tr \040 \012'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
332 NL2SP='tr \015\012 \040\040'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
333
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
334 # NLS nuisances.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
335 # Only set LANG and LC_ALL to C if already set.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
336 # These must not be set unconditionally because not all systems understand
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
337 # e.g. LANG=C (notably SCO).
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
338 # We save the old values to restore during execute mode.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
339 if test "${LC_ALL+set}" = set; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
340 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
341 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
342 if test "${LANG+set}" = set; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
343 save_LANG="$LANG"; LANG=C; export LANG
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
344 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
345
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
346 if test "$LTCONFIG_VERSION" != "$VERSION"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
347 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
348 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
349 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
350 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
351
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
352 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
353 echo "$modename: not configured to build any kind of library" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
354 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
355 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
356 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
357
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
358 # Global variables.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
359 mode=$default_mode
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
360 nonopt=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
361 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
362 prevopt=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
363 run=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
364 show="$echo"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
365 show_help=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
366 execute_dlfiles=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
367 lo2o="s/\\.lo\$/.${objext}/"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
368 o2lo="s/\\.${objext}\$/.lo/"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
369
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
370 # Parse our command line options once, thoroughly.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
371 while test $# -gt 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
372 do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
373 arg="$1"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
374 shift
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
375
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
376 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
377 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
378 *) optarg= ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
379 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
380
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
381 # If the previous option needs an argument, assign it.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
382 if test -n "$prev"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
383 case "$prev" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
384 execute_dlfiles)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
385 eval "$prev=\"\$$prev \$arg\""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
386 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
387 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
388 eval "$prev=\$arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
389 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
390 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
391
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
392 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
393 prevopt=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
394 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
395 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
396
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
397 # Have we seen a non-optional argument yet?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
398 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
399 --help)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
400 show_help=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
401 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
402
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
403 --version)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
404 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
405 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
406 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
407
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
408 --config)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
409 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
410 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
411 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
412
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
413 --debug)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
414 echo "$progname: enabling shell trace mode"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
415 set -x
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
416 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
417
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
418 --dry-run | -n)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
419 run=:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
420 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
421
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
422 --features)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
423 echo "host: $host"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
424 if test "$build_libtool_libs" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
425 echo "enable shared libraries"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
426 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
427 echo "disable shared libraries"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
428 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
429 if test "$build_old_libs" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
430 echo "enable static libraries"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
431 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
432 echo "disable static libraries"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
433 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
434 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
435 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
436
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
437 --finish) mode="finish" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
438
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
439 --mode) prevopt="--mode" prev=mode ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
440 --mode=*) mode="$optarg" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
441
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
442 --quiet | --silent)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
443 show=:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
444 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
445
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
446 -dlopen)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
447 prevopt="-dlopen"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
448 prev=execute_dlfiles
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
449 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
450
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
451 -*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
452 $echo "$modename: unrecognized option \`$arg'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
453 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
454 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
455 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
456
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
457 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
458 nonopt="$arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
459 break
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
460 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
461 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
462 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
463
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
464 if test -n "$prevopt"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
465 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
466 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
467 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
468 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
469
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
470 if test -z "$show_help"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
471
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
472 # Infer the operation mode.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
473 if test -z "$mode"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
474 case "$nonopt" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
475 *cc | *++ | gcc* | *-gcc*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
476 mode=link
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
477 for arg
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
478 do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
479 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
480 -c)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
481 mode=compile
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
482 break
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
483 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
484 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
485 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
486 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
487 *db | *dbx | *strace | *truss)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
488 mode=execute
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
489 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
490 *install*|cp|mv)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
491 mode=install
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
492 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
493 *rm)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
494 mode=uninstall
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
495 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
496 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
497 # If we have no mode, but dlfiles were specified, then do execute mode.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
498 test -n "$execute_dlfiles" && mode=execute
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
499
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
500 # Just use the default operation mode.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
501 if test -z "$mode"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
502 if test -n "$nonopt"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
503 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
504 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
505 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
506 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
507 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
508 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
509 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
510 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
511
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
512 # Only execute mode is allowed to have -dlopen flags.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
513 if test -n "$execute_dlfiles" && test "$mode" != execute; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
514 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
515 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
516 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
517 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
518
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
519 # Change the help message to a mode-specific one.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
520 generic_help="$help"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
521 help="Try \`$modename --help --mode=$mode' for more information."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
522
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
523 # These modes are in order of execution frequency so that they run quickly.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
524 case "$mode" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
525 # libtool compile mode
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
526 compile)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
527 modename="$modename: compile"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
528 # Get the compilation command and the source file.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
529 base_compile=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
530 lastarg=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
531 srcfile="$nonopt"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
532 suppress_output=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
533
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
534 user_target=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
535 for arg
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
536 do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
537 # Accept any command-line options.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
538 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
539 -o)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
540 if test "$user_target" != "no"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
541 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
542 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
543 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
544 user_target=next
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
545 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
546
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
547 -static)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
548 build_old_libs=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
549 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
550 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
551 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
552
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
553 case "$user_target" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
554 next)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
555 # The next one is the -o target name
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
556 user_target=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
557 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
558 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
559 yes)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
560 # We got the output file
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
561 user_target=set
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
562 libobj="$arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
563 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
564 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
565 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
566
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
567 # Accept the current argument as the source file.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
568 lastarg="$srcfile"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
569 srcfile="$arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
570
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
571 # Aesthetically quote the previous argument.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
572
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
573 # Backslashify any backslashes, double quotes, and dollar signs.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
574 # These are the only characters that are still specially
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
575 # interpreted inside of double-quoted scrings.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
576 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
577
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
578 # Double-quote args containing other shell metacharacters.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
579 # Many Bourne shells cannot handle close brackets correctly in scan
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
580 # sets, so we specify it separately.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
581 case "$lastarg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
582 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
583 lastarg="\"$lastarg\""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
584 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
585 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
586
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
587 # Add the previous argument to base_compile.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
588 if test -z "$base_compile"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
589 base_compile="$lastarg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
590 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
591 base_compile="$base_compile $lastarg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
592 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
593 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
594
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
595 case "$user_target" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
596 set)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
597 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
598 no)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
599 # Get the name of the library object.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
600 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
601 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
602 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
603 $echo "$modename: you must specify a target with \`-o'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
604 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
605 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
606 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
607
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
608 # Recognize several different file suffixes.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
609 # If the user specifies -o file.o, it is replaced with file.lo
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
610 xform='[cCFSfmso]'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
611 case "$libobj" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
612 *.ada) xform=ada ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
613 *.adb) xform=adb ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
614 *.ads) xform=ads ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
615 *.asm) xform=asm ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
616 *.c++) xform=c++ ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
617 *.cc) xform=cc ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
618 *.cpp) xform=cpp ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
619 *.cxx) xform=cxx ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
620 *.f90) xform=f90 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
621 *.for) xform=for ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
622 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
623
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
624 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
625
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
626 case "$libobj" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
627 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
628 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
629 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
630 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
631 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
632 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
633
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
634 if test -z "$base_compile"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
635 $echo "$modename: you must specify a compilation command" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
636 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
637 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
638 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
639
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
640 # Delete any leftover library objects.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
641 if test "$build_old_libs" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
642 removelist="$obj $libobj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
643 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
644 removelist="$libobj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
645 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
646
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
647 $run $rm $removelist
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
648 trap "$run $rm $removelist; exit 1" 1 2 15
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
649
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
650 # Calculate the filename of the output object if compiler does
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
651 # not support -o with -c
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
652 if test "$compiler_c_o" = no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
653 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
654 lockfile="$output_obj.lock"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
655 removelist="$removelist $output_obj $lockfile"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
656 trap "$run $rm $removelist; exit 1" 1 2 15
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
657 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
658 need_locks=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
659 lockfile=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
660 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
661
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
662 # Lock this critical section if it is needed
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
663 # We use this script file to make the link, it avoids creating a new file
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
664 if test "$need_locks" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
665 until ln "$0" "$lockfile" 2>/dev/null; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
666 $show "Waiting for $lockfile to be removed"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
667 sleep 2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
668 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
669 elif test "$need_locks" = warn; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
670 if test -f "$lockfile"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
671 echo "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
672 *** ERROR, $lockfile exists and contains:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
673 `cat $lockfile 2>/dev/null`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
674
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
675 This indicates that another process is trying to use the same
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
676 temporary object file, and libtool could not work around it because
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
677 your compiler does not support \`-c' and \`-o' together. If you
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
678 repeat this compilation, it may succeed, by chance, but you had better
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
679 avoid parallel builds (make -j) in this platform, or get a better
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
680 compiler."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
681
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
682 $run $rm $removelist
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
683 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
684 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
685 echo $srcfile > "$lockfile"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
686 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
687
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
688 if test -n "$fix_srcfile_path"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
689 eval srcfile=\"$fix_srcfile_path\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
690 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
691
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
692 # Only build a PIC object if we are building libtool libraries.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
693 if test "$build_libtool_libs" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
694 # Without this assignment, base_compile gets emptied.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
695 fbsd_hideous_sh_bug=$base_compile
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
696
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
697 # All platforms use -DPIC, to notify preprocessed assembler code.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
698 command="$base_compile $srcfile $pic_flag -DPIC"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
699 if test "$build_old_libs" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
700 lo_libobj="$libobj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
701 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
702 if test "X$dir" = "X$libobj"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
703 dir="$objdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
704 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
705 dir="$dir/$objdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
706 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
707 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
708
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
709 if test -d "$dir"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
710 $show "$rm $libobj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
711 $run $rm $libobj
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
712 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
713 $show "$mkdir $dir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
714 $run $mkdir $dir
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
715 status=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
716 if test $status -ne 0 && test ! -d $dir; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
717 exit $status
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
718 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
719 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
720 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
721 if test "$compiler_o_lo" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
722 output_obj="$libobj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
723 command="$command -o $output_obj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
724 elif test "$compiler_c_o" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
725 output_obj="$obj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
726 command="$command -o $output_obj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
727 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
728
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
729 $run $rm "$output_obj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
730 $show "$command"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
731 if $run eval "$command"; then :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
732 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
733 test -n "$output_obj" && $run $rm $removelist
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
734 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
735 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
736
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
737 if test "$need_locks" = warn &&
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
738 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
739 echo "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
740 *** ERROR, $lockfile contains:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
741 `cat $lockfile 2>/dev/null`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
742
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
743 but it should contain:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
744 $srcfile
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
745
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
746 This indicates that another process is trying to use the same
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
747 temporary object file, and libtool could not work around it because
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
748 your compiler does not support \`-c' and \`-o' together. If you
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
749 repeat this compilation, it may succeed, by chance, but you had better
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
750 avoid parallel builds (make -j) in this platform, or get a better
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
751 compiler."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
752
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
753 $run $rm $removelist
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
754 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
755 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
756
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
757 # Just move the object if needed, then go on to compile the next one
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
758 if test x"$output_obj" != x"$libobj"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
759 $show "$mv $output_obj $libobj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
760 if $run $mv $output_obj $libobj; then :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
761 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
762 error=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
763 $run $rm $removelist
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
764 exit $error
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
765 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
766 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
767
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
768 # If we have no pic_flag, then copy the object into place and finish.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
769 if test -z "$pic_flag" && test "$build_old_libs" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
770 # Rename the .lo from within objdir to obj
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
771 if test -f $obj; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
772 $show $rm $obj
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
773 $run $rm $obj
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
774 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
775
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
776 $show "$mv $libobj $obj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
777 if $run $mv $libobj $obj; then :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
778 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
779 error=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
780 $run $rm $removelist
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
781 exit $error
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
782 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
783
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
784 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
785 if test "X$xdir" = "X$obj"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
786 xdir="."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
787 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
788 xdir="$xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
789 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
790 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
791 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
792 # Now arrange that obj and lo_libobj become the same file
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
793 $show "(cd $xdir && $LN_S $baseobj $libobj)"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
794 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
795 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
796 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
797 error=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
798 $run $rm $removelist
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
799 exit $error
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
800 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
801 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
802
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
803 # Allow error messages only from the first compilation.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
804 suppress_output=' >/dev/null 2>&1'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
805 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
806
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
807 # Only build a position-dependent object if we build old libraries.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
808 if test "$build_old_libs" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
809 command="$base_compile $srcfile"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
810 if test "$compiler_c_o" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
811 command="$command -o $obj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
812 output_obj="$obj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
813 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
814
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
815 # Suppress compiler output if we already did a PIC compilation.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
816 command="$command$suppress_output"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
817 $run $rm "$output_obj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
818 $show "$command"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
819 if $run eval "$command"; then :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
820 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
821 $run $rm $removelist
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
822 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
823 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
824
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
825 if test "$need_locks" = warn &&
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
826 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
827 echo "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
828 *** ERROR, $lockfile contains:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
829 `cat $lockfile 2>/dev/null`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
830
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
831 but it should contain:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
832 $srcfile
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
833
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
834 This indicates that another process is trying to use the same
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
835 temporary object file, and libtool could not work around it because
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
836 your compiler does not support \`-c' and \`-o' together. If you
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
837 repeat this compilation, it may succeed, by chance, but you had better
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
838 avoid parallel builds (make -j) in this platform, or get a better
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
839 compiler."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
840
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
841 $run $rm $removelist
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
842 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
843 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
844
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
845 # Just move the object if needed
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
846 if test x"$output_obj" != x"$obj"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
847 $show "$mv $output_obj $obj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
848 if $run $mv $output_obj $obj; then :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
849 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
850 error=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
851 $run $rm $removelist
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
852 exit $error
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
853 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
854 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
855
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
856 # Create an invalid libtool object if no PIC, so that we do not
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
857 # accidentally link it into a program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
858 if test "$build_libtool_libs" != yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
859 $show "echo timestamp > $libobj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
860 $run eval "echo timestamp > \$libobj" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
861 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
862 # Move the .lo from within objdir
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
863 $show "$mv $libobj $lo_libobj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
864 if $run $mv $libobj $lo_libobj; then :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
865 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
866 error=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
867 $run $rm $removelist
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
868 exit $error
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
869 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
870 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
871 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
872
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
873 # Unlock the critical section if it was locked
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
874 if test "$need_locks" != no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
875 $rm "$lockfile"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
876 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
877
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
878 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
879 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
880
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
881 # libtool link mode
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
882 link)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
883 modename="$modename: link"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
884 case "$host" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
885 *-*-cygwin* | *-*-mingw* | *-*-os2*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
886 # It is impossible to link a dll without this setting, and
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
887 # we shouldn't force the makefile maintainer to figure out
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
888 # which system we are compiling for in order to pass an extra
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
889 # flag for every libtool invokation.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
890 # allow_undefined=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
891
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
892 # FIXME: Unfortunately, there are problems with the above when trying
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
893 # to make a dll which has undefined symbols, in which case not
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
894 # even a static library is built. For now, we need to specify
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
895 # -no-undefined on the libtool link line when we can be certain
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
896 # that all symbols are satisfied, otherwise we get a static library.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
897 allow_undefined=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
898
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
899 # This is a source program that is used to create dlls on Windows
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
900 # Don't remove nor modify the starting and closing comments
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
901 # /* ltdll.c starts here */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
902 # #define WIN32_LEAN_AND_MEAN
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
903 # #include <windows.h>
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
904 # #undef WIN32_LEAN_AND_MEAN
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
905 # #include <stdio.h>
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
906 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
907 # #ifndef __CYGWIN__
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
908 # # ifdef __CYGWIN32__
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
909 # # define __CYGWIN__ __CYGWIN32__
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
910 # # endif
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
911 # #endif
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
912 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
913 # #ifdef __cplusplus
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
914 # extern "C" {
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
915 # #endif
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
916 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
917 # #ifdef __cplusplus
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
918 # }
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
919 # #endif
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
920 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
921 # #ifdef __CYGWIN__
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
922 # #include <cygwin/cygwin_dll.h>
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
923 # DECLARE_CYGWIN_DLL( DllMain );
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
924 # #endif
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
925 # HINSTANCE __hDllInstance_base;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
926 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
927 # BOOL APIENTRY
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
928 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
929 # {
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
930 # __hDllInstance_base = hInst;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
931 # return TRUE;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
932 # }
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
933 # /* ltdll.c ends here */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
934 # This is a source program that is used to create import libraries
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
935 # on Windows for dlls which lack them. Don't remove nor modify the
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
936 # starting and closing comments
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
937 # /* impgen.c starts here */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
938 # /* Copyright (C) 1999 Free Software Foundation, Inc.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
939 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
940 # This file is part of GNU libtool.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
941 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
942 # This program is free software; you can redistribute it and/or modify
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
943 # it under the terms of the GNU General Public License as published by
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
944 # the Free Software Foundation; either version 2 of the License, or
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
945 # (at your option) any later version.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
946 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
947 # This program is distributed in the hope that it will be useful,
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
948 # but WITHOUT ANY WARRANTY; without even the implied warranty of
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
949 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
950 # GNU General Public License for more details.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
951 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
952 # You should have received a copy of the GNU General Public License
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
953 # along with this program; if not, write to the Free Software
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
954 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
955 # */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
956 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
957 # #include <stdio.h> /* for printf() */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
958 # #include <unistd.h> /* for open(), lseek(), read() */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
959 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
960 # #include <string.h> /* for strdup() */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
961 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
962 # static unsigned int
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
963 # pe_get16 (fd, offset)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
964 # int fd;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
965 # int offset;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
966 # {
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
967 # unsigned char b[2];
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
968 # lseek (fd, offset, SEEK_SET);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
969 # read (fd, b, 2);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
970 # return b[0] + (b[1]<<8);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
971 # }
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
972 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
973 # static unsigned int
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
974 # pe_get32 (fd, offset)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
975 # int fd;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
976 # int offset;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
977 # {
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
978 # unsigned char b[4];
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
979 # lseek (fd, offset, SEEK_SET);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
980 # read (fd, b, 4);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
981 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
982 # }
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
983 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
984 # static unsigned int
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
985 # pe_as32 (ptr)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
986 # void *ptr;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
987 # {
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
988 # unsigned char *b = ptr;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
989 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
990 # }
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
991 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
992 # int
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
993 # main (argc, argv)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
994 # int argc;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
995 # char *argv[];
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
996 # {
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
997 # int dll;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
998 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
999 # unsigned long export_rva, export_size, nsections, secptr, expptr;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1000 # unsigned long name_rvas, nexp;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1001 # unsigned char *expdata, *erva;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1002 # char *filename, *dll_name;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1003 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1004 # filename = argv[1];
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1005 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1006 # dll = open(filename, O_RDONLY|O_BINARY);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1007 # if (!dll)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1008 # return 1;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1009 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1010 # dll_name = filename;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1011 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1012 # for (i=0; filename[i]; i++)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1013 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1014 # dll_name = filename + i +1;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1015 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1016 # pe_header_offset = pe_get32 (dll, 0x3c);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1017 # opthdr_ofs = pe_header_offset + 4 + 20;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1018 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1019 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1020 # if (num_entries < 1) /* no exports */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1021 # return 1;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1022 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1023 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1024 # export_size = pe_get32 (dll, opthdr_ofs + 100);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1025 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1026 # secptr = (pe_header_offset + 4 + 20 +
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1027 # pe_get16 (dll, pe_header_offset + 4 + 16));
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1028 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1029 # expptr = 0;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1030 # for (i = 0; i < nsections; i++)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1031 # {
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1032 # char sname[8];
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1033 # unsigned long secptr1 = secptr + 40 * i;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1034 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1035 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1036 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1037 # lseek(dll, secptr1, SEEK_SET);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1038 # read(dll, sname, 8);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1039 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1040 # {
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1041 # expptr = fptr + (export_rva - vaddr);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1042 # if (export_rva + export_size > vaddr + vsize)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1043 # export_size = vsize - (export_rva - vaddr);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1044 # break;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1045 # }
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1046 # }
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1047 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1048 # expdata = (unsigned char*)malloc(export_size);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1049 # lseek (dll, expptr, SEEK_SET);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1050 # read (dll, expdata, export_size);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1051 # erva = expdata - export_rva;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1052 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1053 # nexp = pe_as32 (expdata+24);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1054 # name_rvas = pe_as32 (expdata+32);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1055 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1056 # printf ("EXPORTS\n");
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1057 # for (i = 0; i<nexp; i++)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1058 # {
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1059 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1060 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1061 # }
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1062 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1063 # return 0;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1064 # }
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1065 # /* impgen.c ends here */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1066 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1067 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1068 allow_undefined=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1069 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1070 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1071 compile_command="$nonopt"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1072 finalize_command="$nonopt"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1073
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1074 compile_rpath=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1075 finalize_rpath=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1076 compile_shlibpath=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1077 finalize_shlibpath=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1078 convenience=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1079 old_convenience=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1080 deplibs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1081 linkopts=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1082
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1083 if test -n "$shlibpath_var"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1084 # get the directories listed in $shlibpath_var
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1085 eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1086 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1087 lib_search_path=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1088 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1089 # now prepend the system-specific ones
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1090 eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1091 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1092
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1093 avoid_version=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1094 dlfiles=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1095 dlprefiles=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1096 dlself=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1097 export_dynamic=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1098 export_symbols=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1099 export_symbols_regex=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1100 generated=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1101 libobjs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1102 link_against_libtool_libs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1103 ltlibs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1104 module=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1105 objs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1106 prefer_static_libs=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1107 preload=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1108 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1109 prevarg=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1110 release=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1111 rpath=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1112 xrpath=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1113 perm_rpath=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1114 temp_rpath=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1115 thread_safe=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1116 vinfo=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1117
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1118 # We need to know -static, to get the right output filenames.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1119 for arg
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1120 do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1121 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1122 -all-static | -static)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1123 if test "X$arg" = "X-all-static"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1124 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1125 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1126 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1127 if test -n "$link_static_flag"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1128 dlopen_self=$dlopen_self_static
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1129 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1130 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1131 if test -z "$pic_flag" && test -n "$link_static_flag"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1132 dlopen_self=$dlopen_self_static
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1133 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1134 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1135 build_libtool_libs=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1136 build_old_libs=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1137 prefer_static_libs=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1138 break
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1139 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1140 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1141 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1142
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1143 # See if our shared archives depend on static archives.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1144 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1145
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1146 # Go through the arguments, transforming them on the way.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1147 while test $# -gt 0; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1148 arg="$1"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1149 shift
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1150
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1151 # If the previous option needs an argument, assign it.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1152 if test -n "$prev"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1153 case "$prev" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1154 output)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1155 compile_command="$compile_command @OUTPUT@"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1156 finalize_command="$finalize_command @OUTPUT@"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1157 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1158 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1159
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1160 case "$prev" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1161 dlfiles|dlprefiles)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1162 if test "$preload" = no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1163 # Add the symbol object into the linking commands.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1164 compile_command="$compile_command @SYMFILE@"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1165 finalize_command="$finalize_command @SYMFILE@"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1166 preload=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1167 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1168 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1169 *.la | *.lo) ;; # We handle these cases below.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1170 force)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1171 if test "$dlself" = no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1172 dlself=needless
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1173 export_dynamic=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1174 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1175 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1176 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1177 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1178 self)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1179 if test "$prev" = dlprefiles; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1180 dlself=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1181 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1182 dlself=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1183 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1184 dlself=needless
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1185 export_dynamic=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1186 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1187 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1188 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1189 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1190 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1191 if test "$prev" = dlfiles; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1192 dlfiles="$dlfiles $arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1193 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1194 dlprefiles="$dlprefiles $arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1195 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1196 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1197 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1198 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1199 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1200 expsyms)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1201 export_symbols="$arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1202 if test ! -f "$arg"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1203 $echo "$modename: symbol file \`$arg' does not exist"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1204 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1205 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1206 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1207 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1208 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1209 expsyms_regex)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1210 export_symbols_regex="$arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1211 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1212 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1213 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1214 release)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1215 release="-$arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1216 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1217 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1218 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1219 rpath | xrpath)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1220 # We need an absolute path.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1221 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1222 [\\/]* | [A-Za-z]:[\\/]*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1223 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1224 $echo "$modename: only absolute run-paths are allowed" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1225 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1226 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1227 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1228 if test "$prev" = rpath; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1229 case "$rpath " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1230 *" $arg "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1231 *) rpath="$rpath $arg" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1232 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1233 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1234 case "$xrpath " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1235 *" $arg "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1236 *) xrpath="$xrpath $arg" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1237 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1238 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1239 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1240 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1241 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1242 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1243 eval "$prev=\"\$arg\""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1244 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1245 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1246 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1247 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1248 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1249
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1250 prevarg="$arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1251
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1252 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1253 -all-static)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1254 if test -n "$link_static_flag"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1255 compile_command="$compile_command $link_static_flag"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1256 finalize_command="$finalize_command $link_static_flag"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1257 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1258 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1259 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1260
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1261 -allow-undefined)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1262 # FIXME: remove this flag sometime in the future.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1263 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1264 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1265 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1266
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1267 -avoid-version)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1268 avoid_version=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1269 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1270 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1271
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1272 -dlopen)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1273 prev=dlfiles
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1274 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1275 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1276
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1277 -dlpreopen)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1278 prev=dlprefiles
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1279 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1280 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1281
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1282 -export-dynamic)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1283 export_dynamic=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1284 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1285 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1286
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1287 -export-symbols | -export-symbols-regex)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1288 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1289 $echo "$modename: not more than one -exported-symbols argument allowed"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1290 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1291 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1292 if test "X$arg" = "X-export-symbols"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1293 prev=expsyms
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1294 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1295 prev=expsyms_regex
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1296 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1297 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1298 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1299
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1300 -L*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1301 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1302 # We need an absolute path.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1303 case "$dir" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1304 [\\/]* | [A-Za-z]:[\\/]*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1305 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1306 absdir=`cd "$dir" && pwd`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1307 if test -z "$absdir"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1308 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1309 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1310 absdir="$dir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1311 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1312 dir="$absdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1313 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1314 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1315 case " $deplibs " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1316 *" $arg "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1317 *) deplibs="$deplibs $arg";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1318 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1319 case " $lib_search_path " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1320 *" $dir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1321 *) lib_search_path="$lib_search_path $dir";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1322 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1323 case "$host" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1324 *-*-cygwin* | *-*-mingw* | *-*-os2*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1325 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1326 case ":$dllsearchpath:" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1327 ::) dllsearchpath="$dllsearchdir";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1328 *":$dllsearchdir:"*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1329 *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1330 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1331 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1332 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1333 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1334
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1335 -l*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1336 if test "$arg" = "-lc"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1337 case "$host" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1338 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1339 # These systems don't actually have c library (as such)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1340 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1341 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1342 *-*-rhapsody* | *-*-darwin1.[012])
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1343 # Rhapsody C library is in the System framework
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1344 deplibs="$deplibs -framework System"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1345 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1346 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1347 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1348 elif test "$arg" = "-lm"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1349 case "$host" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1350 *-*-cygwin* | *-*-beos*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1351 # These systems don't actually have math library (as such)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1352 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1353 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1354 *-*-rhapsody* | *-*-darwin1.[012])
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1355 # Rhapsody math library is in the System framework
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1356 deplibs="$deplibs -framework System"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1357 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1358 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1359 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1360 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1361 deplibs="$deplibs $arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1362 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1363
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1364 -module)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1365 module=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1366 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1367 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1368
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1369 -no-undefined)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1370 allow_undefined=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1371 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1372 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1373
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1374 -o) prev=output ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1375
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1376 -release)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1377 prev=release
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1378 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1379 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1380
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1381 -rpath)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1382 prev=rpath
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1383 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1384 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1385
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1386 -R)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1387 prev=xrpath
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1388 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1389 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1390
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1391 -R*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1392 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1393 # We need an absolute path.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1394 case "$dir" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1395 [\\/]* | [A-Za-z]:[\\/]*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1396 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1397 $echo "$modename: only absolute run-paths are allowed" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1398 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1399 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1400 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1401 case "$xrpath " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1402 *" $dir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1403 *) xrpath="$xrpath $dir" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1404 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1405 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1406 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1407
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1408 -static)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1409 # If we have no pic_flag, then this is the same as -all-static.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1410 if test -z "$pic_flag" && test -n "$link_static_flag"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1411 compile_command="$compile_command $link_static_flag"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1412 finalize_command="$finalize_command $link_static_flag"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1413 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1414 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1415 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1416
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1417 -thread-safe)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1418 thread_safe=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1419 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1420 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1421
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1422 -version-info)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1423 prev=vinfo
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1424 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1425 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1426
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1427 # Some other compiler flag.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1428 -* | +*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1429 # Unknown arguments in both finalize_command and compile_command need
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1430 # to be aesthetically quoted because they are evaled later.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1431 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1432 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1433 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1434 arg="\"$arg\""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1435 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1436 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1437 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1438
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1439 *.o | *.obj | *.a | *.lib)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1440 # A standard object.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1441 objs="$objs $arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1442 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1443
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1444 *.lo)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1445 # A library object.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1446 if test "$prev" = dlfiles; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1447 dlfiles="$dlfiles $arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1448 if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1449 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1450 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1451 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1452 # If libtool objects are unsupported, then we need to preload.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1453 prev=dlprefiles
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1454 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1455 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1456
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1457 if test "$prev" = dlprefiles; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1458 # Preload the old-style object.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1459 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1460 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1461 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1462 libobjs="$libobjs $arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1463 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1464
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1465 *.la)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1466 # A libtool-controlled library.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1467
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1468 dlname=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1469 libdir=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1470 library_names=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1471 old_library=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1472
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1473 # Check to see that this really is a libtool archive.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1474 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1475 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1476 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1477 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1478 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1479
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1480 # If the library was installed with an old release of libtool,
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1481 # it will not redefine variable installed.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1482 installed=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1483
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1484 # Read the .la file
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1485 # If there is no directory component, then add one.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1486 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1487 */* | *\\*) . $arg ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1488 *) . ./$arg ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1489 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1490
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1491 # Get the name of the library we link against.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1492 linklib=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1493 for l in $old_library $library_names; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1494 linklib="$l"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1495 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1496
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1497 if test -z "$linklib"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1498 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1499 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1500 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1501
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1502 # Find the relevant object directory and library name.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1503 name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1504
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1505 if test "X$installed" = Xyes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1506 dir="$libdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1507 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1508 dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1509 if test "X$dir" = "X$arg"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1510 dir="$objdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1511 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1512 dir="$dir/$objdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1513 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1514 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1515
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1516 if test -n "$dependency_libs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1517 # Extract -R and -L from dependency_libs
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1518 temp_deplibs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1519 for deplib in $dependency_libs; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1520 case "$deplib" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1521 -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1522 case " $rpath $xrpath " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1523 *" $temp_xrpath "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1524 *) xrpath="$xrpath $temp_xrpath";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1525 esac;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1526 -L*) case "$compile_command $temp_deplibs " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1527 *" $deplib "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1528 *) temp_deplibs="$temp_deplibs $deplib";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1529 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1530 temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1531 case " $lib_search_path " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1532 *" $temp_dir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1533 *) lib_search_path="$lib_search_path $temp_dir";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1534 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1535 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1536 *) temp_deplibs="$temp_deplibs $deplib";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1537 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1538 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1539 dependency_libs="$temp_deplibs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1540 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1541
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1542 if test -z "$libdir"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1543 # It is a libtool convenience library, so add in its objects.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1544 convenience="$convenience $dir/$old_library"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1545 old_convenience="$old_convenience $dir/$old_library"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1546 deplibs="$deplibs$dependency_libs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1547 compile_command="$compile_command $dir/$old_library$dependency_libs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1548 finalize_command="$finalize_command $dir/$old_library$dependency_libs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1549 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1550 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1551
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1552 # This library was specified with -dlopen.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1553 if test "$prev" = dlfiles; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1554 dlfiles="$dlfiles $arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1555 if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1556 # If there is no dlname, no dlopen support or we're linking statically,
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1557 # we need to preload.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1558 prev=dlprefiles
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1559 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1560 # We should not create a dependency on this library, but we
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1561 # may need any libraries it requires.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1562 compile_command="$compile_command$dependency_libs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1563 finalize_command="$finalize_command$dependency_libs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1564 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1565 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1566 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1567 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1568
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1569 # The library was specified with -dlpreopen.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1570 if test "$prev" = dlprefiles; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1571 # Prefer using a static library (so that no silly _DYNAMIC symbols
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1572 # are required to link).
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1573 if test -n "$old_library"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1574 dlprefiles="$dlprefiles $dir/$old_library"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1575 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1576 dlprefiles="$dlprefiles $dir/$linklib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1577 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1578 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1579 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1580
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1581 if test -n "$library_names" &&
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1582 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1583 link_against_libtool_libs="$link_against_libtool_libs $arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1584 if test -n "$shlibpath_var"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1585 # Make sure the rpath contains only unique directories.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1586 case "$temp_rpath " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1587 *" $dir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1588 *) temp_rpath="$temp_rpath $dir" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1589 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1590 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1591
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1592 # We need an absolute path.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1593 case "$dir" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1594 [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1595 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1596 absdir=`cd "$dir" && pwd`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1597 if test -z "$absdir"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1598 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1599 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1600 absdir="$dir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1601 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1602 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1603 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1604
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1605 # This is the magic to use -rpath.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1606 # Skip directories that are in the system default run-time
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1607 # search path, unless they have been requested with -R.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1608 case " $sys_lib_dlsearch_path " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1609 *" $absdir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1610 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1611 case "$compile_rpath " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1612 *" $absdir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1613 *) compile_rpath="$compile_rpath $absdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1614 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1615 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1616 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1617
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1618 case " $sys_lib_dlsearch_path " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1619 *" $libdir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1620 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1621 case "$finalize_rpath " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1622 *" $libdir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1623 *) finalize_rpath="$finalize_rpath $libdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1624 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1625 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1626 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1627
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1628 lib_linked=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1629 case "$hardcode_action" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1630 immediate | unsupported)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1631 if test "$hardcode_direct" = no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1632 compile_command="$compile_command $dir/$linklib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1633 deplibs="$deplibs $dir/$linklib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1634 case "$host" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1635 *-*-cygwin* | *-*-mingw* | *-*-os2*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1636 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1637 if test -n "$dllsearchpath"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1638 dllsearchpath="$dllsearchpath:$dllsearchdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1639 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1640 dllsearchpath="$dllsearchdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1641 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1642 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1643 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1644 elif test "$hardcode_minus_L" = no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1645 case "$host" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1646 *-*-sunos*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1647 compile_shlibpath="$compile_shlibpath$dir:"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1648 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1649 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1650 case "$compile_command " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1651 *" -L$dir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1652 *) compile_command="$compile_command -L$dir";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1653 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1654 compile_command="$compile_command -l$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1655 deplibs="$deplibs -L$dir -l$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1656 elif test "$hardcode_shlibpath_var" = no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1657 case ":$compile_shlibpath:" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1658 *":$dir:"*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1659 *) compile_shlibpath="$compile_shlibpath$dir:";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1660 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1661 compile_command="$compile_command -l$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1662 deplibs="$deplibs -l$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1663 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1664 lib_linked=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1665 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1666 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1667
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1668 relink)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1669 if test "$hardcode_direct" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1670 compile_command="$compile_command $absdir/$linklib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1671 deplibs="$deplibs $absdir/$linklib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1672 elif test "$hardcode_minus_L" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1673 case "$compile_command " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1674 *" -L$absdir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1675 *) compile_command="$compile_command -L$absdir";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1676 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1677 compile_command="$compile_command -l$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1678 deplibs="$deplibs -L$absdir -l$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1679 elif test "$hardcode_shlibpath_var" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1680 case ":$compile_shlibpath:" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1681 *":$absdir:"*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1682 *) compile_shlibpath="$compile_shlibpath$absdir:";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1683 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1684 compile_command="$compile_command -l$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1685 deplibs="$deplibs -l$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1686 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1687 lib_linked=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1688 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1689 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1690
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1691 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1692 lib_linked=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1693 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1694 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1695
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1696 if test "$lib_linked" != yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1697 $echo "$modename: configuration error: unsupported hardcode properties"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1698 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1699 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1700
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1701 # Finalize command for both is simple: just hardcode it.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1702 if test "$hardcode_direct" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1703 finalize_command="$finalize_command $libdir/$linklib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1704 elif test "$hardcode_minus_L" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1705 case "$finalize_command " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1706 *" -L$libdir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1707 *) finalize_command="$finalize_command -L$libdir";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1708 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1709 finalize_command="$finalize_command -l$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1710 elif test "$hardcode_shlibpath_var" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1711 case ":$finalize_shlibpath:" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1712 *":$libdir:"*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1713 *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1714 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1715 finalize_command="$finalize_command -l$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1716 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1717 # We cannot seem to hardcode it, guess we'll fake it.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1718 case "$finalize_command " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1719 *" -L$dir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1720 *) finalize_command="$finalize_command -L$libdir";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1721 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1722 finalize_command="$finalize_command -l$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1723 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1724 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1725 # Transform directly to old archives if we don't build new libraries.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1726 if test -n "$pic_flag" && test -z "$old_library"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1727 $echo "$modename: cannot find static library for \`$arg'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1728 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1729 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1730
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1731 # Here we assume that one of hardcode_direct or hardcode_minus_L
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1732 # is not unsupported. This is valid on all known static and
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1733 # shared platforms.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1734 if test "$hardcode_direct" != unsupported; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1735 test -n "$old_library" && linklib="$old_library"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1736 compile_command="$compile_command $dir/$linklib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1737 finalize_command="$finalize_command $dir/$linklib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1738 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1739 case "$compile_command " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1740 *" -L$dir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1741 *) compile_command="$compile_command -L$dir";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1742 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1743 compile_command="$compile_command -l$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1744 case "$finalize_command " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1745 *" -L$dir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1746 *) finalize_command="$finalize_command -L$dir";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1747 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1748 finalize_command="$finalize_command -l$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1749 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1750 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1751
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1752 # Add in any libraries that this one depends upon.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1753 compile_command="$compile_command$dependency_libs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1754 finalize_command="$finalize_command$dependency_libs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1755 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1756 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1757
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1758 # Some other compiler argument.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1759 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1760 # Unknown arguments in both finalize_command and compile_command need
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1761 # to be aesthetically quoted because they are evaled later.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1762 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1763 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1764 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1765 arg="\"$arg\""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1766 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1767 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1768 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1769 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1770
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1771 # Now actually substitute the argument into the commands.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1772 if test -n "$arg"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1773 compile_command="$compile_command $arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1774 finalize_command="$finalize_command $arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1775 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1776 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1777
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1778 if test -n "$prev"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1779 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1780 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1781 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1782 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1783
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1784 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1785 eval arg=\"$export_dynamic_flag_spec\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1786 compile_command="$compile_command $arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1787 finalize_command="$finalize_command $arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1788 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1789
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1790 oldlibs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1791 # calculate the name of the file, without its directory
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1792 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1793 libobjs_save="$libobjs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1794
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1795 case "$output" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1796 "")
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1797 $echo "$modename: you must specify an output file" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1798 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1799 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1800 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1801
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1802 *.a | *.lib)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1803 if test -n "$link_against_libtool_libs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1804 $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1805 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1806 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1807
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1808 if test -n "$deplibs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1809 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1810 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1811
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1812 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1813 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1814 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1815
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1816 if test -n "$rpath"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1817 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1818 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1819
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1820 if test -n "$xrpath"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1821 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1822 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1823
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1824 if test -n "$vinfo"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1825 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1826 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1827
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1828 if test -n "$release"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1829 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1830 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1831
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1832 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1833 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1834 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1835
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1836 # Now set the variables for building old libraries.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1837 build_libtool_libs=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1838 oldlibs="$output"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1839 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1840
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1841 *.la)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1842 # Make sure we only generate libraries of the form `libNAME.la'.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1843 case "$outputname" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1844 lib*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1845 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1846 eval libname=\"$libname_spec\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1847 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1848 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1849 if test "$module" = no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1850 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1851 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1852 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1853 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1854 if test "$need_lib_prefix" != no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1855 # Add the "lib" prefix for modules if required
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1856 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1857 eval libname=\"$libname_spec\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1858 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1859 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1860 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1861 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1862 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1863
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1864 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1865 if test "X$output_objdir" = "X$output"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1866 output_objdir="$objdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1867 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1868 output_objdir="$output_objdir/$objdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1869 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1870
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1871 if test -n "$objs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1872 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1873 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1874 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1875
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1876 # How the heck are we supposed to write a wrapper for a shared library?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1877 if test -n "$link_against_libtool_libs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1878 $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1879 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1880 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1881
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1882 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1883 $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1884 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1885
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1886 set dummy $rpath
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1887 if test $# -gt 2; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1888 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1889 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1890 install_libdir="$2"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1891
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1892 oldlibs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1893 if test -z "$rpath"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1894 if test "$build_libtool_libs" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1895 # Building a libtool convenience library.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1896 libext=al
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1897 oldlibs="$output_objdir/$libname.$libext $oldlibs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1898 build_libtool_libs=convenience
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1899 build_old_libs=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1900 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1901 dependency_libs="$deplibs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1902
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1903 if test -n "$vinfo"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1904 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1905 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1906
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1907 if test -n "$release"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1908 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1909 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1910 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1911
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1912 # Parse the version information argument.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1913 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1914 set dummy $vinfo 0 0 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1915 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1916
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1917 if test -n "$8"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1918 $echo "$modename: too many parameters to \`-version-info'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1919 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1920 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1921 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1922
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1923 current="$2"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1924 revision="$3"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1925 age="$4"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1926
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1927 # Check that each of the things are valid numbers.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1928 case "$current" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1929 0 | [1-9] | [1-9][0-9]*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1930 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1931 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1932 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1933 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1934 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1935 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1936
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1937 case "$revision" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1938 0 | [1-9] | [1-9][0-9]*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1939 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1940 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1941 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1942 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1943 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1944 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1945
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1946 case "$age" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1947 0 | [1-9] | [1-9][0-9]*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1948 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1949 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1950 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1951 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1952 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1953 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1954
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1955 if test $age -gt $current; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1956 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1957 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1958 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1959 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1960
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1961 # Calculate the version variables.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1962 major=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1963 versuffix=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1964 verstring=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1965 case "$version_type" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1966 none) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1967
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1968 irix)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1969 major=`expr $current - $age + 1`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1970 versuffix="$major.$revision"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1971 verstring="sgi$major.$revision"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1972
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1973 # Add in all the interfaces that we are compatible with.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1974 loop=$revision
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1975 while test $loop != 0; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1976 iface=`expr $revision - $loop`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1977 loop=`expr $loop - 1`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1978 verstring="sgi$major.$iface:$verstring"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1979 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1980 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1981
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1982 linux)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1983 major=.`expr $current - $age`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1984 versuffix="$major.$age.$revision"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1985 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1986
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1987 osf)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1988 major=`expr $current - $age`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1989 versuffix=".$current.$age.$revision"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1990 verstring="$current.$age.$revision"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1991
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1992 # Add in all the interfaces that we are compatible with.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1993 loop=$age
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1994 while test $loop != 0; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1995 iface=`expr $current - $loop`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1996 loop=`expr $loop - 1`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1997 verstring="$verstring:${iface}.0"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1998 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1999
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2000 # Make executables depend on our current version.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2001 verstring="$verstring:${current}.0"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2002 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2003
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2004 sunos)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2005 major=".$current"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2006 versuffix=".$current.$revision"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2007 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2008
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2009 freebsd-aout)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2010 major=".$current"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2011 versuffix=".$current.$revision";
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2012 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2013
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2014 freebsd-elf)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2015 major=".$current"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2016 versuffix=".$current";
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2017 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2018
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2019 windows)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2020 # Like Linux, but with '-' rather than '.', since we only
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2021 # want one extension on Windows 95.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2022 major=`expr $current - $age`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2023 versuffix="-$major-$age-$revision"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2024 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2025
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2026 darwin)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2027 # Like Linux, but with the current version available in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2028 # verstring for coding it into the library header
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2029 major=.`expr $current - $age`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2030 versuffix="$major.$age.$revision"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2031 # Darwin ld doesn't like 0 for these options...
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2032 minor_current=`expr $current + 1`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2033 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2034 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2035
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2036 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2037 $echo "$modename: unknown library version type \`$version_type'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2038 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2039 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2040 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2041 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2042
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2043 # Clear the version info if we defaulted, and they specified a release.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2044 if test -z "$vinfo" && test -n "$release"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2045 major=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2046 case "$version_type" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2047 darwin)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2048 # we can't check for "0.0" in archive_cmds due to quoting
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2049 # problems, so we reset it completely
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2050 verstring=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2051 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2052 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2053 verstring="0.0"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2054 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2055 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2056 if test "$need_version" = no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2057 versuffix=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2058 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2059 versuffix=".0.0"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2060 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2061 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2062
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2063 # Remove version info from name if versioning should be avoided
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2064 if test "$avoid_version" = yes && test "$need_version" = no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2065 major=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2066 versuffix=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2067 verstring=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2068 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2069
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2070 # Check to see if the archive will have undefined symbols.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2071 if test "$allow_undefined" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2072 if test "$allow_undefined_flag" = unsupported; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2073 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2074 build_libtool_libs=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2075 build_old_libs=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2076 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2077 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2078 # Don't allow undefined symbols.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2079 allow_undefined_flag="$no_undefined_flag"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2080 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2081
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2082 dependency_libs="$deplibs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2083 case "$host" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2084 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2085 # these systems don't actually have a c library (as such)!
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2086 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2087 *-*-rhapsody* | *-*-darwin1.[012])
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2088 # Rhapsody C library is in the System framework
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2089 deplibs="$deplibs -framework System"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2090 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2091 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2092 # Add libc to deplibs on all other systems.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2093 deplibs="$deplibs -lc"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2094 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2095 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2096 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2097
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2098 # Create the output directory, or remove our outputs if we need to.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2099 if test -d $output_objdir; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2100 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2101 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2102 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2103 $show "$mkdir $output_objdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2104 $run $mkdir $output_objdir
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2105 status=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2106 if test $status -ne 0 && test ! -d $output_objdir; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2107 exit $status
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2108 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2109 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2110
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2111 # Now set the variables for building old libraries.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2112 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2113 oldlibs="$oldlibs $output_objdir/$libname.$libext"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2114
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2115 # Transform .lo files to .o files.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2116 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2117 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2118
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2119 if test "$build_libtool_libs" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2120 # Transform deplibs into only deplibs that can be linked in shared.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2121 name_save=$name
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2122 libname_save=$libname
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2123 release_save=$release
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2124 versuffix_save=$versuffix
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2125 major_save=$major
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2126 # I'm not sure if I'm treating the release correctly. I think
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2127 # release should show up in the -l (ie -lgmp5) so we don't want to
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2128 # add it in twice. Is that correct?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2129 release=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2130 versuffix=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2131 major=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2132 newdeplibs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2133 droppeddeps=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2134 case "$deplibs_check_method" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2135 pass_all)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2136 # Don't check for shared/static. Everything works.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2137 # This might be a little naive. We might want to check
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2138 # whether the library exists or not. But this is on
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2139 # osf3 & osf4 and I'm not really sure... Just
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2140 # implementing what was already the behaviour.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2141 newdeplibs=$deplibs
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2142 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2143 test_compile)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2144 # This code stresses the "libraries are programs" paradigm to its
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2145 # limits. Maybe even breaks it. We compile a program, linking it
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2146 # against the deplibs as a proxy for the library. Then we can check
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2147 # whether they linked in statically or dynamically with ldd.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2148 $rm conftest.c
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2149 cat > conftest.c <<EOF
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2150 int main() { return 0; }
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2151 EOF
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2152 $rm conftest
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2153 $CC -o conftest conftest.c $deplibs
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2154 if test $? -eq 0 ; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2155 ldd_output=`ldd conftest`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2156 for i in $deplibs; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2157 name="`expr $i : '-l\(.*\)'`"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2158 # If $name is empty we are operating on a -L argument.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2159 if test "$name" != "" ; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2160 libname=`eval \\$echo \"$libname_spec\"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2161 deplib_matches=`eval \\$echo \"$library_names_spec\"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2162 set dummy $deplib_matches
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2163 deplib_match=$2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2164 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2165 newdeplibs="$newdeplibs $i"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2166 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2167 droppeddeps=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2168 echo
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2169 echo "*** Warning: This library needs some functionality provided by $i."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2170 echo "*** I have the capability to make that library automatically link in when"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2171 echo "*** you link to this library. But I can only do this if you have a"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2172 echo "*** shared version of the library, which you do not appear to have."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2173 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2174 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2175 newdeplibs="$newdeplibs $i"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2176 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2177 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2178 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2179 # Error occured in the first compile. Let's try to salvage the situation:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2180 # Compile a seperate program for each library.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2181 for i in $deplibs; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2182 name="`expr $i : '-l\(.*\)'`"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2183 # If $name is empty we are operating on a -L argument.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2184 if test "$name" != "" ; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2185 $rm conftest
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2186 $CC -o conftest conftest.c $i
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2187 # Did it work?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2188 if test $? -eq 0 ; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2189 ldd_output=`ldd conftest`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2190 libname=`eval \\$echo \"$libname_spec\"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2191 deplib_matches=`eval \\$echo \"$library_names_spec\"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2192 set dummy $deplib_matches
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2193 deplib_match=$2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2194 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2195 newdeplibs="$newdeplibs $i"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2196 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2197 droppeddeps=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2198 echo
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2199 echo "*** Warning: This library needs some functionality provided by $i."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2200 echo "*** I have the capability to make that library automatically link in when"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2201 echo "*** you link to this library. But I can only do this if you have a"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2202 echo "*** shared version of the library, which you do not appear to have."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2203 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2204 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2205 droppeddeps=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2206 echo
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2207 echo "*** Warning! Library $i is needed by this library but I was not able to"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2208 echo "*** make it link in! You will probably need to install it or some"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2209 echo "*** library that it depends on before this library will be fully"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2210 echo "*** functional. Installing it before continuing would be even better."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2211 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2212 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2213 newdeplibs="$newdeplibs $i"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2214 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2215 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2216 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2217 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2218 file_magic*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2219 set dummy $deplibs_check_method
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2220 file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2221 for a_deplib in $deplibs; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2222 name="`expr $a_deplib : '-l\(.*\)'`"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2223 # If $name is empty we are operating on a -L argument.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2224 if test "$name" != "" ; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2225 libname=`eval \\$echo \"$libname_spec\"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2226 for i in $lib_search_path; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2227 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2228 for potent_lib in $potential_libs; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2229 # Follow soft links.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2230 if ls -lLd "$potent_lib" 2>/dev/null \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2231 | grep " -> " >/dev/null; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2232 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2233 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2234 # The statement above tries to avoid entering an
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2235 # endless loop below, in case of cyclic links.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2236 # We might still enter an endless loop, since a link
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2237 # loop can be closed while we follow links,
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2238 # but so what?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2239 potlib="$potent_lib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2240 while test -h "$potlib" 2>/dev/null; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2241 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2242 case "$potliblink" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2243 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2244 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2245 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2246 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2247 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2248 | sed 10q \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2249 | egrep "$file_magic_regex" > /dev/null; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2250 newdeplibs="$newdeplibs $a_deplib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2251 a_deplib=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2252 break 2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2253 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2254 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2255 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2256 if test -n "$a_deplib" ; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2257 droppeddeps=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2258 echo
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2259 echo "*** Warning: This library needs some functionality provided by $a_deplib."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2260 echo "*** I have the capability to make that library automatically link in when"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2261 echo "*** you link to this library. But I can only do this if you have a"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2262 echo "*** shared version of the library, which you do not appear to have."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2263 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2264 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2265 # Add a -L argument.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2266 newdeplibs="$newdeplibs $a_deplib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2267 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2268 done # Gone through all deplibs.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2269 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2270 none | unknown | *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2271 newdeplibs=""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2272 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2273 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2274 grep . >/dev/null; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2275 echo
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2276 if test "X$deplibs_check_method" = "Xnone"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2277 echo "*** Warning: inter-library dependencies are not supported in this platform."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2278 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2279 echo "*** Warning: inter-library dependencies are not known to be supported."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2280 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2281 echo "*** All declared inter-library dependencies are being dropped."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2282 droppeddeps=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2283 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2284 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2285 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2286 versuffix=$versuffix_save
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2287 major=$major_save
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2288 release=$release_save
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2289 libname=$libname_save
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2290 name=$name_save
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2291
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2292 if test "$droppeddeps" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2293 if test "$module" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2294 echo
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2295 echo "*** Warning: libtool could not satisfy all declared inter-library"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2296 echo "*** dependencies of module $libname. Therefore, libtool will create"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2297 echo "*** a static module, that should work as long as the dlopening"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2298 echo "*** application is linked with the -dlopen flag."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2299 if test -z "$global_symbol_pipe"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2300 echo
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2301 echo "*** However, this would only work if libtool was able to extract symbol"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2302 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2303 echo "*** not find such a program. So, this module is probably useless."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2304 echo "*** \`nm' from GNU binutils and a full rebuild may help."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2305 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2306 if test "$build_old_libs" = no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2307 oldlibs="$output_objdir/$libname.$libext"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2308 build_libtool_libs=module
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2309 build_old_libs=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2310 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2311 build_libtool_libs=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2312 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2313 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2314 echo "*** The inter-library dependencies that have been dropped here will be"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2315 echo "*** automatically added whenever a program is linked with this library"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2316 echo "*** or is declared to -dlopen it."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2317 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2318 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2319 # Done checking deplibs!
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2320 deplibs=$newdeplibs
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2321 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2322
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2323 # All the library-specific variables (install_libdir is set above).
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2324 library_names=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2325 old_library=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2326 dlname=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2327
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2328 # Test again, we may have decided not to build it any more
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2329 if test "$build_libtool_libs" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2330 # Get the real and link names of the library.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2331 eval library_names=\"$library_names_spec\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2332 set dummy $library_names
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2333 realname="$2"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2334 shift; shift
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2335
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2336 if test -n "$soname_spec"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2337 eval soname=\"$soname_spec\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2338 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2339 soname="$realname"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2340 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2341
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2342 lib="$output_objdir/$realname"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2343 for link
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2344 do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2345 linknames="$linknames $link"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2346 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2347
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2348 # Ensure that we have .o objects for linkers which dislike .lo
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2349 # (e.g. aix) in case we are running --disable-static
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2350 for obj in $libobjs; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2351 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2352 if test "X$xdir" = "X$obj"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2353 xdir="."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2354 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2355 xdir="$xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2356 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2357 baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2358 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2359 if test ! -f $xdir/$oldobj; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2360 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2361 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2362 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2363 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2364
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2365 # Use standard objects if they are pic
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2366 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2367
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2368 # Prepare the list of exported symbols
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2369 if test -z "$export_symbols"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2370 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2371 $show "generating symbol list for \`$libname.la'"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2372 export_symbols="$output_objdir/$libname.exp"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2373 $run $rm $export_symbols
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2374 eval cmds=\"$export_symbols_cmds\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2375 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2376 for cmd in $cmds; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2377 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2378 $show "$cmd"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2379 $run eval "$cmd" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2380 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2381 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2382 if test -n "$export_symbols_regex"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2383 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2384 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2385 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2386 $run eval '$mv "${export_symbols}T" "$export_symbols"'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2387 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2388 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2389 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2390
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2391 if test -n "$export_symbols" && test -n "$include_expsyms"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2392 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2393 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2394
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2395 if test -n "$convenience"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2396 if test -n "$whole_archive_flag_spec"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2397 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2398 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2399 gentop="$output_objdir/${outputname}x"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2400 $show "${rm}r $gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2401 $run ${rm}r "$gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2402 $show "mkdir $gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2403 $run mkdir "$gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2404 status=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2405 if test $status -ne 0 && test ! -d "$gentop"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2406 exit $status
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2407 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2408 generated="$generated $gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2409
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2410 for xlib in $convenience; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2411 # Extract the objects.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2412 case "$xlib" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2413 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2414 *) xabs=`pwd`"/$xlib" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2415 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2416 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2417 xdir="$gentop/$xlib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2418
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2419 $show "${rm}r $xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2420 $run ${rm}r "$xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2421 $show "mkdir $xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2422 $run mkdir "$xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2423 status=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2424 if test $status -ne 0 && test ! -d "$xdir"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2425 exit $status
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2426 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2427 $show "(cd $xdir && $AR x $xabs)"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2428 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2429
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2430 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2431 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2432 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2433 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2434
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2435 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2436 eval flag=\"$thread_safe_flag_spec\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2437 linkopts="$linkopts $flag"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2438 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2439
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2440 # Do each of the archive commands.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2441 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2442 eval cmds=\"$archive_expsym_cmds\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2443 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2444 eval cmds=\"$archive_cmds\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2445 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2446 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2447 for cmd in $cmds; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2448 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2449 $show "$cmd"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2450 $run eval "$cmd" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2451 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2452 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2453
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2454 # Create links to the real library.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2455 for linkname in $linknames; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2456 if test "$realname" != "$linkname"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2457 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2458 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2459 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2460 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2461
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2462 # If -module or -export-dynamic was specified, set the dlname.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2463 if test "$module" = yes || test "$export_dynamic" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2464 # On all known operating systems, these are identical.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2465 dlname="$soname"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2466 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2467 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2468 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2469
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2470 *.lo | *.o | *.obj)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2471 if test -n "$link_against_libtool_libs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2472 $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2473 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2474 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2475
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2476 if test -n "$deplibs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2477 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2478 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2479
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2480 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2481 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2482 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2483
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2484 if test -n "$rpath"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2485 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2486 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2487
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2488 if test -n "$xrpath"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2489 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2490 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2491
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2492 if test -n "$vinfo"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2493 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2494 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2495
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2496 if test -n "$release"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2497 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2498 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2499
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2500 case "$output" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2501 *.lo)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2502 if test -n "$objs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2503 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2504 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2505 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2506 libobj="$output"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2507 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2508 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2509 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2510 libobj=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2511 obj="$output"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2512 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2513 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2514
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2515 # Delete the old objects.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2516 $run $rm $obj $libobj
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2517
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2518 # Objects from convenience libraries. This assumes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2519 # single-version convenience libraries. Whenever we create
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2520 # different ones for PIC/non-PIC, this we'll have to duplicate
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2521 # the extraction.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2522 reload_conv_objs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2523 gentop=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2524 # reload_cmds runs $LD directly, so let us get rid of
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2525 # -Wl from whole_archive_flag_spec
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2526 wl=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2527
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2528 if test -n "$convenience"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2529 if test -n "$whole_archive_flag_spec"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2530 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2531 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2532 gentop="$output_objdir/${obj}x"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2533 $show "${rm}r $gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2534 $run ${rm}r "$gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2535 $show "mkdir $gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2536 $run mkdir "$gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2537 status=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2538 if test $status -ne 0 && test ! -d "$gentop"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2539 exit $status
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2540 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2541 generated="$generated $gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2542
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2543 for xlib in $convenience; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2544 # Extract the objects.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2545 case "$xlib" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2546 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2547 *) xabs=`pwd`"/$xlib" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2548 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2549 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2550 xdir="$gentop/$xlib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2551
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2552 $show "${rm}r $xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2553 $run ${rm}r "$xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2554 $show "mkdir $xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2555 $run mkdir "$xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2556 status=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2557 if test $status -ne 0 && test ! -d "$xdir"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2558 exit $status
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2559 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2560 $show "(cd $xdir && $AR x $xabs)"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2561 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2562
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2563 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2564 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2565 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2566 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2567
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2568 # Create the old-style object.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2569 reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2570
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2571 output="$obj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2572 eval cmds=\"$reload_cmds\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2573 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2574 for cmd in $cmds; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2575 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2576 $show "$cmd"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2577 $run eval "$cmd" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2578 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2579 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2580
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2581 # Exit if we aren't doing a library object file.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2582 if test -z "$libobj"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2583 if test -n "$gentop"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2584 $show "${rm}r $gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2585 $run ${rm}r $gentop
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2586 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2587
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2588 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2589 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2590
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2591 if test "$build_libtool_libs" != yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2592 if test -n "$gentop"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2593 $show "${rm}r $gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2594 $run ${rm}r $gentop
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2595 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2596
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2597 # Create an invalid libtool object if no PIC, so that we don't
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2598 # accidentally link it into a program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2599 $show "echo timestamp > $libobj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2600 $run eval "echo timestamp > $libobj" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2601 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2602 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2603
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2604 if test -n "$pic_flag"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2605 # Only do commands if we really have different PIC objects.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2606 reload_objs="$libobjs $reload_conv_objs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2607 output="$libobj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2608 eval cmds=\"$reload_cmds\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2609 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2610 for cmd in $cmds; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2611 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2612 $show "$cmd"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2613 $run eval "$cmd" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2614 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2615 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2616 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2617 # Just create a symlink.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2618 $show $rm $libobj
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2619 $run $rm $libobj
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2620 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2621 if test "X$xdir" = "X$libobj"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2622 xdir="."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2623 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2624 xdir="$xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2625 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2626 baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2627 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2628 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2629 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2630 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2631
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2632 if test -n "$gentop"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2633 $show "${rm}r $gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2634 $run ${rm}r $gentop
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2635 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2636
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2637 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2638 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2639
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2640 # Anything else should be a program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2641 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2642 if test -n "$vinfo"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2643 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2644 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2645
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2646 if test -n "$release"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2647 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2648 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2649
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2650 if test "$preload" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2651 if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2652 test "$dlopen_self_static" = unknown; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2653 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2654 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2655 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2656
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2657 if test -n "$rpath$xrpath"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2658 # If the user specified any rpath flags, then add them.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2659 for libdir in $rpath $xrpath; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2660 # This is the magic to use -rpath.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2661 case "$compile_rpath " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2662 *" $libdir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2663 *) compile_rpath="$compile_rpath $libdir" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2664 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2665 case "$finalize_rpath " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2666 *" $libdir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2667 *) finalize_rpath="$finalize_rpath $libdir" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2668 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2669 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2670 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2671
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2672 # Now hardcode the library paths
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2673 rpath=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2674 hardcode_libdirs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2675 for libdir in $compile_rpath $finalize_rpath; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2676 if test -n "$hardcode_libdir_flag_spec"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2677 if test -n "$hardcode_libdir_separator"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2678 if test -z "$hardcode_libdirs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2679 hardcode_libdirs="$libdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2680 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2681 # Just accumulate the unique libdirs.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2682 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2683 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2684 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2685 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2686 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2687 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2688 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2689 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2690 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2691 eval flag=\"$hardcode_libdir_flag_spec\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2692 rpath="$rpath $flag"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2693 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2694 elif test -n "$runpath_var"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2695 case "$perm_rpath " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2696 *" $libdir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2697 *) perm_rpath="$perm_rpath $libdir" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2698 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2699 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2700 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2701 # Substitute the hardcoded libdirs into the rpath.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2702 if test -n "$hardcode_libdir_separator" &&
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2703 test -n "$hardcode_libdirs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2704 libdir="$hardcode_libdirs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2705 eval rpath=\" $hardcode_libdir_flag_spec\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2706 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2707 compile_rpath="$rpath"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2708
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2709 rpath=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2710 hardcode_libdirs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2711 for libdir in $finalize_rpath; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2712 if test -n "$hardcode_libdir_flag_spec"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2713 if test -n "$hardcode_libdir_separator"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2714 if test -z "$hardcode_libdirs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2715 hardcode_libdirs="$libdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2716 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2717 # Just accumulate the unique libdirs.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2718 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2719 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2720 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2721 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2722 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2723 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2724 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2725 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2726 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2727 eval flag=\"$hardcode_libdir_flag_spec\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2728 rpath="$rpath $flag"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2729 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2730 elif test -n "$runpath_var"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2731 case "$finalize_perm_rpath " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2732 *" $libdir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2733 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2734 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2735 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2736 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2737 # Substitute the hardcoded libdirs into the rpath.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2738 if test -n "$hardcode_libdir_separator" &&
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2739 test -n "$hardcode_libdirs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2740 libdir="$hardcode_libdirs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2741 eval rpath=\" $hardcode_libdir_flag_spec\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2742 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2743 finalize_rpath="$rpath"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2744
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2745 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2746 if test "X$output_objdir" = "X$output"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2747 output_objdir="$objdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2748 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2749 output_objdir="$output_objdir/$objdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2750 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2751
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2752 # Create the binary in the object directory, then wrap it.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2753 if test ! -d $output_objdir; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2754 $show "$mkdir $output_objdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2755 $run $mkdir $output_objdir
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2756 status=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2757 if test $status -ne 0 && test ! -d $output_objdir; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2758 exit $status
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2759 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2760 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2761
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2762 if test -n "$libobjs" && test "$build_old_libs" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2763 # Transform all the library objects into standard objects.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2764 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2765 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2766 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2767
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2768 dlsyms=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2769 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2770 if test -n "$NM" && test -n "$global_symbol_pipe"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2771 dlsyms="${outputname}S.c"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2772 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2773 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2774 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2775 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2776
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2777 if test -n "$dlsyms"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2778 case "$dlsyms" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2779 "") ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2780 *.c)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2781 # Discover the nlist of each of the dlfiles.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2782 nlist="$output_objdir/${outputname}.nm"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2783
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2784 $show "$rm $nlist ${nlist}S ${nlist}T"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2785 $run $rm "$nlist" "${nlist}S" "${nlist}T"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2786
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2787 # Parse the name list into a source file.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2788 $show "creating $output_objdir/$dlsyms"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2789
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2790 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2791 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2792 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2793
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2794 #ifdef __cplusplus
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2795 extern \"C\" {
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2796 #endif
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2797
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2798 /* Prevent the only kind of declaration conflicts we can make. */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2799 #define lt_preloaded_symbols some_other_symbol
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2800
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2801 /* External symbol declarations for the compiler. */\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2802 "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2803
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2804 if test "$dlself" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2805 $show "generating symbol list for \`$output'"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2806
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2807 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2808
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2809 # Add our own program objects to the symbol list.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2810 progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2811 for arg in $progfiles; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2812 $show "extracting global C symbols from \`$arg'"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2813 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2814 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2815
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2816 if test -n "$exclude_expsyms"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2817 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2818 $run eval '$mv "$nlist"T "$nlist"'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2819 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2820
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2821 if test -n "$export_symbols_regex"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2822 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2823 $run eval '$mv "$nlist"T "$nlist"'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2824 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2825
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2826 # Prepare the list of exported symbols
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2827 if test -z "$export_symbols"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2828 export_symbols="$output_objdir/$output.exp"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2829 $run $rm $export_symbols
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2830 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2831 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2832 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2833 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2834 $run eval 'mv "$nlist"T "$nlist"'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2835 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2836 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2837
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2838 for arg in $dlprefiles; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2839 $show "extracting global C symbols from \`$arg'"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2840 name=`echo "$arg" | sed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2841 $run eval 'echo ": $name " >> "$nlist"'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2842 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2843 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2844
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2845 if test -z "$run"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2846 # Make sure we have at least an empty file.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2847 test -f "$nlist" || : > "$nlist"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2848
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2849 if test -n "$exclude_expsyms"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2850 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2851 $mv "$nlist"T "$nlist"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2852 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2853
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2854 # Try sorting and uniquifying the output.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2855 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2856 :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2857 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2858 grep -v "^: " < "$nlist" > "$nlist"S
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2859 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2860
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2861 if test -f "$nlist"S; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2862 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2863 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2864 echo '/* NONE */' >> "$output_objdir/$dlsyms"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2865 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2866
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2867 $echo >> "$output_objdir/$dlsyms" "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2868
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2869 #undef lt_preloaded_symbols
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2870
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2871 #if defined (__STDC__) && __STDC__
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2872 # define lt_ptr_t void *
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2873 #else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2874 # define lt_ptr_t char *
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2875 # define const
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2876 #endif
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2877
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2878 /* The mapping between symbol names and symbols. */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2879 const struct {
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2880 const char *name;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2881 lt_ptr_t address;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2882 }
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2883 lt_preloaded_symbols[] =
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2884 {\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2885 "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2886
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2887 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2888 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2889 < "$nlist" >> "$output_objdir/$dlsyms"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2890
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2891 $echo >> "$output_objdir/$dlsyms" "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2892 {0, (lt_ptr_t) 0}
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2893 };
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2894
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2895 /* This works around a problem in FreeBSD linker */
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2896 #ifdef FREEBSD_WORKAROUND
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2897 static const void *lt_preloaded_setup() {
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2898 return lt_preloaded_symbols;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2899 }
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2900 #endif
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2901
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2902 #ifdef __cplusplus
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2903 }
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2904 #endif\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2905 "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2906 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2907
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2908 pic_flag_for_symtable=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2909 case "$host" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2910 # compiling the symbol table file with pic_flag works around
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2911 # a FreeBSD bug that causes programs to crash when -lm is
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2912 # linked before any other PIC object. But we must not use
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2913 # pic_flag when linking with -static. The problem exists in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2914 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2915 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2916 case "$compile_command " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2917 *" -static "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2918 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2919 esac;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2920 *-*-hpux*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2921 case "$compile_command " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2922 *" -static "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2923 *) pic_flag_for_symtable=" $pic_flag -DPIC";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2924 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2925 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2926
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2927 # Now compile the dynamic symbol file.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2928 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2929 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2930
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2931 # Clean up the generated files.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2932 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2933 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2934
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2935 # Transform the symbol file into the correct name.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2936 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2937 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2938 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2939 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2940 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2941 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2942 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2943 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2944 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2945 # We keep going just in case the user didn't refer to
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2946 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2947 # really was required.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2948
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2949 # Nullify the symbol file.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2950 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2951 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2952 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2953
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2954 if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2955 # Replace the output file specification.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2956 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2957 link_command="$compile_command$compile_rpath"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2958
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2959 # We have no uninstalled library dependencies, so finalize right now.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2960 $show "$link_command"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2961 $run eval "$link_command"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2962 status=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2963
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2964 # Delete the generated files.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2965 if test -n "$dlsyms"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2966 $show "$rm $output_objdir/${outputname}S.${objext}"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2967 $run $rm "$output_objdir/${outputname}S.${objext}"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2968 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2969
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2970 exit $status
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2971 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2972
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2973 if test -n "$shlibpath_var"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2974 # We should set the shlibpath_var
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2975 rpath=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2976 for dir in $temp_rpath; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2977 case "$dir" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2978 [\\/]* | [A-Za-z]:[\\/]*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2979 # Absolute path.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2980 rpath="$rpath$dir:"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2981 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2982 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2983 # Relative path: add a thisdir entry.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2984 rpath="$rpath\$thisdir/$dir:"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2985 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2986 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2987 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2988 temp_rpath="$rpath"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2989 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2990
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2991 if test -n "$compile_shlibpath$finalize_shlibpath"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2992 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2993 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2994 if test -n "$finalize_shlibpath"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2995 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2996 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2997
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2998 compile_var=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2999 finalize_var=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3000 if test -n "$runpath_var"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3001 if test -n "$perm_rpath"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3002 # We should set the runpath_var.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3003 rpath=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3004 for dir in $perm_rpath; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3005 rpath="$rpath$dir:"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3006 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3007 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3008 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3009 if test -n "$finalize_perm_rpath"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3010 # We should set the runpath_var.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3011 rpath=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3012 for dir in $finalize_perm_rpath; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3013 rpath="$rpath$dir:"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3014 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3015 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3016 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3017 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3018
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3019 if test "$hardcode_action" = relink; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3020 # Fast installation is not supported
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3021 link_command="$compile_var$compile_command$compile_rpath"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3022 relink_command="$finalize_var$finalize_command$finalize_rpath"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3023
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3024 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3025 $echo "$modename: \`$output' will be relinked during installation" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3026 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3027 if test "$fast_install" != no; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3028 link_command="$finalize_var$compile_command$finalize_rpath"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3029 if test "$fast_install" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3030 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3031 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3032 # fast_install is set to needless
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3033 relink_command=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3034 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3035 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3036 link_command="$compile_var$compile_command$compile_rpath"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3037 relink_command="$finalize_var$finalize_command$finalize_rpath"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3038 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3039 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3040
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3041 # Replace the output file specification.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3042 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3043
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3044 # Delete the old output files.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3045 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3046
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3047 $show "$link_command"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3048 $run eval "$link_command" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3049
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3050 # Now create the wrapper script.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3051 $show "creating $output"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3052
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3053 # Quote the relink command for shipping.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3054 if test -n "$relink_command"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3055 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3056 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3057
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3058 # Quote $echo for shipping.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3059 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3060 case "$0" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3061 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3062 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3063 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3064 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3065 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3066 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3067 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3068
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3069 # Only actually do things if our run command is non-null.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3070 if test -z "$run"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3071 # win32 will think the script is a binary if it has
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3072 # a .exe suffix, so we strip it off here.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3073 case $output in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3074 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3075 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3076 $rm $output
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3077 trap "$rm $output; exit 1" 1 2 15
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3078
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3079 $echo > $output "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3080 #! $SHELL
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3081
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3082 # $output - temporary wrapper script for $objdir/$outputname
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3083 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3084 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3085 # The $output program cannot be directly executed until all the libtool
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3086 # libraries that it depends on are installed.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3087 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3088 # This wrapper script should never be moved out of the build directory.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3089 # If it is, it will not operate correctly.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3090
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3091 # Sed substitution that helps us do robust quoting. It backslashifies
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3092 # metacharacters that are still active within double-quoted strings.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3093 Xsed='sed -e 1s/^X//'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3094 sed_quote_subst='$sed_quote_subst'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3095
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3096 # The HP-UX ksh and POSIX shell print the target directory to stdout
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3097 # if CDPATH is set.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3098 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3099
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3100 relink_command=\"$relink_command\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3101
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3102 # This environment variable determines our operation mode.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3103 if test \"\$libtool_install_magic\" = \"$magic\"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3104 # install mode needs the following variable:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3105 link_against_libtool_libs='$link_against_libtool_libs'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3106 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3107 # When we are sourced in execute mode, \$file and \$echo are already set.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3108 if test \"\$libtool_execute_magic\" != \"$magic\"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3109 echo=\"$qecho\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3110 file=\"\$0\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3111 # Make sure echo works.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3112 if test \"X\$1\" = X--no-reexec; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3113 # Discard the --no-reexec flag, and continue.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3114 shift
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3115 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3116 # Yippee, \$echo works!
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3117 :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3118 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3119 # Restart under the correct shell, and then maybe \$echo will work.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3120 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3121 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3122 fi\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3123 "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3124 $echo >> $output "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3125
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3126 # Find the directory that this script lives in.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3127 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3128 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3129
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3130 # Follow symbolic links until we get to the real thisdir.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3131 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3132 while test -n \"\$file\"; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3133 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3134
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3135 # If there was a directory component, then change thisdir.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3136 if test \"x\$destdir\" != \"x\$file\"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3137 case \"\$destdir\" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3138 [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3139 *) thisdir=\"\$thisdir/\$destdir\" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3140 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3141 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3142
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3143 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3144 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3145 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3146
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3147 # Try to get the absolute directory name.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3148 absdir=\`cd \"\$thisdir\" && pwd\`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3149 test -n \"\$absdir\" && thisdir=\"\$absdir\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3150 "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3151
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3152 if test "$fast_install" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3153 echo >> $output "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3154 program=lt-'$outputname'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3155 progdir=\"\$thisdir/$objdir\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3156
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3157 if test ! -f \"\$progdir/\$program\" || \\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3158 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3159 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3160
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3161 file=\"\$\$-\$program\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3162
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3163 if test ! -d \"\$progdir\"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3164 $mkdir \"\$progdir\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3165 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3166 $rm \"\$progdir/\$file\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3167 fi"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3168
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3169 echo >> $output "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3170
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3171 # relink executable if necessary
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3172 if test -n \"\$relink_command\"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3173 if (cd \"\$thisdir\" && eval \$relink_command); then :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3174 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3175 $rm \"\$progdir/\$file\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3176 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3177 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3178 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3179
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3180 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3181 { $rm \"\$progdir/\$program\";
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3182 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3183 $rm \"\$progdir/\$file\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3184 fi"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3185 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3186 echo >> $output "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3187 program='$outputname'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3188 progdir=\"\$thisdir/$objdir\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3189 "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3190 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3191
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3192 echo >> $output "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3193
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3194 if test -f \"\$progdir/\$program\"; then"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3195
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3196 # Export our shlibpath_var if we have one.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3197 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3198 $echo >> $output "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3199 # Add our own library path to $shlibpath_var
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3200 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3201
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3202 # Some systems cannot cope with colon-terminated $shlibpath_var
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3203 # The second colon is a workaround for a bug in BeOS R4 sed
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3204 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3205
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3206 export $shlibpath_var
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3207 "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3208 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3209
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3210 # fixup the dll searchpath if we need to.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3211 if test -n "$dllsearchpath"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3212 $echo >> $output "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3213 # Add the dll search path components to the executable PATH
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3214 PATH=$dllsearchpath:\$PATH
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3215 "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3216 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3217
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3218 $echo >> $output "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3219 if test \"\$libtool_execute_magic\" != \"$magic\"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3220 # Run the actual program with our arguments.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3221 "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3222 case $host in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3223 # win32 systems need to use the prog path for dll
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3224 # lookup to work
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3225 *-*-cygwin*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3226 $echo >> $output "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3227 exec \$progdir/\$program \${1+\"\$@\"}
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3228 "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3229 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3230
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3231 # Backslashes separate directories on plain windows
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3232 *-*-mingw | *-*-os2*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3233 $echo >> $output "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3234 exec \$progdir\\\\\$program \${1+\"\$@\"}
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3235 "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3236 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3237
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3238 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3239 $echo >> $output "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3240 # Export the path to the program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3241 PATH=\"\$progdir:\$PATH\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3242 export PATH
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3243
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3244 exec \$program \${1+\"\$@\"}
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3245 "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3246 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3247 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3248 $echo >> $output "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3249 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3250 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3251 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3252 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3253 # The program doesn't exist.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3254 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3255 \$echo \"This script is just a wrapper for \$program.\" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3256 echo \"See the $PACKAGE documentation for more information.\" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3257 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3258 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3259 fi\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3260 "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3261 chmod +x $output
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3262 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3263 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3264 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3265 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3266
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3267 # See if we need to build an old-fashioned archive.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3268 for oldlib in $oldlibs; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3269
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3270 if test "$build_libtool_libs" = convenience; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3271 oldobjs="$libobjs_save"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3272 addlibs="$convenience"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3273 build_libtool_libs=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3274 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3275 if test "$build_libtool_libs" = module; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3276 oldobjs="$libobjs_save"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3277 build_libtool_libs=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3278 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3279 oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3280 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3281 addlibs="$old_convenience"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3282 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3283
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3284 if test -n "$addlibs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3285 gentop="$output_objdir/${outputname}x"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3286 $show "${rm}r $gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3287 $run ${rm}r "$gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3288 $show "mkdir $gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3289 $run mkdir "$gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3290 status=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3291 if test $status -ne 0 && test ! -d "$gentop"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3292 exit $status
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3293 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3294 generated="$generated $gentop"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3295
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3296 # Add in members from convenience archives.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3297 for xlib in $addlibs; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3298 # Extract the objects.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3299 case "$xlib" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3300 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3301 *) xabs=`pwd`"/$xlib" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3302 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3303 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3304 xdir="$gentop/$xlib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3305
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3306 $show "${rm}r $xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3307 $run ${rm}r "$xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3308 $show "mkdir $xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3309 $run mkdir "$xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3310 status=$?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3311 if test $status -ne 0 && test ! -d "$xdir"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3312 exit $status
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3313 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3314 $show "(cd $xdir && $AR x $xabs)"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3315 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3316
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3317 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3318 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3319 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3320
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3321 # Do each command in the archive commands.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3322 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3323 eval cmds=\"$old_archive_from_new_cmds\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3324 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3325 # Ensure that we have .o objects in place in case we decided
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3326 # not to build a shared library, and have fallen back to building
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3327 # static libs even though --disable-static was passed!
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3328 for oldobj in $oldobjs; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3329 if test ! -f $oldobj; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3330 xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3331 if test "X$xdir" = "X$oldobj"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3332 xdir="."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3333 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3334 xdir="$xdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3335 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3336 baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3337 obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3338 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3339 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3340 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3341 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3342
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3343 eval cmds=\"$old_archive_cmds\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3344 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3345 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3346 for cmd in $cmds; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3347 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3348 $show "$cmd"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3349 $run eval "$cmd" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3350 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3351 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3352 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3353
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3354 if test -n "$generated"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3355 $show "${rm}r$generated"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3356 $run ${rm}r$generated
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3357 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3358
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3359 # Now create the libtool archive.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3360 case "$output" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3361 *.la)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3362 old_library=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3363 test "$build_old_libs" = yes && old_library="$libname.$libext"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3364 $show "creating $output"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3365
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3366 if test -n "$xrpath"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3367 temp_xrpath=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3368 for libdir in $xrpath; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3369 temp_xrpath="$temp_xrpath -R$libdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3370 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3371 dependency_libs="$temp_xrpath $dependency_libs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3372 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3373
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3374 # Only create the output if not a dry run.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3375 if test -z "$run"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3376 for installed in no yes; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3377 if test "$installed" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3378 if test -z "$install_libdir"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3379 break
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3380 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3381 output="$output_objdir/$outputname"i
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3382 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3383 $rm $output
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3384 $echo > $output "\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3385 # $outputname - a libtool library file
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3386 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3387 #
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3388 # Please DO NOT delete this file!
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3389 # It is necessary for linking the library.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3390
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3391 # The name that we can dlopen(3).
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3392 dlname='$dlname'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3393
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3394 # Names of this library.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3395 library_names='$library_names'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3396
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3397 # The name of the static archive.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3398 old_library='$old_library'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3399
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3400 # Libraries that this one depends upon.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3401 dependency_libs='$dependency_libs'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3402
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3403 # Version information for $libname.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3404 current=$current
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3405 age=$age
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3406 revision=$revision
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3407
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3408 # Is this an already installed library?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3409 installed=$installed
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3410
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3411 # Directory that this library needs to be installed in:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3412 libdir='$install_libdir'\
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3413 "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3414 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3415 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3416
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3417 # Do a symbolic link so that the libtool archive can be found in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3418 # LD_LIBRARY_PATH before the program is installed.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3419 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3420 $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3421 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3422 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3423 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3424 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3425
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3426 # libtool install mode
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3427 install)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3428 modename="$modename: install"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3429
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3430 # There may be an optional sh(1) argument at the beginning of
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3431 # install_prog (especially on Windows NT).
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3432 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3433 # Aesthetically quote it.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3434 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3435 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3436 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3437 arg="\"$arg\""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3438 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3439 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3440 install_prog="$arg "
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3441 arg="$1"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3442 shift
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3443 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3444 install_prog=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3445 arg="$nonopt"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3446 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3447
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3448 # The real first argument should be the name of the installation program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3449 # Aesthetically quote it.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3450 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3451 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3452 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3453 arg="\"$arg\""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3454 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3455 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3456 install_prog="$install_prog$arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3457
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3458 # We need to accept at least all the BSD install flags.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3459 dest=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3460 files=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3461 opts=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3462 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3463 install_type=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3464 isdir=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3465 stripme=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3466 for arg
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3467 do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3468 if test -n "$dest"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3469 files="$files $dest"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3470 dest="$arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3471 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3472 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3473
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3474 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3475 -d) isdir=yes ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3476 -f) prev="-f" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3477 -g) prev="-g" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3478 -m) prev="-m" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3479 -o) prev="-o" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3480 -s)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3481 stripme=" -s"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3482 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3483 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3484 -*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3485
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3486 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3487 # If the previous option needed an argument, then skip it.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3488 if test -n "$prev"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3489 prev=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3490 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3491 dest="$arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3492 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3493 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3494 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3495 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3496
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3497 # Aesthetically quote the argument.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3498 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3499 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3500 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3501 arg="\"$arg\""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3502 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3503 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3504 install_prog="$install_prog $arg"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3505 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3506
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3507 if test -z "$install_prog"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3508 $echo "$modename: you must specify an install program" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3509 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3510 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3511 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3512
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3513 if test -n "$prev"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3514 $echo "$modename: the \`$prev' option requires an argument" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3515 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3516 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3517 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3518
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3519 if test -z "$files"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3520 if test -z "$dest"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3521 $echo "$modename: no file or destination specified" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3522 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3523 $echo "$modename: you must specify a destination" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3524 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3525 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3526 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3527 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3528
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3529 # Strip any trailing slash from the destination.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3530 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3531
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3532 # Check to see that the destination is a directory.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3533 test -d "$dest" && isdir=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3534 if test "$isdir" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3535 destdir="$dest"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3536 destname=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3537 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3538 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3539 test "X$destdir" = "X$dest" && destdir=.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3540 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3541
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3542 # Not a directory, so check to see that there is only one file specified.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3543 set dummy $files
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3544 if test $# -gt 2; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3545 $echo "$modename: \`$dest' is not a directory" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3546 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3547 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3548 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3549 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3550 case "$destdir" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3551 [\\/]* | [A-Za-z]:[\\/]*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3552 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3553 for file in $files; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3554 case "$file" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3555 *.lo) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3556 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3557 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3558 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3559 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3560 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3561 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3562 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3563 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3564 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3565
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3566 # This variable tells wrapper scripts just to set variables rather
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3567 # than running their programs.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3568 libtool_install_magic="$magic"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3569
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3570 staticlibs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3571 future_libdirs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3572 current_libdirs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3573 for file in $files; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3574
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3575 # Do each installation.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3576 case "$file" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3577 *.a | *.lib)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3578 # Do the static libraries later.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3579 staticlibs="$staticlibs $file"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3580 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3581
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3582 *.la)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3583 # Check to see that this really is a libtool archive.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3584 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3585 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3586 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3587 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3588 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3589 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3590
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3591 library_names=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3592 old_library=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3593 # If there is no directory component, then add one.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3594 case "$file" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3595 */* | *\\*) . $file ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3596 *) . ./$file ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3597 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3598
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3599 # Add the libdir to current_libdirs if it is the destination.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3600 if test "X$destdir" = "X$libdir"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3601 case "$current_libdirs " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3602 *" $libdir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3603 *) current_libdirs="$current_libdirs $libdir" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3604 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3605 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3606 # Note the libdir as a future libdir.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3607 case "$future_libdirs " in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3608 *" $libdir "*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3609 *) future_libdirs="$future_libdirs $libdir" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3610 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3611 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3612
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3613 dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3614 test "X$dir" = "X$file/" && dir=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3615 dir="$dir$objdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3616
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3617 # See the names of the shared library.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3618 set dummy $library_names
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3619 if test -n "$2"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3620 realname="$2"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3621 shift
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3622 shift
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3623
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3624 # Install the shared library and build the symlinks.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3625 $show "$install_prog $dir/$realname $destdir/$realname"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3626 $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3627
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3628 if test $# -gt 0; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3629 # Delete the old symlinks, and create new ones.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3630 for linkname
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3631 do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3632 if test "$linkname" != "$realname"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3633 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3634 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3635 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3636 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3637 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3638
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3639 # Do each command in the postinstall commands.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3640 lib="$destdir/$realname"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3641 eval cmds=\"$postinstall_cmds\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3642 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3643 for cmd in $cmds; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3644 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3645 $show "$cmd"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3646 $run eval "$cmd" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3647 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3648 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3649 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3650
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3651 # Install the pseudo-library for information purposes.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3652 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3653 instname="$dir/$name"i
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3654 $show "$install_prog $instname $destdir/$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3655 $run eval "$install_prog $instname $destdir/$name" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3656
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3657 # Maybe install the static library, too.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3658 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3659 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3660
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3661 *.lo)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3662 # Install (i.e. copy) a libtool object.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3663
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3664 # Figure out destination file name, if it wasn't already specified.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3665 if test -n "$destname"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3666 destfile="$destdir/$destname"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3667 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3668 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3669 destfile="$destdir/$destfile"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3670 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3671
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3672 # Deduce the name of the destination old-style object file.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3673 case "$destfile" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3674 *.lo)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3675 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3676 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3677 *.o | *.obj)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3678 staticdest="$destfile"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3679 destfile=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3680 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3681 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3682 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3683 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3684 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3685 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3686 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3687
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3688 # Install the libtool object if requested.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3689 if test -n "$destfile"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3690 $show "$install_prog $file $destfile"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3691 $run eval "$install_prog $file $destfile" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3692 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3693
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3694 # Install the old object if enabled.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3695 if test "$build_old_libs" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3696 # Deduce the name of the old-style object file.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3697 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3698
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3699 $show "$install_prog $staticobj $staticdest"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3700 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3701 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3702 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3703 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3704
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3705 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3706 # Figure out destination file name, if it wasn't already specified.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3707 if test -n "$destname"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3708 destfile="$destdir/$destname"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3709 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3710 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3711 destfile="$destdir/$destfile"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3712 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3713
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3714 # Do a test to see if this is really a libtool program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3715 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3716 link_against_libtool_libs=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3717 relink_command=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3718
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3719 # If there is no directory component, then add one.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3720 case "$file" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3721 */* | *\\*) . $file ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3722 *) . ./$file ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3723 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3724
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3725 # Check the variables that should have been set.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3726 if test -z "$link_against_libtool_libs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3727 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3728 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3729 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3730
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3731 finalize=yes
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3732 for lib in $link_against_libtool_libs; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3733 # Check to see that each library is installed.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3734 libdir=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3735 if test -f "$lib"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3736 # If there is no directory component, then add one.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3737 case "$lib" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3738 */* | *\\*) . $lib ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3739 *) . ./$lib ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3740 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3741 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3742 libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3743 if test -n "$libdir" && test ! -f "$libfile"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3744 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3745 finalize=no
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3746 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3747 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3748
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3749 outputname=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3750 if test "$fast_install" = no && test -n "$relink_command"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3751 if test "$finalize" = yes && test -z "$run"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3752 tmpdir="/tmp"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3753 test -n "$TMPDIR" && tmpdir="$TMPDIR"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3754 tmpdir="$tmpdir/libtool-$$"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3755 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3756 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3757 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3758 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3759 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3760 outputname="$tmpdir/$file"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3761 # Replace the output file specification.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3762 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3763
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3764 $show "$relink_command"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3765 if $run eval "$relink_command"; then :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3766 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3767 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3768 ${rm}r "$tmpdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3769 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3770 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3771 file="$outputname"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3772 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3773 $echo "$modename: warning: cannot relink \`$file'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3774 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3775 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3776 # Install the binary that we compiled earlier.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3777 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3778 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3779 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3780
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3781 $show "$install_prog$stripme $file $destfile"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3782 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3783 test -n "$outputname" && ${rm}r "$tmpdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3784 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3785 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3786 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3787
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3788 for file in $staticlibs; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3789 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3790
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3791 # Set up the ranlib parameters.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3792 oldlib="$destdir/$name"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3793
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3794 $show "$install_prog $file $oldlib"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3795 $run eval "$install_prog \$file \$oldlib" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3796
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3797 # Do each command in the postinstall commands.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3798 eval cmds=\"$old_postinstall_cmds\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3799 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3800 for cmd in $cmds; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3801 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3802 $show "$cmd"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3803 $run eval "$cmd" || exit $?
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3804 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3805 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3806 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3807
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3808 if test -n "$future_libdirs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3809 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3810 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3811
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3812 if test -n "$current_libdirs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3813 # Maybe just do a dry run.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3814 test -n "$run" && current_libdirs=" -n$current_libdirs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3815 exec $SHELL $0 --finish$current_libdirs
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3816 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3817 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3818
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3819 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3820 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3821
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3822 # libtool finish mode
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3823 finish)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3824 modename="$modename: finish"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3825 libdirs="$nonopt"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3826 admincmds=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3827
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3828 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3829 for dir
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3830 do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3831 libdirs="$libdirs $dir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3832 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3833
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3834 for libdir in $libdirs; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3835 if test -n "$finish_cmds"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3836 # Do each command in the finish commands.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3837 eval cmds=\"$finish_cmds\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3838 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3839 for cmd in $cmds; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3840 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3841 $show "$cmd"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3842 $run eval "$cmd" || admincmds="$admincmds
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3843 $cmd"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3844 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3845 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3846 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3847 if test -n "$finish_eval"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3848 # Do the single finish_eval.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3849 eval cmds=\"$finish_eval\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3850 $run eval "$cmds" || admincmds="$admincmds
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3851 $cmds"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3852 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3853 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3854 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3855
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3856 # Exit here if they wanted silent mode.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3857 test "$show" = : && exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3858
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3859 echo "----------------------------------------------------------------------"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3860 echo "Libraries have been installed in:"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3861 for libdir in $libdirs; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3862 echo " $libdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3863 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3864 echo
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3865 echo "If you ever happen to want to link against installed libraries"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3866 echo "in a given directory, LIBDIR, you must either use libtool, and"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3867 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3868 echo "flag during linking and do at least one of the following:"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3869 if test -n "$shlibpath_var"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3870 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3871 echo " during execution"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3872 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3873 if test -n "$runpath_var"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3874 echo " - add LIBDIR to the \`$runpath_var' environment variable"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3875 echo " during linking"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3876 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3877 if test -n "$hardcode_libdir_flag_spec"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3878 libdir=LIBDIR
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3879 eval flag=\"$hardcode_libdir_flag_spec\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3880
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3881 echo " - use the \`$flag' linker flag"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3882 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3883 if test -n "$admincmds"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3884 echo " - have your system administrator run these commands:$admincmds"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3885 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3886 if test -f /etc/ld.so.conf; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3887 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3888 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3889 echo
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3890 echo "See any operating system documentation about shared libraries for"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3891 echo "more information, such as the ld(1) and ld.so(8) manual pages."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3892 echo "----------------------------------------------------------------------"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3893 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3894 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3895
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3896 # libtool execute mode
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3897 execute)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3898 modename="$modename: execute"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3899
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3900 # The first argument is the command name.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3901 cmd="$nonopt"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3902 if test -z "$cmd"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3903 $echo "$modename: you must specify a COMMAND" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3904 $echo "$help"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3905 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3906 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3907
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3908 # Handle -dlopen flags immediately.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3909 for file in $execute_dlfiles; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3910 if test ! -f "$file"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3911 $echo "$modename: \`$file' is not a file" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3912 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3913 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3914 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3915
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3916 dir=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3917 case "$file" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3918 *.la)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3919 # Check to see that this really is a libtool archive.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3920 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3921 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3922 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3923 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3924 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3925 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3926
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3927 # Read the libtool library.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3928 dlname=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3929 library_names=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3930
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3931 # If there is no directory component, then add one.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3932 case "$file" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3933 */* | *\\*) . $file ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3934 *) . ./$file ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3935 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3936
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3937 # Skip this library if it cannot be dlopened.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3938 if test -z "$dlname"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3939 # Warn if it was a shared library.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3940 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3941 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3942 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3943
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3944 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3945 test "X$dir" = "X$file" && dir=.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3946
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3947 if test -f "$dir/$objdir/$dlname"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3948 dir="$dir/$objdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3949 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3950 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3951 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3952 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3953 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3954
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3955 *.lo)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3956 # Just add the directory containing the .lo file.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3957 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3958 test "X$dir" = "X$file" && dir=.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3959 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3960
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3961 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3962 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3963 continue
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3964 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3965 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3966
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3967 # Get the absolute pathname.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3968 absdir=`cd "$dir" && pwd`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3969 test -n "$absdir" && dir="$absdir"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3970
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3971 # Now add the directory to shlibpath_var.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3972 if eval "test -z \"\$$shlibpath_var\""; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3973 eval "$shlibpath_var=\"\$dir\""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3974 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3975 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3976 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3977 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3978
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3979 # This variable tells wrapper scripts just to set shlibpath_var
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3980 # rather than running their programs.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3981 libtool_execute_magic="$magic"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3982
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3983 # Check if any of the arguments is a wrapper script.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3984 args=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3985 for file
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3986 do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3987 case "$file" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3988 -*) ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3989 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3990 # Do a test to see if this is really a libtool program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3991 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3992 # If there is no directory component, then add one.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3993 case "$file" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3994 */* | *\\*) . $file ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3995 *) . ./$file ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3996 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3997
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3998 # Transform arg to wrapped name.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3999 file="$progdir/$program"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4000 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4001 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4002 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4003 # Quote arguments (to preserve shell metacharacters).
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4004 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4005 args="$args \"$file\""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4006 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4007
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4008 if test -z "$run"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4009 if test -n "$shlibpath_var"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4010 # Export the shlibpath_var.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4011 eval "export $shlibpath_var"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4012 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4013
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4014 # Restore saved enviroment variables
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4015 if test "${save_LC_ALL+set}" = set; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4016 LC_ALL="$save_LC_ALL"; export LC_ALL
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4017 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4018 if test "${save_LANG+set}" = set; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4019 LANG="$save_LANG"; export LANG
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4020 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4021
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4022 # Now actually exec the command.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4023 eval "exec \$cmd$args"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4024
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4025 $echo "$modename: cannot exec \$cmd$args"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4026 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4027 else
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4028 # Display what would be done.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4029 if test -n "$shlibpath_var"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4030 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4031 $echo "export $shlibpath_var"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4032 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4033 $echo "$cmd$args"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4034 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4035 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4036 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4037
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4038 # libtool uninstall mode
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4039 uninstall)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4040 modename="$modename: uninstall"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4041 rm="$nonopt"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4042 files=
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4043
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4044 for arg
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4045 do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4046 case "$arg" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4047 -*) rm="$rm $arg" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4048 *) files="$files $arg" ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4049 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4050 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4051
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4052 if test -z "$rm"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4053 $echo "$modename: you must specify an RM program" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4054 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4055 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4056 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4057
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4058 for file in $files; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4059 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4060 test "X$dir" = "X$file" && dir=.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4061 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4062
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4063 rmfiles="$file"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4064
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4065 case "$name" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4066 *.la)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4067 # Possibly a libtool archive, so verify it.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4068 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4069 . $dir/$name
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4070
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4071 # Delete the libtool libraries and symlinks.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4072 for n in $library_names; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4073 rmfiles="$rmfiles $dir/$n"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4074 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4075 test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4076
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4077 $show "$rm $rmfiles"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4078 $run $rm $rmfiles
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4079
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4080 if test -n "$library_names"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4081 # Do each command in the postuninstall commands.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4082 eval cmds=\"$postuninstall_cmds\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4083 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4084 for cmd in $cmds; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4085 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4086 $show "$cmd"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4087 $run eval "$cmd"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4088 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4089 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4090 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4091
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4092 if test -n "$old_library"; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4093 # Do each command in the old_postuninstall commands.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4094 eval cmds=\"$old_postuninstall_cmds\"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4095 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4096 for cmd in $cmds; do
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4097 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4098 $show "$cmd"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4099 $run eval "$cmd"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4100 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4101 IFS="$save_ifs"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4102 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4103
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4104 # FIXME: should reinstall the best remaining shared library.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4105 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4106 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4107
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4108 *.lo)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4109 if test "$build_old_libs" = yes; then
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4110 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4111 rmfiles="$rmfiles $dir/$oldobj"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4112 fi
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4113 $show "$rm $rmfiles"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4114 $run $rm $rmfiles
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4115 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4116
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4117 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4118 $show "$rm $rmfiles"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4119 $run $rm $rmfiles
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4120 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4121 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4122 done
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4123 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4124 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4125
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4126 "")
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4127 $echo "$modename: you must specify a MODE" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4128 $echo "$generic_help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4129 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4130 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4131 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4132
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4133 $echo "$modename: invalid operation mode \`$mode'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4134 $echo "$generic_help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4135 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4136 fi # test -z "$show_help"
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4137
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4138 # We need to display help for each of the modes.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4139 case "$mode" in
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4140 "") $echo \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4141 "Usage: $modename [OPTION]... [MODE-ARG]...
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4142
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4143 Provide generalized library-building support services.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4144
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4145 --config show all configuration variables
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4146 --debug enable verbose shell tracing
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4147 -n, --dry-run display commands without modifying any files
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4148 --features display basic configuration information and exit
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4149 --finish same as \`--mode=finish'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4150 --help display this help message and exit
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4151 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4152 --quiet same as \`--silent'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4153 --silent don't print informational messages
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4154 --version print version information
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4155
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4156 MODE must be one of the following:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4157
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4158 compile compile a source file into a libtool object
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4159 execute automatically set library path, then run a program
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4160 finish complete the installation of libtool libraries
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4161 install install libraries or executables
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4162 link create a library or an executable
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4163 uninstall remove libraries from an installed directory
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4164
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4165 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4166 a more detailed description of MODE."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4167 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4168 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4169
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4170 compile)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4171 $echo \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4172 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4173
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4174 Compile a source file into a libtool library object.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4175
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4176 This mode accepts the following additional options:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4177
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4178 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4179 -static always build a \`.o' file suitable for static linking
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4180
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4181 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4182 from the given SOURCEFILE.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4183
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4184 The output file name is determined by removing the directory component from
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4185 SOURCEFILE, then substituting the C source code suffix \`.c' with the
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4186 library object suffix, \`.lo'."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4187 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4188
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4189 execute)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4190 $echo \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4191 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4192
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4193 Automatically set library path, then run a program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4194
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4195 This mode accepts the following additional options:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4196
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4197 -dlopen FILE add the directory containing FILE to the library path
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4198
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4199 This mode sets the library path environment variable according to \`-dlopen'
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4200 flags.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4201
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4202 If any of the ARGS are libtool executable wrappers, then they are translated
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4203 into their corresponding uninstalled binary, and any of their required library
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4204 directories are added to the library path.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4205
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4206 Then, COMMAND is executed, with ARGS as arguments."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4207 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4208
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4209 finish)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4210 $echo \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4211 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4212
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4213 Complete the installation of libtool libraries.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4214
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4215 Each LIBDIR is a directory that contains libtool libraries.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4216
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4217 The commands that this mode executes may require superuser privileges. Use
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4218 the \`--dry-run' option if you just want to see what would be executed."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4219 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4220
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4221 install)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4222 $echo \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4223 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4224
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4225 Install executables or libraries.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4226
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4227 INSTALL-COMMAND is the installation command. The first component should be
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4228 either the \`install' or \`cp' program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4229
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4230 The rest of the components are interpreted as arguments to that command (only
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4231 BSD-compatible install options are recognized)."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4232 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4233
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4234 link)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4235 $echo \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4236 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4237
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4238 Link object files or libraries together to form another library, or to
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4239 create an executable program.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4240
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4241 LINK-COMMAND is a command using the C compiler that you would use to create
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4242 a program from several object files.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4243
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4244 The following components of LINK-COMMAND are treated specially:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4245
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4246 -all-static do not do any dynamic linking at all
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4247 -avoid-version do not add a version suffix if possible
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4248 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4249 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4250 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4251 -export-symbols SYMFILE
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4252 try to export only the symbols listed in SYMFILE
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4253 -export-symbols-regex REGEX
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4254 try to export only the symbols matching REGEX
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4255 -LLIBDIR search LIBDIR for required installed libraries
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4256 -lNAME OUTPUT-FILE requires the installed library libNAME
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4257 -module build a library that can dlopened
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4258 -no-undefined declare that a library does not refer to external symbols
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4259 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4260 -release RELEASE specify package release information
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4261 -rpath LIBDIR the created library will eventually be installed in LIBDIR
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4262 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4263 -static do not do any dynamic linking of libtool libraries
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4264 -version-info CURRENT[:REVISION[:AGE]]
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4265 specify library version info [each variable defaults to 0]
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4266
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4267 All other options (arguments beginning with \`-') are ignored.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4268
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4269 Every other argument is treated as a filename. Files ending in \`.la' are
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4270 treated as uninstalled libtool libraries, other files are standard or library
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4271 object files.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4272
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4273 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4274 only library objects (\`.lo' files) may be specified, and \`-rpath' is
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4275 required, except when creating a convenience library.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4276
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4277 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4278 using \`ar' and \`ranlib', or on Windows using \`lib'.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4279
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4280 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4281 is created, otherwise an executable program is created."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4282 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4283
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4284 uninstall)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4285 $echo \
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4286 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4287
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4288 Remove libraries from an installation directory.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4289
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4290 RM is the name of the program to use to delete files associated with each FILE
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4291 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4292 to RM.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4293
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4294 If FILE is a libtool library, all the files associated with it are deleted.
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4295 Otherwise, only FILE itself is deleted using RM."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4296 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4297
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4298 *)
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4299 $echo "$modename: invalid operation mode \`$mode'" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4300 $echo "$help" 1>&2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4301 exit 1
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4302 ;;
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4303 esac
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4304
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4305 echo
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4306 $echo "Try \`$modename --help' for more information about other modes."
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4307
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4308 exit 0
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4309
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4310 # Local Variables:
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4311 # mode:shell-script
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4312 # sh-indentation:2
cee26d04d0ca Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4313 # End: