This is the mail archive of the automake-prs@sources.redhat.com 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]

automake/326: Bug with conditionally defined variables used in _SOURCES



>Number:         326
>Category:       automake
>Synopsis:       Bug with conditionally defined variables used in _SOURCES
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    tromey
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 31 04:21:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     richard@tartarus.org
>Release:        1.6.1, branch 1.6 CVS, CVS HEAD
>Organization:
>Environment:
Debian GNU/Linux
>Description:
When trying to build GStreamer, I found that a makefile which conditionally included various sources was causing the link step to link in the first of these sources multiple times, and ignoring subsequent conditional sources.  I have reduced the problem to a minimal testcase - the problem only seems to  manifest itself when a variable used in _SOURCES is defined in only the negative case of the conditional.

ie:
 if TWO
 STWO =
 else
 STWO = two.c
 endif

If the above is replaced with:
 if !TWO
 STWO = two.c
 endif
then the makefile.in is generated correctly.

There may be further subtleties; it may be possible to reduce the testcase attached, but my attempts so far have resulted in the problem disappearing.
>How-To-Repeat:
Run the attached test case.

I would expect the generated Makefile.in to contain the lines:
@ONE_TRUE@am__objects_1 = one.$(OBJEXT)
@TWO_TRUE@am__objects_2 =
@TWO_FALSE@am__objects_2 = two.$(OBJEXT)
@THREE_TRUE@am__objects_3 =
@THREE_FALSE@am__objects_3 = three.$(OBJEXT)
am_targ_OBJECTS = $(am__objects_1) $(am__objects_2) $(am__objects_3)

Instead, it contains
@ONE_TRUE@am__objects_1 = one.$(OBJEXT)
@TWO_TRUE@am__objects_2 =
@TWO_FALSE@am__objects_2 = two.$(OBJEXT)
@THREE_TRUE@am__objects_2 =
@THREE_FALSE@am__objects_2 = three.$(OBJEXT)
am_targ_OBJECTS = $(am__objects_1) $(am__objects_2) $(am__objects_2)
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="cond21.test"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="cond21.test"

IyEgL2Jpbi9zaAoKIyBSZWdyZXNzaW9uIHRlc3QgZm9yIGJ1ZyB3aGVuIHNvdXJjZXMgbGlzdGVk
IGluIGNvbmRpdGlvbmFsLgojIFJlcG9ydCBmcm9tIFJpY2hhcmQgQm91bHRvbgoKLiAkc3JjZGly
L2RlZnMgfHwgZXhpdCAxCgpjYXQgPiBjb25maWd1cmUuaW4gPDwgJ0VORCcKQUNfSU5JVApBTV9J
TklUX0FVVE9NQUtFKG5vbmVzdWNoLCBub25lc3VjaCkKQUNfUFJPR19DQwpBTV9DT05ESVRJT05B
TChPTkUsIHRydWUpCkFNX0NPTkRJVElPTkFMKFRXTywgZmFsc2UpCkFNX0NPTkRJVElPTkFMKFRI
UkVFLCBtYXliZSkKQUNfT1VUUFVUKE1ha2VmaWxlKQpFTkQKCmNhdCA+IE1ha2VmaWxlLmFtIDw8
ICdFTkQnCmJpbl9QUk9HUkFNUyA9IHRhcmcKCmlmIE9ORQpTT05FID0gb25lLmMKZW5kaWYKCmlm
IFRXTwpTVFdPID0gCmVsc2UKU1RXTyA9IHR3by5jCmVuZGlmCgppZiBUSFJFRQpTVEhSRUUgPSAK
ZWxzZQpTVEhSRUUgPSB0aHJlZS5jCmVuZGlmCgp0YXJnX1NPVVJDRVMgPSAkKFNPTkUpICQoU1RX
TykgJChTVEhSRUUpCkVORAoKJEFDTE9DQUwgfHwgZXhpdCAxCiRBVVRPTUFLRSB8fCBleGl0IDEK
CiMgYGIgdG9wJyBzbyB0aGF0CnNlZCAtbiAnCi9bb09dW2JCXVtqSl1bZUVdW2NDXVt0VF0uKiA9
LyB7CiAgOiBsb29wCiAgL1xcJC8gewogICAgcAogICAgbgogICAgYiBsb29wCiAgfQogIHAKfScg
TWFrZWZpbGUuaW4gPnByb2R1Y2VkCgpjYXQgPmV4cGVjdGVkIDw8ICdFT0YnCkBPTkVfVFJVRUBh
bV9fb2JqZWN0c18xID0gb25lLiQoT0JKRVhUKQpAVFdPX1RSVUVAYW1fX29iamVjdHNfMiA9CkBU
V09fRkFMU0VAYW1fX29iamVjdHNfMiA9IHR3by4kKE9CSkVYVCkKQFRIUkVFX1RSVUVAYW1fX29i
amVjdHNfMyA9CkBUSFJFRV9GQUxTRUBhbV9fb2JqZWN0c18zID0gdGhyZWUuJChPQkpFWFQpCmFt
X3RhcmdfT0JKRUNUUyA9ICQoYW1fX29iamVjdHNfMSkgJChhbV9fb2JqZWN0c18yKSAkKGFtX19v
YmplY3RzXzMpCnRhcmdfT0JKRUNUUyA9ICQoYW1fdGFyZ19PQkpFQ1RTKQpFT0YKCmRpZmYgZXhw
ZWN0ZWQgcHJvZHVjZWQgfHwgZXhpdCAxCg==


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