#!/usr/bin/perl $libName = shift; $sourceFile = shift; $assemblyFile = shift; $exportFile = shift; $loadLibrary = shift; # read in the entire list of symbols foreach $arg (@ARGV) { local $/; undef $/; # Ignore end-of-line delimiters in the file open (ARG, "$arg") or die ("Can't open $arg for reading."); $file .= ; close (ARG); } foreach $symbol (split (/\n|\r/, $file)) { if ($symbol =~ /^\s*_(.*)\s*$/) { # Ignore blank lines push @symbols, $1; } } # Now build the various files # The export file: open (EXPORT, ">$exportFile") or die ("Can't open $exportFile for writing."); select (EXPORT); print ("___${libName}_LoadKerberosFramework\n"); foreach $symbol (@symbols) { print ("_${symbol}\n"); } close (EXPORT); # The assembly file open (ASSEMBLER, ">$assemblyFile") or die ("Can't open $assemblyFile for writing."); select (ASSEMBLER); print ("; Data Section: storage for function pointers\n"); print (" .data\n\n"); foreach $symbol (@symbols) { print <$sourceFile") or die ("Can't open $sourceFile for writing."); select (SOURCE); # necessary header file print ("#include \n\n"); # externs for pointers: foreach $symbol (@symbols) { print ("extern ProcPtr ${symbol}_ProcPtr;\n"); } # load the Kerberos Framework: print <