automake
[Top][All Lists]
Advanced

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

Re: [automake] Two CVS Projects, One Build Environment


From: Simon Richter
Subject: Re: [automake] Two CVS Projects, One Build Environment
Date: Wed, 23 Jul 2003 11:42:20 +0200
User-agent: Mutt/1.5.4i

Scott,

> For this project I have some code that I want to share between two
> separate software projects.  I would like each of these software projects
> to conditionally-compile and link my software extensions.

>   AC_ARG_ENABLE([extra],dnl
>   [  --enable-extra      Enable extra hooks],[
>     ln -s $enableval extra_link
>     DIR=extra_link
>   ],[
>     DIR=extra_stub
>   ])
>   AC_OUTPUT($DIR/Makefile)

This is not the way conditionals work in automake. AM always needs to be
able to determine which files must go in the distribution, which is not
possible with your setup, since there is no way a program could analyze
what values $DIR can take.

Instead, you could write

AC_CONFIG_FILES(extra_link/Makefile extra_stub/Makefile)
AC_ARG_ENABLE([extra],dnl
        AC_HELP_STRING([--enable-extra],[Enable extra hooks]))
AM_CONDITIONAL([EXTRASTUFF],[test "$enable_extra" = "yes"])

and then in the Makefile.am

if EXTRASTUFF
EXTRADIR = extra_link
else
EXTRADIR = extra_stub
endif
SUBDIRS = $(EXTRADIR)

> So, I wanted to ask this list if anyone has any experience with a setup
> like this.  Can anyone recommend a minimal, effective method for having
> two separate software projects conditionally build and link a totally
> independent source tree?  How do I configure automake (and configure,
> for that matter) to do this?

Building an external source tree is not supported. You should build the
extension separately (i.e. make it a separate package) and have the user
build it before the other packages.

   Simon

-- 
GPG Fingerprint: 040E B5F7 84F1 4FBC CEAD  ADC6 18A0 CC8D 5706 A4B4

Attachment: pgp2fttVDkryD.pgp
Description: PGP signature


reply via email to

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