It was decided pretty early in LCDproc's life to use GNU autoconf and GNU automake. This allows LCDproc to be ported to several platforms with much less effort. It can be quite daunting to understand how autoconf & automake interact with each others and with your code, but don't be discouraged. We have taken great care in making this as simple as possible for programers to add their own driver to LCDproc. Hopefully, you'll only have to modify two files, one for autoconf and one for automake.
The first thing you need to do is to find a name for your driver, it should be as descriptive as possible; most drivers are named after their respective chipset, for example hd44780, mtc_s16209x, sed1330 and stv5730, others are named after the company that makes that particular LCD display, for example CFontz and MtxOrb. Remember that these names are case sensitive. In this chapter, we'll use myDriver (which is an absolute non-descriptive name).
</para>
<sect2 id="autoconf">
<title>Autoconf and its friend, acinclude.m4</title>
<para>
You need to add your driver to function LCD_DRIVERS_SELECT of file acinclude.m4. This can be done in three steps.
</para>
<sect3 id="autoconf-step1">
<title>Step 1</title>
<para>
First you need to add your driver name to the list of possible choices in the help screen.
<para>Then last, you need to add your driver to be big switch-case in this function, see below.</para>
<screen>
myDriver)
DRIVERS="$DRIVERS myDriver${SO}"
actdrivers=["$actdrivers myDriver"]
;;
</screen>
<para>
If your driver only works in some platform or requires a particular library or header, you can add your autoconf test here. You can see how other drivers do it, but if you're not sure on how to do this, just send an email to the mailing list and we'll make it for you.
</para>
</sect3>
</sect2>
<sect2 id="automake">
<title>Automake and its friend, Makefile.am</title>
<para>Allready half of the job is done! Not to bad, wasn't it? The rest should be just as easy. In this section, you'll be adding your driver to the file server/drivers/Makefile.am. As you can guess, it's the Makefile for the drivers. This can be done in three (or two) simple steps.</para>
<sect3 id="automake-step1">
<title>Step 1</title>
<para>First, you need to add your driver to the list of drivers in this file, this list is called EXTRA_PROGRAMS.</para>
<para>This second step is only needed if your driver needs a particular library. If it doesn't, you can skip to step 3.</para>
<para>You basically need to put you driver name followed by _LDADD and egal this to the name of the library that you need. Usually, these library are substituted by a autoconf variable, if you're not comfortable with this, you send an email to the mailing list and we'll set this up for you.</para>
<para>For example, we would put this for our fictional driver</para>