source: CMT/v1r10p20011126/mgr/cmt_make_shlib_common.sh @ 1

Last change on this file since 1 was 1, checked in by arnault, 19 years ago

Import all tags

File size: 1.3 KB
Line 
1#!/bin/sh
2
3#set -x
4
5#------------------------------------------------------
6#
7#  Syntax :
8#
9#  cmt_make_shlib_common.sh extract-arg package extra-args
10#
11#   with :
12#
13#      extract-arg  : either "extract" or "no_extract"
14#      package      : the current package name
15#      extra-args   : extra link options
16#
17#------------------------------------------------------
18
19
20extract=$1
21shift
22
23tag=$1
24shift
25
26lib=$1
27shift
28
29extra=$*
30
31here=`pwd`
32
33ld=`${CMTROOT}/mgr/cmt show macro_value shlibbuilder -tag=${tag}`
34ldflags=`${CMTROOT}/mgr/cmt show macro_value shlibflags -tag=${tag}`
35suffix=`${CMTROOT}/mgr/cmt show macro_value shlibsuffix -tag=${tag}`
36
37if test "${ld}" = "" ; then
38  exit 1
39fi
40
41/bin/rm -f lib${lib}.${suffix}
42
43result=0
44
45temp_shlib=${lib}temp_shlib
46
47if test ${extract} = "extract"; then
48  trap 'cd ${here}; /bin/rm -rf ${temp_shlib}; exit ${result}' 0 1 2 15
49
50  mkdir -p ${temp_shlib}
51  /bin/rm -f ${temp_shlib}/*
52
53  (cd ${temp_shlib}; ar x ../lib${lib}.a)
54
55  eval ${ld} ${ldflags} -o lib${lib}.${suffix} `ls -1 ${temp_shlib} | sed -e 's#^'${lib}'temp_shlib/##'` ${extra}
56  result=$?
57
58  /bin/rm -rf ${temp_shlib}
59else
60  eval ${ld} ${ldflags} -all lib${lib}.a -o lib${lib}.${suffix} ${extra} -rpath `pwd`
61  result=$?
62fi
63
64
65
66
Note: See TracBrowser for help on using the repository browser.