automake
[Top][All Lists]
Advanced

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

Re: conditionally linking to mingw32 library


From: Ralf Wildenhues
Subject: Re: conditionally linking to mingw32 library
Date: Wed, 1 Jun 2005 16:12:03 +0200
User-agent: Mutt/1.4.1i

Hi Mark,

* Mark Brand wrote on Wed, Jun 01, 2005 at 02:41:58PM CEST:
>
> to my situation, but I'm getting stuck. I have:
> 
> <configure.ac>
>  if test x$target_os == xmingw32; then

Don't use the test operator `==' , it's unportable and completely
superfluous, as `=' does string comparison just fine.

>     WINSOCK=-lws2_32
>  fi
>  AC_SUBST(WINSOCK)
> </configure.ac>
> 
> <Makefile.am>
>  myprogram_LDADD := @LTLIBINTL@ @WINSOCK@

Use
  myprogram_LDADD = $(LTLIBINTL) $(WINSOCK)

as `:=' assignment is not portable, and, as you already learned,
automake will set the WINSOCK make variable for you in the generated
Makefile.in.  (The recommendation to use the make variables over the
substituted values is rather one of style.)

> </Makefile.am>
> 
> My generated Makefile contains:
> 
>     WINSOCK = @WINSOCK@
> 
> When I build (for either target) I get this error:
> 
>     g++  -g -O2   -o myprogram  main.o  @WINSOCK@
>     g++: @WINSOCK@: No such file or directory
>     make[2]: *** [myprogram Error 1
> 

Let me guess: You did rerun automake but forgot rerunning either
autoconf or configure (in that order)?

Regards,
Ralf




reply via email to

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