Hi,

To tell the truth, I've been bothering this problem at the configure
time, also expecting there are other IRIX users in secret :-(

The problem I have (possibly) exists at line 4831 in the "Configure".
Please see the following script I cut and modified from Configure:

--from here (signal.sh)
#!/bin/sh

cat=/usr/freeware/bin/cat
cc='ccache gcc'
optimize=-O2
ccflags='-W -Wall -Wformat=2 -g'
ldflags=
libs='-licuuc -lintl -liconv -lz'

: Some greps do not return status, grrr.
echo "grimblepritz" >grimble
if grep blurfldyick grimble >/dev/null 2>&1 ; then
        contains=contains
elif grep grimblepritz grimble >/dev/null 2>&1 ; then
        contains=grep
else
        contains=contains
fi
rm -f grimble
: the following should work in any shell
case "$contains" in
contains*)
        echo " "
        echo "AGH!  Grep doesn't return a status.  Attempting remedial action."
        cat >contains <<'EOSS'
grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
EOSS
chmod +x contains
esac

: define a shorthand compile call
compile='
mc_file=$1;
shift;
$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 
2>&1;'
: define a shorthand compile call for compilations that should be ok.
compile_ok='
mc_file=$1;
shift;
$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'

: see if signals are kept
val="$undef";
echo " "
echo "Checking to see if signal handlers stick around..."
$cat >try.c <<'EOCP'
foo() {}

int main()
{
        signal(2, foo);
        kill(getpid(), 2);
        kill(getpid(), 2);
        printf("abc\n");
}
EOCP
set try
if eval $compile; then
        echo `sh -c $run ./try >try.out 2>/dev/null` >/dev/null
        echo "test"
        if $contains abc try.out >/dev/null 2>&1; then
                echo "Yes, they do."
                val="$define";
        else
                echo "No, they don't."
        fi
else
        $echo $n "(I can't seem to compile the test program. Assuming $c"
        if ./bsd; then
                echo "they do.)"
                val="$define"
        else
                echo "they don't.)"
        fi
fi
set d_keepsig
eval $setvar
$rm -f try*
--end here

The result is:

$ ./signal.sh

Checking to see if signal handlers stick around...
$

Also there is an another script cut from signal.sh:

--from here (signal_result.sh)
#!/bin/sh

: Some greps do not return status, grrr.
echo "grimblepritz" >grimble
if grep blurfldyick grimble >/dev/null 2>&1 ; then
        contains=contains
elif grep grimblepritz grimble >/dev/null 2>&1 ; then
        contains=grep
else
        contains=contains
fi
rm -f grimble
: the following should work in any shell
case "$contains" in
contains*)
        echo " "
        echo "AGH!  Grep doesn't return a status.  Attempting remedial action."
        cat >contains <<'EOSS'
grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
EOSS
chmod +x contains
esac

if $contains abc try.out >/dev/null 2>&1; then
        echo "Yes, they do."
        val="$define";
else
        echo "No, they don't."
fi
--end here

After running signal.sh, I ran the above in the same directory:

$ ./signal_result.sh
No, they don't.
$

I confirmed it doesn't depend LANGUAGE (C, EUC-JP), shell (sh, ksh, bash).
Is there better idea?

Thanks in advance.
-- 
Daichi


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Gtk-gnutella-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to