delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/01/09/03:51:26

Message-ID: <3696B7AC.C445D895@gmx.net>
Date: Sat, 09 Jan 1999 00:58:04 -0100
From: Robert Hoehne <robert DOT hoehne AT gmx DOT net>
Organization: none provided
X-Mailer: Mozilla 4.07 [de] (Win95; I)
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: shell utils 1.16 question
References: <Pine DOT LNX DOT 3 DOT 93 DOT 990108195028 DOT 5351C-100000 AT acp3bf> (message from Hans-Bernhard Broeker on Fri,
8 Jan 1999 19:54:42 +0100 (MET)) <199901082127 DOT VAA20686 AT out4 DOT ibm DOT net>
Reply-To: djgpp-workers AT delorie DOT com

Mark E. wrote :
> 
> about it, I've concluded the best way to handle the test -f vs. autoconf is
> to submit a patch to change "test -f" to "test -x" at certain places in
> AC_CHECK_PROG and AC_PATH_PROG in autoconf. That way

I did this already a long time ago. And I have sent this patch
also to the gnu-utils list, but it seems, that it was ignored.

This patch checks at first, if the -x swicth is supported
by the shell, and then it is used, since I was told, that
not any shell can handle the -x switch.

--- acgeneral.m4~	Tue Nov 26 19:09:42 1996
+++ acgeneral.m4	Sat Jan  9 00:52:34 1999
@@ -1262,6 +1262,15 @@
 [errprint(__file__:__line__: warning: [$1] is obsolete[$2]
 )])
 
+dnl ### Check if "test -x" is available.
+AC_DEFUN(AC_TEST_X,
+[echo "" >conftest.x
+test -x conftest.x
+case $? in
+0 | 1) ac_test_x_option=-x ;;
+*) ac_test_x_option=-f ;;
+esac
+rm -f conftest.x])
 
 dnl ### Checking for programs
 
@@ -1272,6 +1281,7 @@
 [# Extract the first word of "$2", so it can be a program name with args.
 set dummy $2; ac_word=[$]2
 AC_MSG_CHECKING([for $ac_word])
+AC_REQUIRE([AC_TEST_X])
 AC_CACHE_VAL(ac_cv_prog_$1,
 [if test -n "[$]$1"; then
   ac_cv_prog_$1="[$]$1" # Let the user override the test.
@@ -1284,7 +1294,7 @@
 dnl not every word.  This closes a longstanding sh security hole.
   for ac_dir in ifelse([$5], , $PATH, [$5$ac_dummy]); do
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
+    if test $ac_text_x_option $ac_dir/$ac_word; then
 ifelse([$6], , , dnl
 [      if test "[$ac_dir/$ac_word]" = "$6"; then
         ac_prog_rejected=yes
@@ -1336,6 +1346,7 @@
 [# Extract the first word of "$2", so it can be a program name with args.
 set dummy $2; ac_word=[$]2
 AC_MSG_CHECKING([for $ac_word])
+AC_REQUIRE([AC_TEST_X])
 AC_CACHE_VAL(ac_cv_path_$1,
 [case "[$]$1" in
   /*)
@@ -1348,7 +1359,7 @@
 dnl not every word.  This closes a longstanding sh security hole.
   for ac_dir in ifelse([$4], , $PATH, [$4$ac_dummy]); do
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
+    if test $ac_text_x_option $ac_dir/$ac_word; then
       ac_cv_path_$1="$ac_dir/$ac_word"
       break
     fi


BTW: I was the person, who haven't sent the djconfig.sh
to the maintainer, since I thought, that it belongs only
to the DJGPP port, but I'm learning for future projects.

Robert
-- 
******************************************************
* email:   Robert Hoehne <robert DOT hoehne AT gmx DOT net>     *
* Post:    Am Berg 3, D-09573 Dittmannsdorf, Germany *
* WWW:     http://www.tu-chemnitz.de/~sho/rho        *
******************************************************


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019