Subject: Re: pkg/29135: x11/xorg-libs build failure on OpenBSD
To: Juan RP <juan@xtraeme.nopcode.org>
From: Hiramatsu Yoshifumi <hiramatu@boreas.dti.ne.jp>
List: pkgsrc-bugs
Date: 01/28/2005 22:13:34
Hello,

I tried your patch but it didn't work because makefile expressions are
evaluated before make targets are executed.

At Thu, 27 Jan 2005 16:17:15 +0100,
Juan RP <juan@xtraeme.nopcode.org> wrote:
> Index: Makefile.common
> ===================================================================
> RCS file: /cvsroot/pkgsrc/meta-pkgs/xorg/Makefile.common,v
> retrieving revision 1.16
> diff -b -u -u -r1.16 Makefile.common
> --- Makefile.common     25 Jan 2005 17:49:57 -0000      1.16
> +++ Makefile.common     27 Jan 2005 15:15:46 -0000
> @@ -216,8 +216,10 @@
>  .endif
>  
>  .  for F in ${SYSTEMS}
> +.    if exists(${WRKSRC}/config/cf/${F}.cf)
>         @${MV} ${WRKSRC}/config/cf/${F}.cf \
>                 ${WRKSRC}/config/cf/${F}.cf.in
> +.    endif
>  .  endfor
>  .  undef F

. if exists(${WRKSRC}/config/cf/${F}.cf)

becomes always false because this line is evaluated before xorg sources are
extracted.

Why don't you use /bin/sh builtin test command instead?

Index: Makefile.common
===================================================================
RCS file: /cvsroot/pkgsrc/meta-pkgs/xorg/Makefile.common,v
retrieving revision 1.16
diff -b -u -r1.16 Makefile.common
--- Makefile.common     25 Jan 2005 17:49:57 -0000      1.16
+++ Makefile.common     28 Jan 2005 12:58:42 -0000
@@ -216,8 +216,10 @@
 .endif
 
 .  for F in ${SYSTEMS}
-       @${MV} ${WRKSRC}/config/cf/${F}.cf \
-               ${WRKSRC}/config/cf/${F}.cf.in
+       @if ${TEST} -f ${WRKSRC}/config/cf/${F}.cf; then \
+       ${MV} ${WRKSRC}/config/cf/${F}.cf \
+               ${WRKSRC}/config/cf/${F}.cf.in ; \
+       fi
 .  endfor
 .  undef F

-- 
// Hiramatsu Yoshifumi
// hiramatu@boreas.dti.ne.jp