// write the imports to link with to the .opt file
linkOptPw.print(" ");
Enumeration imps = imports.elements();
while( imps.hasMoreElements() ) {
JkData imp = (JkData) imps.nextElement();
String name = imp.getValue();
if( name==null ) continue;
linkOptPw.print(name+" ");
}
// write the link flags out
linkOptPw.print("/machine:I386 ");
linkOptPw.print("/out:" + soFile + ".dll ");
linkOptPw.print("/nologo ");
linkOptPw.print("/dll ");
linkOptPw.print("/incremental:no ");
// write out any additional link options
Enumeration opts = linkOpts.elements();
while( opts.hasMoreElements() ) {
JkData opt = (JkData) opts.nextElement();
String option = opt.getValue();
if( option == null ) continue;
linkOptPw.println( option );
}
// add debug information in if requested
if (optG)
{
linkOptPw.print("/debug ");
}
// def file
linkOptPw.println("/def:link.def");
// write the objects to link with to the .opt file
for( int i=0; i<srcList.size(); i++ ) {
Source source=(Source)srcList.elementAt(i);
File srcF = source.getFile();
String name=srcF.getName();
String targetNA[]=co_mapper.mapFileName( name );
if( targetNA!=null )
linkOptPw.println( targetNA[0] );
}
// Write the resources to link to .opt file
Enumeration ress = resources.elements();
while( ress.hasMoreElements() ) {
JkData res = (JkData) ress.nextElement();
String name = res.getValue();
if( name==null ) continue;
linkOptPw.println(name);
}
// Write the library name to the def file
linkDefPw.println("LIBRARY\t\""+soFile+"\"");
// write the exported symbols to the .def file
Enumeration exps = exports.elements();
if ( exps.hasMoreElements() )
{
linkDefPw.println("EXPORTS");
while( exps.hasMoreElements() ) {
JkData exp = (JkData) exps.nextElement();
String name = exp.getValue();
if( name==null ) continue;
linkDefPw.println("\t" + name);
}
}
}