Bug 13892 - use m4_default and more pkg.m4 cosmetics
use m4_default and more pkg.m4 cosmetics
Status: RESOLVED FIXED
Product: pkg-config
Classification: Unclassified
Component: src
unspecified
All All
: low normal
Assigned To: Tollef Fog Heen
:
Depends on: 9704
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-02 04:42 UTC by Stepan Kasal
Modified: 2009-12-06 12:40 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
pkg.m4 cleanup (1.65 KB, patch)
2008-01-02 04:55 UTC, Stepan Kasal
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Stepan Kasal 2008-01-02 04:42:17 UTC
The following patch makes some cosmetic changes to m4 macros in pkg.m4.

1) ifelse([$7], [], [this], [$7]) is the same as m4_default([$7], [this])

2) Whitespace before each m4 parameter is ignored, so the`dnl' in the folowing is redundant:
  MACRO(dnl
  parameter)

3) Shell syntax does not allow empty command the `then' or `else' branch; that's why you can see things like:
  if test $foo = yes; then
     ifelse([$3], , :, [$3])
  fi
But if the possible empty $3 is not alone there, no magic is needed:
  if test $foo = yes; then
     echo Oh, yes!
     $3
  fi
Comment 1 Stepan Kasal 2008-01-02 04:55:21 UTC
Created attachment 13456 [details] [review]
pkg.m4 cleanup

This patch has to be applied after patch https://bugs.freedesktop.org/attachment.cgi?id=8443 from bug #9704
Comment 2 Tollef Fog Heen 2009-12-06 12:40:17 UTC
Thanks, I've taken most of your changes in 6ff8aeb.