Article View: comp.unix.programmer
Article #3794Re: automake conditional compilation technicality
From: Ken Pizzini
Date: Tue, 04 Jan 2000 00:00
Date: Tue, 04 Jan 2000 00:00
27 lines
1770 bytes
1770 bytes
On 29 Dec 1999 13:36:56 GMT, Ian Macdonald <ian@caliban.org> wrote: >The problem is with a couple of source files that need to be compiled >only under certain circumstances. > >I currently have a Makefile.am consisting of the following: > >bin_PROGRAMS = qrcs >qrcs_SOURCES = qrcs.c qrcs.h >EXTRA_qrcs_SOURCES = ext2fs.c ext2fs.h >man_MANS = qrcs.1 >EXTRA_DIST = $(man_MANS) qrcs.spec qrcs.lsm > >The automake manual recommends assigning source files that are only >conditionally part of the build process to EXTRA_qrcs_SOURCES instead >of qrcs_SOURCES, so that is what I have done. > >The problem comes in not knowing how to inform the build process when >it should build the EXTRA_qrcs_SOURCES files. > >My configure.in checks for the existence of linux/ext2_fs.h and, if it >is found, defines HAVE_LINUX_EXT2_FS_H. That's the easy part. The configure.in should also conditionally set a configuration variable, say EXT2_FS, to ext2fs.o and have your Makefile.am say: qrcs_SOURCES = qrcs.c qrcs.h @EXT2_FS@ --Ken Pizzini
Technical Details
Message-ID:
<slrn874aji.95.ken@pulsar.halcyon.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<slrn86k3jo.h30.ian@caliban.xs4all.nl>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109f73,70579a91ac9a2bf6 X-Google-Attributes: gid109f73,public X-Google-Thread: fc89c,70579a91ac9a2bf6 X-Google-Attributes: gidfc89c,public From: ken@halcyon.com (Ken Pizzini) Subject: Re: automake conditional compilation technicality Date: 2000/01/04 Message-ID: <slrn874aji.95.ken@pulsar.halcyon.com> X-Deja-AN: 568238131 References: <slrn86k3jo.h30.ian@caliban.xs4all.nl> Mail-Copies-To: nobody X-Trace: brokaw.wa.com 947007900 8562 206.63.63.10 (4 Jan 2000 17:45:00 GMT) Organization: _ User-Agent: slrn/0.9.5.3 (UNIX) Reply-To: ken@halcyon.com NNTP-Posting-Date: 4 Jan 2000 17:45:00 GMT Newsgroups: comp.unix.programmer,gnu.utils.help