⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 990-993.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Linux Unleashed, Third Edition:Adabas-D and other Databases</TITLE>

<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=0672313723//-->

<!--TITLE=Linux Unleashed, Third Edition//-->

<!--AUTHOR=Tim Parker//-->

<!--PUBLISHER=Macmillan Computer Publishing//-->

<!--IMPRINT=Sams//-->

<!--CHAPTER=62//-->

<!--PAGES=990-993//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="987-990.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="993-996.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H4 ALIGN="LEFT"><A NAME="Heading5"></A><FONT COLOR="#000077">Installing FlagShip</FONT></H4>

<P>Most people obtain FlagShip from a CD-ROM collection, a Web site, or an FTP archive. In most cases, there are two versions of FlagShip available, and the choice of the correct one for your system depends on the version of Linux you are running. Typically, the files are contained in a tar archive called <TT>fsdemo.tar</TT> (if you are obtaining the restricted demo version). One version is optimized for more recent releases of Linux and uses ELF. An older version, usually designated with the name <TT>aout</TT> (for a.out) at the end of the filename, works on any Linux system. The ELF version is much more flexible and powerful, but in most cases the demo files are the older version.</P>

<P>Once you have the <TT>fsdemo.tar</TT> file on your Linux system in a suitable (preferably new and empty other than the <TT>fsdemo</TT> file) directory, you need to unpack the tar file with the command:</P>

<!-- CODE SNIP //-->

<PRE>

tar xvf fsdemo.tar

</PRE>

<!-- END CODE SNIP //-->

<P>This creates a number of files, two of which are usually called <TT>FSinstall.set</TT> and <TT>FSinstall</TT>. The <TT>FSinstall.set</TT> file sets environment variables for the installation routine and should be run first by simply typing its name at the command line. You won&#146;t see anything when you do this. After running the <TT>.set</TT> file, type the <TT>FSinstall</TT> filename and let it install FlagShip for you.</P>

<P>If the installation process loads properly, you are asked if there is enough room on your filesystem, as shown in Figure 62.1.</P>

<P><A NAME="Fig1"></A><A HREF="javascript:displayWindow('images/62-01.jpg',572,367 )"><IMG SRC="images/62-01t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/62-01.jpg',572,367)"><FONT COLOR="#000077"><B>Figure 62.1.</B></FONT></A>&nbsp;&nbsp;The FlagShip installation routine checks that you have enough room on your hard drive.</P>

<P>You are then asked where you want the FlagShip program to be stored, and in most cases you should accept the default values suggested by the installation routine. If you want to change the defaults, a menu prompt lets you, and then enter the new values, as shown in Figure 62.2. Once the installation routine has finished, you are returned to the shell prompt. FlagShip is now ready to be used.

</P>

<P><A NAME="Fig2"></A><A HREF="javascript:displayWindow('images/62-02.jpg',572,367 )"><IMG SRC="images/62-02t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/62-02.jpg',572,367)"><FONT COLOR="#000077"><B>Figure 62.2.</B></FONT></A>&nbsp;&nbsp;You can override the default FlagShip installation settings if you want.</P>

<H4 ALIGN="LEFT"><A NAME="Heading6"></A><FONT COLOR="#000077">Using FlagShip</FONT></H4>

<P>If you have used Clipper or one of the other xBase compilers, you will know most of the commands you need for FlagShip. A few modifications have been made because of the UNIX environment, but using FlagShip is otherwise pretty simple. Keep in mind that FlagShip is not an interactive development product: it doesn&#146;t help you design your code. FlagShip is a compiler. You can use it to develop applications if you are familiar with the dBASE language, but FlagShip is not designed to teach you dBASE or to help you develop applications.

</P>

<P>Once you have your <TT>.prg</TT> source files ready to go, you can invoke the FlagShip compiler. In general, the command line is like this&#133;</P>

<!-- CODE SNIP //-->

<PRE>

FlagShip app_name.prg -ocompiled_name -Mstart

</PRE>

<!-- END CODE SNIP //-->

<P>&#133;where <TT>app_name.prg</TT> is the name of the main program file (that calls all the others) and <TT>compiler_name</TT> is the name of the compiled executable (C defaults to <TT>a.out</TT> as the compiled executable name). If your main program file doesn&#146;t call all the other program files that need to be linked together, you will have to compile them separately and link them together.</P>

<P>Once compiled, the application runs as though it were on DOS or any other operating system. For example, Figure 62.3 shows a DOS application that has been ported to Linux and recompiled with FlagShip, and then executed. The only changes necessary to the source code were changes in path names from DOS&#146;s structure to Linux&#146;s. As you can see, even the fundamental ASCII graphics are retained and can be used on any terminal supported by Linux.</P>

<P><A NAME="Fig3"></A><A HREF="javascript:displayWindow('images/62-03.jpg',572,367 )"><IMG SRC="images/62-03t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/62-03.jpg',572,367)"><FONT COLOR="#000077"><B>Figure 62.3.</B></FONT></A>&nbsp;&nbsp;A FlagShip-compiled application runs under Linux just as it would under DOS.</P>

<H4 ALIGN="LEFT"><A NAME="Heading7"></A><FONT COLOR="#000077">Porting Existing Applications</FONT></H4>

<P>What do you have to worry about if you have some existing dBASE or Clipper code that you want to run under Linux? To start with, you need the <TT>.prg</TT> (program) source code. Move those files to Linux using any means you want, such as a network connection or floppy disk. FlagShip is clever enough to ignore case, which may seem trivial but isn&#146;t. Since most DOS programmers write in mixed case, converting applications to run under UNIX&#146;s case-significant environment is a major problem with other dBASE tools.</P>

<P>There are complete instructions on modifying code to run cleanly under FlagShip included with the software (or available through the FlagShip Web page), but essentially most application can run straight away.</P>

<P>FlagShip converts dBASE code into C source code and then compiles it with a C compiler. That means you will need a C compiler, which luckily is part of almost every UNIX and Linux system available. If you want to use FlagShip and haven&#146;t installed the C development system from the CD-ROM, you should do so; otherwise, you will see error messages from FlagShip. You don&#146;t need C&#43;&#43;, only the standard C compilers that are on the CD-ROM (including the one at the end of this book). The procedure FlagShip goes through to run an application is straightforward:</P>

<DL>

<DD><B>1.</B>&nbsp;&nbsp;Preprocess the code to make sure there are no syntax errors or other common errors. If there are errors, issue error messages and terminate the compilation.

<DD><B>2.</B>&nbsp;&nbsp;Convert to C code.

<DD><B>3.</B>&nbsp;&nbsp;Compile with the system&#146;s C compiler to produce an object file.

<DD><B>4.</B>&nbsp;&nbsp;Link the object file with FlagShip&#146;s libraries and produce an executable.

</DL>

<P>The executable thus produced can be run at the Linux command line prompt.

</P>

<P>A quick word for dBASE and Clipper veterans: you needn&#146;t bother with overlays because UNIX has no need for them. Linux uses the virtual memory on your system to enable you to load any size application (although there are limits, they can be changed). Therefore, don&#146;t bother with overlays as you would with Clipper or other xBase compilers, and instead link your code into a single, large executable. Let Linux worry about loading it.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="987-990.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="993-996.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -