[Lcdproc] Re: [PATCH] include asm/termbits.h instead of termios.h
in hd44780-serial.c
Lars Stavholm
stava@telcotec.se
Tue Apr 17 17:25:02 2007
Peter Marschall wrote:
> Hi,
>
> On Tuesday, 17. April 2007 01:32, FoX wrote:
>> This version includes <asm/temios.h> instead of <termios.h>. It also
>> fixes the compilation with our toolchain and seems less intrusive.
>> Chose the best of the two.
>
> I concur with Markus' answer: unconditionally replacing standard headers
> without checking that the change does not negatively affect other
> distributions it not the way to go.
This is exactly why the autotools (autoconf, automake,
libtool) were developed. All we have to do is use it.
> AFAIK the files in /usr/include/asm/ should not be used directly by
> user prgorams.
>
> Please try to come up with something like
>
> #ifdef __GEEXBOX__
> # include ....
> #endif
>
> where __GEEXBOX__ can be determined at configuration time.
>
> Alternatively fix the toolchain to adhere to the standards
> for Linux and BSD ;-)
Maybe something like...
In configure.in, add:
AC_CHECK_HEADERS(termios.h)
And then add:
#if HAVE_TERMIOS_H
#include <termios.h>
#endif
...in config.h.in.
I've forgotten what the original problem was,
but the above is a typical setup with autotools.
Cheers
/Lars