File: link

package info (click to toggle)
mocka 9905-2
  • links: PTS
  • area: non-free
  • in suites: potato, sarge, woody
  • size: 5,436 kB
  • ctags: 160
  • sloc: asm: 23,203; makefile: 124; sh: 102; ansic: 23
file content (41 lines) | stat: -rwxr-xr-x 774 bytes parent folder | download | duplicates (2)
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/sh

SYSDIR=`dirname $0`

GLIBC=1

case $1 in
'-elf' ) LD='/usr/bin/ld -m elf_i386 -rpath /lib/elf' ;
	 PRE='/usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o' ;
	 RTS=$SYSDIR/M2RTS-elf.o ;
	 POST='/usr/lib/crtend.o /usr/lib/crtn.o'
	 shift ;;
*      ) LD='/usr/i486-linuxaout/bin/ld -m i386linux' ;
	 PRE='/usr/i486-linuxaout/lib/crt0.o' ;
	 RTS=$SYSDIR/M2RTS-aout.o ;
	 POST= ;;
esac;

case $1 in
'-static' ) STAT='-static' ; shift ;;
*         ) STAT='' ;;
#*         ) STAT='-dynamic-linker /lib/elf/ld-linux.so.1' ;;
esac;

case $1 in
'-g' ) LIB=-lc ; shift ;;
*    ) LIB=-lc ;;
esac;

program=$1 ; shift ; modules="$*"

if [ $GLIBC = "1" ]
then
    LIB=""
    PRE=""
    POST=""
    STAT=""
    LD="gcc"
fi

$LD -o $program $STAT $PRE $RTS $modules $LIB $POST