Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(285)

Side by Side Diff: bin/9l

Issue 217045: Open door for gcc dialects (and llvm clang too)
Patch Set: Created 15 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « bin/9c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 2
3 test -f $PLAN9/config && . $PLAN9/config 3 test -f $PLAN9/config && . $PLAN9/config
4 libsl="" 4 libsl=""
5 frameworks="" 5 frameworks=""
6 doautolib=true 6 doautolib=true
7 doautoframework=true 7 doautoframework=true
8 verbose=false 8 verbose=false
9 9
10 nmflags="" 10 nmflags=""
11 extralibs="-lm" 11 extralibs="-lm"
12 tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}" 12 tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}"
13 case "$tag" in 13 case "$tag" in
14 *FreeBSD*) 14 *FreeBSD*)
15 » ld=gcc 15 » ld=${CC9:-gcc}
16 userpath=true 16 userpath=true
17 extralibs="$extralibs -lutil" 17 extralibs="$extralibs -lutil"
18 case "`uname -r`" in 18 case "`uname -r`" in
19 5.2.*) 19 5.2.*)
20 extralibs="$extralibs -lkse" 20 extralibs="$extralibs -lkse"
21 ;; 21 ;;
22 [5-9].*) 22 [5-9].*)
23 extralibs="$extralibs -lpthread" 23 extralibs="$extralibs -lpthread"
24 ;; 24 ;;
25 esac 25 esac
26 ;; 26 ;;
27 *BSD*) 27 *BSD*)
28 » ld=gcc 28 » ld=${CC9:-gcc}
29 userpath=true 29 userpath=true
30 extralibs="$extralibs -lutil" 30 extralibs="$extralibs -lutil"
31 ;; 31 ;;
32 *OSF1*) 32 *OSF1*)
33 » ld=cc 33 » ld=${CC9:-cc}
34 userpath=true 34 userpath=true
35 extralibs="$extralibs -lutil" 35 extralibs="$extralibs -lutil"
36 nmflags="-B" 36 nmflags="-B"
37 ;; 37 ;;
38 *Linux*) 38 *Linux*)
39 » ld=gcc 39 » ld=${CC9:-gcc}
40 userpath=true 40 userpath=true
41 extralibs="$extralibs -lutil" 41 extralibs="$extralibs -lutil"
42 case "${SYSVERSION:-`uname -r`}" in 42 case "${SYSVERSION:-`uname -r`}" in
43 2.6.*) 43 2.6.*)
44 extralibs="$extralibs -lpthread" 44 extralibs="$extralibs -lpthread"
45 ;; 45 ;;
46 esac 46 esac
47 ;; 47 ;;
48 *Darwin*) 48 *Darwin*)
49 » ld="gcc -m32" 49 » ld="${CC9:-gcc} -m32"
50 ;; 50 ;;
51 *SunOS*) 51 *SunOS*)
52 ld="${CC9:-cc} -g" 52 ld="${CC9:-cc} -g"
53 extralibs="$extralibs -lrt -lpthread -lsocket -lnsl" 53 extralibs="$extralibs -lrt -lpthread -lsocket -lnsl"
54 # Record paths to shared libraries to avoid needing LD_LIBRARY_PATH· 54 # Record paths to shared libraries to avoid needing LD_LIBRARY_PATH·
55 for i in "$libsl $@" 55 for i in "$libsl $@"
56 do 56 do
57 case "$i" in 57 case "$i" in
58 -L*) 58 -L*)
59 s=`echo $i | sed 's/-L/-R/'` 59 s=`echo $i | sed 's/-L/-R/'`
60 extralibs="$extralibs $s" 60 extralibs="$extralibs $s"
61 ;; 61 ;;
62 esac 62 esac
63 done 63 done
64 case "${SYSVERSION:-`uname -r`}" in 64 case "${SYSVERSION:-`uname -r`}" in
65 5.[67]) 65 5.[67])
66 echo do not know how to link right thread library on "$tag" 1>&2 66 echo do not know how to link right thread library on "$tag" 1>&2
67 ;; 67 ;;
68 5.8) 68 5.8)
69 # Some trickery is needed to force use of 69 # Some trickery is needed to force use of
70 # alternate thread lib from /usr/lib/lwp 70 # alternate thread lib from /usr/lib/lwp
71 # Likely, this only works with sun cc, 71 # Likely, this only works with sun cc,
72 # for other compiler/loader we would need other flags. 72 # for other compiler/loader we would need other flags.
73 ld="$ld -i" 73 ld="$ld -i"
74 extralibs="$extralibs /usr/lib/lwp/libthread.so -R/usr/lib/lwp:/ usr/lib" 74 extralibs="$extralibs /usr/lib/lwp/libthread.so -R/usr/lib/lwp:/ usr/lib"
75 ;; 75 ;;
76 esac 76 esac
77 ;; 77 ;;
78 *AIX*) 78 *AIX*)
79 » ld=gcc 79 » ld=${CC9:-gcc}
80 nmflags="-B" 80 nmflags="-B"
81 ;; 81 ;;
82 *) 82 *)
83 echo do not know how to link on "$tag" 1>&2 83 echo do not know how to link on "$tag" 1>&2
84 exit 1 84 exit 1
85 esac 85 esac
86 86
87 if [ "x$1" = "x-l" ] 87 if [ "x$1" = "x-l" ]
88 then 88 then
89 shift 89 shift
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 if $ld -L$PLAN9/lib "$@" $libsl $extralibs $frameworks >$xtmp 2>&1 348 if $ld -L$PLAN9/lib "$@" $libsl $extralibs $frameworks >$xtmp 2>&1
349 then 349 then
350 xxout 350 xxout
351 exit 0 351 exit 0
352 else 352 else
353 xxout 353 xxout
354 rm -f $target 354 rm -f $target
355 exit 1 355 exit 1
356 fi 356 fi
357 357
OLDNEW
« no previous file with comments | « bin/9c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b