Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.unix.aix Frequently Asked Questions (Part 5 of 5)
Section - 8.10: How do I make an export list from a library archive?

( Part1 - Part2 - Part3 - Part4 - Part5 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Zip codes ]


Top Document: comp.unix.aix Frequently Asked Questions (Part 5 of 5)
Previous Document: 8.09: How can I hack libc.a to alter how hostnames are resolved?
Next Document: 9.00: Contributors
See reader questions & answers on this topic! - Help others by sharing your knowledge
[ formerly in section 2.17 ]

This script will only extract the "export"able names and should be
useful in starting the shared library creation process. The user must
determine which names should be included in the import and export lists.
It's only been tested on a few library archives.

#!/bin/ksh
#
# mkexps - make export list
# This program creates an export list by combining all the "." and normal names
# into one list. 
#
if [[ "$#" -ne 1 ]]
then
    print "Usage: mkexps ArchiveFile"
    exit -2
fi
if [[ ! -f $1 ]] 
then
    print "mkexps: Cannot open file \"$1\""
    exit -1
fi
dump -g $1 | awk '
BEGIN {
        top = 1
}    
/^[ ]*[0-9][0-9]*/ {
    if ( (n = index( $2, "." )) > 0 ) {
        export_array[ top++ ] = substr( $2, n+1, length( $2 ))
    }
    else {
	export_array[ top++ ] = $2
    }
}

END {
    for ( i = 1; i < top; i++ )
    {
	print export_array[ i ]
    }

}' | sort | uniq


User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: comp.unix.aix Frequently Asked Questions (Part 5 of 5)
Previous Document: 8.09: How can I hack libc.a to alter how hostnames are resolved?
Next Document: 9.00: Contributors

Part1 - Part2 - Part3 - Part4 - Part5 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
bofh@mail.teleweb.pt (Jose Pina Coelho)





Last Update March 27 2014 @ 02:11 PM