[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: automake

From: Ralf Wildenhues
Subject: Re: automake
Date: Fri, 25 Nov 2005 08:48:47 +0100
User-agent: Mutt/1.5.11

Hi Adnan,

* Adnan Shaheen wrote on Fri, Nov 25, 2005 at 06:59:16AM CET:
> Well I am writting some code, you tell me what should the compiler do when I
> compile it.
> As earlier I told you about I am working on a LINUX machine.
> #ifdef LINUX
> #include <sys/socket.h>
> #else // !(LINUX)
> #include <winsock.h>
> #endif // LINUX

Autoconf-style for this would be to add
  AC_CHECK_HEADERS([sys/socket.h winsock.h])
to, and to change your code like this:  Put

# include <config.h>

at the very top of your .c files (this is so the code works whether you
use AC_CONFIG_HEADERS or not), and change above snippet to

#include <stdlib.h>
# include <sys/socket.h>
# include <winsock.h>

The Autoconf manual notes that stdlib.h should be included before
sys/socket.h for Darwin.

> I think you understand this simple code, I want to open the socket.h header
> when I am under LINUX and winsock.h header when I am working on the WINDOWS
> machine. So what the compiler did to me, is that, it was trying to open the
> winsock.h header instead of socket.h.
> As when I wrote the makefile mannually, It works fine.

That's likely because your manual makefile defines LINUX somewhere, and
the automake-generated one doesn't.  It's not necessary, though, see


reply via email to

[Prev in Thread] Current Thread [Next in Thread]