[Lcdproc] preliminary Solaris patch for review

Markus Dolze bsdfan at nurfuerspam.de
Thu Apr 23 17:51:47 UTC 2009


Larson, Timothy E. wrote:
>> yesterday I had the chance to look at your patch. Find my comments below.
> 
> (clients/lcdexec/lcdexec.c)
>>
>> But anyway, the programs include "getopt.h", not <getopt.h> - so it
>> should not be your system's getopt.h. This is because LCDproc does have
>> its own getopt implementation, which is not used by default. But I
>> wonder if that really works, or if "shared/getopt.h" needs to be included.
>>
>> More interestingly configure does not check for 'getopt()', but
>> 'getopt_long()' which is used nowhere (see configure.in, line 191).
>>
>> AFAIK 'getopt()' is part specified by posix, but 'getopt_long()' is an
>> extension. On FreeBSD i.e. it is sufficient to include 'unistd.h' to be
>> able to use 'getopt()'.
>>
>> Did compiling failed on Solaris with an error regarding 'getopt()'?
>> After reading the Sun documentation I'm not sure if Solaris 9 has
>> getopt_long(), thus resulting in LCDprocs own getopt() implementation to
>> be used which may not work.
> 
> lcdexec.c:23:20: error: getopt.h: No such file or directory
> 
> Since I did not find a "getopt.h" in the local dir, I assumed there used to be one which had been removed, and the include fell back to search the standard paths for it.  I didn't even look in shared.  If this is meant to pick up that one, it should be "shared/getopt.h" right?  I could try going that route instead, and see if it works.
> 
> Very strange to me that others are getting this to build.  FWIW, my system declares getopt in stdio.h, stdlib.h, and unistd.h.
> 
>> In the end it might be sufficient to replace the
>> 'AC_CHECK_FUNC(getopt_long)' with 'AC_CHECK_FUNC(getopt)'.
> 
> Checking for getopt() and conditionally including the local declaration based on that, rather than existence of getopt.h, makes sense.
> 

Hi,

does the server compile if you run 'make server' from the top level 
directory (with your driver patches)? The server core files do include 
'(top_srcdir)/shared' in the header search path.

Regards,
Markus


More information about the LCDproc mailing list