tech-pkg archive

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

Re: PKGSRC_PHASE



On Sun, May 05, 2013 at 06:52:25AM +0000, David Holland wrote:
> Unrelatedly:
> 
> On Sat, May 04, 2013 at 03:10:15PM +0900, Masao Uebayashi wrote:
>  > For example cc wrappers can behave differently depending on the
>  > phase.
> 
> Is there any way to get _WRAP_EXTRA_ARGS.CC to be phase-dependent?

I think that change is doable with the PKGSRC_PHASE environment.
diff --git a/mk/wrapper/wrapper.sh b/mk/wrapper/wrapper.sh
index 6849d78..ba6648d 100644
--- a/mk/wrapper/wrapper.sh
+++ b/mk/wrapper/wrapper.sh
@@ -103,10 +103,23 @@ init_queue cmdbuf
 append_extra_args=yes
 . $scan
 
+case "$PKGSRC_PHASE" in
+configure)
+       extra_args_phase=@_WRAP_EXTRA_ARGS_PHASE_CONFIGURE@
+       ;;
+build)
+       extra_args_phase=@_WRAP_EXTRA_ARGS_PHASE_BUILD@
+       ;;
+install)
+       extra_args_phase=@_WRAP_EXTRA_ARGS_PHASE_INSTALL@
+       ;;
+esac
+extra_args="@_WRAP_EXTRA_ARGS@ $extra_args_phase"
+
 case $append_extra_args in
 yes)
-       $debug_log $wrapperlog "    (wrapper.sh) append args: 
@_WRAP_EXTRA_ARGS@"
-       set -- "$@" @_WRAP_EXTRA_ARGS@
+       $debug_log $wrapperlog "    (wrapper.sh) append args: $extra_args"
+       set -- "$@" $extra_args
        ;;
 *)
        ;;


Home | Main Index | Thread Index | Old Index