[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A target_os conditionally applied -lfoo switch
From: |
Ralf Corsepius |
Subject: |
Re: A target_os conditionally applied -lfoo switch |
Date: |
13 Nov 2002 19:35:56 +0100 |
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
> endif
>
>
> Unfortunately automake thinks the conditional belongs to it instead of make.
>
> Help?
1. Ugly "You-don't-really-want to-apply-it"; brute-force approach:
Add this to your configure.ac:
AC_SUBST(ENDIF,endif)
and use @ENDIF@ instead of endif inside of you Makefile.am
2. Check $host_* inside of your configure.ac and setup a conditional,
eg. something along this example
AM_CONDITIONAL(MINGW,test x"$host_os" == "mingw32")
And apply @MINGW@ inside of your Makefile.am
3. Apply an autoconf-lib checks to determine when adding this lib is
necessary.
4. Tell your users to use ./configure LIBS=-lws2_32 or similar
Ralf