This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A target_os conditionally applied -lfoo switch


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







Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]