3 XCOMM $TOG: mergelib.cpp /main/5 1998/02/06 11:24:31 kaleb $
5 XCOMM Copyright (c) 1989, 1998 The Open Group
7 XCOMM All Rights Reserved
9 XCOMM The above copyright notice and this permission notice shall be included in
10 XCOMM all copies or substantial portions of the Software.
12 XCOMM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 XCOMM IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 XCOMM FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 XCOMM OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
16 XCOMM AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
17 XCOMM CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 XCOMM Except as contained in this notice, the name of The Open Group shall not be
20 XCOMM used in advertising or otherwise to promote the sale, use or other dealings
21 XCOMM in this Software without prior written authorization from The Open Group.
23 XCOMM Author: Jim Fulton, MIT X Consortium
25 XCOMM mergelib - merge one library into another; this is commonly used by X
26 XCOMM to add the extension library into the base Xlib.
29 usage="usage: $0 to-library from-library [object-filename-prefix]"
35 *) echo "$usage" 1>&2; exit 1 ;;
41 if [ ! -f $fromlib ]; then
42 echo "$0: no such from-library $fromlib" 1>&2
46 if [ ! -f $tolib ]; then
47 echo "$0: no such to-library $tolib" 1>&2
53 XCOMM Create a temp directory, and figure out how to reference the
54 XCOMM object files from it (i.e. relative vs. absolute path names).
62 if [ ! -d $tmpdir ]; then
63 echo "$0: unable to create temporary directory $tmpdir" 1>&2
79 XCOMM In the temp directory, extract all of the object files and prefix
80 XCOMM them with some symbol to avoid name clashes with the base library.
83 ar x ${upfrom}$fromlib
90 XCOMM Merge in the object modules, ranlib (if appropriate) and cleanup
92 ARCMD ${upto}$tolib *.o