Skip to content

Commit 50bec2d

Browse files
author
Vysheng
committed
Added cygwin fixes
1 parent e12d05b commit 50bec2d

File tree

7 files changed

+183
-19
lines changed

7 files changed

+183
-19
lines changed

‎config.h

+48-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
/* enable libconfig */
55
#define ENABLE_LIBCONFIG 1
66

7+
/* Define to 1 if you have the `alarm' function. */
8+
#define HAVE_ALARM 1
9+
10+
/* Define to 1 if you have the <arpa/inet.h> header file. */
11+
#define HAVE_ARPA_INET_H 1
12+
13+
/* Define to 1 if you have the `endpwent' function. */
14+
#define HAVE_ENDPWENT 1
15+
716
/* Define to 1 if you have the <fcntl.h> header file. */
817
#define HAVE_FCNTL_H 1
918

@@ -19,9 +28,6 @@
1928
/* Define to 1 if you have the `edit' library (-ledit). */
2029
/* #undef HAVE_LIBEDIT */
2130

22-
/* Define to 1 if you have the `execinfo' library (-lexecinfo). */
23-
/* #undef HAVE_LIBEXECINFO */
24-
2531
/* Define to 1 if you have the `m' library (-lm). */
2632
#define HAVE_LIBM 1
2733

@@ -34,26 +40,44 @@
3440
/* Define to 1 if you have the <lua.h> header file. */
3541
#define HAVE_LUA_H 1
3642

43+
/* Define to 1 if you have the <mach/mach.h> header file. */
44+
/* #undef HAVE_MACH_MACH_H */
45+
3746
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
3847
to 0 otherwise. */
3948
#define HAVE_MALLOC 1
4049

4150
/* Define to 1 if you have the <malloc.h> header file. */
4251
#define HAVE_MALLOC_H 1
4352

53+
/* Define to 1 if you have the `memmove' function. */
54+
#define HAVE_MEMMOVE 1
55+
4456
/* Define to 1 if you have the <memory.h> header file. */
4557
#define HAVE_MEMORY_H 1
4658

4759
/* Define to 1 if you have the `memset' function. */
4860
#define HAVE_MEMSET 1
4961

62+
/* Define to 1 if you have the `mkdir' function. */
63+
#define HAVE_MKDIR 1
64+
65+
/* Define to 1 if you have the <netdb.h> header file. */
66+
#define HAVE_NETDB_H 1
67+
68+
/* Define to 1 if you have the <netinet/in.h> header file. */
69+
#define HAVE_NETINET_IN_H 1
70+
5071
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
5172
and to 0 otherwise. */
5273
#define HAVE_REALLOC 1
5374

5475
/* Define to 1 if you have the `select' function. */
5576
#define HAVE_SELECT 1
5677

78+
/* Define to 1 if you have the `socket' function. */
79+
#define HAVE_SOCKET 1
80+
5781
/* Define to 1 if you have the <stdint.h> header file. */
5882
#define HAVE_STDINT_H 1
5983

@@ -72,6 +96,9 @@
7296
/* Define to 1 if you have the `strndup' function. */
7397
#define HAVE_STRNDUP 1
7498

99+
/* Define to 1 if you have the <sys/file.h> header file. */
100+
#define HAVE_SYS_FILE_H 1
101+
75102
/* Define to 1 if you have the <sys/socket.h> header file. */
76103
#define HAVE_SYS_SOCKET_H 1
77104

@@ -81,6 +108,12 @@
81108
/* Define to 1 if you have the <sys/types.h> header file. */
82109
#define HAVE_SYS_TYPES_H 1
83110

111+
/* Define to 1 if you have the <termios.h> header file. */
112+
#define HAVE_TERMIOS_H 1
113+
114+
/* Define to 1 if you have the `uname' function. */
115+
#define HAVE_UNAME 1
116+
84117
/* Define to 1 if you have the <unistd.h> header file. */
85118
#define HAVE_UNISTD_H 1
86119

@@ -114,6 +147,15 @@
114147
/* use lua */
115148
#define USE_LUA 1
116149

150+
/* Define to `int' if <sys/types.h> doesn't define. */
151+
/* #undef gid_t */
152+
153+
/* Define to `__inline__' or `__inline' if that's what the C compiler
154+
calls it, or to nothing if 'inline' is not supported under any name. */
155+
#ifndef __cplusplus
156+
/* #undef inline */
157+
#endif
158+
117159
/* Define to rpl_malloc if the replacement function should be used. */
118160
/* #undef malloc */
119161

@@ -122,3 +164,6 @@
122164

123165
/* Define to `unsigned int' if <sys/types.h> does not define. */
124166
/* #undef size_t */
167+
168+
/* Define to `int' if <sys/types.h> doesn't define. */
169+
/* #undef uid_t */

‎config.h.in

+48-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
/* enable libconfig */
44
#undef ENABLE_LIBCONFIG
55

