--- uae/src/od-amiga/scc 2018/04/24 16:40:30 1.1 +++ uae/src/od-amiga/scc 2018/04/24 16:42:53 1.1.1.2 @@ -2,7 +2,8 @@ # # This is a small perl script that emulates gcc with the # SAS/C compiler. It is mainly created to compile UAE -# with SAS/C to test 68060 optimisations. +# with SAS/C to test 68060 optimisations. This scripts also +# manages so that links are properly handled by SAS/C. # # (c) 1997 by Samuel Devulder. # @@ -13,8 +14,11 @@ $LNDIR = "scc-idir"; # replace all filenames that actually are links for($i=0;$i<=$#ARGV;++$i) { $_ = $ARGV[$i]; + $_=readlink($_) if -l $_; if(/\/[^\/]+$/ && -l $`) { $_=readlink($`).$&; + s/.*\/src\///; + s/^\/([^\/]+)\//$1:/; } $ARGV[$i] = $_; } @@ -26,7 +30,8 @@ if(! -d $LNDIR) { while(<*>) { next if ! -l $_; $linkname = $_; - $realname = readlink($_); $realname =~ s/[.][.]//g; + $realname = readlink($_); + $realname =~ s/^\/([^\/]+)\//$1:/; $realname =~ s/[.][.]//g; if(-d $linkname) { mkdir("$LNDIR/$linkname",0777); while(<$linkname/*.h>) { @@ -68,13 +73,14 @@ s/\s+-l\s*(\w+)/ LIB=LIB:$1.lib/g; # ot s/\s+-D\s*/ DEF=/g; # preprocessor defines s/\s+-traditional-cpp//g; # s/\s+-m(\w+)/ CPU=$1/g; # specific cpu code generation -s/\s+-O./ OPT OPTSCHED OPTTIME/g; # optimize ? +s/\s+-O(\d?)/ OPT OPTSCHED OPTTIME/g; # optimize ? # use NOLINK (-c was found) or LINK TO ? !s/\s+-E/ PPONLY/g && !s/\s+-c/ NOLINK/g && s/OBJNAME/LINK TO/; # build amigaos command-line with extra defs -$_ = "sc IDIR=$LNDIR$_ DEF=AMIGA DEF=_OFF_T DATA=FAR CODE=FAR PARAM=B NOSTKCHK NOICON NOVERBOSE IGN=64,84,85,93,100,181,306,315,316 BATCH"; +$_ = "sc IDIR=$LNDIR$_ DEF=__GNU_LIBRARY__ DEF=AMIGA DEF=_OFF_T DEF=off_t=long DATA=FAR CODE=FAR PARAM=B NOSTKCHK NOICON NOVERBOSE IGN=64,84,85,93,100,181,306,315,316 BATCH"; +#$_ = "sc IDIR=$LNDIR$_ DEF=AMIGA DEF=_OFF_T DEF=off_t=long DATA=FAR CODE=FAR PARAM=B NOSTKCHK NOICON NOVERBOSE IGN=64,84,85,93,100,181,306,315,316 BATCH"; # if -d is present, display the executed command-line s/\s+-d//g && print STDERR "=> $_\n";