Now that I've made sufficient progress on my AVR and FTDI-based project,
I've started to revisit the initial implementation I did to use FTDI
bit-bang mode to serial program AVRs (patch #4330.)
The patch was Cygwin only, and used FTDI's DLL library to access the
I'd now like to port this functionality to Linux, and use the
libftdi/libusb interface (and eventually go back to Cygwin and use the
equivalent libraries ported to Win32).
For the code, I understand the build system creates WIN32NATIVE and
__linux__ defines (among others), so I can pretty easily conditionalize
the things that would platform specific. But I'm at a loss on how to do
this for the build system itself.
Specifically, for Cygwin builds, I need to tell the build system to link
in the FTD2XX.lib export file during the linking stage. Right now I'm
just hard coding a 'avrdude_LDADD' entry in Makefile.am, along with a
fixed path to the location of the file.
For Linux, I need to tell it to statically link in libftdi.a.
Not being an autoconf/automake guru, I have no clue how to make it such
that the appropriate things happen only in the specific build environments.
While I'm fiddling with the build system, for Cygwin-builds I'd like to
make the location of the FTD2XX.lib file a little more configurable.
(Or, is there a standard location for this?)
Finally there is the issue of what to call the interface (as text) to
pass to the -P command line parameter. The simple mode of FTD2XX.DLL
has an integer identifier, and I had originally planned to use
where xx is the integer (though my patch has it hard coded to the first
device found.) But with libftdi's open call you specify the vendor and
product id, which may not be FTDI's but an OEM's. And the FT2232 part
has two ports. Without over-engineering this, what's a simple way to