mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 21:59:54 -06:00
AIX: Add ExportImportList option to skip the object files
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
# This script is internal to CMake and meant only to be
|
||||
# invoked by CMake-generated build systems on AIX.
|
||||
|
||||
usage='usage: ExportImportList -o <out-file> [-l <lib>] [--] <objects>...'
|
||||
usage='usage: ExportImportList -o <out-file> [-l <lib>] [-n] [--] <objects>...'
|
||||
|
||||
die() {
|
||||
echo "$@" 1>&2; exit 1
|
||||
@@ -14,10 +14,12 @@ die() {
|
||||
# Process command-line arguments.
|
||||
out=''
|
||||
lib=''
|
||||
no_objects=''
|
||||
while test "$#" != 0; do
|
||||
case "$1" in
|
||||
-l) shift; lib="$1" ;;
|
||||
-o) shift; out="$1" ;;
|
||||
-n) no_objects='1' ;;
|
||||
--) shift; break ;;
|
||||
-*) die "$usage" ;;
|
||||
*) break ;;
|
||||
@@ -32,20 +34,22 @@ trap 'rm -f "$out_tmp"' EXIT INT TERM
|
||||
> "$out_tmp"
|
||||
|
||||
# Collect symbols exported from all object files.
|
||||
for f in "$@"; do
|
||||
dump -tov -X 32_64 "$f" |
|
||||
awk '
|
||||
BEGIN {
|
||||
V["EXPORTED"]=" export"
|
||||
V["PROTECTED"]=" protected"
|
||||
}
|
||||
/^\[[0-9]+\]\tm +[^ ]+ +\.(text|data|bss) +[^ ]+ +(extern|weak) +(EXPORTED|PROTECTED| ) / {
|
||||
if (!match($NF,/^(\.|__sinit|__sterm|__[0-9]+__)/)) {
|
||||
print $NF V[$(NF-1)]
|
||||
if test -z "$no_objects"; then
|
||||
for f in "$@"; do
|
||||
dump -tov -X 32_64 "$f" |
|
||||
awk '
|
||||
BEGIN {
|
||||
V["EXPORTED"]=" export"
|
||||
V["PROTECTED"]=" protected"
|
||||
}
|
||||
}
|
||||
'
|
||||
done >> "$out_tmp"
|
||||
/^\[[0-9]+\]\tm +[^ ]+ +\.(text|data|bss) +[^ ]+ +(extern|weak) +(EXPORTED|PROTECTED| ) / {
|
||||
if (!match($NF,/^(\.|__sinit|__sterm|__[0-9]+__)/)) {
|
||||
print $NF V[$(NF-1)]
|
||||
}
|
||||
}
|
||||
'
|
||||
done >> "$out_tmp"
|
||||
fi
|
||||
|
||||
# Generate the export/import file.
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user