ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ozone/mgar/gar/bin/fixlibtool
Revision: 1
Committed: Sat Jun 20 14:58:51 2026 UTC (4 weeks, 3 days ago) by operz
File size: 2029 byte(s)
Log Message:
Initial import of OZSW mgar build tree

File Contents

# User Rev Content
1 operz 1 #!/bin/bash
2     #set -x
3     ####################################################
4     #
5     # $URL: svn://svn.code.sf.net/p/gar/code/csw/mgar/gar/v2/bin/fixlibtool $
6     # $Date: 2010-02-10 10:06:09 -0500 (Wed, 10 Feb 2010) $
7     # $Revision: 8462 $
8     # $LastChangedRevision: 8462 $
9     #
10     # Author: Mike Watters (mwatters~~@~~opencsw.org)
11     # Intended to remove the use of libtool's
12     # pseudo-libraries for opencsw builds.
13     #
14     # Usage: fixlibtool $(WORKSRC)
15     #
16     # Intened usage:
17     # DISTFILES += fixlibtool
18     # post-configure-modulated:
19     # @(echo "~~~ Fixing Libtool ~~~")
20     # @$(DOWNLOADDIR)/fixlibtool $(WORKSRC)
21     # @$(MAKECOOKIE)
22     #
23     ####################################################
24     umask 0022
25     PATH=/opt/csw/bin
26    
27     if [ $# -ne 1 ]; then
28     gecho "USAGE: $(basename $0) WORKSRC"
29     exit 1
30     fi
31     BASEPATH=$1
32    
33     ## Fix Makefiles
34     for mk in $(gfind ${BASEPATH} -name Makefile -print); do
35     gcp ${mk} ${mk}.orig
36     LT_FILES=$(for lib in $(gegrep -v '^#|^$' ${mk} | \
37     ggrep '/opt/csw.*/lib/.*\.la'); do \
38     echo $lib |gsed -ne '/\/opt.*\.la/p'; done)
39     for file in ${LT_FILES}; do
40     LIB_NAME=$(ggrep 'dlname=' ${file} | \
41     gsed -e "s/.*'\(.*\)'/\1/" \
42     -e "s/^lib//" \
43     -e "s/\.so.*$//")
44     fixpath=$(gecho $file |gsed 's/\//\\\//g')
45     gsed "s/${fixpath}/-l${LIB_NAME}/g" ${mk} >${mk}.new
46     LIB_DIR=$(ggrep 'libdir=' ${file} | gsed -e "s/.*'\(.*\)'/\1/")
47     perl -pe 's,(LDFLAGS =[^\\]*)(\\)?\n,$1 -R'${LIB_DIR}' -L'${LIB_DIR}' $2\n,' ${mk}.new >${mk}
48     gchmod +x ${mk}
49     done
50     done
51    
52     ## Fix libtool Script
53     for lt in $(gfind ${BASEPATH} -name libtool -print); do
54     gcp ${lt} ${lt}.orig
55     gsed "/for search_ext in .*\.la/s/\.la//" ${lt} >${lt}.new
56     gmv ${lt}.new ${lt}
57     gchmod +x ${lt}
58     done
59    
60     for LTMAIN in $(gfind ${BASEPATH} -name ltmain.sh -print); do
61     gcp ${LTMAIN} ${LTMAIN}.orig
62     gsed "/for search_ext in .*\.la/s/\.la//" ${LTMAIN} >${LTMAIN}.new
63     gmv ${LTMAIN}.new ${LTMAIN}
64     gchmod +x ${LTMAIN}
65     done
66    
67     exit 0

Properties

Name Value
svn:executable *