]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* tests/fail.at: Use "test -x" if available, for testing of
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 13 May 2006 18:14:36 +0000 (18:14 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 13 May 2006 18:14:36 +0000 (18:14 +0000)
executables; code modified from Autoconf's AS_EXECUTABLE_P.
Reported by Albert Chin <china@thewrittenword.com>.

ChangeLog
tests/fail.at

index 75c089326e8d2a82f38684dffedf9a660e8ddfe5..6f1d6ab67fa0d5dff1c73d278a91b8788c33943b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-05-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * tests/fail.at: Use "test -x" if available, for testing of
+       executables; code modified from Autoconf's AS_EXECUTABLE_P.
+       Reported by Albert Chin <china@thewrittenword.com>.
+
 2006-04-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * libltdl/config/ltmain.m4sh (func_write_libtool_object):
index edc8702ad44c07529cb4cf613e648bfb6ef83119..27f0395a0abfad8771471427fdfe29e1ffa70998 100644 (file)
@@ -28,6 +28,17 @@ m4_pushdef([FAIL_CHECK],
 [AT_CHECK([if $1; then (exit 1); else :; fi], [0], [ignore], [ignore])
 ])
 
+AT_DATA([script],
+[[#! /bin/sh
+exit 0
+]])
+chmod +x script
+if test -x script >/dev/null 2>&1; then
+  test_x="test -x"
+else
+  test_x=:
+fi
+
 # compile failure
 echo 'choke me' > a.c
 FAIL_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c a.c])
@@ -52,9 +63,9 @@ esac
 echo 'int not_main(void) { return 0; }' > a.c
 $CC $CPPFLAGS $CFLAGS -c a.c
 FAIL_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o a a.$OBJEXT])
-AT_CHECK([test -f a || test -f a$EXEEXT], [1])
+AT_CHECK([{ test -f a && $test_x a; } || { test -f a$EXEEXT && $test_x a$EXEEXT; }], [1])
 FAIL_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o a a.$OBJEXT -static])
-AT_CHECK([test -f a || test -f a$EXEEXT], [1])
+AT_CHECK([{ test -f a && $test_x a; } || { test -f a$EXEEXT && $test_x a$EXEEXT; }], [1])
 
 # shared library creation failure
 case $build_libtool_libs in yes)