automake-patches
[Top][All Lists]
Advanced

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

[Fwd: Doc problem]


From: cedric pinson
Subject: [Fwd: Doc problem]
Date: Tue, 09 Nov 2004 12:08:04 +0100
User-agent: Mozilla Thunderbird 0.8 (X11/20041104)

--- Begin Message --- Subject: Doc problem Date: Mon, 08 Nov 2004 13:19:03 +0100 User-agent: Mozilla Thunderbird 0.8 (X11/20041104)
Hello,
I had a problem to pass a option from configure to my makefile. I have followed the doc about AM_CONDITIONAL with this scheme:
     if COND_OPT
       MAYBE_OPT = opt
     endif
     SUBDIRS = src $(MAYBE_OPT)

but when I ran automake i have an error about the variable MAYBE_OPT (MAYBE_OPT is undefined). To resolve that we have added this code:
     if COND_OPT
       MAYBE_OPT = opt
     else
       MAYBE_OPT =
     endif
     SUBDIRS = src $(MAYBE_OPT)
And all seems to be ok. It's not a big problem but when we follow the documentation it doesnot work. So this is a patch for the documentation.

But maybe i am wrong and the documentation explains in detail this behaviour.

Cheers
Cedric

here the whole original paragraph from documentation:
=================================================================================
Conditional subdirectories with AM_CONDITIONAL

configure should output the Makefile for each directory and define a condition into which opt/ should be built.

     ...
     AM_CONDITIONAL([COND_OPT], [test "$want_opt" = yes])
     AC_CONFIG_FILES([Makefile src/Makefile opt/Makefile])
     ...


Then SUBDIRS can be defined in the top-level Makefile.am as follows.

     if COND_OPT
       MAYBE_OPT = opt
     endif
     SUBDIRS = src $(MAYBE_OPT)


As you can see, running make will rightly recurse into src/ and maybe opt/.

As you can't see, running make dist will recurse into both src/ and opt/ directories because make dist, unlike make all, doesn't use the SUBDIRS variable. It uses the DIST_SUBDIRS variable.

In this case Automake will define DIST_SUBDIRS = src opt automatically because it knows that MAYBE_OPT can contain opt in some condition.
? patch
Index: doc/automake.texi
===================================================================
RCS file: /cvs/automake/automake/doc/automake.texi,v
retrieving revision 1.65
diff -r1.65 automake.texi
2362a2363,2364
> else
>   MAYBE_OPT = 

--- End Message ---

reply via email to

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