6+
/* Define to 1 if you have the `alarm' function. */
7+
#undef HAVE_ALARM
8+
9+
/* Define to 1 if you have the <arpa/inet.h> header file. */
10+
#undef HAVE_ARPA_INET_H
11+
12+
/* Define to 1 if you have the `endpwent' function. */
13+
#undef HAVE_ENDPWENT
14+
615
/* Define to 1 if you have the <fcntl.h> header file. */
716
#undef HAVE_FCNTL_H
817

@@ -18,9 +27,6 @@
1827
/* Define to 1 if you have the `edit' library (-ledit). */
1928
#undef HAVE_LIBEDIT
2029

21-
/* Define to 1 if you have the `execinfo' library (-lexecinfo). */
22-
#undef HAVE_LIBEXECINFO
23-
2430
/* Define to 1 if you have the `m' library (-lm). */
2531
#undef HAVE_LIBM
2632

@@ -33,26 +39,44 @@
3339
/* Define to 1 if you have the <lua.h> header file. */
3440
#undef HAVE_LUA_H
3541

42+
/* Define to 1 if you have the <mach/mach.h> header file. */
43+
#undef HAVE_MACH_MACH_H
44+
3645
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
3746
to 0 otherwise. */
3847
#undef HAVE_MALLOC
3948

4049
/* Define to 1 if you have the <malloc.h> header file. */
4150
#undef HAVE_MALLOC_H
4251

52+
/* Define to 1 if you have the `memmove' function. */
53+
#undef HAVE_MEMMOVE
54+
4355
/* Define to 1 if you have the <memory.h> header file. */
4456
#undef HAVE_MEMORY_H
4557

4658
/* Define to 1 if you have the `memset' function. */
4759
#undef HAVE_MEMSET
4860

61+
/* Define to 1 if you have the `mkdir' function. */
62+
#undef HAVE_MKDIR
63+
64+
/* Define to 1 if you have the <netdb.h> header file. */
65+
#undef HAVE_NETDB_H
66+
67+
/* Define to 1 if you have the <netinet/in.h> header file. */
68+
#undef HAVE_NETINET_IN_H
69+
4970
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
5071
and to 0 otherwise. */
5172
#undef HAVE_REALLOC
5273

5374
/* Define to 1 if you have the `select' function. */
5475
#undef HAVE_SELECT
5576

77+
/* Define to 1 if you have the `socket' function. */
78+
#undef HAVE_SOCKET
79+
5680
/* Define to 1 if you have the <stdint.h> header file. */
5781
#undef HAVE_STDINT_H
5882

@@ -71,6 +95,9 @@
7195
/* Define to 1 if you have the `strndup' function. */
7296
#undef HAVE_STRNDUP
7397

98+
/* Define to 1 if you have the <sys/file.h> header file. */
99+
#undef HAVE_SYS_FILE_H
100+
74101
/* Define to 1 if you have the <sys/socket.h> header file. */
75102
#undef HAVE_SYS_SOCKET_H
76103

@@ -80,6 +107,12 @@
80107
/* Define to 1 if you have the <sys/types.h> header file. */
81108
#undef HAVE_SYS_TYPES_H
82109

110+
/* Define to 1 if you have the <termios.h> header file. */
111+
#undef HAVE_TERMIOS_H
112+
113+
/* Define to 1 if you have the `uname' function. */
114+
#undef HAVE_UNAME
115+
83116
/* Define to 1 if you have the <unistd.h> header file. */
84117
#undef HAVE_UNISTD_H
85118

@@ -113,6 +146,15 @@
113146
/* use lua */
114147
#undef USE_LUA
115148

149+
/* Define to `int' if <sys/types.h> doesn't define. */
150+
#undef gid_t
151+
152+
/* Define to `__inline__' or `__inline' if that's what the C compiler
153+
calls it, or to nothing if 'inline' is not supported under any name. */
154+
#ifndef __cplusplus
155+
#undef inline
156+
#endif
157+
116158
/* Define to rpl_malloc if the replacement function should be used. */
117159
#undef malloc
118160

@@ -121,3 +163,6 @@
121163

122164
/* Define to `unsigned int' if <sys/types.h> does not define. */
123165
#undef size_t
166+
167+
/* Define to `int' if <sys/types.h> doesn't define. */
168+
#undef uid_t

‎configure

+77-9
Original file line numberDiff line numberDiff line change
@@ -3306,15 +3306,11 @@ fi
33063306
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_execinfo_backtrace" >&5
33073307
$as_echo "$ac_cv_lib_execinfo_backtrace" >&6; }
33083308
if test "x$ac_cv_lib_execinfo_backtrace" = xyes; then :
3309-
cat >>confdefs.h <<_ACEOF
3310-
#define HAVE_LIBEXECINFO 1
3311-
_ACEOF
3312-
3313-
LIBS="-lexecinfo $LIBS"
3314-
3309+
EXTRA_LIBS="${EXTRA_LIBS} -lexecinfo" ;
3310+
else
3311+
CFLAGS="${CFLAGS} -DNO_BACKTRACE" ;
33153312
fi
33163313

3317-
EXTRA_LIBS="${EXTRA_LIBS} -lexecinfo" ;
33183314
fi
33193315

33203316
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_save_prompt in -lreadline" >&5
@@ -5305,7 +5301,7 @@ fi
53055301

53065302

