File: load-foreign.csh

package info (click to toggle)
cmucl 21d-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 45,328 kB
  • sloc: lisp: 378,758; ansic: 30,673; asm: 2,977; sh: 1,417; makefile: 357; csh: 31
file content (41 lines) | stat: -rwxr-xr-x 883 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/csh -fx

# script run by load-foreign to do OS-specific symbol-table extraction.

switch ( `uname` )

 case HP-UX:
   ld -a archive -N -A $argv[1] -R $argv[2] -o $argv[3] $argv[5-] /lib/dyncall.o
   if ($status != 0) exit 1

   /bin/nm -xp $argv[3] | sed -e '/ [tdb] /d' -e 's/^0x//' -e 's/  / /' > $argv[4]
   if ($status != 0) exit 2
   breaksw

 case FreeBSD:
   ld -shared -R $argv[1] -Ttext $argv[2] -o $argv[3] $argv[5-]
   if ($status != 0) exit 1

   nm -gp $argv[3] > $argv[4]
   if ($status != 0) exit 2
   breaksw

 case NetBSD:
   ld -N -R $argv[1] -Ttext $argv[2] -o $argv[3] $argv[5-]
   if ($status != 0) exit 1

   nm -gp $argv[3] > $argv[4]
   if ($status != 0) exit 2
   breaksw

 default:
   ld -N -A $argv[1] -T $argv[2] -o $argv[3] $argv[5-]
   if ($status != 0) exit 1

   nm -gp $argv[3] > $argv[4]
   if ($status != 0) exit 2
   breaksw

endsw

exit 0