libtool-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] tests: skip with-pic test when no "real" pic flag is used.


From: Peter Rosin
Subject: Re: [PATCH] tests: skip with-pic test when no "real" pic flag is used.
Date: Wed, 19 Sep 2012 11:57:20 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1

On 2012-09-19 11:20, Gary V. Vaughan wrote:
> Hi Peter,
> 
> On 19 ก.ย. 2012, at 15:56, Peter Rosin <address@hidden> wrote:
> 
>> * tests/with-pic.at: Windows uses "-DDLL_EXPORT -DPIC" as the pic
>> "flag", but never applies it to static libraries. Cater for this
>> and skip if no "real" pic flag is in use.
>> [[...]]
>>
>> Ok to push?
> 
> Yes, with nit below addressed. Thanks!
> 
>> I tried to eliminate the loop using variants of this:
>>
>> real_pic=false
>> case " $pic_flag " in
>> *" "[^-]* | *" "-[^D]*) real_pic=: ;;
>> esac
>> AT_CHECK([$real_pic || exit 77])
>>
>> ...but I never got that to work in the test. It worked in an
>> interactive bash though. Strange.
> 
> M4 will strip one level of square brackets as it generates the testsuite 
> script. Normally we just put an extra level of quoting around regexps/globs 
> to account for that:
> 
>  [*" "[^-]* | *" "-[^D]*]) real_pic=: ;; 

Doh!  Face-palm.  It's been a while...

I needed an extra space to not see "  " as a real pic flag.
This is what I pushed:

Cheers,
Peter

diff --git a/tests/with-pic.at b/tests/with-pic.at
index cee5e32..915acf5 100644
--- a/tests/with-pic.at
+++ b/tests/with-pic.at
@@ -24,7 +24,11 @@
 AT_SETUP([test --with-pic])
 eval `$LIBTOOL --config | $EGREP '^(pic_flag|FGREP)='`

-AT_CHECK([test -n "$pic_flag" || exit 77])
+real_pic=false
+case " $pic_flag " in
+[*" "[^" "-]* | *" "-[^D]*]) real_pic=: ;;
+esac
+AT_CHECK([$real_pic || exit 77])
 AT_CHECK([test . != "$at_srcdir" || exit 77])

 CONFIGURE=$abs_top_srcdir/tests/demo/configure




reply via email to

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