<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <HTML ><HEAD ><TITLE >Adding A New Target</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.64 "><LINK REL="HOME" TITLE="DejaGnu" HREF="book1.html"><LINK REL="UP" TITLE="Extending DejaGnu" HREF="extending.html"><LINK REL="PREVIOUS" TITLE="Adding A New Tool" HREF="addtool.html"><LINK REL="NEXT" TITLE="Adding A New Board" HREF="addboard.html"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >DejaGnu: The GNU Testing Framework</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="addtool.html" ><<< Previous</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Extending DejaGnu</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="addboard.html" >Next >>></A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="ADDTARGET" >Adding A New Target</A ></H1 ><P >DejaGnu has some additional requirements for target support, beyond the general-purpose provisions of configure. DejaGnu must actively communicate with the target, rather than simply generating or managing code for the target architecture. Therefore, each tool requires an initialization module for each target. For new targets, you must supply a few Tcl procedures to adapt DejaGnu to the target. This permits DejaGnu itself to remain target independent.</P ><P >Usually the best way to write a new initialization module is to edit an existing initialization module; some trial and error will be required. If necessary, you can use the @samp{--debug} option to see what is really going on.</P ><P >When you code an initialization module, be generous in printing information controlled by the <TT CLASS="FUNCTION" >verbose</TT > procedure.</P ><P >For cross targets, most of the work is in getting the communications right. Communications code (for several situations involving IP networks or serial lines) is available in a DejaGnu library file.</P ><P >If you suspect a communication problem, try running the connection interactively from <SPAN CLASS="PRODUCTNAME" >Expect</SPAN >. (There are three ways of running <SPAN CLASS="PRODUCTNAME" >Expect</SPAN > as an interactive interpreter. You can run <SPAN CLASS="PRODUCTNAME" >Expect</SPAN > with no arguments, and control it completely interactively; or you can use <B CLASS="COMMAND" >expect -i</B > together with other command-line options and arguments; or you can run the command <B CLASS="COMMAND" >interpreter</B > from any <SPAN CLASS="PRODUCTNAME" >Expect</SPAN > procedure. Use <B CLASS="COMMAND" >return</B > to get back to the calling procedure (if any), or <B CLASS="COMMAND" >return -tcl</B > to make the calling procedure itself return to its caller; use <B CLASS="COMMAND" >exi</B >t or end-of-file to leave Expect altogether.) Run the program whose name is recorded in <SPAN CLASS="SYMBOL" >$connectmode</SPAN >, with the arguments in <SPAN CLASS="SYMBOL" >$targetname</SPAN >, to establish a connection. You should at least be able to get a prompt from any target that is physically connected.</P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="addtool.html" ><<< Previous</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="book1.html" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="addboard.html" >Next >>></A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Adding A New Tool</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="extending.html" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Adding A New Board</TD ></TR ></TABLE ></DIV ></BODY ></HTML >