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