newlib/winsup/cygwin/speclib
Christopher Faylor 05cb7b17cb Throughout, eliminate argument to sig_dispatch_pending.
* exceptions.cc (setup_handler): Move non-interruptible condition handling
(back) to wait_sig (as suggested by Pierre Humblet).
(set_process_mask): Don't worry about calling sig_dispatch_pending from
sigthread since it is detected in the function anyway.
(sig_handle): Eliminate thisproc arg.  Don't call sig_dispatch_pending on
SIGCONT since that should happen automatically.
* sigproc.cc (sig_dispatch_pending): Eliminate justwake argument.  Just return
when called from sigthread.
(wait_sig): Change some variables to bool.  Change inner while to an if.  Move
uninterruptible signal handling here.
(sigproc_terminate): Don't call sig_dispatch_pending.  Just increment semaphore
on exit.
* speclib: Use slightly different (but still flawed) method for determining
symbols to extract from libraries.
2003-08-19 04:10:42 +00:00

40 lines
1.2 KiB
Bash
Executable File

#!/bin/sh -x
# speclib - Make a special version of the cygwin import library.
#
# Copyright 2001, 2002 Red Hat, Inc.
#
# This file is part of Cygwin.
#
# This software is a copyrighted work licensed under the terms of the
# Cygwin license. Please consult the file "CYGWIN_LICENSE" for
# details.
case "$1" in
-v) shift; v() { :; } ;;
*) v() { /bin/false; } ;;
esac
lib=$1; shift
nm=$1; shift
ar=$1; shift
libdll=$1; shift
cp /dev/null /tmp/$$.objs
# trap "/bin/rm -rf /tmp/$$.dir /tmp/$$.syms /tmp/$$.objs /tmp/$$.raw" 0 1 2 15
$nm --extern-only --defined-only $* | sed -n -e 's%^.* [TD] \(.*\)$%/ \1\$/p%p' > /tmp/$$.syms
v || $nm -Ap --extern-only --defined-only $libdll | egrep ' I __head| I _.*_iname' | awk -F: '{print $2}' > /tmp/$$.objs
$nm -Ap --extern-only --defined-only $libdll | sed -n -f /tmp/$$.syms | awk -F: '{print $2}' >> /tmp/$$.objs
sort -o /tmp/$$.objs -u /tmp/$$.objs
[ -s /tmp/$$.objs ] || { echo "speclib: couldn't find symbols for $lib" 1>&2; exit 1; }
/bin/rm -f /tmp/$$>dir
mkdir /tmp/$$.dir
cd /tmp/$$.dir
if v; then
$ar x $libdll
/bin/rm -f `cat /tmp/$$.objs`
else
$ar x $libdll `cat /tmp/$$.objs`
fi
/bin/rm -f $lib
$ar crus $lib *.o