summaryrefslogtreecommitdiff
path: root/Modules/Platform/AIX
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-30 10:22:56 -0500
committerBrad King <brad.king@kitware.com>2020-01-31 09:28:07 -0500
commit0ffd54f0947967166fbaf2b92743fb40df96f0b3 (patch)
tree84ca388e6e02622f47000e4c77d9f9334307d7f3 /Modules/Platform/AIX
parent0dcfb63cb9793311b4b7ae3a395e0a273ec824b2 (diff)
downloadcmake-0ffd54f0947967166fbaf2b92743fb40df96f0b3.tar.gz
AIX: Add ExportImportList option to skip the object files
Diffstat (limited to 'Modules/Platform/AIX')
-rwxr-xr-xModules/Platform/AIX/ExportImportList32
1 files changed, 18 insertions, 14 deletions
diff --git a/Modules/Platform/AIX/ExportImportList b/Modules/Platform/AIX/ExportImportList
index c7f60b5266..891bce76d9 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.
{