diff options
author | jlam <jlam@pkgsrc.org> | 2004-12-05 03:43:18 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-12-05 03:43:18 +0000 |
commit | 835c300b47fa95beb7f8f287fde55e647ab88d50 (patch) | |
tree | b38c198495594ce06b54b8aaee6b4c646a68c5e1 /mk/wrapper/logic | |
parent | c46a5f786c90fc9cb46fcaffa28afe0df7f93f35 (diff) | |
download | pkgsrc-835c300b47fa95beb7f8f287fde55e647ab88d50.tar.gz |
Allow the wrapper-specific transform scripts to replace one arg with
several args by setting split_arg="yes" as part of the transformation.
Diffstat (limited to 'mk/wrapper/logic')
-rw-r--r-- | mk/wrapper/logic | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/mk/wrapper/logic b/mk/wrapper/logic index 84a969dc3dc..d30e31d4a03 100644 --- a/mk/wrapper/logic +++ b/mk/wrapper/logic @@ -1,4 +1,4 @@ -# $NetBSD: logic,v 1.6 2004/10/08 21:53:53 jlam Exp $ +# $NetBSD: logic,v 1.7 2004/12/05 03:43:18 jlam Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -207,6 +207,7 @@ while ! queue_is_empty argbuf; do *) # Apply transformations to $arg. addtocache=no + split_arg=no case $skip_transform in yes) $debug_log $wrapperlog " (logic) to: $arg [untransformed]" @@ -231,12 +232,22 @@ while ! queue_is_empty argbuf; do ;; esac + ############################################## + # Split all -l options along whitespace. This + # disallows library names with whitespace, but it + # allows us to handle transformations that look + # like, e.g. "-lreadline" -> "-ledit -ltermcap". + ############################################## + case $arg in + -l*) split_arg=yes ;; + esac + # Re-create the cache file if we're adding to it. case $updatecache,$addtocache in yes,yes) shquote "$arg"; cachedarg="$shquoted" $cat >> $cache_body << EOF -$cachearg) arg=$cachedarg; cachehit=yes ;; +$cachearg) arg=$cachedarg; split_arg=$split_arg; cachehit=yes ;; EOF $cat $cache_header \ $cache_body \ @@ -245,23 +256,24 @@ EOF esac ;; esac - case $arg in + + case $split_arg in ###################################################### - # Split -l options along whitespace. This disallows - # library names with whitespace, but it allows us to - # handle transformations that look like, e.g. - # "-lreadline" -> "-ledit -ltermcap". + # Split some options along whitespace. This disallows + # options that contain whitespace, but it allows us to + # handle transformations that transform one arg into + # several. ###################################################### - -l*) - for lib in $arg; do - append_queue cmdbuf "$lib" - $debug_log $wrapperlog " (logic) push: $lib" + yes) + for i in $arg; do + append_queue cmdbuf "$i" + $debug_log $wrapperlog " (logic) push: $i" done ;; ###################################################### # Everything else goes into the command buffer unchanged. ###################################################### - *) + no) append_queue cmdbuf "$arg" $debug_log $wrapperlog " (logic) push: $arg" ;; |