[cygwin] misc fixes to get things building/running on windows

This change is just a first step, it should get the basics going.  But,
the tests don't all build and there are probably other issues when
running.
pull/69/head
Timothy Stack 11 years ago
parent 6968b76825
commit 5e011a9203

206
configure vendored

@ -1877,6 +1877,109 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_c_check_header_compile
# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
# ----------------------------------------------------
# Tries to find if the field MEMBER exists in type AGGR, after including
# INCLUDES, setting cache variable VAR accordingly.
ac_fn_c_check_member ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
$as_echo_n "checking for $2.$3... " >&6; }
if eval \${$4+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$5
int
main ()
{
static $2 ac_aggr;
if (ac_aggr.$3)
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$4=yes"
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$5
int
main ()
{
static $2 ac_aggr;
if (sizeof ac_aggr.$3)
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$4=yes"
else
eval "$4=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$4
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_member
# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
# ---------------------------------------------
# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
# accordingly.
ac_fn_c_check_decl ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
as_decl_name=`echo $2|sed 's/ *(.*//'`
as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main ()
{
#ifndef $as_decl_name
#ifdef __cplusplus
(void) $as_decl_use;
#else
(void) $as_decl_name;
#endif
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_decl
# ac_fn_c_try_link LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
@ -5468,6 +5571,109 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
if ${ac_cv_struct_tm+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <time.h>
int
main ()
{
struct tm tm;
int *p = &tm.tm_sec;
return !p;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_struct_tm=time.h
else
ac_cv_struct_tm=sys/time.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
$as_echo "$ac_cv_struct_tm" >&6; }
if test $ac_cv_struct_tm = sys/time.h; then
$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
fi
ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h>
#include <$ac_cv_struct_tm>
"
if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_TM_TM_ZONE 1
_ACEOF
fi
if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
else
ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h>
"
if test "x$ac_cv_have_decl_tzname" = xyes; then :
ac_have_decl=1
else
ac_have_decl=0
fi
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_TZNAME $ac_have_decl
_ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
$as_echo_n "checking for tzname... " >&6; }
if ${ac_cv_var_tzname+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <time.h>
#if !HAVE_DECL_TZNAME
extern char *tzname[];
#endif
int
main ()
{
return tzname[0][0];
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_var_tzname=yes
else
ac_cv_var_tzname=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
$as_echo "$ac_cv_var_tzname" >&6; }
if test $ac_cv_var_tzname = yes; then
$as_echo "#define HAVE_TZNAME 1" >>confdefs.h
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing openpty" >&5
$as_echo_n "checking for library containing openpty... " >&6; }
if ${ac_cv_search_openpty+:} false; then :

@ -72,6 +72,8 @@ fi
AC_CHECK_SIZEOF(off_t)
AC_CHECK_SIZEOF(size_t)
AC_STRUCT_TIMEZONE
AC_SEARCH_LIBS(openpty, util)
AC_SEARCH_LIBS(gzseek, z, [], [AC_MSG_ERROR([libz required to build])])
AC_SEARCH_LIBS(BZ2_bzopen, bz2)

@ -18,6 +18,10 @@
/* Define to 1 if library supports certain obsolete features */
#undef HAVE_CURSES_OBSOLETE
/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
*/
#undef HAVE_DECL_TZNAME
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@ -84,12 +88,23 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if `tm_zone' is a member of `struct tm'. */
#undef HAVE_STRUCT_TM_TM_ZONE
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
`HAVE_STRUCT_TM_TM_ZONE' instead. */
#undef HAVE_TM_ZONE
/* Define to 1 if you don't have `tm_zone' but do have the external array
`tzname'. */
#undef HAVE_TZNAME
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
@ -129,6 +144,9 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
/* Version number of package */
#undef VERSION

@ -305,7 +305,7 @@ throw (error)
retval = true;
}
else if (this->lb_fd != -1) {
int rc;
ssize_t rc;
/* Make sure there is enough space, then */
this->ensure_available(start, max_length);
@ -386,6 +386,12 @@ throw (error)
&this->lb_buffer[this->lb_buffer_size],
this->lb_buffer_max - this->lb_buffer_size);
}
// XXX For some reason, cygwin is giving us a bogus return value when
// up to the end of the file.
if (rc > (this->lb_buffer_max - this->lb_buffer_size)) {
rc = -1;
errno = ENODATA;
}
switch (rc) {
case 0:
this->lb_file_size = this->lb_file_offset + this->lb_buffer_size;
@ -404,7 +410,7 @@ throw (error)
}
break;
case -1:
case (ssize_t)-1:
switch (errno) {
#ifdef ENODATA
/* Cygwin seems to return this when pread reaches the end of the */

@ -196,9 +196,11 @@ time_t tm2sec(const struct tm *t)
return BAD_DATE;
} /* must have overflowed */
else {
#ifdef HAVE_STRUCT_TM_TM_ZONE
if (t->tm_zone) {
days -= t->tm_gmtoff;
}
#endif
return days;
} /* must be a valid time */
}
@ -276,7 +278,9 @@ const char *date_time_scanner::scan(const char *time_dest,
if (this->dts_local_time) {
localtime_r(&gmt, tm_out);
#ifdef HAVE_STRUCT_TM_TM_ZONE
tm_out->tm_zone = NULL;
#endif
tm_out->tm_isdst = 0;
gmt = tm2sec(tm_out);
}
@ -315,7 +319,9 @@ const char *date_time_scanner::scan(const char *time_dest,
time_t gmt = tm2sec(tm_out);
localtime_r(&gmt, tm_out);
#ifdef HAVE_STRUCT_TM_TM_ZONE
tm_out->tm_zone = NULL;
#endif
tm_out->tm_isdst = 0;
}
tv_out.tv_sec = tm2sec(tm_out);

@ -38,6 +38,7 @@
#include <assert.h>
#include <stdint.h>
#include <limits.h>
#include <sys/time.h>
#if defined HAVE_NCURSESW_CURSES_H
# include <ncursesw/curses.h>

@ -33,12 +33,25 @@
#define __xterm_mouse_hh
#include <stdlib.h>
#include <curses.h>
#include <string.h>
#include <unistd.h>
#include <string>
#if defined HAVE_NCURSESW_CURSES_H
# include <ncursesw/curses.h>
#elif defined HAVE_NCURSESW_H
# include <ncursesw.h>
#elif defined HAVE_NCURSES_CURSES_H
# include <ncurses/curses.h>
#elif defined HAVE_NCURSES_H
# include <ncurses.h>
#elif defined HAVE_CURSES_H
# include <curses.h>
#else
# error "SysV or X/Open-compatible Curses header file required"
#endif
/**
* Base class for delegates of the xterm_mouse class.
*/

Loading…
Cancel
Save