diff --git a/config.h b/config.h index 3ee4d79..c3e95d2 100644 --- a/config.h +++ b/config.h @@ -4,6 +4,15 @@ /* enable libconfig */ #define ENABLE_LIBCONFIG 1 +/* Define to 1 if you have the `alarm' function. */ +#define HAVE_ALARM 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the `endpwent' function. */ +#define HAVE_ENDPWENT 1 + /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 @@ -19,9 +28,6 @@ /* Define to 1 if you have the `edit' library (-ledit). */ /* #undef HAVE_LIBEDIT */ -/* Define to 1 if you have the `execinfo' library (-lexecinfo). */ -/* #undef HAVE_LIBEXECINFO */ - /* Define to 1 if you have the `m' library (-lm). */ #define HAVE_LIBM 1 @@ -34,6 +40,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LUA_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACH_MACH_H */ + /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #define HAVE_MALLOC 1 @@ -41,12 +50,24 @@ /* Define to 1 if you have the header file. */ #define HAVE_MALLOC_H 1 +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `memset' function. */ #define HAVE_MEMSET 1 +/* Define to 1 if you have the `mkdir' function. */ +#define HAVE_MKDIR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #define HAVE_REALLOC 1 @@ -54,6 +75,9 @@ /* Define to 1 if you have the `select' function. */ #define HAVE_SELECT 1 +/* Define to 1 if you have the `socket' function. */ +#define HAVE_SOCKET 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -72,6 +96,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_FILE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_SOCKET_H 1 @@ -81,6 +108,12 @@ /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_TERMIOS_H 1 + +/* Define to 1 if you have the `uname' function. */ +#define HAVE_UNAME 1 + /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 @@ -114,6 +147,15 @@ /* use lua */ #define USE_LUA 1 +/* Define to `int' if doesn't define. */ +/* #undef gid_t */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + /* Define to rpl_malloc if the replacement function should be used. */ /* #undef malloc */ @@ -122,3 +164,6 @@ /* Define to `unsigned int' if does not define. */ /* #undef size_t */ + +/* Define to `int' if doesn't define. */ +/* #undef uid_t */ diff --git a/config.h.in b/config.h.in index 26115be..b77cede 100644 --- a/config.h.in +++ b/config.h.in @@ -3,6 +3,15 @@ /* enable libconfig */ #undef ENABLE_LIBCONFIG +/* Define to 1 if you have the `alarm' function. */ +#undef HAVE_ALARM + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the `endpwent' function. */ +#undef HAVE_ENDPWENT + /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H @@ -18,9 +27,6 @@ /* Define to 1 if you have the `edit' library (-ledit). */ #undef HAVE_LIBEDIT -/* Define to 1 if you have the `execinfo' library (-lexecinfo). */ -#undef HAVE_LIBEXECINFO - /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM @@ -33,6 +39,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LUA_H +/* Define to 1 if you have the header file. */ +#undef HAVE_MACH_MACH_H + /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC @@ -40,12 +49,24 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET +/* Define to 1 if you have the `mkdir' function. */ +#undef HAVE_MKDIR + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC @@ -53,6 +74,9 @@ /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT +/* Define to 1 if you have the `socket' function. */ +#undef HAVE_SOCKET + /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H @@ -71,6 +95,9 @@ /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_FILE_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H @@ -80,6 +107,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H +/* Define to 1 if you have the header file. */ +#undef HAVE_TERMIOS_H + +/* Define to 1 if you have the `uname' function. */ +#undef HAVE_UNAME + /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H @@ -113,6 +146,15 @@ /* use lua */ #undef USE_LUA +/* Define to `int' if doesn't define. */ +#undef gid_t + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc @@ -121,3 +163,6 @@ /* Define to `unsigned int' if does not define. */ #undef size_t + +/* Define to `int' if doesn't define. */ +#undef uid_t diff --git a/configure b/configure index cc99b1e..f40b39a 100755 --- a/configure +++ b/configure @@ -3306,15 +3306,11 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_execinfo_backtrace" >&5 $as_echo "$ac_cv_lib_execinfo_backtrace" >&6; } if test "x$ac_cv_lib_execinfo_backtrace" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBEXECINFO 1 -_ACEOF - - LIBS="-lexecinfo $LIBS" - + EXTRA_LIBS="${EXTRA_LIBS} -lexecinfo" ; +else + CFLAGS="${CFLAGS} -DNO_BACKTRACE" ; fi - EXTRA_LIBS="${EXTRA_LIBS} -lexecinfo" ; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_save_prompt in -lreadline" >&5 @@ -5305,7 +5301,7 @@ fi # Checks for header files. -for ac_header in fcntl.h malloc.h stdlib.h string.h sys/socket.h unistd.h +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 do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -5331,6 +5327,78 @@ _ACEOF fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if ${ac_cv_type_uid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then : + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +$as_echo "#define uid_t int" >>confdefs.h + + +$as_echo "#define gid_t int" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + # Checks for library functions. for ac_header in stdlib.h @@ -5467,7 +5535,7 @@ $as_echo "#define realloc rpl_realloc" >>confdefs.h fi -for ac_func in memset select strdup strndup +for ac_func in alarm endpwent memset memmove mkdir select socket strdup strndup uname do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/configure.ac b/configure.ac index d56598d..82b8117 100644 --- a/configure.ac +++ b/configure.ac @@ -24,8 +24,9 @@ AC_CHECK_FUNC([backtrace], ) if test "x$BT" = "x" ; then - AC_CHECK_LIB([execinfo], [backtrace]) - [ EXTRA_LIBS="${EXTRA_LIBS} -lexecinfo" ; ] + AC_CHECK_LIB([execinfo], [backtrace], + [ EXTRA_LIBS="${EXTRA_LIBS} -lexecinfo" ; ], + [ CFLAGS="${CFLAGS} -DNO_BACKTRACE" ; ]) fi AC_CHECK_LIB([readline], [rl_save_prompt], diff --git a/interface.h b/interface.h index a61f968..80c7ee2 100644 --- a/interface.h +++ b/interface.h @@ -39,7 +39,6 @@ char **complete_text (char *text, int start, int end); void interpreter (char *line); void rprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2))); -void iprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2))); void logprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2))); void hexdump (int *in_ptr, int *in_end); diff --git a/main.c b/main.c index de39372..edb576c 100644 --- a/main.c +++ b/main.c @@ -418,11 +418,17 @@ void args_parse (int argc, char **argv) { } } +#ifndef NO_BACKTRACE void print_backtrace (void) { void *buffer[255]; const int calls = backtrace (buffer, sizeof (buffer) / sizeof (void *)); backtrace_symbols_fd (buffer, calls, 1); } +#else +void print_backtrace (void) { + printf ("No libexec. Backtrace disabled\n"); +} +#endif void sig_handler (int signum) { set_terminal_attributes (); diff --git a/net.c b/net.c index fa02e87..881f670 100644 --- a/net.c +++ b/net.c @@ -45,7 +45,7 @@ #include "tree.h" #include "interface.h" -#if defined(__MACH__) || defined(__FreeBSD__) +#ifndef POLLRDHUP #define POLLRDHUP 0 #endif