Print this page
4265 remove INTERNAL_RELEASE_BUILD
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/sgs/libconv/common/bld_vernote.ksh
+++ new/usr/src/cmd/sgs/libconv/common/bld_vernote.ksh
1 1 #! /usr/bin/ksh
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License (the "License").
7 7 # You may not use this file except in compliance with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
13 13 #
14 14 # When distributing Covered Code, include this CDDL HEADER in each
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 # If applicable, add the following below this CDDL HEADER, with the
17 17 # fields enclosed by brackets "[]" replaced with your own identifying
18 18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 19 #
20 20 # CDDL HEADER END
21 21 #
22 22
23 23 #
24 24 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
25 25 # Use is subject to license terms.
26 26 #
27 27
28 28 usage()
29 29 {
30 30 echo "usage: bld_vernote -R <revision> -r <release> -o <outfile.s>"
31 31 }
32 32
33 33 pad_notestring()
34 34 {
35 35 extra=$1
36 36 len=$(( ${#notestring} + $extra ))
37 37 padlen=$(( $len % 4 ))
38 38 while [[ $(( $len % 4)) != 0 ]]
39 39 do
40 40 notestring="${notestring}\0"
41 41 len=$(( $len + 1 ))
42 42 done
43 43 }
44 44
45 45
46 46 build_sparcnote()
47 47 {
48 48 notestring="Solaris Link Editors: $release-$revision (illumos)\0"
49 49 #
50 50 # The 'adjustment' is for the '\0'
51 51 #
52 52 pad_notestring -1
53 53
54 54 cat > $notefile <<EOF
55 55 .section ".note"
56 56
57 57 #include <sgs.h>
58 58
59 59 .align 4
60 60 .word .endname - .startname /* note name size */
61 61 .word 0 /* note desc size */
62 62 .word 0 /* note type */
63 63 .startname:
64 64 .ascii "$notestring"
65 65 .endname:
66 66
67 67 .section ".rodata", #alloc
68 68 .global link_ver_string
69 69 link_ver_string:
70 70 .type link_ver_string, #object
71 71 .ascii "${release}-${revision} (illumos)\0"
72 72 .size link_ver_string, .-link_ver_string
73 73 EOF
74 74 }
75 75
76 76 build_i386note()
77 77 {
78 78 notestring="Solaris Link Editors: $release-$revision (illumos)"
79 79 #
80 80 # The 'adjustment' is for the the fact that the x86/amd64
81 81 # assembler automatically append a '\0' at the end of a string.
82 82 #
83 83 pad_notestring -1
84 84 cat > $notefile <<EOF
85 85 .section .note
86 86
87 87 #include <sgs.h>
88 88
89 89 .align 4
90 90 .long .endname - .startname /* note name size */
91 91 .long 0 /* note desc size */
92 92 .long 0 /* note type */
93 93 .startname:
94 94 .string "$notestring"
95 95 .endname:
96 96
97 97 .section .rodata, "a"
98 98 .globl link_ver_string
99 99 link_ver_string:
100 100 .type link_ver_string,@object
↓ open down ↓ |
100 lines elided |
↑ open up ↑ |
101 101 .string "${release}-${revision} (illumos)\0"
102 102 .size link_ver_string, .-link_ver_string
103 103 EOF
104 104 }
105 105
106 106
107 107 notefile=""
108 108 release=""
109 109 revision=""
110 110
111 -while getopts DR:o:r: c
111 +while getopts R:o:r: c
112 112 do
113 113 case $c in
114 114 o)
115 115 notefile=$OPTARG
116 116 ;;
117 117 r)
118 118 release=$OPTARG
119 119 ;;
120 120 R)
121 121 revision=$OPTARG
122 122 ;;
123 123 \?)
124 124 usage
125 125 exit 1
126 126 ;;
127 127 esac
128 128 done
129 129
130 130 if [[ ( -z $notefile ) || ( -z $release ) || ( -z $revision ) ]]; then
131 131 usage
132 132 exit 1
133 133 fi
134 134
135 135
136 136 if [[ $MACH = "sparc" ]]; then
137 137 build_sparcnote
138 138 elif [[ $MACH = "i386" ]]; then
139 139 build_i386note
140 140 else
141 141 echo "I don't know how to build a vernote.s for ${MACH}, so sorry"
142 142 exit 1
143 143 fi
↓ open down ↓ |
22 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX