automake
[Top][All Lists]
Advanced

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

Re: ifeq/else/endif problem


From: Raja R Harinath
Subject: Re: ifeq/else/endif problem
Date: 27 Oct 2000 14:52:20 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Patrick Guio <address@hidden> writes:
> I am trying to insert a conditional part in a Makefile.am in the following
> way :
> 
> ## 2-dimensions library
> libmudfas2d_la_SOURCES = $(MUDSRC)
> ifeq ($(CXX),cxx)
>   libmudfas2d_la_CXXFLAGS = -ptr mudfas2d -DDIM=2
>   libmudfas2d_la_LDFLAGS = mudfas2d/*.o -version-info 0:0:0
> else
>   libmudfas2d_la_CXXFLAGS = -DDIM=2
>   libmudfas2d_la_LDFLAGS = -version-info 0:0:0
> endif
> 
> But when running automake I get
> 
> % automake -a -c --include-deps 
> src/Makefile.am:24: endif without if
> src/Makefile.am:31: else without if
> src/Makefile.am:34: endif without if
> src/Makefile.am:41: else without if
> src/Makefile.am:44: endif without if

Automake has its own conditional, which, unfortunately, share keywords
with GNU make conditionals.  If you can convert your checks above to
automake conditionals, that would be good.

In configure.in, do

   AM_CONDITIONAL(COMPILER_IS_COMPAQ_CXX, [test x"$CXX" = xcxx])

and in Makefile.am, do

   if COMPILER_IS_COMPAQ_CXX
     foo
   else
     bar
   endif

Otherwise, in case of extreme duress, try this (untested):

In configure.in, 

   MK=''; AC_SUBST(MK)

And in Makefile.am:

   @address@hidden ...
            foo
   @address@hidden
            bar
   @address@hidden

However, you cannot put in automake magic variables (things like
foo_SOURCES, foo_LDFLAGS, etc) inside an ifeq/else/endif.  Rather, you
can, but automake will get extremely confused if you do ;-)

- Hari
-- 
Raja R Harinath ------------------------------ address@hidden
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash



reply via email to

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