[Top][All Lists]

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

Re: A target_os conditionally applied -lfoo switch

From: Earnie Boyd
Subject: Re: A target_os conditionally applied -lfoo switch
Date: Wed, 13 Nov 2002 14:49:18 -0500
User-agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.1) Gecko/20020826

Ralf Corsepius wrote:
Am Mit, 2002-11-13 um 19.08 schrieb Earnie Boyd:

I need to add a library specific to a target_os. I've tried several possible techniques and can't get cooperation from the tools.

What I want is something similar to:

target_os := @target_os@

ifeq ($(target_os),mingw32)
  LDADD += -lws2_32

Unfortunately automake thinks the conditional belongs to it instead of make.


1. Ugly "You-don't-really-want to-apply-it"; brute-force approach:

Add this to your
and use @ENDIF@ instead of endif inside of you

I may try this but

2. Check $host_* inside of your and setup a conditional,
eg. something along this example
AM_CONDITIONAL(MINGW,test x"$host_os" == "mingw32")
And apply @MINGW@ inside of your

this I had tried already. However I had forgotten the last step. Trying again I have: with
  AM_CONDITIONAL(WINDOWS, test x$target_os == xmingw32) with
  LDADD += -lws2_32

But I can't tell if is correct totally. It doesn't contain the `if WINDOWS' condition at all. It does contain various WINDOWS generated parts based on what should happen with AM_CONDITIONAL.

3. Apply an autoconf-lib checks to determine when adding this lib is

I'm researching this.

4. Tell your users to use ./configure LIBS=-lws2_32 or similar

That I want to avoid.


P.S.: I'm using 1.7.1 of Automake and version 2.54 of Autoconf.

reply via email to

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