<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2008 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>4.6.9 Libraries</TITLE> <META NAME="description" CONTENT="4.6.9 Libraries"> <META NAME="keywords" CONTENT="sdccman"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2008"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="sdccman.css"> <LINK REL="next" HREF="node129.html"> <LINK REL="previous" HREF="node127.html"> <LINK REL="up" HREF="node119.html"> <LINK REL="next" HREF="node129.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html2674" HREF="node129.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html2668" HREF="node119.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html2662" HREF="node127.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html2670" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html2672" HREF="node191.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html2675" HREF="node129.html">4.6.10 Adding New Devices</A> <B> Up:</B> <A NAME="tex2html2669" HREF="node119.html">4.6 The PIC16 port</A> <B> Previous:</B> <A NAME="tex2html2663" HREF="node127.html">4.6.8 Header Files</A> <B> <A NAME="tex2html2671" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html2673" HREF="node191.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <!--Table of Child-Links--> <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A> <UL> <LI><A NAME="tex2html2676" HREF="node128.html#SECTION00569100000000000000">Building the libraries</A> <LI><A NAME="tex2html2677" HREF="node128.html#SECTION00569200000000000000">Output of float values via printf()</A> </UL> <!--End of Table of Child-Links--> <HR> <H2><A NAME="SECTION00569000000000000000"></A><A NAME="sub:pic16Libraries"></A> <BR> 4.6.9 Libraries </H2> <P> The libraries<A NAME="3199"></A> that PIC16<A NAME="3200"></A> port depends on are the microcontroller device libraries which contain the symbol definitions for the microcontroller special function registers. These libraries have the format pic18fxxxx.lib, where <I>xxxx</I> is the microcontroller identification number. The specific library is selected automatically by the compiler at link stage according to the selected device. <P> Libraries are created with gplib which is part of the gputils package <TT><A NAME="tex2html52" HREF="http://sourceforge.net/projects/gputils">http://sourceforge.net/projects/gputils</A></TT>. <P> <H3><A NAME="SECTION00569100000000000000"> Building the libraries</A> </H3> <P> Before using SDCC/pic16 there are some libraries that need to be compiled. This process is done automatically if gputils are found at SDCC's compile time. Should you require to rebuild the pic16 libraries manually (e.g. in order to enable output of float values<A NAME="3204"></A> via <TT>printf()</TT>, see below), these are the steps required to do so under Linux or Mac OS X (cygwin might work as well, but is untested): <P> <DL COMPACT> <DT> <DD>cd device/lib/pic16 <P> ./configure.gnu <P> cd .. <P> make model-pic16 <P> su -c 'make install' # install the libraries, you need the root password <P> cd ../.. </DD> </DL>If you need to install the headers too, do: <P> <DL COMPACT> <DT> <DD>cd device/include <P> su -c 'make install' # install the headers, you need the root password </DD> </DL> <P> <H3><A NAME="SECTION00569200000000000000"> Output of float values via printf()</A> </H3> <P> The library is normally built without support for displaying float values, only <NO FLOAT><A NAME="3211"></A><A NAME="3212"></A> will appear instead of the value. To change this, rebuild the library as stated above, but call <TT>./configure.gnu -enable-floats </TT>instead of just <TT>./configure.gnu</TT>. Also make sure that at least <TT>libc/stdio/vfprintf.c</TT> is actually recompiled, e.g. by <TT>touch</TT>ing it after the <TT>configure</TT> run or deleting its <TT>.o</TT> file. <P> The more common appraoch of compiling <TT>vfprintf.c</TT> manually with <TT>-DUSE_FLOATS=1</TT> should also work, but is untested. <P> <HR> <!--Navigation Panel--> <A NAME="tex2html2674" HREF="node129.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html2668" HREF="node119.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html2662" HREF="node127.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html2670" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html2672" HREF="node191.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html2675" HREF="node129.html">4.6.10 Adding New Devices</A> <B> Up:</B> <A NAME="tex2html2669" HREF="node119.html">4.6 The PIC16 port</A> <B> Previous:</B> <A NAME="tex2html2663" HREF="node127.html">4.6.8 Header Files</A> <B> <A NAME="tex2html2671" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html2673" HREF="node191.html">Index</A></B> <!--End of Navigation Panel--> <ADDRESS> 2011-03-20 </ADDRESS> </BODY> </HTML>