diff options
author | Brad King <brad.king@kitware.com> | 2020-01-30 15:22:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-01-31 14:28:07 (GMT) |
commit | 0ffd54f0947967166fbaf2b92743fb40df96f0b3 (patch) | |
tree | 84ca388e6e02622f47000e4c77d9f9334307d7f3 | |
parent | 0dcfb63cb9793311b4b7ae3a395e0a273ec824b2 (diff) | |
download | CMake-0ffd54f0947967166fbaf2b92743fb40df96f0b3.zip CMake-0ffd54f0947967166fbaf2b92743fb40df96f0b3.tar.gz CMake-0ffd54f0947967166fbaf2b92743fb40df96f0b3.tar.bz2 |
AIX: Add ExportImportList option to skip the object files
-rwxr-xr-x | Modules/Platform/AIX/ExportImportList | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/Modules/Platform/AIX/ExportImportList b/Modules/Platform/AIX/ExportImportList index c7f60b5..891bce7 100755 --- a/Modules/Platform/AIX/ExportImportList +++ b/Modules/Platform/AIX/ExportImportList @@ -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. { |