3 XCOMM $XConsortium: mergelib.cpp,v 1.4 94/04/17 20:10:43 rws Exp $
5 XCOMM Copyright (c) 1989 X Consortium
7 XCOMM Permission is hereby granted, free of charge, to any person obtaining a copy
8 XCOMM of this software and associated documentation files (the "Software"), to deal
9 XCOMM in the Software without restriction, including without limitation the rights
10 XCOMM to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 XCOMM copies of the Software, and to permit persons to whom the Software is
12 XCOMM furnished to do so, subject to the following conditions:
14 XCOMM The above copyright notice and this permission notice shall be included in
15 XCOMM all copies or substantial portions of the Software.
17 XCOMM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 XCOMM IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 XCOMM FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 XCOMM X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 XCOMM AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 XCOMM CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 XCOMM Except as contained in this notice, the name of the X Consortium shall not be
25 XCOMM used in advertising or otherwise to promote the sale, use or other dealings
26 XCOMM in this Software without prior written authorization from the X Consortium.
28 XCOMM Author: Jim Fulton, MIT X Consortium
30 XCOMM mergelib - merge one library into another; this is commonly used by X
31 XCOMM to add the extension library into the base Xlib.
34 usage="usage: $0 to-library from-library [object-filename-prefix]"
40 *) echo "$usage" 1>&2; exit 1 ;;
46 if [ ! -f $fromlib ]; then
47 echo "$0: no such from-library $fromlib" 1>&2
51 if [ ! -f $tolib ]; then
52 echo "$0: no such to-library $tolib" 1>&2
58 XCOMM Create a temp directory, and figure out how to reference the
59 XCOMM object files from it (i.e. relative vs. absolute path names).
67 if [ ! -d $tmpdir ]; then
68 echo "$0: unable to create temporary directory $tmpdir" 1>&2
84 XCOMM In the temp directory, extract all of the object files and prefix
85 XCOMM them with some symbol to avoid name clashes with the base library.
88 ar x ${upfrom}$fromlib
95 XCOMM Merge in the object modules, ranlib (if appropriate) and cleanup
97 ARCMD ${upto}$tolib *.o