Error Buddy
Do you have an error message from your application? Then find the answer with Error Buddy. You can search over 40000 source code files and troubleshooting documents using our beta lucene/nutch search interface or if you prefer, search as normal using google. With LXR technology you can drill right down into the line of source code where it came from with full cross-referencing.
If after searching you didn't get your ideal answer, or you are still unclear what the error means, you can choose to post that question to the community forums following the link included in the search results.
[1.6]001 #! /bin/sh 002 003 # depcomp - compile a program generating dependencies as side-effects 004 # Copyright 1999, 2000 Free Software Foundation, Inc. 005 006 # This program is free software; you can redistribute it and/or modify 007 # it under the terms of the GNU General Public License as published by 008 # the Free Software Foundation; either version 2, or (at your option) 009 # any later version. 010 011 # This program is distributed in the hope that it will be useful, 012 # but WITHOUT ANY WARRANTY; without even the implied warranty of 013 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 # GNU General Public License for more details. 015 016 # You should have received a copy of the GNU General Public License 017 # along with this program; if not, write to the Free Software 018 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 019 # 02111-1307, USA. 020 021 # As a special exception to the GNU General Public License, if you 022 # distribute this file as part of a program that contains a 023 # configuration script generated by Autoconf, you may include it under 024 # the same distribution terms that you use for the rest of that program. 025 026 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. 027 028 if test -z "$depmode" || test -z "$source" || test -z "$object"; then 029 echo "depcomp: Variables source, object and depmode must be set" 1>&2 030 exit 1 031 fi 032 # `libtool' can also be set to `yes' or `no'. 033 034 if test -z "$depfile"; then 035 base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` 036 dir=`echo "$object" | sed 's,/.*$,/,'` 037 if test "$dir" = "$object"; then 038 dir= 039 fi 040 # FIXME: should be _deps on DOS. 041 depfile="$dir.deps/$base" 042 fi 043 044 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} 045 046 rm -f "$tmpdepfile" 047 048 # Some modes work just like other modes, but use different flags. We 049 # parameterize here, but still list the modes in the big case below, 050 # to make depend.m4 easier to write. Note that we *cannot* use a case 051 # here, because this file can only contain one case statement. 052 if test "$depmode" = hp; then 053 # HP compiler uses -M and no extra arg. 054 gccflag=-M 055 depmode=gcc 056 fi 057 058 if test "$depmode" = dashXmstdout; then 059 # This is just like dashmstdout with a different argument. 060 dashmflag=-xM 061 depmode=dashmstdout 062 fi 063 064 case "$depmode" in 065 gcc3) 066 ## gcc 3 implements dependency tracking that does exactly what 067 ## we want. Yay! Note: for some reason libtool 1.4 doesn't like 068 ## it if -MD -MP comes after the -MF stuff. Hmm. 069 "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" 070 stat=$? 071 if test $stat -eq 0; then : 072 else 073 rm -f "$tmpdepfile" 074 exit $stat 075 fi 076 mv "$tmpdepfile" "$depfile" 077 ;; 078 079 gcc) 080 ## There are various ways to get dependency output from gcc. Here's 081 ## why we pick this rather obscure method: 082 ## - Don't want to use -MD because we'd like the dependencies to end 083 ## up in a subdir. Having to rename by hand is ugly. 084 ## (We might end up doing this anyway to support other compilers.) 085 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like 086 ## -MM, not -M (despite what the docs say). 087 ## - Using -M directly means running the compiler twice (even worse 088 ## than renaming). 089 if test -z "$gccflag"; then 090 gccflag=-MD, 091 fi 092 "$@" -Wp,"$gccflag$tmpdepfile" 093 stat=$? 094 if test $stat -eq 0; then : 095 else 096 rm -f "$tmpdepfile" 097 exit $stat 098 fi 099 rm -f "$depfile" 100 echo "$object : \\" > "$depfile" 101 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 102 ## The second -e expression handles DOS-style file names with drive letters. 103 sed -e 's/^[^:]*: / /' \ 104 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" 105 ## This next piece of magic avoids the `deleted header file' problem. 106 ## The problem is that when a header file which appears in a .P file 107 ## is deleted, the dependency causes make to die (because there is 108 ## typically no way to rebuild the header). We avoid this by adding 109 ## dummy dependencies for each header file. Too bad gcc doesn't do 110 ## this for us directly. 111 tr ' ' ' 112 ' < "$tmpdepfile" | 113 ## Some versions of gcc put a space before the `:'. On the theory 114 ## that the space means something, we add a space to the output as 115 ## well. 116 ## Some versions of the HPUX 10.20 sed can't process this invocation 117 ## correctly. Breaking it into two sed invocations is a workaround. 118 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 119 rm -f "$tmpdepfile" 120 ;; 121 122 hp) 123 # This case exists only to let depend.m4 do its work. It works by 124 # looking at the text of this script. This case will never be run, 125 # since it is checked for above. 126 exit 1 127 ;; 128 129 sgi) 130 if test "$libtool" = yes; then 131 "$@" "-Wp,-MDupdate,$tmpdepfile" 132 else 133 "$@" -MDupdate "$tmpdepfile" 134 fi 135 stat=$? 136 if test $stat -eq 0; then : 137 else 138 rm -f "$tmpdepfile" 139 exit $stat 140 fi 141 rm -f "$depfile" 142 143 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files 144 echo "$object : \\" > "$depfile" 145 146 # Clip off the initial element (the dependent). Don't try to be 147 # clever and replace this with sed code, as IRIX sed won't handle 148 # lines with more than a fixed number of characters (4096 in 149 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; 150 # the IRIX cc adds comments like `#:fec' to the end of the 151 # dependency line. 152 tr ' ' ' 153 ' < "$tmpdepfile" \ 154 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ 155 tr ' 156 ' ' ' >> $depfile 157 echo >> $depfile 158 159 # The second pass generates a dummy entry for each header file. 160 tr ' ' ' 161 ' < "$tmpdepfile" \ 162 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ 163 >> $depfile 164 else 165 # The sourcefile does not contain any dependencies, so just 166 # store a dummy comment line, to avoid errors with the Makefile 167 # "include basename.Plo" scheme. 168 echo "#dummy" > "$depfile" 169 fi 170 rm -f "$tmpdepfile" 171 ;; 172 173 aix) 174 # The C for AIX Compiler uses -M and outputs the dependencies 175 # in a .u file. This file always lives in the current directory. 176 # Also, the AIX compiler puts `$object:' at the start of each line; 177 # $object doesn't have directory information. 178 stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` 179 tmpdepfile="$stripped.u" 180 outname="$stripped.o" 181 if test "$libtool" = yes; then 182 "$@" -Wc,-M 183 else 184 "$@" -M 185 fi 186 187 stat=$? 188 if test $stat -eq 0; then : 189 else 190 rm -f "$tmpdepfile" 191 exit $stat 192 fi 193 194 if test -f "$tmpdepfile"; then 195 # Each line is of the form `foo.o: dependent.h'. 196 # Do two passes, one to just change these to 197 # `$object: dependent.h' and one to simply `dependent.h:'. 198 sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" 199 sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" 200 else 201 # The sourcefile does not contain any dependencies, so just 202 # store a dummy comment line, to avoid errors with the Makefile 203 # "include basename.Plo" scheme. 204 echo "#dummy" > "$depfile" 205 fi 206 rm -f "$tmpdepfile" 207 ;; 208 209 tru64) 210 # The Tru64 compiler uses -MD to generate dependencies as a side 211 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. 212 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 213 # dependencies in `foo.d' instead, so we check for that too. 214 # Subdirectories are respected. 215 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 216 test "x$dir" = "x$object" && dir= 217 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 218 219 if test "$libtool" = yes; then 220 tmpdepfile1="$dir.libs/$base.lo.d" 221 tmpdepfile2="$dir.libs/$base.d" 222 "$@" -Wc,-MD 223 else 224 tmpdepfile1="$dir$base.o.d" 225 tmpdepfile2="$dir$base.d" 226 "$@" -MD 227 fi 228 229 stat=$? 230 if test $stat -eq 0; then : 231 else 232 rm -f "$tmpdepfile1" "$tmpdepfile2" 233 exit $stat 234 fi 235 236 if test -f "$tmpdepfile1"; then 237 tmpdepfile="$tmpdepfile1" 238 else 239 tmpdepfile="$tmpdepfile2" 240 fi 241 if test -f "$tmpdepfile"; then 242 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 243 # That's a space and a tab in the []. 244 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 245 else 246 echo "#dummy" > "$depfile" 247 fi 248 rm -f "$tmpdepfile" 249 ;; 250 251 #nosideeffect) 252 # This comment above is used by automake to tell side-effect 253 # dependency tracking mechanisms from slower ones. 254 255 dashmstdout) 256 # Important note: in order to support this mode, a compiler *must* 257 # always write the proprocessed file to stdout, regardless of -o. 258 "$@" || exit $? 259 260 # Remove the call to Libtool. 261 if test "$libtool" = yes; then 262 while test $1 != '--mode=compile'; do 263 shift 264 done 265 shift 266 fi 267 268 # Remove `-o $object'. We will use -o /dev/null later, 269 # however we can't do the remplacement now because 270 # `-o $object' might simply not be used 271 IFS=" " 272 for arg 273 do 274 case $arg in 275 -o) 276 shift 277 ;; 278 $object) 279 shift 280 ;; 281 *) 282 set fnord "$@" "$arg" 283 shift # fnord 284 shift # $arg 285 ;; 286 esac 287 done 288 289 test -z "$dashmflag" && dashmflag=-M 290 "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" 291 rm -f "$depfile" 292 cat < "$tmpdepfile" > "$depfile" 293 tr ' ' ' 294 ' < "$tmpdepfile" | \ 295 ## Some versions of the HPUX 10.20 sed can't process this invocation 296 ## correctly. Breaking it into two sed invocations is a workaround. 297 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 298 rm -f "$tmpdepfile" 299 ;; 300 301 dashXmstdout) 302 # This case only exists to satisfy depend.m4. It is never actually 303 # run, as this mode is specially recognized in the preamble. 304 exit 1 305 ;; 306 307 makedepend) 308 "$@" || exit $? 309 # X makedepend 310 shift 311 cleared=no 312 for arg in "$@"; do 313 case $cleared in 314 no) 315 set ""; shift 316 cleared=yes ;; 317 esac 318 case "$arg" in 319 -D*|-I*) 320 set fnord "$@" "$arg"; shift ;; 321 -*) 322 ;; 323 *) 324 set fnord "$@" "$arg"; shift ;; 325 esac 326 done 327 obj_suffix="`echo $object | sed 's/^.*\././'`" 328 touch "$tmpdepfile" 329 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" 330 rm -f "$depfile" 331 cat < "$tmpdepfile" > "$depfile" 332 sed '1,2d' "$tmpdepfile" | tr ' ' ' 333 ' | \ 334 ## Some versions of the HPUX 10.20 sed can't process this invocation 335 ## correctly. Breaking it into two sed invocations is a workaround. 336 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 337 rm -f "$tmpdepfile" "$tmpdepfile".bak 338 ;; 339 340 cpp) 341 # Important note: in order to support this mode, a compiler *must* 342 # always write the proprocessed file to stdout. 343 "$@" || exit $? 344 345 # Remove the call to Libtool. 346 if test "$libtool" = yes; then 347 while test $1 != '--mode=compile'; do 348 shift 349 done 350 shift 351 fi 352 353 # Remove `-o $object'. 354 IFS=" " 355 for arg 356 do 357 case $arg in 358 -o) 359 shift 360 ;; 361 $object) 362 shift 363 ;; 364 *) 365 set fnord "$@" "$arg" 366 shift # fnord 367 shift # $arg 368 ;; 369 esac 370 done 371 372 "$@" -E | 373 sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | 374 sed '$ s: \\$::' > "$tmpdepfile" 375 rm -f "$depfile" 376 echo "$object : \\" > "$depfile" 377 cat < "$tmpdepfile" >> "$depfile" 378 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" 379 rm -f "$tmpdepfile" 380 ;; 381 382 msvisualcpp) 383 # Important note: in order to support this mode, a compiler *must* 384 # always write the proprocessed file to stdout, regardless of -o, 385 # because we must use -o when running libtool. 386 "$@" || exit $? 387 IFS=" " 388 for arg 389 do 390 case "$arg" in 391 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") 392 set fnord "$@" 393 shift 394 shift 395 ;; 396 *) 397 set fnord "$@" "$arg" 398 shift 399 shift 400 ;; 401 esac 402 done 403 "$@" -E | 404 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" 405 rm -f "$depfile" 406 echo "$object : \\" > "$depfile" 407 . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" 408 echo " " >> "$depfile" 409 . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" 410 rm -f "$tmpdepfile" 411 ;; 412 413 none) 414 exec "$@" 415 ;; 416 417 *) 418 echo "Unknown depmode $depmode" 1>&2 419 exit 1 420 ;; 421 esac 422 423 exit 0
Testing
