[Goodies-dev] [Wavelan] compile error

James Westby jw+xfce at jameswestby.net
Sun Jan 7 23:47:32 CET 2007


On (07/01/07 22:57), Maximilian Schleiss wrote:
> Hi all,
> 
> I try to compile the latest SVN version of the Wavelan plugin but when I 
> do ./autogen.sh I get this message after a while:
> 
> configure: WARNING: linux/wireless.h: present but cannot be compiled
> configure: WARNING: linux/wireless.h:     check for missing prerequisite 
> headers?
> configure: WARNING: linux/wireless.h: see the Autoconf documentation
> configure: WARNING: linux/wireless.h:     section "Present But Cannot Be 
> Compiled"
> configure: WARNING: linux/wireless.h: proceeding with the preprocessor's 
> result
> configure: WARNING: linux/wireless.h: in the future, the compiler will 
> take precedence

This is a change warning about a future change in the way autoconf will
work, as it will break this plugin when they make the change.

The problem is that if you create a test program that is just

  #include <linux/wireless.h>

then cpp will process it fine as it can find the file and include it.
However gcc has a problem as it will find that some of the symbols are
not found that are used in this file. This is in particular struct
sockaddr which linux/wireless.h expects to get when it #includes
linux/socket.h.

However in that file the definition of struct sockaddr is surrounded by
a #if that only defines it if it is being included by the kernel, or if
an old version of glibc is being used. This is not the case here so the
test program doesn't get the definition and so has a problem.

The other place that struct sockaddr is defined is in sys/socket.h. This
is the usual place to get it, and in fact panel-plugin/wi_linux.h
#includes it before linux/wireless.h, and so struct sockaddr is defined
and the plugin will compile and run fine.

I wasn't too bothered about the warning as it all worked, but your post
triggered me to look in to it, and writing this led me to the solution:

  Get the test program used by autoconf to #include <sys/socket.h>
  before linux/wireless.h.

I have just committed this fix (2314), could you try it out and ensure that
it works for you?

Thanks,

James





More information about the Goodies-dev mailing list