public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix libiberty to detect new cygwin exports
@ 2001-08-15 15:06 Christopher Faylor
  2001-08-15 15:24 ` Richard Henderson
  2001-08-15 15:24 ` Christopher Faylor
  0 siblings, 2 replies; 9+ messages in thread
From: Christopher Faylor @ 2001-08-15 15:06 UTC (permalink / raw)
  To: gcc-patches

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
      ;;

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-08-17 13:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-15 15:06 [PATCH] Fix libiberty to detect new cygwin exports Christopher Faylor
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

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).