From: Ralf Wildenhues Date: Sat, 13 May 2006 18:14:36 +0000 (+0000) Subject: * tests/fail.at: Use "test -x" if available, for testing of X-Git-Tag: release-2-1b~300 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d129c269b000148f97d5d6bce76513f22b694f9e;p=thirdparty%2Flibtool.git * tests/fail.at: Use "test -x" if available, for testing of executables; code modified from Autoconf's AS_EXECUTABLE_P. Reported by Albert Chin . --- diff --git a/ChangeLog b/ChangeLog index 75c089326..6f1d6ab67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-05-13 Ralf Wildenhues + + * tests/fail.at: Use "test -x" if available, for testing of + executables; code modified from Autoconf's AS_EXECUTABLE_P. + Reported by Albert Chin . + 2006-04-22 Ralf Wildenhues * libltdl/config/ltmain.m4sh (func_write_libtool_object): diff --git a/tests/fail.at b/tests/fail.at index edc8702ad..27f0395a0 100644 --- a/tests/fail.at +++ b/tests/fail.at @@ -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)