#!/usr/bin/perl
# linkrel       *** internal script (called by vmake !)
#
# @(#)linkrel  6.1.2  1995-09-20
#
# prelink object modules to relocatables
#
# KEEPFLG       optional keep intermediate files flag
#
package linkrel;
use Env;
use Carp;
use ToolLib;

$DEBUG  = "";

do "$TOOLVARS";
if ( $@ ) { print "$@"; exit }
ToolTrace("linkrel called with @ARGV\n");
@LDCMD=();
$GenerateBuildNr=0;

$USAGE = "usage: linkrel relocatable objects/libraries\n";



while ($_ = $ARGV[0], /^-/) {
    shift;
    last if /^--$/;

	if(/^-g$/) { $DEBUG="y"; next}


    if(/^-g$|^-p$|^-Y$/) { next }	# ignored

	if (/^-k$/) { @KEEPFLG = "-k"; next }

	#CTS 1103488
	if(/^-BuildNrFunction\s*=\s*(.*)/i)
    {
        ToolLib::SetBuildNrModule($1);
        $GenerateBuildNr=1;
        next;
    }
} #while


if ( @ARGV < 2 ) { print $USAGE; exit 1 }

$REL = shift;


@LDCMD=("ld");
push @LDCMD, "-r", "-o", $REL, "-L$TOOL/lib", @ARGV;

# CTS 1103488
push @LDCMD, ToolLib::CreateBuildNrModule(@KEEPFLG,$DEBUG?("-g"):()) if ( $GenerateBuildNr );

print "@LDCMD\n" if ( $ENV{NOQUIET});
system(@LDCMD) == 0
	or croak "Error while executing \"@LDCMD\"\n".
	"message: $!\n";


__END__

Hier können lange Kommentare stehen

