52 exit 10 |
52 exit 10 |
53 fi |
53 fi |
54 |
54 |
55 if [ "`uname`" == "SunOS" ]; then |
55 if [ "`uname`" == "SunOS" ]; then |
56 NM=gnm |
56 NM=gnm |
57 STAT=gstat |
57 STAT="gstat -c%s" |
|
58 LDD=ldd |
58 elif [ $OSTYPE == "cygwin" ]; then |
59 elif [ $OSTYPE == "cygwin" ]; then |
59 NM="$VS100COMNTOOLS/../../VC/bin/amd64/dumpbin.exe" |
60 NM="$VS100COMNTOOLS/../../VC/bin/amd64/dumpbin.exe" |
60 NM_ARGS=/exports |
61 NM_ARGS=/exports |
61 STAT=stat |
62 STAT="stat -c%s" |
62 else |
63 LDD= |
|
64 elif [ "`uname`" == "Darwin" ]; then |
63 NM=nm |
65 NM=nm |
64 STAT=stat |
66 STAT="stat -f%z" |
|
67 LDD="otool -L" |
|
68 else |
|
69 NM=nm |
|
70 STAT="stat -c%s" |
|
71 LDD=ldd |
65 fi |
72 fi |
66 |
73 |
67 # Should the differences be viewed? |
74 # Should the differences be viewed? |
68 VIEW= |
75 VIEW= |
69 # You can do export DIFF=meld to view |
76 # You can do export DIFF=meld to view |
137 |
144 |
138 DIFFS=$(LANG=C diff $OLD_SYMBOLS $NEW_SYMBOLS) |
145 DIFFS=$(LANG=C diff $OLD_SYMBOLS $NEW_SYMBOLS) |
139 |
146 |
140 RESULT=0 |
147 RESULT=0 |
141 |
148 |
|
149 if [ "${LDD}" ] |
|
150 then |
|
151 NAME=`basename $OLD` |
|
152 TMP=$COMPARE_ROOT/ldd/ldd.${NAME} |
|
153 rm -rf "${TMP}" |
|
154 mkdir -p "${TMP}" |
|
155 |
|
156 (cd "${TMP}" && cp $OLD . && ${LDD} ${NAME} | awk '{ print $1;}' | sort | tee dep.old | uniq > dep.uniq.old) |
|
157 (cd "${TMP}" && cp $NEW . && ${LDD} ${NAME} | awk '{ print $1;}' | sort | tee dep.new | uniq > dep.uniq.new) |
|
158 (cd "${TMP}" && rm -f ${NAME}) |
|
159 |
|
160 DIFFS_DEP=$(LANG=C diff "${TMP}/dep.old" "${TMP}/dep.new") |
|
161 DIFFS_UNIQ_DEP=$(LANG=C diff "${TMP}/dep.uniq.old" "${TMP}/dep.uniq.new") |
|
162 |
|
163 DEP_MSG= |
|
164 if [ -z "${DIFFS_UNIQ_DEP}" -a -z "${DIFFS_DEP}" ]; then |
|
165 DEP_MSG="Identical dependencies" |
|
166 elif [ -z "${DIFFS_UNIQ_DEP}" ]; then |
|
167 DEP_MSG="Redundant duplicate dependencies added" |
|
168 RES=1 |
|
169 else |
|
170 DEP_MSG="DIFFERENT dependencies" |
|
171 RES=1 |
|
172 fi |
|
173 fi |
|
174 |
142 if [ -n "$DIFFS" ]; then |
175 if [ -n "$DIFFS" ]; then |
143 if [ $OLD_SIZE -ne $NEW_SIZE ] |
176 if [ $OLD_SIZE -ne $NEW_SIZE ] |
144 then |
177 then |
145 echo Differences, content AND size : $OLD_NAME |
178 echo Differences, content AND size : $DEP_MSG : $OLD_NAME |
146 RESULT=4 |
179 RESULT=4 |
147 else |
180 else |
148 echo Differences, content BUT SAME size: $OLD_NAME |
181 echo Differences, content BUT SAME size: $DEP_MSG : $OLD_NAME |
149 RESULT=3 |
182 RESULT=3 |
150 fi |
183 fi |
151 if [ "x$VIEW" == "xview" ]; then |
184 if [ "x$VIEW" == "xview" ]; then |
152 LANG=C $DIFF $OLD_SYMBOLS $NEW_SYMBOLS |
185 LANG=C $DIFF $OLD_SYMBOLS $NEW_SYMBOLS |
153 fi |
186 fi |
154 else |
187 else |
155 if [ $OLD_SIZE -ne $NEW_SIZE ] |
188 if [ $OLD_SIZE -ne $NEW_SIZE ] |
156 then |
189 then |
157 echo Identical symbols BUT NEW size : $OLD_NAME |
190 echo Identical symbols BUT NEW size : $DEP_MSG : $OLD_NAME |
158 RESULT=2 |
191 RESULT=2 |
159 else |
192 else |
160 echo Identical symbols AND size, BUT not bytewise identical: $OLD_NAME |
193 echo Identical symbols AND size, BUT not bytewise identical: $DEP_MSG : $OLD_NAME |
161 RESULT=1 |
194 RESULT=1 |
162 fi |
195 fi |
163 fi |
196 fi |
164 |
197 |
165 exit $RESULT |
198 exit $RESULT |