From: Christopher Faylor <cgf@redhat.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Fix libiberty to detect new cygwin exports
Date: Wed, 15 Aug 2001 15:06:00 -0000 [thread overview]
Message-ID: <20010815180621.A16847@redhat.com> (raw)
Newer cygwins export sys_errlist and sys_nerr. Configure.in was not
expecting this and has a hard time detecting this situation. It is one
of those chicken/egg headaches that is common when building cygwin.
The patch below adds detection to configure.in so that it will know when
libiberty is being configured in an environment that uses a newer
cygwin.
cgf
Wed Aug 15 18:00:49 2001 Christopher Faylor <cgf@cygnus.com>
* configure.in: Under cygwin, add checks for newly exported sys_errlist
and sys_nerr. Collapse two identical if/cases into one.
* configure: Regenerate.
Index: configure.in
===================================================================
RCS file: /cvs/uberbaum/libiberty/configure.in,v
retrieving revision 1.33
diff -p -r1.33 configure.in
*** configure.in 2001/07/05 17:24:39 1.33
--- configure.in 2001/08/15 22:01:53
*************** if test -n "${with_target_subdir}"; then
*** 177,184 ****
# Of the functions in $checkfuncs, newlib only has strerror.
AC_DEFINE_NOAUTOHEADER(HAVE_STRERROR)
! setobjs=yes
!
fi
else
--- 177,186 ----
# Of the functions in $checkfuncs, newlib only has strerror.
AC_DEFINE_NOAUTOHEADER(HAVE_STRERROR)
! case "$host" in
! *-*-cygwin*) ;;
! *) setobjs=yes ;;
! esac
fi
else
*************** if test -z "${setobjs}"; then
*** 221,233 ****
setobjs=yes
;;
- esac
- fi
-
- if test -z "${setobjs}"; then
-
- case "${host}" in
-
*-*-cygwin*)
# The Cygwin library actually uses a couple of files from
# libiberty when it is built. If we are building a native
--- 223,228 ----
*************** if test -z "${setobjs}"; then
*** 247,252 ****
--- 242,272 ----
funcs="`echo $funcs | sed -e 's/random//'`"
LIBOBJS="$LIBOBJS random.o"
vars="`echo $vars | sed -e 's/sys_siglist//'`"
+ # Newer cygwins define sys_errlist and sys_nerr.
+ # We have a chicken/egg situation here, though. How do we know that
+ # the toolchain being built contains a newer cygwin?
+ # The code below checks for the existence of sys_errlist in the
+ # winsup/cygwin/cygwin.din file. The assumption is that you are going
+ # to be building a dll which contains this global.
+ # If this is not found then check if the export is in the library
+ # that is used by GCC. Define the appropriate libiberty_cv_var variables
+ # if so.
+ if test -z "$libiberty_cv_var_sys_errlist"
+ then
+ eval `sed -n -e 's/^sys_errlist.*/libiberty_cv_var_sys_errlist=yes/p' \
+ -e 's/^sys_nerr .*/libiberty_cv_var_sys_nerr=yes/p' \
+ "$srcdir/../winsup/cygwin/cygwin.din" 2>/dev/null`
+ if test -z "$libiberty_cv_var_sys_errlist"
+ then
+ for v in sys_errlist sys_nerr; do
+ AC_TRY_LINK([int *p;], [extern int _imp__$v; p = &_imp__$v;],
+ [eval "libiberty_cv_var_$v=yes"],
+ [eval "libiberty_cv_var_$v=no"])
+ done
+ fi
+ fi
+ test -z "$libiberty_cv_var_sys_errlist" && libiberty_cv_var_sys_errlist=no
+ test -z "$libiberty_cv_var_sys_nerr" && libiberty_cv_var_sys_nerr=no
checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`"
fi
;;
next reply other threads:[~2001-08-15 15:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-15 15:06 Christopher Faylor [this message]
2001-08-15 15:24 ` Richard Henderson
2001-08-15 15:24 ` Christopher Faylor
2001-08-16 10:49 ` [RFA] Fix libiberty to detect new cygwin export, try 2 Christopher Faylor
2001-08-16 13:38 ` DJ Delorie
2001-08-17 13:17 ` Christopher Faylor
2001-08-16 16:47 ` [PATCH] Fix libiberty to detect new cygwin exports Richard Henderson
2001-08-17 13:16 ` Christopher Faylor
2001-08-15 15:24 ` Christopher Faylor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010815180621.A16847@redhat.com \
--to=cgf@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).