bug-automake
[Top][All Lists]
Advanced

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

Automake 1.5 automatic dependencies broken with conditional _LDADD


From: Rob Leslie
Subject: Automake 1.5 automatic dependencies broken with conditional _LDADD
Date: Sun, 13 Jan 2002 23:58:19 -0800

Hello,

I've discovered what I think is a bug in the automatic dependency rules
generated by automake 1.5 (_DEPENDENCIES generated from _LDADD) when the
_LDADD variable depends on a conditional variable.

For example:

  if COND
  cond_var = cond_value
  endif

  bin_PROGRAMS = foo

  foo_DEPENDENCIES = foo_depend
  foo_LDADD = $(cond_var)

This results in:

  Makefile.am:7: foo_DEPENDENCIES was already defined in condition TRUE, which
  implies condition COND_TRUE

    foo_DEPENDENCIES (User, where = 7) =
    {
      TRUE => foo_depend
    }
  Makefile.am:7: foo_DEPENDENCIES was already defined in condition TRUE, which
  implies condition COND_FALSE

    foo_DEPENDENCIES (User, where = 7) =
    {
      TRUE => foo_depend
      COND_TRUE => cond_value
    }

I've looked at the code, and I think the problem stems from line 2245:

  if ($xname ne '' && ! &variable_defined ($xname . '_DEPENDENCIES', $cond))
  {
    &define_pretty_variable ($xname . '_DEPENDENCIES', $cond, @dep_list);
  }

This only checks whether $xname . '_DEPENDENCIES' is defined in the current
condition and fails to check whether it is defined in condition TRUE (unless
$cond is 'TRUE' of course).

Perhaps an additional check is appropriate:

  if ($xname ne '' && ! &variable_defined ($xname . '_DEPENDENCIES', $cond)
      && ! &variable_defined ($xname . '_DEPENDENCIES', 'TRUE'))

This seems to correct the problem for me.

BTW, this was not a problem in automake 1.4.

Thanks,

-- 
Rob Leslie
address@hidden



reply via email to

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