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

Peter Rosin <[email protected]>
Newsgroups gmane.comp.gnu.libtool.patches
Message-ID <[email protected]>
* 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.

Signed-off-by: Peter Rosin <[email protected]>
---
 tests/with-pic.at |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

Ok to push?
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.

Cheers,
Peter

diff --git a/tests/with-pic.at b/tests/with-pic.at
index cee5e32..e4f52c2 100644
--- a/tests/with-pic.at
+++ b/tests/with-pic.at
@@ -24,7 +24,16 @@
 AT_SETUP([test --with-pic])
 eval `$LIBTOOL --config | $EGREP '^(pic_flag|FGREP)='`
 
-AT_CHECK([test -n "$pic_flag" || exit 77])
+# skip if there is no "real" pic flag (-D defines don't count)
+set x $pic_flag
+shift
+for pf; do
+  case $1 in
+    -D*) shift ;;
+    *)   break ;;
+  esac
+done
+AT_CHECK([test $# -ne 0 || exit 77])
 AT_CHECK([test . != "$at_srcdir" || exit 77])
 
 CONFIGURE=$abs_top_srcdir/tests/demo/configure
--
1.7.9
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.