53075303
# Checks for header files.
5308-
for ac_header in fcntl.h malloc.h stdlib.h string.h sys/socket.h unistd.h
5304+
for ac_header in fcntl.h malloc.h netdb.h stdlib.h string.h unistd.h arpa/inet.h mach/mach.h netinet/in.h sys/file.h sys/socket.h termios.h
53095305
do :
53105306
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
53115307
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -5331,6 +5327,78 @@ _ACEOF
53315327

53325328
fi
53335329

5330+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
5331+
$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
5332+
if ${ac_cv_type_uid_t+:} false; then :
5333+
$as_echo_n "(cached) " >&6
5334+
else
5335+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5336+
/* end confdefs.h. */
5337+
#include <sys/types.h>
5338+
5339+
_ACEOF
5340+
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5341+
$EGREP "uid_t" >/dev/null 2>&1; then :
5342+
ac_cv_type_uid_t=yes
5343+
else
5344+
ac_cv_type_uid_t=no
5345+
fi
5346+
rm -f conftest*
5347+
5348+
fi
5349+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
5350+
$as_echo "$ac_cv_type_uid_t" >&6; }
5351+
if test $ac_cv_type_uid_t = no; then
5352+
5353+
$as_echo "#define uid_t int" >>confdefs.h
5354+
5355+
5356+
$as_echo "#define gid_t int" >>confdefs.h
5357+
5358+
fi
5359+
5360+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
5361+
$as_echo_n "checking for inline... " >&6; }
5362+
if ${ac_cv_c_inline+:} false; then :
5363+
$as_echo_n "(cached) " >&6
5364+
else
5365+
ac_cv_c_inline=no
5366+
for ac_kw in inline __inline__ __inline; do
5367+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5368+
/* end confdefs.h. */
5369+
#ifndef __cplusplus
5370+
typedef int foo_t;
5371+
static $ac_kw foo_t static_foo () {return 0; }
5372+
$ac_kw foo_t foo () {return 0; }
5373+
#endif
5374+
5375+
_ACEOF
5376+
if ac_fn_c_try_compile "$LINENO"; then :
5377+
ac_cv_c_inline=$ac_kw
5378+
fi
5379+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5380+
test "$ac_cv_c_inline" != no && break
5381+
done
5382+
5383+
fi
5384+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
5385+
$as_echo "$ac_cv_c_inline" >&6; }
5386+
5387+
case $ac_cv_c_inline in
5388+
inline | yes) ;;
5389+
*)
5390+
case $ac_cv_c_inline in
5391+
no) ac_val=;;
5392+
*) ac_val=$ac_cv_c_inline;;
5393+
esac
5394+
cat >>confdefs.h <<_ACEOF
5395+
#ifndef __cplusplus
5396+
#define inline $ac_val
5397+
#endif
5398+
_ACEOF
5399+
;;
5400+
esac
5401+
53345402

53355403
# Checks for library functions.
53365404
for ac_header in stdlib.h
@@ -5467,7 +5535,7 @@ $as_echo "#define realloc rpl_realloc" >>confdefs.h
54675535
fi
54685536

54695537

5470-
for ac_func in memset select strdup strndup
5538+
for ac_func in alarm endpwent memset memmove mkdir select socket strdup strndup uname
54715539
do :
54725540
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
54735541
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"

‎configure.ac

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ AC_CHECK_FUNC([backtrace],
2424
)
2525

2626
if test "x$BT" = "x" ; then
27-
AC_CHECK_LIB([execinfo], [backtrace])
28-
[ EXTRA_LIBS="${EXTRA_LIBS} -lexecinfo" ; ]
27+
AC_CHECK_LIB([execinfo], [backtrace],
28+
[ EXTRA_LIBS="${EXTRA_LIBS} -lexecinfo" ; ],
29+
[ CFLAGS="${CFLAGS} -DNO_BACKTRACE" ; ])
2930
fi
3031

3132
AC_CHECK_LIB([readline], [rl_save_prompt],

‎interface.h

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ char **complete_text (char *text, int start, int end);
3939
void interpreter (char *line);
4040

4141
void rprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2)));
42-
void iprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2)));
4342
void logprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2)));
4443
void hexdump (int *in_ptr, int *in_end);
4544

‎main.c

+6
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,17 @@ void args_parse (int argc, char **argv) {
418418
}
419419
}
420420

421+
#ifndef NO_BACKTRACE
421422
void print_backtrace (void) {
422423
void *buffer[255];
423424
const int calls = backtrace (buffer, sizeof (buffer) / sizeof (void *));
424425
backtrace_symbols_fd (buffer, calls, 1);
425426
}
427+
#else
428+
void print_backtrace (void) {
429+
printf ("No libexec. Backtrace disabled\n");
430+
}
431+
#endif
426432

427433
void sig_handler (int signum) {
428434
set_terminal_attributes ();

‎net.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#include "tree.h"
4646
#include "interface.h"
4747

48-
#if defined(__MACH__) || defined(__FreeBSD__)
48+
#ifndef POLLRDHUP
4949
#define POLLRDHUP 0
5050
#endif
5151

0 commit comments

Comments
 (0)