Short: MCCP patch :) From: "Bastian Hoyer" <dafire@dafire.de> Date: Thu Oct 11 21:02:00 2001 Type: Patch State: New See also: p-020810-1 ---------- From: "Bastian Hoyer" <dafire@dafire.de> Subject: mccp patch fuer 3-3.168 Date: Sat, 16 Feb 2002 17:19:44 +0100 hier mal eine neue version von meinem mccp patch :) Gruss Bastian Neue Files: Du koenntest mal ueber die files gucken und vielleicht bischen korrigieren wenn dir was auffaellt.. mein englisch ist nicht mehr so gut glaub ich :) doc/concepts/mccp doc/efun/end_mccp_compress doc/efun/query_mccp doc/efun/query_mccp_stats doc/efun/start_mccp_compress Veraenderte Files: doc/driver/predefined src/autoconf/configure.in - mccp ein und ausschalten und ggf. zlib ... man koennte vielleicht noch aendern das -lz nicht zweimal in LIBS steht wenn auch mysql definiert ist.. aber eigentlich egal :) src/comm.c - extra funktion fuer die negotiation von mccp - binary_message benutzt nicht write wenn die verbindung comprimiert ist.. das wuerde den zlib stream zerstoeren - 4 neue efuns ( start_mccp_compress end_mccp_compress query_mccp query_mccp_stats ) - add_message komprimiert ggf. den auszugebenen text in den zlib buffer und verwendet den dann zum senden uebers netzwerk (vielleicht kann man das sauberer machen ? ) - beim erschaffen und zerstoeren eines interactives werden die zlib variablen ordentlich initialisiert und auch alles an speicher wieder freigegeben :) src/comm.h - zlib.h included und interactive_t mit dem zlib buffer versorgt :) src/config.h.in - den USE_MCCP schalter eingebaut src/configure hmm.. das sieht bei mir bischen anders aus als bei dir.. vielleicht solltest du da dein autoconf mal drueberlaufen lassen.. startest du das mit irgendwelchen parametern ?:) src/func_spec - die neuen efuns eingetragen src/lex.c - das __MCCP__ define src/main.c - anzeige ob MCCP drin ist bei -options :) Gruss Bastian ------=_NextPart_000_0008_01C1B70E.211D0660 diff --new-file -c5 -r 3-3.orig/doc/concepts/mccp 3-3.export/doc/concepts/mccp *** 3-3.orig/doc/concepts/mccp Thu Jan 1 01:00:00 1970 --- 3-3.export/doc/concepts/mccp Fri Feb 15 15:35:23 2002 *************** *** 0 **** --- 1,93 ---- + CONCEPT + mccp - The Mud Client Compression Protocol + + DESCRIPTION + + Informations and code taken from the MCCP Homepage + http://www.randomly.org/projects/MCCP/ + + MCCP is implemented as a Telnet option [RFC854, RFC855]. The server + and client negotiate the use of MCCP as they would any other telnet + option. Once agreement has been reached on the use of the option, + option subnegotiation is used to determine acceptable compression + methods to use, and to indicate the start of a compressed data stream. + + If the driver is compiled with MCCP Support there is a + define __MCCP__. + + The driver currently supports both versions of mccp. If your mud + has a H_NOECHO hook you have to find out if the client supports + mccp. Without this hook you still have to start neogotiation. + + All sub-negotiation is done by the efuns start_mccp_compress() and + end_mccp_compress() whether you have this hook or not. + + Notice: when the client uses compressions all binary_message calls + are executed with flag=3. This is because writing to the + socket would disturb zlib stream. + + mccp-efuns: + start_mysql_compress(int telopt) (only needed with H_NOECHO) + end_mysql_compress(int telopt) (only needed with H_NOECHO) + query_mccp(object player) + query_mccp_stats(object player) + + Initiating MCCP without H_NOECHO-Hook: + just do: + if(!query_mccp()){ + binary_message(({ IAC, WILL, TELOPT_COMPRESS2 }),1) + binary_message(({ IAC, WILL, TELOPT_COMPRESS }),1) + } + the driver will parse the clients answers and start compression. + (The connection might already be compressed, because although the + documentation says clients should not negotiate from themselfes, + zmud e.g. does.) + + You can start and stop compression manually by efuns + when you are sure client supports compression :) + + + Initiating mccp compression ( the H_NOECHO way ) + + If your mudlib uses the H_NOECHO driver-hook you decided to do + all the negotiation by yourself: + + Server Commands + IAC WILL COMPRESS indicates the sender supports version 1 of the + protocol, and is willing to compress data it sends. + + IAC WILL COMPRESS2 indicates the sender supports version 2, and is + willing to compress data it sends. + + IAC WONT COMPRESS indicates the sender refuses to compress data using + version 1. + + IAC WONT COMPRESS2 indicates the sender refuses to compress data + using version 2. + + Client Commands + IAC DO COMPRESS indicates the sender supports version 1 of the + protocol, and is willing to decompress data received. + + IAC DO COMPRESS2 indicates the sender supports version 2 or above, + and is willing to decompress data received. + + IAC DONT COMPRESS indicates the sender refuses to support version 1. + If compression was previously negotiated and is + currently being used, the server should terminate + compression. + + IAC DONT COMPRESS2 indicates the sender refuses to support version 2. + If compression was previously negotiated and is + currently being used, the server should terminate + compression + + After you found out whether the client supports mccp or not you can + start compression with start_mccp_compress(TELOPT_COMPRESS2) or + start_mccp_compress(TELOPT_COMPRESS). ( you could start it without + checking but some players would protest :) ) + + AUTHOR + Bastian Hoyer (dafire@ff.mud.de) (some text taken from project page) + + HISTORY diff --new-file -c5 -r 3-3.orig/doc/driver/predefined 3-3.export/doc/driver/predefined *** 3-3.orig/doc/driver/predefined Sun Feb 10 10:11:19 2002 --- 3-3.export/doc/driver/predefined Thu Feb 14 23:34:48 2002 *************** *** 57,66 **** --- 57,67 ---- The following macros are defined if their associated package has been compiled into the driver: __IPV6__ : support for IP v 6 __MYSQL__ : support for mySQL + __MCCP__: support for MCCP http://www.randomly.org/projects/MCCP __ALISTS__: support for alists __PCRE__: support for PCRE instead of traditional regexps. __DEPRECATED__: support for obsolete and deprecated efuns. diff --new-file -c5 -r 3-3.orig/doc/efun/end_mccp_compress 3-3.export/doc/efun/end_mccp_compress *** 3-3.orig/doc/efun/end_mccp_compress Thu Jan 1 01:00:00 1970 --- 3-3.export/doc/efun/end_mccp_compress Thu Feb 14 23:32:04 2002 *************** *** 0 **** --- 1,9 ---- + SYNOPSIS + int end_mccp_compress() + + DESCRIPTION + This efun must be called inside an interactive player and stops + compression of the driver -> client traffic immediatly. + + SEE ALSO + start_mccp_compress(E), query_mccp(E), query_mccp_stats(E), mccp(C) \ No newline at end of file diff --new-file -c5 -r 3-3.orig/doc/efun/query_mccp 3-3.export/doc/efun/query_mccp *** 3-3.orig/doc/efun/query_mccp Thu Jan 1 01:00:00 1970 --- 3-3.export/doc/efun/query_mccp Thu Feb 14 23:32:04 2002 *************** *** 0 **** --- 1,13 ---- + SYNOPSIS + int query_mccp() + int query_mccp(object player) + + DESCRIPTION + This efun returns current wheter the client uses compression + or not. ( default this_player() ) + You will get either TELOPT_COMPRESS, TELOPT_COMPRESS2 or 0 if the + connection is uncompressed. + + SEE ALSO + end_mccp_compress(E), start_mccp_compress(E), query_mccp_stats(E), + mccp(C) \ No newline at end of file diff --new-file -c5 -r 3-3.orig/doc/efun/query_mccp_stats 3-3.export/doc/efun/query_mccp_stats *** 3-3.orig/doc/efun/query_mccp_stats Thu Jan 1 01:00:00 1970 --- 3-3.export/doc/efun/query_mccp_stats Thu Feb 14 23:32:04 2002 *************** *** 0 **** --- 1,13 ---- + SYNOPSIS + int *query_mccp_stats() + int *query_mccp_stats(object player) + + DESCRIPTION + This efun gives you statistics about current compression + of the player. ( default this_player() ) + You get an array with ({ uncompressed bytes , compressed bytes }). + If the connection is not compressed it returns 0. + It raises an error on not-interactive objects. + + SEE ALSO + end_mccp_compress(E), start_mccp_compress(E), query_mccp(E), mccp(C) \ No newline at end of file diff --new-file -c5 -r 3-3.orig/doc/efun/start_mccp_compress 3-3.export/doc/efun/start_mccp_compress *** 3-3.orig/doc/efun/start_mccp_compress Thu Jan 1 01:00:00 1970 --- 3-3.export/doc/efun/start_mccp_compress Thu Feb 14 23:32:04 2002 *************** *** 0 **** --- 1,11 ---- + SYNOPSIS + int start_mccp_compress(int telopt) + + DESCRIPTION + This efun must be called inside an interactive player and starts + compression of the driver -> client traffic immediatly. + telopt must be either TELOPT_COMPRESS2 or TELOPT_COMRESS from + sys/telnet.h. + + SEE ALSO + end_mccp_compress(E), query_mccp(E), query_mccp_stats(E), mccp(C) \ No newline at end of file diff --new-file -c5 -r 3-3.orig/src/autoconf/configure.in 3-3.export/src/autoconf/configure.in *** 3-3.orig/src/autoconf/configure.in Sun Feb 10 10:11:19 2002 --- 3-3.export/src/autoconf/configure.in Thu Feb 14 11:58:33 2002 *************** *** 92,101 **** --- 92,102 ---- AC_MY_ARG_ENABLE(use-system-crypt,yes,,) AC_MY_ARG_ENABLE(udp-send,yes,,) AC_MY_ARG_ENABLE(use-ipv6,no,,[Enables support for IPv6]) AC_MY_ARG_ENABLE(use-alists,no,,[Enables alist support]) AC_MY_ARG_ENABLE(use-mysql,no,,[Enables mySQL support]) + AC_MY_ARG_ENABLE(use-mccp,no,,[Enables MCCP support]) AC_MY_ARG_ENABLE(use-pcre,no,,[Enables PCRE instead of traditional regexps]) AC_MY_ARG_ENABLE(use-deprecated,yes,,[Enables obsolete and deprecated efuns]) AC_MY_ARG_ENABLE(comm-stat,yes,,) AC_MY_ARG_ENABLE(apply-cache_stat,yes,,) AC_MY_ARG_ENABLE(malloc-trace,no,,) *************** *** 214,223 **** --- 215,225 ---- AC_CDEF_FROM_ENABLE(strict_euids) AC_CDEF_FROM_ENABLE(supply_parse_command) AC_CDEF_FROM_ENABLE(initialization_by___init) AC_CDEF_FROM_ENABLE(use_system_crypt) AC_CDEF_FROM_ENABLE(use_alists) + AC_CDEF_FROM_ENABLE(use_mccp) AC_CDEF_FROM_ENABLE(use_pcre) AC_CDEF_FROM_ENABLE(use_ipv6) AC_CDEF_FROM_ENABLE(use_deprecated) AC_CDEF_FROM_ENABLE(comm_stat) AC_CDEF_FROM_ENABLE(apply_cache_stat) *************** *** 456,465 **** --- 458,471 ---- AC_CHECK_LIB(m,main) AC_CHECK_LIB(socket,main) AC_CHECK_LIB(ucb,main, LIBS="$LIBS -lc -lucb") AC_CHECK_LIB(crypt,main, LIBS="$LIBS -lcrypt") + if test $enable_use_mccp = yes; then + AC_CHECK_LIB(z,main, LIBS="$LIBS -lz") + fi + if test $ac_cv_lib_socket_main = "yes" || test $ac_cv_lib_ucb_main = "yes"; then AC_CHECK_LIB(nsl,main) fi AC_FUNC_ALLOCA AC_CHECK_FUNCS(fchmod getrusage bzero memset memcpy memmem strdup strcspn crypt _crypt) *************** *** 1548,1557 **** --- 1554,1564 ---- AC_SUBST(cdef_initialization_by___init) AC_SUBST(cdef_use_system_crypt) AC_SUBST(cdef_use_ipv6) AC_SUBST(cdef_use_mysql) AC_SUBST(cdef_use_alists) + AC_SUBST(cdef_use_mccp) AC_SUBST(cdef_use_pcre) AC_SUBST(cdef_use_deprecated) AC_SUBST(cdef_comm_stat) AC_SUBST(cdef_apply_cache_stat) AC_SUBST(cdef_malloc_trace) diff --new-file -c5 -r 3-3.orig/src/comm.c 3-3.export/src/comm.c *** 3-3.orig/src/comm.c Thu Feb 14 12:16:54 2002 --- 3-3.export/src/comm.c Sat Feb 16 16:19:49 2002 *************** *** 409,418 **** --- 409,424 ---- /*-------------------------------------------------------------------------*/ /* Forward declarations */ + #ifdef USE_MCCP + static int start_compress(interactive_t *,unsigned char telopt); + static int end_compress(interactive_t *); + #endif + static void mccp_telnet_neg(int); + static void free_input_to(input_to_t *); static void telnet_neg(interactive_t *); static void send_will(int); static void send_wont(int); static void send_do(int); *************** *** 1467,1490 **** /* Check how much data there is in .message_buf[]. * If it is enough, send it, else terminate the outer loop * (because *source must be exhausted for this to happen). */ chunk = dest - ip->message_buf; if (chunk < min_length) { break; } ! ! /* Write .message_buf[] to the network. */ ! for (retries = 6;;) { ! ! if ((n = (int)socket_write(ip->socket, ip->message_buf, (size_t)chunk)) != -1) ! { break; ! } switch (errno) { case EINTR: if (--retries) continue; ip->msg_discarded = MY_TRUE; --- 1473,1537 ---- /* Check how much data there is in .message_buf[]. * If it is enough, send it, else terminate the outer loop * (because *source must be exhausted for this to happen). */ + chunk = dest - ip->message_buf; if (chunk < min_length) { break; } ! ! #ifdef USE_MCCP ! if (ip->out_compress) ! { ! ! ip->out_compress->next_in = (unsigned char *) ip->message_buf; ! ip->out_compress->avail_in = chunk; ! ! ip->out_compress->avail_out = COMPRESS_BUF_SIZE - ! (ip->out_compress->next_out - ! ip->out_compress_buf); ! ! { ! int status = deflate(ip->out_compress, Z_SYNC_FLUSH); ! ! if (status != Z_OK) ! return; ! } ! ! /* ok.. perhaps i should take care that all data in message_buf ! is compressed, but i guess there is no chance that 1024 byte compressed ! won't fit into the 8192 byte buffer */ ! ! length = ip->out_compress->next_out - ip->out_compress_buf; ! } ! #endif ! /* now sending the buffer... */ ! for (retries = 6;;) { ! ! #ifdef USE_MCCP ! if (!ip->out_compress) /* here we choose the correct buffer */ ! { ! #endif ! if ((n = (int)socket_write(ip->socket, ip->message_buf, (size_t)chunk)) != -1) ! { break; ! } ! #ifdef USE_MCCP ! } ! else ! { ! if ((n = (int)socket_write(ip->socket, ip->out_compress_buf, (size_t)length)) != -1) ! { ! break; ! } ! } ! #endif ! switch (errno) { case EINTR: if (--retries) continue; ip->msg_discarded = MY_TRUE; *************** *** 1540,1552 **** #ifdef COMM_STAT inet_packets++; inet_volume += n; #endif ! if (n != chunk) ! fprintf(stderr, "%s write socket: wrote %ld, should be %ld.\n" ! , time_stamp(), (long)n, (long)chunk); /* Continue with the processing of source */ dest = &ip->message_buf[0]; } while (srclen != 0); --- 1587,1612 ---- #ifdef COMM_STAT inet_packets++; inet_volume += n; #endif ! ! #ifdef USE_MCCP ! if (ip->out_compress) ! { ! /* we update the compressed buffer here */ ! ip->out_compress->next_out = ip->out_compress_buf + length - n; ! if (n != length) ! fprintf(stderr, "%s write socket (compressed): wrote %ld, should be %ld.\n" ! , time_stamp(), (long)n, (long)chunk); ! } ! else ! #endif ! if (n != chunk) ! fprintf(stderr, "%s write socket: wrote %ld, should be %ld.\n" ! , time_stamp(), (long)n, (long)chunk); ! /* Continue with the processing of source */ dest = &ip->message_buf[0]; } while (srclen != 0); *************** *** 2650,2659 **** --- 2710,2725 ---- { /* Say goodbye to the user. */ trace_level |= interactive->trace_level; add_message(message_flush); } + + #ifdef USE_MCCP + if (interactive->out_compress) + end_compress(interactive); + #endif + shutdown(interactive->socket, 2); socket_close(interactive->socket); } /* if (erq or user) */ #if defined(ACCESS_CONTROL) *************** *** 2676,2685 **** --- 2742,2758 ---- if (interactive->modify_command) { free_object(interactive->modify_command, "remove_interactive"); } + #ifdef USE_MCCP + if (interactive->out_compress_buf) + free(interactive->out_compress_buf); + if (interactive->out_compress) + free(interactive->out_compress); + #endif + free_svalue(&interactive->prompt); if (interactive->trace_prefix) free_mstring(interactive->trace_prefix); *************** *** 2877,2886 **** --- 2950,2965 ---- master_ob->flags |= O_ONCE_INTERACTIVE; new_interactive->ob = master_ob; /* Initialize the rest of the interactive structure */ + #ifdef USE_MCCP + new_interactive->compressing = 0; + new_interactive->out_compress = NULL; + new_interactive->out_compress_buf=NULL; + #endif + new_interactive->input_to = NULL; put_number(&new_interactive->prompt, 0); new_interactive->modify_command = NULL; new_interactive->msg_discarded = MY_FALSE; new_interactive->set_input_to = MY_FALSE; *************** *** 3940,3950 **** break; } } } /* reply_h_telnet_neg() */ ! /*-------------------------------------------------------------------------*/ void init_telopts (void) /* Initialise the telopts_xxx[] tables. * The default setting is such that requests are ignored or rejected. --- 4019,4031 ---- break; } } } /* reply_h_telnet_neg() */ ! /*- ! ! -----------------------------------------------------------------------*/ void init_telopts (void) /* Initialise the telopts_xxx[] tables. * The default setting is such that requests are ignored or rejected. *************** *** 4029,4047 **** telopts_do[TELOPT_SGA] = reply_to_do_sga; telopts_dont[TELOPT_SGA] = reply_to_dont_sga; /* Mud specific protocols */ ! telopts_do[TELOPT_COMPRESS] = reply_h_telnet_neg; ! telopts_dont[TELOPT_COMPRESS] = reply_h_telnet_neg; ! telopts_will[TELOPT_COMPRESS] = reply_h_telnet_neg; ! telopts_wont[TELOPT_COMPRESS] = reply_h_telnet_neg; ! ! telopts_do[TELOPT_COMPRESS2] = reply_h_telnet_neg; ! telopts_dont[TELOPT_COMPRESS2] = reply_h_telnet_neg; ! telopts_will[TELOPT_COMPRESS2] = reply_h_telnet_neg; ! telopts_wont[TELOPT_COMPRESS2] = reply_h_telnet_neg; telopts_do[TELOPT_MSP] = reply_h_telnet_neg; telopts_dont[TELOPT_MSP] = reply_h_telnet_neg; telopts_will[TELOPT_MSP] = reply_h_telnet_neg; telopts_wont[TELOPT_MSP] = reply_h_telnet_neg; --- 4110,4128 ---- telopts_do[TELOPT_SGA] = reply_to_do_sga; telopts_dont[TELOPT_SGA] = reply_to_dont_sga; /* Mud specific protocols */ ! telopts_do[TELOPT_COMPRESS] = mccp_telnet_neg; ! telopts_dont[TELOPT_COMPRESS] = mccp_telnet_neg; ! telopts_will[TELOPT_COMPRESS] = mccp_telnet_neg; ! telopts_wont[TELOPT_COMPRESS] = mccp_telnet_neg; ! ! telopts_do[TELOPT_COMPRESS2] = mccp_telnet_neg; ! telopts_dont[TELOPT_COMPRESS2] = mccp_telnet_neg; ! telopts_will[TELOPT_COMPRESS2] = mccp_telnet_neg; ! telopts_wont[TELOPT_COMPRESS2] = mccp_telnet_neg; telopts_do[TELOPT_MSP] = reply_h_telnet_neg; telopts_dont[TELOPT_MSP] = reply_h_telnet_neg; telopts_will[TELOPT_MSP] = reply_h_telnet_neg; telopts_wont[TELOPT_MSP] = reply_h_telnet_neg; *************** *** 5781,5790 **** --- 5862,5875 ---- * * The idea behind the flag settings is that sending command * codes for colours and other things needs to bypass the allowed * charset filters, but isn't important enough to waste bandwith * on a synchronous transmission. + * + * If the client uses MCCP compression add_message ist always used + * with flushing buffer _after_ the Message. + * */ { string_t *msg; mp_int wrote = 0, i; *************** *** 5827,5849 **** if (O_SET_INTERACTIVE(ip, current_object) && !ip->do_close) { save_command_giver = command_giver; command_giver = current_object; ! if (sp->u.number & 1) { /* Write before flush... */ sending_telnet_command = MY_TRUE; /* turn of IAC quoting */ add_message(FMT_STRING, msg); sending_telnet_command = MY_FALSE; if (sp->u.number & 2) ! add_message(message_flush); wrote = 0; } else { /* Flush, then write. */ --- 5912,5942 ---- if (O_SET_INTERACTIVE(ip, current_object) && !ip->do_close) { save_command_giver = command_giver; command_giver = current_object; ! #ifdef USE_MCCP ! if ((sp->u.number & 1)||ip->out_compress) ! #else if (sp->u.number & 1) + #endif + { /* Write before flush... */ sending_telnet_command = MY_TRUE; /* turn of IAC quoting */ add_message(FMT_STRING, msg); sending_telnet_command = MY_FALSE; + #ifdef USE_MCCP + if ((sp->u.number & 2)||ip->out_compress) + #else if (sp->u.number & 2) ! #endif ! add_message(message_flush); wrote = 0; } else { /* Flush, then write. */ *************** *** 6791,6795 **** --- 6884,7204 ---- return sp; } /* f_query_udp_port() */ /***************************************************************************/ + static void + mccp_telnet_neg (int option) + { + interactive_t *ip = O_GET_INTERACTIVE (command_giver); + + switch (ip->tn_state) + { + case TS_WILL: + DTF(("MCCP NEG (%d) STATE (WILL)\n", option)); + break; + case TS_WONT: + DTF(("MCCP NEG (%d) STATE (WONT)\n", option)); + break; + case TS_DO: + DTF(("MCCP NEG (%d) STATE (DO)\n", option)); + #ifdef USE_MCCP + if (!ip->compressing) + start_compress(ip, option); + #endif + break; + case TS_DONT: + DTF(("MCCP NEG (%d) STATE (DONT)\n", option)); + #ifdef USE_MCCP + if(ip->compressing==option) + end_compress(ip); + #endif + break; + default: + DTF(("MCCP NEG (%d) STATE (%d)\n", option, ip->tn_state)); + } + } + + #ifdef USE_MCCP + + svalue_t * + f_start_mccp_compress (svalue_t * sp) + { + interactive_t *ip; + int mccpver; + int retval; + + mccpver=sp->u.number; + + if ((mccpver!=TELOPT_COMPRESS)&& + (mccpver!=TELOPT_COMPRESS2)) + { + error("arg 1 should be TELOPT_COMPRESS or TELOPT_COMPRESS2.\n"); + return sp; + } + + if (!O_SET_INTERACTIVE(ip, current_object)) + { + error("start_mccp_compress() must be called inside the interactive\n"); + return sp; + } + + free_svalue(sp); + retval=start_compress(ip,mccpver); + put_number(sp,retval); + + return sp; + } + svalue_t * + + f_end_mccp_compress (svalue_t * sp) + { + interactive_t *ip; + int retval; + + if (!O_SET_INTERACTIVE(ip, current_object)) + { + error("end_mccp_compress() must be called inside the interactive\n"); + return sp; + } + + retval=end_compress(ip); + sp++; + put_number(sp,retval); + + return sp; + } + + + svalue_t * + f_query_mccp (svalue_t * sp) + /* EFUN query_mccp() + * + * int query_mccp(object ob) + * + * this efun returns 0 if no mccp is used for interactive ob. + * if ob|this_player uses mccp it returns TELOPT_COMPRESS or + * TELOPT_COMPRESS2 + */ + { + interactive_t *ip; + + /* Make sure the object is interactive */ + if (!(O_SET_INTERACTIVE (ip, sp->u.ob)) || ip->closing) + { + error ("Bad arg 1 to query_mccp(): object not interactive.\n"); + return sp; + } + + free_svalue (sp); + put_number (sp, ip->compressing); + + return sp; + } /* query_mccp() */ + + svalue_t * + f_query_mccp_stats (svalue_t * sp) + /* EFUN query_mccp_stats() + * + * int *query_mccp_stats(object ob) + * + * if the connection of interactive ob ( or this_object() if ob==0 ) + * is compressed it returns an array with zlib statistics + * ({ total_in, total_out }) ( uncompressed/compressed) + * + */ + { + interactive_t *ip; + vector_t *mccp_stats; + + /* Make sure the object is interactive */ + if (!(O_SET_INTERACTIVE (ip, sp->u.ob)) || ip->closing) + { + error ("Bad arg 1 to query_mccp_stats(): object not interactive.\n"); + return sp; + } + + free_svalue (sp); + + if (ip->compressing > 0) + { + mccp_stats = allocate_uninit_array (2); + put_number (mccp_stats->item, ip->out_compress->total_in); + put_number (mccp_stats->item + 1, ip->out_compress->total_out); + put_array (sp, mccp_stats); + } + else + { + put_number (sp, 0); + } + + + return sp; + } /* query_mccp_stats() */ + + + + /* + * the rest of the file is sligthly modified taken from the mccp-site so + * the header of the original file remains here: + */ + + /* + * mccp.c - support functions for the Mud Client Compression Protocol + * + * see http://www.randomly.org/projects/MCCP/ + * + * Copyright (c) 1999, Oliver Jowett <oliver@randomly.org> + * + * This code may be freely distributed and used if this copyright + * notice is retained intact. + */ + + void * + zlib_alloc (void *opaque, unsigned int items, unsigned int size) + { + return calloc (items, size); + } + + void + zlib_free (void *opaque, void *address) + { + free (address); + } + + + static int + start_compress (interactive_t * ip, unsigned char telopt) + { + z_stream *s; + + /* already compressing */ + if (ip->out_compress) + return 1; + + /* allocate and init stream, buffer */ + s = (z_stream *) malloc (sizeof (*s)); + ip->out_compress_buf = (unsigned char *) malloc (COMPRESS_BUF_SIZE); + + s->next_in = NULL; + s->avail_in = 0; + s->next_out = ip->out_compress_buf; + s->avail_out = COMPRESS_BUF_SIZE; + s->zalloc = zlib_alloc; + s->zfree = zlib_free; + s->opaque = NULL; + + if (deflateInit (s, 9) != Z_OK) + { + free (ip->out_compress_buf); + free (s); + return 0; + } + + /* version 1 or 2 support */ + if (telopt == TELOPT_COMPRESS) + { + DTF (("%s TDEBUG: send IAC SB %02x WILL SE\n", time_stamp (), telopt)); + SEND_TELNET_COMMAND (add_message ("%c", IAC); + add_message ("%c%c%c%c", SB, telopt, WILL, SE); + add_message (message_flush);); + } + else if (telopt == TELOPT_COMPRESS2) + { + DTF (("%s TDEBUG: send IAC SB %02x WILL SE\n", time_stamp (), telopt)); + SEND_TELNET_COMMAND (add_message ("%c", IAC); + add_message ("%c%c%c%c", SB, telopt, IAC, SE); + add_message (message_flush);); + } + else + { + printf ("Bad teleoption %d passed", telopt); + free (ip->out_compress_buf); + free (s); + return 0; + } + + ip->compressing = telopt; + ip->out_compress = s; + + printf("%s MCCP-DEBUG: '%s' mccp started (%d)\n", time_stamp(), get_txt(ip->ob->name),telopt); + + /* success */ + return 1; + } + + /* Try to send any pending compressed-but-not-sent data in `desc' */ + int + process_compressed (interactive_t * ip) + { + int iStart, nBlock, nWrite, len; + + if (!ip->out_compress) + return 1; + + len = ip->out_compress->next_out - ip->out_compress_buf; + if (len > 0) + { + for (iStart = 0; iStart < len; iStart += nWrite) + { + nBlock = UMIN (len - iStart, 4096); + if ((nWrite = + write (ip->socket, ip->out_compress_buf + iStart, nBlock)) < 0) + { + if (errno == EAGAIN || errno == ENOSR) + break; + + /* write error */ + return 0; + } + if (nWrite <= 0) + break; + } + + if (iStart) + { + if (iStart < len) + memmove (ip->out_compress_buf, ip->out_compress_buf + iStart, + len - iStart); + + ip->out_compress->next_out = ip->out_compress_buf + len - iStart; + } + } + + /* success */ + return 1; + } + + /* Cleanly shut down compression on `desc' */ + static int + end_compress (interactive_t * ip) + { + unsigned char dummy[1]; + + if (!ip->out_compress) + return 1; + + ip->out_compress->avail_in = 0; + ip->out_compress->next_in = dummy; + + /* No terminating signature is needed - receiver will get Z_STREAM_END */ + if (deflate (ip->out_compress, Z_FINISH) != Z_STREAM_END) + return 0; + + /* try to send any residual data */ + if (!process_compressed (ip)) + return 0; + + /* reset compression values */ + deflateEnd (ip->out_compress); + free (ip->out_compress_buf); + free (ip->out_compress); + ip->compressing = 0; + ip->out_compress = NULL; + ip->out_compress_buf = NULL; + + printf("%s MCCP-DEBUG: '%s' mccp ended\n", time_stamp(), get_txt(ip->ob->name)); + + /* success */ + return 1; + } + #endif diff --new-file -c5 -r 3-3.orig/src/comm.h 3-3.export/src/comm.h *** 3-3.orig/src/comm.h Fri Feb 8 07:03:48 2002 --- 3-3.export/src/comm.h Sat Feb 16 16:52:55 2002 *************** *** 3,12 **** --- 3,16 ---- #include "driver.h" #include "typedefs.h" #include <sys/types.h> + #ifdef USE_MCCP + # include <zlib.h> + #endif + #include "simulate.h" /* callback_t for input_to_t */ #include "svalue.h" /* TODO: Make the following a separate "my-socket.h" include, also * TODO:: to be used in access_check.h instead of comm.h. *************** *** 165,174 **** --- 169,185 ---- * and a terminating '\0'. */ char message_buf[MAX_SOCKET_PACKET_SIZE]; /* The send buffer. */ + + #ifdef USE_MCCP + unsigned char compressing; /* MCCP support */ + z_stream * out_compress; /* MCCP support */ + unsigned char * out_compress_buf; /* MCCP support */ + #endif + }; /* --- Bitflags and masks for interactive.noecho --- * * 'noecho' is a historical misnomer as it actually represents several *************** *** 310,316 **** --- 321,330 ---- extern svalue_t *f_users(svalue_t *sp); #if defined(ACCESS_CONTROL) extern void refresh_access_data(void (*add_entry)(struct sockaddr_in *, int, long*) ); #endif /* ACCESS_CONTROL */ + + #define COMPRESS_BUF_SIZE 8192 + #define UMIN(a,b) ((a) < (b) ? (a) : (b)) #endif /* COMM_H__ */ diff --new-file -c5 -r 3-3.orig/src/config.h.in 3-3.export/src/config.h.in *** 3-3.orig/src/config.h.in Sun Feb 10 10:11:19 2002 --- 3-3.export/src/config.h.in Thu Feb 14 11:58:33 2002 *************** *** 305,314 **** --- 305,319 ---- /* Define this if you want mySQL support (assuming that your host * actually offers this. */ @cdef_use_mysql@ USE_MYSQL + /* Define this if you want MCCP (Mud Control Compression Protocol). + */ + + @cdef_use_mccp@ USE_MCCP + /* Define this if you want PCRE instead of traditional regexps. */ @cdef_use_pcre@ USE_PCRE diff --new-file -c5 -r 3-3.orig/src/configure 3-3.export/src/configure *** 3-3.orig/src/configure Sun Feb 10 10:11:19 2002 --- 3-3.export/src/configure Thu Feb 14 11:58:33 2002 *************** *** 54,63 **** --- 54,66 ---- Enables alist support" ac_help="$ac_help --enable-use-mysql default=disabled Enables mySQL support" ac_help="$ac_help + --enable-use-mccp default=disabled + Enables MCCP support" + ac_help="$ac_help --enable-use-pcre default=disabled Enables PCRE instead of traditional regexps" ac_help="$ac_help --enable-use-deprecated default=enabled Enables obsolete and deprecated efuns" *************** *** 211,224 **** localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' - guidedir='${prefix}/guide' - htmldir='${prefix}/html' - psdir='${prefix}/ps' - dvidir='${prefix}/dvi' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= --- 214,223 ---- *************** *** 332,345 **** --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] - --guidedir=DIR Amigaguide documentation in DIR [PREFIX/guide] - --htmldir=DIR HTML documentation in DIR [PREFIX/html] - --psdir=DIR postscript documentation in DIR [PREFIX/ps] - --dvidir=DIR TeX dvi documentation in DIR [PREFIX/dvi] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM --- 331,340 ---- *************** *** 378,403 **** -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; - -guidedir | --guidedir | --guidedi | --guided | --guide | --gui) - ac_prev=guidedir ;; - -guidedir=* | --guidedir=* | --guidedi=* | --guided=* | --guide=* |--gui=*)+ guidedir="$ac_optarg" ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* |--htm=*)+ htmldir="$ac_optarg" ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+ psdir="$ac_optarg" ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* |--dv=*)+ dvidir="$ac_optarg" ;; - -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; --- 373,382 ---- *************** *** 820,829 **** --- 799,816 ---- enableval="$enable_use_mysql" : fi + DEFAULTenable_use_mccp=no + # Check whether --enable-use-mccp or --disable-use-mccp was given. + if test "${enable_use_mccp+set}" = set; then + enableval="$enable_use_mccp" + : + fi + + DEFAULTenable_use_pcre=no # Check whether --enable-use-pcre or --disable-use-pcre was given. if test "${enable_use_pcre+set}" = set; then enableval="$enable_use_pcre" : *************** *** 1420,1429 **** --- 1407,1426 ---- cdef_use_alists="#define" else cdef_use_alists="#undef" fi + if test "x$enable_use_mccp" = "x" && test "x$DEFAULTenable_use_mccp" != "x"; then + enable_use_mccp=$DEFAULTenable_use_mccp + fi + + if test "x$enable_use_mccp" = "xyes"; then + cdef_use_mccp="#define" + else + cdef_use_mccp="#undef" + fi + if test "x$enable_use_pcre" = "x" && test "x$DEFAULTenable_use_pcre" != "x"; then enable_use_pcre=$DEFAULTenable_use_pcre fi if test "x$enable_use_pcre" = "xyes"; then *************** *** 2004,2014 **** # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2010: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. --- 2001,2011 ---- # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2007: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. *************** *** 2031,2139 **** else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then - # Extract the first word of "bcc", so it can be a program name with args. - set dummy bcc; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 - echo "configure:2040: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. - else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="bcc" - break - fi - done - IFS="$ac_save_ifs" - fi - fi - CC="$ac_cv_prog_CC" - if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 - else - echo "$ac_t""no" 1>&6 - fi - - fi - if test -z "$CC"; then - machine=`(uname -m 2>/dev/null)` || machine=unknown - case "$machine" in - BePC) # Extract the first word of "mwccx86", so it can be a program name with args. - set dummy mwccx86; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 - echo "configure:2073: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. - else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="mwccx86" - break - fi - done - IFS="$ac_save_ifs" - fi - fi - CC="$ac_cv_prog_CC" - if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 - else - echo "$ac_t""no" 1>&6 - fi - ;; - BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args. - set dummy mwcc; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 - echo "configure:2102: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. - else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="mwcc" - break - fi - done - IFS="$ac_save_ifs" - fi - fi - CC="$ac_cv_prog_CC" - if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 - else - echo "$ac_t""no" 1>&6 - fi - ;; - *) ;; - esac - fi - if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2135: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. --- 2028,2041 ---- else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2037: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. *************** *** 2174,2191 **** echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ! fi ! if test -z "$CC"; then ! case "`uname -s`" in ! *win32* | *WIN32*) ! # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2187: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. --- 2076,2092 ---- echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ! if test -z "$CC"; then ! case "`uname -s`" in ! *win32* | *WIN32*) ! # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2088: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. *************** *** 2207,2238 **** echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; ! esac fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:2218: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF ! #line 2229 "configure" #include "confdefs.h" main(){return(0);} EOF ! if { (eval echo configure:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else --- 2108,2140 ---- echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; ! esac ! fi ! test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:2120: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF ! #line 2131 "configure" #include "confdefs.h" main(){return(0);} EOF ! if { (eval echo configure:2136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else *************** *** 2254,2278 **** echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:2260: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:2265: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <<EOF #ifdef __GNUC__ yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi --- 2156,2180 ---- echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:2162: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:2167: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <<EOF #ifdef __GNUC__ yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi *************** *** 2287,2297 **** ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:2293: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then --- 2189,2199 ---- ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:2195: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then *************** *** 2317,2366 **** CFLAGS="-O2" else CFLAGS= fi fi - case "$CC" in - bcc ) - AR=${AR-mwld} - LD=${LD-mwld} - RANLIB=${RANLIB-true};; - mwcc ) - CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -nodup" - AR=${AR-mwld} - LD=${LD-mwld} - RANLIB=${RANLIB-true};; - mwccx86 ) - CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib" - AR=${AR-mwldx86} - LD=${LD-mwldx86} - RANLIB=${RANLIB-true};; - ${host_alias}-gcc) - ;; - *) - AR=${AR-ar} - LD=${LD-ld} - RANLIB=${RANLIB-ranlib};; - esac - # The newer versions of gcc/egcs running on SunOS fall into catatonia when # asked to compile this test with any optimisation. To be able to run # configure at all, we fudge the CFLAGS a bit. save_cflags=$CFLAGS echo "For this test, I use '-g' instead of '$CFLAGS' as compiler flags." CFLAGS="-g" echo $ac_n "checking gcc/assembler float/branch incompatibility, e.g. on AIX""... $ac_c" 1>&6 ! echo "configure:2357: checking gcc/assembler float/branch incompatibility, e.g. on AIX" >&5 if eval "test \"`echo '$''{'lp_cv_sys_float_branch_incompatible'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2362 "configure" #include "confdefs.h" int foo(), bar(), foobar(); #define x1 foobar(); #define x4 x1 x1 x1 x1 #define x10 x4 x4 x4 x4 --- 2219,2245 ---- CFLAGS="-O2" else CFLAGS= fi fi # The newer versions of gcc/egcs running on SunOS fall into catatonia when # asked to compile this test with any optimisation. To be able to run # configure at all, we fudge the CFLAGS a bit. save_cflags=$CFLAGS echo "For this test, I use '-g' instead of '$CFLAGS' as compiler flags." CFLAGS="-g" echo $ac_n "checking gcc/assembler float/branch incompatibility, e.g. on AIX""... $ac_c" 1>&6 ! echo "configure:2236: checking gcc/assembler float/branch incompatibility, e.g. on AIX" >&5 if eval "test \"`echo '$''{'lp_cv_sys_float_branch_incompatible'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2241 "configure" #include "confdefs.h" int foo(), bar(), foobar(); #define x1 foobar(); #define x4 x1 x1 x1 x1 #define x10 x4 x4 x4 x4 *************** *** 2382,2392 **** double d = 4.5; int main() { double e = 1.3; e/= 0.2; ; return 0; } EOF ! if { (eval echo configure:2388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lp_cv_sys_float_branch_incompatible=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 2261,2271 ---- double d = 4.5; int main() { double e = 1.3; e/= 0.2; ; return 0; } EOF ! if { (eval echo configure:2267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lp_cv_sys_float_branch_incompatible=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 2406,2416 **** # Restore the CFLAGS CFLAGS=$save_cflags cat > conftest.$ac_ext <<EOF ! #line 2412 "configure" #include "confdefs.h" #ifndef __STDC__ #error need STDC guarantee an compiling error here... --- 2285,2295 ---- # Restore the CFLAGS CFLAGS=$save_cflags cat > conftest.$ac_ext <<EOF ! #line 2291 "configure" #include "confdefs.h" #ifndef __STDC__ #error need STDC guarantee an compiling error here... *************** *** 2418,2428 **** int main() { ; return 0; } EOF ! if { (eval echo configure:2424: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 2297,2307 ---- int main() { ; return 0; } EOF ! if { (eval echo configure:2303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 2458,2483 **** # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install - # AmigaOS /c/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:2470: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in ! /|./|.//|/etc/*|/c/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do --- 2337,2361 ---- # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:2348: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in ! /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do *************** *** 2522,2532 **** for ac_prog in byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2528: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. --- 2400,2410 ---- for ac_prog in byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2406: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. *************** *** 2553,2563 **** test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:2559: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then --- 2431,2441 ---- test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:2437: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then *************** *** 2568,2618 **** # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF ! #line 2574 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2580: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF ! #line 2591 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2597: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF ! #line 2608 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 --- 2446,2496 ---- # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF ! #line 2452 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2458: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF ! #line 2469 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2475: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF ! #line 2486 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2492: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 *************** *** 2635,2645 **** echo "$ac_t""$CPP" 1>&6 cat > conftest.$ac_ext <<EOF ! #line 2641 "configure" #include "confdefs.h" #if defined(__EMX__) yes #endif --- 2513,2523 ---- echo "$ac_t""$CPP" 1>&6 cat > conftest.$ac_ext <<EOF ! #line 2519 "configure" #include "confdefs.h" #if defined(__EMX__) yes #endif *************** *** 2652,2662 **** fi rm -f conftest* cat > conftest.$ac_ext <<EOF ! #line 2658 "configure" #include "confdefs.h" #if defined(__CYGWIN32__) || defined(__CYGWIN__) yes #endif --- 2530,2540 ---- fi rm -f conftest* cat > conftest.$ac_ext <<EOF ! #line 2536 "configure" #include "confdefs.h" #if defined(__CYGWIN32__) || defined(__CYGWIN__) yes #endif *************** *** 2673,2693 **** for ac_hdr in sys/rusage.h sys/time.h unistd.h stdlib.h libc.h memory.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2679: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2684 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else --- 2551,2571 ---- for ac_hdr in sys/rusage.h sys/time.h unistd.h stdlib.h libc.h memory.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2557: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2562 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else *************** *** 2713,2733 **** for ac_hdr in values.h string.h bstring.h netdb.h crypt.h sys/param.h sys/termios.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2719: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2724 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else --- 2591,2611 ---- for ac_hdr in values.h string.h bstring.h netdb.h crypt.h sys/param.h sys/termios.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2597: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2602 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2607: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else *************** *** 2750,2773 **** echo "$ac_t""no" 1>&6 fi done echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:2756: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2761 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else --- 2628,2651 ---- echo "$ac_t""no" 1>&6 fi done echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:2634: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2639 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2647: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else *************** *** 2780,2790 **** rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF ! #line 2786 "configure" #include "confdefs.h" #include <string.h> EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then --- 2658,2668 ---- rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF ! #line 2664 "configure" #include "confdefs.h" #include <string.h> EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then *************** *** 2798,2808 **** fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF ! #line 2804 "configure" #include "confdefs.h" #include <stdlib.h> EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then --- 2676,2686 ---- fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF ! #line 2682 "configure" #include "confdefs.h" #include <stdlib.h> EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then *************** *** 2819,2840 **** # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF ! #line 2825 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF ! if { (eval echo configure:2836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 2697,2718 ---- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF ! #line 2703 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF ! if { (eval echo configure:2714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 2857,2877 **** for ac_hdr in limits.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2863: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2868 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else --- 2735,2755 ---- for ac_hdr in limits.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2741: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2746 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else *************** *** 2898,2921 **** ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:2904: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2909 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> int main() { DIR *dirp = 0; ; return 0; } EOF ! if { (eval echo configure:2917: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 2776,2799 ---- ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:2782: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2787 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> int main() { DIR *dirp = 0; ; return 0; } EOF ! if { (eval echo configure:2795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 2936,2965 **** fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:2942: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF ! #line 2950 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir(); int main() { opendir() ; return 0; } EOF ! if { (eval echo configure:2961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 2814,2843 ---- fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:2820: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF ! #line 2828 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir(); int main() { opendir() ; return 0; } EOF ! if { (eval echo configure:2839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 2977,3006 **** echo "$ac_t""no" 1>&6 fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:2983: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF ! #line 2991 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir(); int main() { opendir() ; return 0; } EOF ! if { (eval echo configure:3002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 2855,2884 ---- echo "$ac_t""no" 1>&6 fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:2861: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF ! #line 2869 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir(); int main() { opendir() ; return 0; } EOF ! if { (eval echo configure:2880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3020,3049 **** fi echo $ac_n "checking size of char *""... $ac_c" 1>&6 ! echo "configure:3026: checking size of char *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_char_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 3034 "configure" #include "confdefs.h" #include <stdio.h> main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(char *)); exit(0); } EOF ! if { (eval echo configure:3045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_char_p=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 2898,2928 ---- fi echo $ac_n "checking size of char *""... $ac_c" 1>&6 ! echo "configure:2904: checking size of char *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_char_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 2912 "configure" #include "confdefs.h" #include <stdio.h> + #include <sys/types.h> main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(char *)); exit(0); } EOF ! if { (eval echo configure:2924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_char_p=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3059,3088 **** #define SIZEOF_CHAR_P $ac_cv_sizeof_char_p EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 ! echo "configure:3065: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 3073 "configure" #include "confdefs.h" #include <stdio.h> main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(int)); exit(0); } EOF ! if { (eval echo configure:3084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 2938,2968 ---- #define SIZEOF_CHAR_P $ac_cv_sizeof_char_p EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 ! echo "configure:2944: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 2952 "configure" #include "confdefs.h" #include <stdio.h> + #include <sys/types.h> main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(int)); exit(0); } EOF ! if { (eval echo configure:2964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3098,3127 **** #define SIZEOF_INT $ac_cv_sizeof_int EOF echo $ac_n "checking size of short""... $ac_c" 1>&6 ! echo "configure:3104: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 3112 "configure" #include "confdefs.h" #include <stdio.h> main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(short)); exit(0); } EOF ! if { (eval echo configure:3123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 2978,3008 ---- #define SIZEOF_INT $ac_cv_sizeof_int EOF echo $ac_n "checking size of short""... $ac_c" 1>&6 ! echo "configure:2984: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 2992 "configure" #include "confdefs.h" #include <stdio.h> + #include <sys/types.h> main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(short)); exit(0); } EOF ! if { (eval echo configure:3004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3137,3166 **** #define SIZEOF_SHORT $ac_cv_sizeof_short EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 ! echo "configure:3143: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 3151 "configure" #include "confdefs.h" #include <stdio.h> main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(long)); exit(0); } EOF ! if { (eval echo configure:3162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3018,3048 ---- #define SIZEOF_SHORT $ac_cv_sizeof_short EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 ! echo "configure:3024: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 3032 "configure" #include "confdefs.h" #include <stdio.h> + #include <sys/types.h> main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(long)); exit(0); } EOF ! if { (eval echo configure:3044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3177,3201 **** EOF echo $ac_n "checking for needed malloc() alignment""... $ac_c" 1>&6 ! echo "configure:3183: checking for needed malloc() alignment" >&5 if eval "test \"`echo '$''{'lp_cv_sys_malloc_align'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3188 "configure" #include "confdefs.h" struct ts {double d; char *p; double e;}; int i = 96/(sizeof(struct ts)-20); int main() { ; return 0; } EOF ! if { (eval echo configure:3197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_sys_malloc_align=8 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3059,3083 ---- EOF echo $ac_n "checking for needed malloc() alignment""... $ac_c" 1>&6 ! echo "configure:3065: checking for needed malloc() alignment" >&5 if eval "test \"`echo '$''{'lp_cv_sys_malloc_align'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3070 "configure" #include "confdefs.h" struct ts {double d; char *p; double e;}; int i = 96/(sizeof(struct ts)-20); int main() { ; return 0; } EOF ! if { (eval echo configure:3079: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_sys_malloc_align=8 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3210,3233 **** #define MALLOC_ALIGN $lp_cv_sys_malloc_align EOF echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 ! echo "configure:3216: checking for ssize_t" >&5 if eval "test \"`echo '$''{'lp_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3221 "configure" #include "confdefs.h" #include <sys/types.h> ssize_t i; int main() { ; return 0; } EOF ! if { (eval echo configure:3229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_type_ssize_t=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3092,3115 ---- #define MALLOC_ALIGN $lp_cv_sys_malloc_align EOF echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 ! echo "configure:3098: checking for ssize_t" >&5 if eval "test \"`echo '$''{'lp_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3103 "configure" #include "confdefs.h" #include <sys/types.h> ssize_t i; int main() { ; return 0; } EOF ! if { (eval echo configure:3111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_type_ssize_t=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3244,3266 **** EOF fi echo $ac_n "checking for long long""... $ac_c" 1>&6 ! echo "configure:3250: checking for long long" >&5 if eval "test \"`echo '$''{'lp_cv_type_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3255 "configure" #include "confdefs.h" long long i; int main() { ; return 0; } EOF ! if { (eval echo configure:3262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_type_long_long=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3126,3148 ---- EOF fi echo $ac_n "checking for long long""... $ac_c" 1>&6 ! echo "configure:3132: checking for long long" >&5 if eval "test \"`echo '$''{'lp_cv_type_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3137 "configure" #include "confdefs.h" long long i; int main() { ; return 0; } EOF ! if { (eval echo configure:3144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_type_long_long=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3275,3304 **** cat >> confdefs.h <<\EOF #define HAVE_LONG_LONG 1 EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 ! echo "configure:3281: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 3289 "configure" #include "confdefs.h" #include <stdio.h> main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(long long)); exit(0); } EOF ! if { (eval echo configure:3300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3157,3187 ---- cat >> confdefs.h <<\EOF #define HAVE_LONG_LONG 1 EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 ! echo "configure:3163: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 3171 "configure" #include "confdefs.h" #include <stdio.h> + #include <sys/types.h> main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(long long)); exit(0); } EOF ! if { (eval echo configure:3183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3316,3338 **** fi echo $ac_n "checking for bool""... $ac_c" 1>&6 ! echo "configure:3322: checking for bool" >&5 if eval "test \"`echo '$''{'lp_cv_type_bool'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3327 "configure" #include "confdefs.h" bool b; int main() { ; return 0; } EOF ! if { (eval echo configure:3334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_type_bool=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3199,3221 ---- fi echo $ac_n "checking for bool""... $ac_c" 1>&6 ! echo "configure:3205: checking for bool" >&5 if eval "test \"`echo '$''{'lp_cv_type_bool'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3210 "configure" #include "confdefs.h" bool b; int main() { ; return 0; } EOF ! if { (eval echo configure:3217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_type_bool=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3349,3373 **** EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 ! echo "configure:3355: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF ! #line 3362 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF ! if { (eval echo configure:3369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3232,3256 ---- EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 ! echo "configure:3238: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF ! #line 3245 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF ! if { (eval echo configure:3252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3396,3411 **** EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 ! echo "configure:3402: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3407 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS #include <stdlib.h> #include <stddef.h> --- 3279,3294 ---- EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 ! echo "configure:3285: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3290 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS #include <stdlib.h> #include <stddef.h> *************** *** 3429,3444 **** EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 ! echo "configure:3435: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3440 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS #include <stdlib.h> #include <stddef.h> --- 3312,3327 ---- EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 ! echo "configure:3318: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3323 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS #include <stdlib.h> #include <stddef.h> *************** *** 3462,3477 **** EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:3468: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3473 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> #ifdef signal #undef signal --- 3345,3360 ---- EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:3351: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3356 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> #ifdef signal #undef signal *************** *** 3484,3494 **** int main() { int i; ; return 0; } EOF ! if { (eval echo configure:3490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3367,3377 ---- int main() { int i; ; return 0; } EOF ! if { (eval echo configure:3373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3510,3535 **** #define RETSIGTYPE_VOID 1 EOF fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 ! echo "configure:3516: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <<EOF ! #line 3524 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:3531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3393,3418 ---- #define RETSIGTYPE_VOID 1 EOF fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 ! echo "configure:3399: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <<EOF ! #line 3407 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:3414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3553,3578 **** else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 ! echo "configure:3559: checking for main in -lsocket" >&5 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <<EOF ! #line 3567 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:3574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3436,3461 ---- else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 ! echo "configure:3442: checking for main in -lsocket" >&5 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <<EOF ! #line 3450 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:3457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3596,3621 **** else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for main in -lucb""... $ac_c" 1>&6 ! echo "configure:3602: checking for main in -lucb" >&5 ac_lib_var=`echo ucb'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lucb $LIBS" cat > conftest.$ac_ext <<EOF ! #line 3610 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:3617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3479,3504 ---- else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for main in -lucb""... $ac_c" 1>&6 ! echo "configure:3485: checking for main in -lucb" >&5 ac_lib_var=`echo ucb'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lucb $LIBS" cat > conftest.$ac_ext <<EOF ! #line 3493 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:3500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3632,3657 **** else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for main in -lcrypt""... $ac_c" 1>&6 ! echo "configure:3638: checking for main in -lcrypt" >&5 ac_lib_var=`echo crypt'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <<EOF ! #line 3646 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:3653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3515,3540 ---- else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for main in -lcrypt""... $ac_c" 1>&6 ! echo "configure:3521: checking for main in -lcrypt" >&5 ac_lib_var=`echo crypt'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <<EOF ! #line 3529 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:3536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3667,3694 **** LIBS="$LIBS -lcrypt" else echo "$ac_t""no" 1>&6 fi if test $ac_cv_lib_socket_main = "yes" || test $ac_cv_lib_ucb_main = "yes"; then echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 ! echo "configure:3675: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <<EOF ! #line 3683 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:3690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3550,3616 ---- LIBS="$LIBS -lcrypt" else echo "$ac_t""no" 1>&6 fi + if test $enable_use_mccp = yes; then + echo $ac_n "checking for main in -lz""... $ac_c" 1>&6 + echo "configure:3558: checking for main in -lz" >&5 + ac_lib_var=`echo z'_'main | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-lz $LIBS" + cat > conftest.$ac_ext <<EOF + #line 3566 "configure" + #include "confdefs.h" + + int main() { + main() + ; return 0; } + EOF + if { (eval echo configure:3573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* + LIBS="$ac_save_LIBS" + + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lz" + else + echo "$ac_t""no" 1>&6 + fi + + fi + if test $ac_cv_lib_socket_main = "yes" || test $ac_cv_lib_ucb_main = "yes"; then echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 ! echo "configure:3597: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <<EOF ! #line 3605 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:3612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3715,3737 **** fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ! echo "configure:3721: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3726 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF ! if { (eval echo configure:3733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3637,3659 ---- fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ! echo "configure:3643: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3648 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF ! if { (eval echo configure:3655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3748,3766 **** EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 ! echo "configure:3754: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3759 "configure" #include "confdefs.h" ! #if 0 /* Never do this, it's unnecessary. -fnf */ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include <malloc.h> # define alloca _alloca --- 3670,3688 ---- EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 ! echo "configure:3676: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3681 "configure" #include "confdefs.h" ! #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include <malloc.h> # define alloca _alloca *************** *** 3781,3791 **** int main() { char *p = (char *) alloca(1); ; return 0; } EOF ! if { (eval echo configure:3787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3703,3713 ---- int main() { char *p = (char *) alloca(1); ; return 0; } EOF ! if { (eval echo configure:3709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3813,3828 **** #define C_ALLOCA 1 EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 ! echo "configure:3819: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3824 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray --- 3735,3750 ---- #define C_ALLOCA 1 EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 ! echo "configure:3741: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3746 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray *************** *** 3843,3858 **** echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3849: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3854 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ --- 3765,3780 ---- echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3771: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3776 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ *************** *** 3871,3881 **** $ac_func(); #endif ; return 0; } EOF ! if { (eval echo configure:3877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3793,3803 ---- $ac_func(); #endif ; return 0; } EOF ! if { (eval echo configure:3799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3898,3916 **** done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:3904: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF ! #line 3912 "configure" #include "confdefs.h" find_stack_direction () { static char *addr = 0; auto char dummy; --- 3820,3838 ---- done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:3826: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF ! #line 3834 "configure" #include "confdefs.h" find_stack_direction () { static char *addr = 0; auto char dummy; *************** *** 3925,3935 **** main () { exit (find_stack_direction() < 0); } EOF ! if { (eval echo configure:3931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3847,3857 ---- main () { exit (find_stack_direction() < 0); } EOF ! if { (eval echo configure:3853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 3949,3964 **** fi for ac_func in fchmod getrusage bzero memset memcpy memmem strdup strcspn crypt _crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3955: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3960 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ --- 3871,3886 ---- fi for ac_func in fchmod getrusage bzero memset memcpy memmem strdup strcspn crypt _crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3877: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3882 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ *************** *** 3977,3987 **** $ac_func(); #endif ; return 0; } EOF ! if { (eval echo configure:3983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3899,3909 ---- $ac_func(); #endif ; return 0; } EOF ! if { (eval echo configure:3905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4004,4019 **** done for ac_func in strchr strrchr getcwd memmove sysconf gettimeofday wait3 waitpid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:4010: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 4015 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ --- 3926,3941 ---- done for ac_func in strchr strrchr getcwd memmove sysconf gettimeofday wait3 waitpid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3932: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3937 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ *************** *** 4032,4042 **** $ac_func(); #endif ; return 0; } EOF ! if { (eval echo configure:4038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 3954,3964 ---- $ac_func(); #endif ; return 0; } EOF ! if { (eval echo configure:3960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4059,4074 **** done for ac_func in fcntl getdomainname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:4065: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 4070 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ --- 3981,3996 ---- done for ac_func in fcntl getdomainname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3987: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 3992 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ *************** *** 4087,4097 **** $ac_func(); #endif ; return 0; } EOF ! if { (eval echo configure:4093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4009,4019 ---- $ac_func(); #endif ; return 0; } EOF ! if { (eval echo configure:4015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4113,4129 **** fi done echo $ac_n "checking if inet_ntoa() ok""... $ac_c" 1>&6 ! echo "configure:4119: checking if inet_ntoa() ok" >&5 if eval "test \"`echo '$''{'lp_cv_func_inet_ntoa_ok'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext <<EOF ! #line 4125 "configure" #include "confdefs.h" #if defined(sun) && !defined(__svr4__) #include <sys/types.h> /* needed for netinet/in.h */ #include <netinet/in.h> --- 4035,4051 ---- fi done echo $ac_n "checking if inet_ntoa() ok""... $ac_c" 1>&6 ! echo "configure:4041: checking if inet_ntoa() ok" >&5 if eval "test \"`echo '$''{'lp_cv_func_inet_ntoa_ok'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext <<EOF ! #line 4047 "configure" #include "confdefs.h" #if defined(sun) && !defined(__svr4__) #include <sys/types.h> /* needed for netinet/in.h */ #include <netinet/in.h> *************** *** 4140,4150 **** int main() { ; return 0; } EOF ! if { (eval echo configure:4146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_func_inet_ntoa_ok=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4062,4072 ---- int main() { ; return 0; } EOF ! if { (eval echo configure:4068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_func_inet_ntoa_ok=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4153,4163 **** fi rm -f conftest* else cat > conftest.$ac_ext <<EOF ! #line 4159 "configure" #include "confdefs.h" #include <sys/types.h> /* needed for netinet/in.h */ #include <netinet/in.h> #include <arpa/inet.h> --- 4075,4085 ---- fi rm -f conftest* else cat > conftest.$ac_ext <<EOF ! #line 4081 "configure" #include "confdefs.h" #include <sys/types.h> /* needed for netinet/in.h */ #include <netinet/in.h> #include <arpa/inet.h> *************** *** 4179,4189 **** exit(1); exit(0); } EOF ! if { (eval echo configure:4185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_func_inet_ntoa_ok=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4101,4111 ---- exit(1); exit(0); } EOF ! if { (eval echo configure:4107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_func_inet_ntoa_ok=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4202,4219 **** EOF fi echo $ac_n "checking for IPv6 support""... $ac_c" 1>&6 ! echo "configure:4208: checking for IPv6 support" >&5 if eval "test \"`echo '$''{'lp_cv_has_ipv6'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else saveflags="$CFLAGS" CFLAGS="$CFLAGS -I/usr/inet6/include" cat > conftest.$ac_ext <<EOF ! #line 4215 "configure" #include "confdefs.h" #include <sys/types.h> #include <netinet/in.h> --- 4124,4141 ---- EOF fi echo $ac_n "checking for IPv6 support""... $ac_c" 1>&6 ! echo "configure:4130: checking for IPv6 support" >&5 if eval "test \"`echo '$''{'lp_cv_has_ipv6'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else saveflags="$CFLAGS" CFLAGS="$CFLAGS -I/usr/inet6/include" cat > conftest.$ac_ext <<EOF ! #line 4137 "configure" #include "confdefs.h" #include <sys/types.h> #include <netinet/in.h> *************** *** 4226,4236 **** int main() { ; return 0; } EOF ! if { (eval echo configure:4232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_has_ipv6=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4148,4158 ---- int main() { ; return 0; } EOF ! if { (eval echo configure:4154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_has_ipv6=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4248,4273 **** #define HAS_IPV6 1 EOF if test $enable_use_ipv6 = yes; then echo $ac_n "checking for main in -linet6""... $ac_c" 1>&6 ! echo "configure:4254: checking for main in -linet6" >&5 ac_lib_var=`echo inet6'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-linet6 $LIBS" cat > conftest.$ac_ext <<EOF ! #line 4262 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:4269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4170,4195 ---- #define HAS_IPV6 1 EOF if test $enable_use_ipv6 = yes; then echo $ac_n "checking for main in -linet6""... $ac_c" 1>&6 ! echo "configure:4176: checking for main in -linet6" >&5 ac_lib_var=`echo inet6'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-linet6 $LIBS" cat > conftest.$ac_ext <<EOF ! #line 4184 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:4191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4287,4307 **** fi fi echo $ac_n "checking for mySQL""... $ac_c" 1>&6 ! echo "configure:4293: checking for mySQL" >&5 if eval "test \"`echo '$''{'lp_cv_has_mysql'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for TESTPATH in "" "$mysql_path" "$mysql_path/include" "/usr/local/include"; do saveflags="$CFLAGS" if test "x$TESTPATH" != "x"; then CFLAGS="$CFLAGS -I$TESTPATH" fi cat > conftest.$ac_ext <<EOF ! #line 4303 "configure" #include "confdefs.h" #include <sys/types.h> #include <mysql/mysql.h> #include <mysql/errmsg.h> --- 4209,4229 ---- fi fi echo $ac_n "checking for mySQL""... $ac_c" 1>&6 ! echo "configure:4215: checking for mySQL" >&5 if eval "test \"`echo '$''{'lp_cv_has_mysql'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for TESTPATH in "" "$mysql_path" "$mysql_path/include" "/usr/local/include"; do saveflags="$CFLAGS" if test "x$TESTPATH" != "x"; then CFLAGS="$CFLAGS -I$TESTPATH" fi cat > conftest.$ac_ext <<EOF ! #line 4225 "configure" #include "confdefs.h" #include <sys/types.h> #include <mysql/mysql.h> #include <mysql/errmsg.h> *************** *** 4315,4325 **** int main() { ; return 0; } EOF ! if { (eval echo configure:4321: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_has_mysql=yes if test "x$TESTPATH" != "x"; then EXTRA_CFLAGS="-I$TESTPATH $EXTRA_CFLAGS" fi --- 4237,4247 ---- int main() { ; return 0; } EOF ! if { (eval echo configure:4243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_has_mysql=yes if test "x$TESTPATH" != "x"; then EXTRA_CFLAGS="-I$TESTPATH $EXTRA_CFLAGS" fi *************** *** 4349,4374 **** if test $enable_use_mysql = yes; then if test "x$mysql_path" = "x"; then echo $ac_n "checking for main in -lmysqlclient""... $ac_c" 1>&6 ! echo "configure:4355: checking for main in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $LIBS" cat > conftest.$ac_ext <<EOF ! #line 4363 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:4370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4271,4296 ---- if test $enable_use_mysql = yes; then if test "x$mysql_path" = "x"; then echo $ac_n "checking for main in -lmysqlclient""... $ac_c" 1>&6 ! echo "configure:4277: checking for main in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $LIBS" cat > conftest.$ac_ext <<EOF ! #line 4285 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:4292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4390,4415 **** tmp="" if test -d "${mysql_path}/lib/mysql"; then CFLAGS="$saveflags -L${mysql_path}/lib/mysql" echo $ac_n "checking for main in -lmysqlclient""... $ac_c" 1>&6 ! echo "configure:4396: checking for main in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $LIBS" cat > conftest.$ac_ext <<EOF ! #line 4404 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:4411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4312,4337 ---- tmp="" if test -d "${mysql_path}/lib/mysql"; then CFLAGS="$saveflags -L${mysql_path}/lib/mysql" echo $ac_n "checking for main in -lmysqlclient""... $ac_c" 1>&6 ! echo "configure:4318: checking for main in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $LIBS" cat > conftest.$ac_ext <<EOF ! #line 4326 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:4333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4428,4453 **** fi elif test -d "${mysql_path}/lib"; then CFLAGS="$saveflags -L${mysql_path}/lib" echo $ac_n "checking for main in -lmysqlclient""... $ac_c" 1>&6 ! echo "configure:4434: checking for main in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $LIBS" cat > conftest.$ac_ext <<EOF ! #line 4442 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:4449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4350,4375 ---- fi elif test -d "${mysql_path}/lib"; then CFLAGS="$saveflags -L${mysql_path}/lib" echo $ac_n "checking for main in -lmysqlclient""... $ac_c" 1>&6 ! echo "configure:4356: checking for main in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $LIBS" cat > conftest.$ac_ext <<EOF ! #line 4364 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:4371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4466,4491 **** fi else CFLAGS="$saveflags -L$mysql_path" echo $ac_n "checking for main in -lmysqlclient""... $ac_c" 1>&6 ! echo "configure:4472: checking for main in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $LIBS" cat > conftest.$ac_ext <<EOF ! #line 4480 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:4487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4388,4413 ---- fi else CFLAGS="$saveflags -L$mysql_path" echo $ac_n "checking for main in -lmysqlclient""... $ac_c" 1>&6 ! echo "configure:4394: checking for main in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $LIBS" cat > conftest.$ac_ext <<EOF ! #line 4402 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:4409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4518,4543 **** fi if test $enable_use_mysql = yes; then # On some systems, mysqlclient requires the compression libz. echo $ac_n "checking for main in -lz""... $ac_c" 1>&6 ! echo "configure:4524: checking for main in -lz" >&5 ac_lib_var=`echo z'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <<EOF ! #line 4532 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:4539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4440,4465 ---- fi if test $enable_use_mysql = yes; then # On some systems, mysqlclient requires the compression libz. echo $ac_n "checking for main in -lz""... $ac_c" 1>&6 ! echo "configure:4446: checking for main in -lz" >&5 ac_lib_var=`echo z'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <<EOF ! #line 4454 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:4461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4555,4580 **** echo "$ac_t""no" 1>&6 fi # On some systems, mysqlclient requires the libnsl. echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 ! echo "configure:4561: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <<EOF ! #line 4569 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:4576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4477,4502 ---- echo "$ac_t""no" 1>&6 fi # On some systems, mysqlclient requires the libnsl. echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 ! echo "configure:4483: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <<EOF ! #line 4491 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF ! if { (eval echo configure:4498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4596,4623 **** CFLAGS="$saveflags" fi echo $ac_n "checking if rename handles directories""... $ac_c" 1>&6 ! echo "configure:4602: checking if rename handles directories" >&5 if eval "test \"`echo '$''{'lp_cv_sys_rename_handles_directories'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 4610 "configure" #include "confdefs.h" main() { mkdir("conftestdirfrom", 0770); exit(rename("conftestdirfrom", "conftestdirto")); } EOF ! if { (eval echo configure:4619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_sys_rename_handles_directories=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4518,4545 ---- CFLAGS="$saveflags" fi echo $ac_n "checking if rename handles directories""... $ac_c" 1>&6 ! echo "configure:4524: checking if rename handles directories" >&5 if eval "test \"`echo '$''{'lp_cv_sys_rename_handles_directories'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 4532 "configure" #include "confdefs.h" main() { mkdir("conftestdirfrom", 0770); exit(rename("conftestdirfrom", "conftestdirto")); } EOF ! if { (eval echo configure:4541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_sys_rename_handles_directories=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4637,4652 **** fi if test $ac_cv_func_getrusage = "yes" ; then echo $ac_n "checking full availability of struct rusage members""... $ac_c" 1>&6 ! echo "configure:4643: checking full availability of struct rusage members" >&5 if eval "test \"`echo '$''{'lp_cv_struct_rusage_full'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 4648 "configure" #include "confdefs.h" #include <sys/types.h> /* BSDI 2.0.1 / 2.1 needs this for resource.h */ #include <sys/time.h> #ifdef HAVE_SYS_RUSAGE_H --- 4559,4574 ---- fi if test $ac_cv_func_getrusage = "yes" ; then echo $ac_n "checking full availability of struct rusage members""... $ac_c" 1>&6 ! echo "configure:4565: checking full availability of struct rusage members" >&5 if eval "test \"`echo '$''{'lp_cv_struct_rusage_full'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 4570 "configure" #include "confdefs.h" #include <sys/types.h> /* BSDI 2.0.1 / 2.1 needs this for resource.h */ #include <sys/time.h> #ifdef HAVE_SYS_RUSAGE_H *************** *** 4677,4687 **** *v++ = rus.ru_nvcsw; *v++ = rus.ru_nivcsw; ; return 0; } EOF ! if { (eval echo configure:4683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_struct_rusage_full=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4599,4609 ---- *v++ = rus.ru_nvcsw; *v++ = rus.ru_nivcsw; ; return 0; } EOF ! if { (eval echo configure:4605: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_struct_rusage_full=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4697,4712 **** #define GETRUSAGE_RESTRICTED 1 EOF fi echo $ac_n "checking struct rusage timeval members with tv_usec""... $ac_c" 1>&6 ! echo "configure:4703: checking struct rusage timeval members with tv_usec" >&5 if eval "test \"`echo '$''{'lp_cv_struct_rusage_usec'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 4708 "configure" #include "confdefs.h" #include <sys/types.h> /* BSDI 2.0.1 / 2.1 needs this for resource.h */ #include <sys/time.h> #ifdef HAVE_SYS_RUSAGE_H --- 4619,4634 ---- #define GETRUSAGE_RESTRICTED 1 EOF fi echo $ac_n "checking struct rusage timeval members with tv_usec""... $ac_c" 1>&6 ! echo "configure:4625: checking struct rusage timeval members with tv_usec" >&5 if eval "test \"`echo '$''{'lp_cv_struct_rusage_usec'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 4630 "configure" #include "confdefs.h" #include <sys/types.h> /* BSDI 2.0.1 / 2.1 needs this for resource.h */ #include <sys/time.h> #ifdef HAVE_SYS_RUSAGE_H *************** *** 4725,4735 **** *v++ = rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000; *v++ = rus.ru_stime.tv_sec * 1000 + rus.ru_stime.tv_usec / 1000; ; return 0; } EOF ! if { (eval echo configure:4731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_struct_rusage_usec=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4647,4657 ---- *v++ = rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000; *v++ = rus.ru_stime.tv_sec * 1000 + rus.ru_stime.tv_usec / 1000; ; return 0; } EOF ! if { (eval echo configure:4653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_struct_rusage_usec=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4746,4761 **** EOF fi else echo $ac_n "checking for getrusage() via syscall()""... $ac_c" 1>&6 ! echo "configure:4752: checking for getrusage() via syscall()" >&5 if eval "test \"`echo '$''{'lp_cv_func_getrusage_via_syscall'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 4757 "configure" #include "confdefs.h" #include <sys/types.h> /* BSDI 2.0.1 / 2.1 needs this for resource.h */ #include <sys/syscall.h> #include <sys/resource.h> --- 4668,4683 ---- EOF fi else echo $ac_n "checking for getrusage() via syscall()""... $ac_c" 1>&6 ! echo "configure:4674: checking for getrusage() via syscall()" >&5 if eval "test \"`echo '$''{'lp_cv_func_getrusage_via_syscall'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 4679 "configure" #include "confdefs.h" #include <sys/types.h> /* BSDI 2.0.1 / 2.1 needs this for resource.h */ #include <sys/syscall.h> #include <sys/resource.h> *************** *** 4768,4778 **** struct rusage rus; syscall(SYS_GETRUSAGE, RUSAGE_SELF, rus); ; return 0; } EOF ! if { (eval echo configure:4774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_func_getrusage_via_syscall=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4690,4700 ---- struct rusage rus; syscall(SYS_GETRUSAGE, RUSAGE_SELF, rus); ; return 0; } EOF ! if { (eval echo configure:4696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_func_getrusage_via_syscall=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4793,4808 **** fi fi echo $ac_n "checking if return type of free is void""... $ac_c" 1>&6 ! echo "configure:4799: checking if return type of free is void" >&5 if eval "test \"`echo '$''{'lp_cv_prop_free_returns_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 4804 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif --- 4715,4730 ---- fi fi echo $ac_n "checking if return type of free is void""... $ac_c" 1>&6 ! echo "configure:4721: checking if return type of free is void" >&5 if eval "test \"`echo '$''{'lp_cv_prop_free_returns_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 4726 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif *************** *** 4816,4826 **** int main() { ; return 0; } EOF ! if { (eval echo configure:4822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_prop_free_returns_void=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4738,4748 ---- int main() { ; return 0; } EOF ! if { (eval echo configure:4744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_prop_free_returns_void=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4837,4852 **** EOF fi echo $ac_n "checking if void* or char* from malloc""... $ac_c" 1>&6 ! echo "configure:4843: checking if void* or char* from malloc" >&5 if eval "test \"`echo '$''{'lp_cv_prop_malloc_return_type'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 4848 "configure" #include "confdefs.h" #include <sys/types.h> #ifdef HAVE_STDLIB_H #include <stdlib.h> --- 4759,4774 ---- EOF fi echo $ac_n "checking if void* or char* from malloc""... $ac_c" 1>&6 ! echo "configure:4765: checking if void* or char* from malloc" >&5 if eval "test \"`echo '$''{'lp_cv_prop_malloc_return_type'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 4770 "configure" #include "confdefs.h" #include <sys/types.h> #ifdef HAVE_STDLIB_H #include <stdlib.h> *************** *** 4872,4882 **** int main() { ; return 0; } EOF ! if { (eval echo configure:4878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_prop_malloc_return_type="void *" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4794,4804 ---- int main() { ; return 0; } EOF ! if { (eval echo configure:4800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_prop_malloc_return_type="void *" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4891,4906 **** #define POINTER $lp_cv_prop_malloc_return_type EOF echo $ac_n "checking if CHAR_BIT == 8 or undef""... $ac_c" 1>&6 ! echo "configure:4897: checking if CHAR_BIT == 8 or undef" >&5 if eval "test \"`echo '$''{'lp_cv_prop_charbits_eq_8'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 4902 "configure" #include "confdefs.h" #include <stdio.h> #include <string.h> #include <ctype.h> --- 4813,4828 ---- #define POINTER $lp_cv_prop_malloc_return_type EOF echo $ac_n "checking if CHAR_BIT == 8 or undef""... $ac_c" 1>&6 ! echo "configure:4819: checking if CHAR_BIT == 8 or undef" >&5 if eval "test \"`echo '$''{'lp_cv_prop_charbits_eq_8'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 4824 "configure" #include "confdefs.h" #include <stdio.h> #include <string.h> #include <ctype.h> *************** *** 4912,4922 **** int main() { ; return 0; } EOF ! if { (eval echo configure:4918: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_prop_charbits_eq_8=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4834,4844 ---- int main() { ; return 0; } EOF ! if { (eval echo configure:4840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_prop_charbits_eq_8=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4938,4956 **** EOF fi echo $ac_n "checking if strtol broken""... $ac_c" 1>&6 ! echo "configure:4944: checking if strtol broken" >&5 if eval "test \"`echo '$''{'lp_cv_prop_strtol_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 4952 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif --- 4860,4878 ---- EOF fi echo $ac_n "checking if strtol broken""... $ac_c" 1>&6 ! echo "configure:4866: checking if strtol broken" >&5 if eval "test \"`echo '$''{'lp_cv_prop_strtol_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 4874 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif *************** *** 4961,4971 **** if (strtol("1", (char **)0, 10) != 1) exit(1); exit(0); } EOF ! if { (eval echo configure:4967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_prop_strtol_broken=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4883,4893 ---- if (strtol("1", (char **)0, 10) != 1) exit(1); exit(0); } EOF ! if { (eval echo configure:4889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_prop_strtol_broken=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 4984,5004 **** EOF fi echo $ac_n "checking nonblocking using ioctl with FIONBIO""... $ac_c" 1>&6 ! echo "configure:4990: checking nonblocking using ioctl with FIONBIO" >&5 if eval "test \"`echo '$''{'lp_cv_prop_use_ioctl_fionbio'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lp_cv_prop_use_ioctl_fionbio=unknown echo "configure: warning: You have to supply the correct way to set sockets non-blocking by hand." 1>&2 else cat > conftest.$ac_ext <<EOF ! #line 5000 "configure" #include "confdefs.h" #include <sys/types.h> /* needed for netinet/in.h */ #include <sys/socket.h> #include <netinet/in.h> --- 4906,4926 ---- EOF fi echo $ac_n "checking nonblocking using ioctl with FIONBIO""... $ac_c" 1>&6 ! echo "configure:4912: checking nonblocking using ioctl with FIONBIO" >&5 if eval "test \"`echo '$''{'lp_cv_prop_use_ioctl_fionbio'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lp_cv_prop_use_ioctl_fionbio=unknown echo "configure: warning: You have to supply the correct way to set sockets non-blocking by hand." 1>&2 else cat > conftest.$ac_ext <<EOF ! #line 4922 "configure" #include "confdefs.h" #include <sys/types.h> /* needed for netinet/in.h */ #include <sys/socket.h> #include <netinet/in.h> *************** *** 5065,5075 **** } exit(1); } EOF ! if { (eval echo configure:5071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_prop_use_ioctl_fionbio=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 4987,4997 ---- } exit(1); } EOF ! if { (eval echo configure:4993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_prop_use_ioctl_fionbio=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 5088,5106 **** EOF fi echo $ac_n "checking nonblocking using fcntl with O_NDELAY""... $ac_c" 1>&6 ! echo "configure:5094: checking nonblocking using fcntl with O_NDELAY" >&5 if eval "test \"`echo '$''{'lp_cv_prop_use_fnctl_o_ndelay'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lp_cv_prop_use_fnctl_o_ndelay=unknown else cat > conftest.$ac_ext <<EOF ! #line 5102 "configure" #include "confdefs.h" #include <sys/types.h> /* needed for netinet/in.h */ #include <sys/socket.h> #include <netinet/in.h> --- 5010,5028 ---- EOF fi echo $ac_n "checking nonblocking using fcntl with O_NDELAY""... $ac_c" 1>&6 ! echo "configure:5016: checking nonblocking using fcntl with O_NDELAY" >&5 if eval "test \"`echo '$''{'lp_cv_prop_use_fnctl_o_ndelay'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lp_cv_prop_use_fnctl_o_ndelay=unknown else cat > conftest.$ac_ext <<EOF ! #line 5024 "configure" #include "confdefs.h" #include <sys/types.h> /* needed for netinet/in.h */ #include <sys/socket.h> #include <netinet/in.h> *************** *** 5151,5161 **** } exit(1); } EOF ! if { (eval echo configure:5157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_prop_use_fnctl_o_ndelay=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 5073,5083 ---- } exit(1); } EOF ! if { (eval echo configure:5079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_prop_use_fnctl_o_ndelay=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 5174,5192 **** EOF fi echo $ac_n "checking nonblocking using fcntl with FNDELAY""... $ac_c" 1>&6 ! echo "configure:5180: checking nonblocking using fcntl with FNDELAY" >&5 if eval "test \"`echo '$''{'lp_cv_prop_use_fcntl_fndelay'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lp_cv_prop_use_fcntl_fndelay=unknown else cat > conftest.$ac_ext <<EOF ! #line 5188 "configure" #include "confdefs.h" #include <sys/types.h> /* needed for netinet/in.h */ #include <sys/socket.h> #include <netinet/in.h> --- 5096,5114 ---- EOF fi echo $ac_n "checking nonblocking using fcntl with FNDELAY""... $ac_c" 1>&6 ! echo "configure:5102: checking nonblocking using fcntl with FNDELAY" >&5 if eval "test \"`echo '$''{'lp_cv_prop_use_fcntl_fndelay'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lp_cv_prop_use_fcntl_fndelay=unknown else cat > conftest.$ac_ext <<EOF ! #line 5110 "configure" #include "confdefs.h" #include <sys/types.h> /* needed for netinet/in.h */ #include <sys/socket.h> #include <netinet/in.h> *************** *** 5237,5247 **** } exit(1); } EOF ! if { (eval echo configure:5243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_prop_use_fcntl_fndelay=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 5159,5169 ---- } exit(1); } EOF ! if { (eval echo configure:5165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_prop_use_fcntl_fndelay=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 5261,5279 **** fi echo $ac_n "checking if fcntl with SETOWN works""... $ac_c" 1>&6 ! echo "configure:5267: checking if fcntl with SETOWN works" >&5 if eval "test \"`echo '$''{'lp_cv_prop_use_fcntl_setown'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lp_cv_prop_use_fcntl_setown=unknown else cat > conftest.$ac_ext <<EOF ! #line 5275 "configure" #include "confdefs.h" #include <sys/types.h> /* needed for netinet/in.h */ #include <sys/socket.h> #include <netinet/in.h> --- 5183,5201 ---- fi echo $ac_n "checking if fcntl with SETOWN works""... $ac_c" 1>&6 ! echo "configure:5189: checking if fcntl with SETOWN works" >&5 if eval "test \"`echo '$''{'lp_cv_prop_use_fcntl_setown'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lp_cv_prop_use_fcntl_setown=unknown else cat > conftest.$ac_ext <<EOF ! #line 5197 "configure" #include "confdefs.h" #include <sys/types.h> /* needed for netinet/in.h */ #include <sys/socket.h> #include <netinet/in.h> *************** *** 5321,5331 **** } exit(1); } EOF ! if { (eval echo configure:5327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_prop_use_fcntl_setown=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 5243,5253 ---- } exit(1); } EOF ! if { (eval echo configure:5249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_prop_use_fcntl_setown=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 5344,5362 **** EOF fi echo $ac_n "checking if OOBINLINE works""... $ac_c" 1>&6 ! echo "configure:5350: checking if OOBINLINE works" >&5 if eval "test \"`echo '$''{'lp_cv_prop_use_oobinline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lp_cv_prop_use_oobinline=unknown else cat > conftest.$ac_ext <<EOF ! #line 5358 "configure" #include "confdefs.h" #include <sys/types.h> /* needed for netinet/in.h */ #include <sys/socket.h> #include <netinet/in.h> --- 5266,5284 ---- EOF fi echo $ac_n "checking if OOBINLINE works""... $ac_c" 1>&6 ! echo "configure:5272: checking if OOBINLINE works" >&5 if eval "test \"`echo '$''{'lp_cv_prop_use_oobinline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lp_cv_prop_use_oobinline=unknown else cat > conftest.$ac_ext <<EOF ! #line 5280 "configure" #include "confdefs.h" #include <sys/types.h> /* needed for netinet/in.h */ #include <sys/socket.h> #include <netinet/in.h> *************** *** 5407,5417 **** } exit(1); } EOF ! if { (eval echo configure:5413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_prop_use_oobinline=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 5329,5339 ---- } exit(1); } EOF ! if { (eval echo configure:5335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_prop_use_oobinline=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 5431,5449 **** fi echo $ac_n "checking for overlapping bcopy""... $ac_c" 1>&6 ! echo "configure:5437: checking for overlapping bcopy" >&5 if eval "test \"`echo '$''{'lp_cv_prop_overlapping_bcopy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lp_cv_prop_overlapping_bcopy=yes else cat > conftest.$ac_ext <<EOF ! #line 5445 "configure" #include "confdefs.h" main(){ char str[99] = "hello world"; bcopy(str, str+2, 12); --- 5353,5371 ---- fi echo $ac_n "checking for overlapping bcopy""... $ac_c" 1>&6 ! echo "configure:5359: checking for overlapping bcopy" >&5 if eval "test \"`echo '$''{'lp_cv_prop_overlapping_bcopy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lp_cv_prop_overlapping_bcopy=yes else cat > conftest.$ac_ext <<EOF ! #line 5367 "configure" #include "confdefs.h" main(){ char str[99] = "hello world"; bcopy(str, str+2, 12); *************** *** 5454,5464 **** exit(1); exit(0); } EOF ! if { (eval echo configure:5460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_prop_overlapping_bcopy=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 5376,5386 ---- exit(1); exit(0); } EOF ! if { (eval echo configure:5382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then lp_cv_prop_overlapping_bcopy=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 5477,5503 **** EOF fi echo $ac_n "checking if strtol needs const char*""... $ac_c" 1>&6 ! echo "configure:5483: checking if strtol needs const char*" >&5 if eval "test \"`echo '$''{'lp_cv_prop_strtol_const_charp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 5488 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif long strtol(str, ptr, base) char *str; char **ptr; int base; { return 0; } int main() { ; return 0; } EOF ! if { (eval echo configure:5499: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_prop_strtol_const_charp=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 5399,5425 ---- EOF fi echo $ac_n "checking if strtol needs const char*""... $ac_c" 1>&6 ! echo "configure:5405: checking if strtol needs const char*" >&5 if eval "test \"`echo '$''{'lp_cv_prop_strtol_const_charp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 5410 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif long strtol(str, ptr, base) char *str; char **ptr; int base; { return 0; } int main() { ; return 0; } EOF ! if { (eval echo configure:5421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* lp_cv_prop_strtol_const_charp=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 5523,5533 **** #include <stdio.h> double d = 4.5; main() { printf("hello world\n"); } EOF echo $ac_n "checking low optimization CFLAGS""... $ac_c" 1>&6 ! echo "configure:5529: checking low optimization CFLAGS" >&5 for TESTFLAG in -O; do if eval $tcomp; then if echo `eval $tcomp2` | egrep '[uU]n(recognized|known) [oO]ption' >/dev/null; then : #the [e]grep option -v will not give a failure exit status on the atari --- 5445,5455 ---- #include <stdio.h> double d = 4.5; main() { printf("hello world\n"); } EOF echo $ac_n "checking low optimization CFLAGS""... $ac_c" 1>&6 ! echo "configure:5451: checking low optimization CFLAGS" >&5 for TESTFLAG in -O; do if eval $tcomp; then if echo `eval $tcomp2` | egrep '[uU]n(recognized|known) [oO]ption' >/dev/null; then : #the [e]grep option -v will not give a failure exit status on the atari *************** *** 5559,5569 **** done LCFLAGS=$CFLAGS echo "$ac_t""$LCFLAGS" 1>&6 echo $ac_n "checking medium optimization CFLAGS""... $ac_c" 1>&6 ! echo "configure:5565: checking medium optimization CFLAGS" >&5 for TESTFLAG in -O2 -O; do if eval $tcomp; then if echo `eval $tcomp2` | egrep '[uU]n(recognized|known) [oO]ption' >/dev/null; then : #the [e]grep option -v will not give a failure exit status on the atari --- 5481,5491 ---- done LCFLAGS=$CFLAGS echo "$ac_t""$LCFLAGS" 1>&6 echo $ac_n "checking medium optimization CFLAGS""... $ac_c" 1>&6 ! echo "configure:5487: checking medium optimization CFLAGS" >&5 for TESTFLAG in -O2 -O; do if eval $tcomp; then if echo `eval $tcomp2` | egrep '[uU]n(recognized|known) [oO]ption' >/dev/null; then : #the [e]grep option -v will not give a failure exit status on the atari *************** *** 5611,5621 **** fi MCFLAGS=$CFLAGS echo "$ac_t""$MCFLAGS" 1>&6 echo $ac_n "checking highest optimization CFLAGS""... $ac_c" 1>&6 ! echo "configure:5617: checking highest optimization CFLAGS" >&5 for TESTFLAG in -O4 -O3 -O2 -O; do if eval $tcomp; then if echo `eval $tcomp2` | egrep '[uU]n(recognized|known) [oO]ption' >/dev/null; then : #the [e]grep option -v will not give a failure exit status on the atari --- 5533,5543 ---- fi MCFLAGS=$CFLAGS echo "$ac_t""$MCFLAGS" 1>&6 echo $ac_n "checking highest optimization CFLAGS""... $ac_c" 1>&6 ! echo "configure:5539: checking highest optimization CFLAGS" >&5 for TESTFLAG in -O4 -O3 -O2 -O; do if eval $tcomp; then if echo `eval $tcomp2` | egrep '[uU]n(recognized|known) [oO]ption' >/dev/null; then : #the [e]grep option -v will not give a failure exit status on the atari *************** *** 5658,5668 **** fi rm -f conftest.c if test $ac_cv_lib_socket_main = "yes"; then cat > conftest.$ac_ext <<EOF ! #line 5664 "configure" #include "confdefs.h" #if defined(sun) yes #endif --- 5580,5590 ---- fi rm -f conftest.c if test $ac_cv_lib_socket_main = "yes"; then cat > conftest.$ac_ext <<EOF ! #line 5586 "configure" #include "confdefs.h" #if defined(sun) yes #endif *************** *** 5683,5693 **** EXTRA_CFLAGS="${EXTRA_CFLAGS} -D${withval}" fi echo $ac_n "checking if ${YACC} includes bogus malloc prototypes""... $ac_c" 1>&6 ! echo "configure:5689: checking if ${YACC} includes bogus malloc prototypes" >&5 cat > conftest.y <<EOF %{ #include "confdefs.h" #ifdef HAVE_UNISTD_H #include <unistd.h> --- 5605,5615 ---- EXTRA_CFLAGS="${EXTRA_CFLAGS} -D${withval}" fi echo $ac_n "checking if ${YACC} includes bogus malloc prototypes""... $ac_c" 1>&6 ! echo "configure:5611: checking if ${YACC} includes bogus malloc prototypes" >&5 cat > conftest.y <<EOF %{ #include "confdefs.h" #ifdef HAVE_UNISTD_H #include <unistd.h> *************** *** 5724,5734 **** echo "$ac_t""yes" 1>&6 fi rm -f conftest* echo $ac_n "checking for ${YACC} / <malloc.h> / -DSGI_SOURCE / afree name clash""... $ac_c" 1>&6 ! echo "configure:5730: checking for ${YACC} / <malloc.h> / -DSGI_SOURCE / afree name clash" >&5 cat > conftest.y <<EOF %{ #include "confdefs.h" #define afree free %} --- 5646,5656 ---- echo "$ac_t""yes" 1>&6 fi rm -f conftest* echo $ac_n "checking for ${YACC} / <malloc.h> / -DSGI_SOURCE / afree name clash""... $ac_c" 1>&6 ! echo "configure:5652: checking for ${YACC} / <malloc.h> / -DSGI_SOURCE / afree name clash" >&5 cat > conftest.y <<EOF %{ #include "confdefs.h" #define afree free %} *************** *** 5759,5778 **** SAVE_LIBS="${LIBS}" SAVE_CFLAGS="${CFLAGS}" CFLAGS='' for TESTFLAG in '' -static -Bstatic -n; do echo $ac_n "checking malloc redefinition with linking flag ${TESTFLAG}""... $ac_c" 1>&6 ! echo "configure:5765: checking malloc redefinition with linking flag ${TESTFLAG}" >&5 LIBS="${SAVE_LIBS} ${TESTFLAG}" cat > conftest.data <<EOF 42 EOF if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 5774 "configure" #include "confdefs.h" #include <sys/types.h> #include <stdio.h> #ifdef HAVE_UNISTD_H --- 5681,5700 ---- SAVE_LIBS="${LIBS}" SAVE_CFLAGS="${CFLAGS}" CFLAGS='' for TESTFLAG in '' -static -Bstatic -n; do echo $ac_n "checking malloc redefinition with linking flag ${TESTFLAG}""... $ac_c" 1>&6 ! echo "configure:5687: checking malloc redefinition with linking flag ${TESTFLAG}" >&5 LIBS="${SAVE_LIBS} ${TESTFLAG}" cat > conftest.data <<EOF 42 EOF if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF ! #line 5696 "configure" #include "confdefs.h" #include <sys/types.h> #include <stdio.h> #ifdef HAVE_UNISTD_H *************** *** 5859,5869 **** POINTER p; { return 1; } #endif EOF ! if { (eval echo configure:5865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SBRK_OK=1 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 --- 5781,5791 ---- POINTER p; { return 1; } #endif EOF ! if { (eval echo configure:5787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SBRK_OK=1 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 *************** *** 5906,5916 **** LDFLAGS= "$LDFLAGS -luser32 -lwinmm -lkernel32 -lwsock32" ;; esac echo $ac_n "checking malloc overhead""... $ac_c" 1>&6 ! echo "configure:5912: checking malloc overhead" >&5 if eval "test \"`echo '$''{'lp_cv_sys_malloc_overhead'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <<EOF #include "confdefs.h" --- 5828,5838 ---- LDFLAGS= "$LDFLAGS -luser32 -lwinmm -lkernel32 -lwsock32" ;; esac echo $ac_n "checking malloc overhead""... $ac_c" 1>&6 ! echo "configure:5834: checking malloc overhead" >&5 if eval "test \"`echo '$''{'lp_cv_sys_malloc_overhead'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <<EOF #include "confdefs.h" *************** *** 6026,6035 **** --- 5948,5958 ---- + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. *************** *** 6095,6107 **** # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS ! # Some systems, like AmigaOS, won't allow you to remove a script that is ! # being executed, so just move it out of the way instead. ! if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi cat > $CONFIG_STATUS <<EOF #! /bin/sh # Generated automatically by configure. # Run this file to recreate the current configuration. # This directory was configured as follows, --- 6018,6028 ---- # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS ! rm -f $CONFIG_STATUS cat > $CONFIG_STATUS <<EOF #! /bin/sh # Generated automatically by configure. # Run this file to recreate the current configuration. # This directory was configured as follows, *************** *** 6161,6178 **** s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g - s%@guidedir@%$guidedir%g - s%@htmldir@%$htmldir%g - s%@psdir@%$psdir%g - s%@dvidir@%$dvidir%g s%@mandir@%$mandir%g s%@CC@%$CC%g - s%@AR@%$AR%g - s%@RANLIB@%$RANLIB%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@YACC@%$YACC%g s%@CPP@%$CPP%g --- 6082,6093 ---- *************** *** 6198,6207 **** --- 6113,6123 ---- s%@cdef_initialization_by___init@%$cdef_initialization_by___init%g s%@cdef_use_system_crypt@%$cdef_use_system_crypt%g s%@cdef_use_ipv6@%$cdef_use_ipv6%g s%@cdef_use_mysql@%$cdef_use_mysql%g s%@cdef_use_alists@%$cdef_use_alists%g + s%@cdef_use_mccp@%$cdef_use_mccp%g s%@cdef_use_pcre@%$cdef_use_pcre%g s%@cdef_use_deprecated@%$cdef_use_deprecated%g s%@cdef_comm_stat@%$cdef_comm_stat%g s%@cdef_apply_cache_stat@%$cdef_apply_cache_stat%g s%@cdef_malloc_trace@%$cdef_malloc_trace%g *************** *** 6398,6408 **** ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in EOF - # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: # Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals --- 6314,6323 ---- *************** *** 6444,6454 **** rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals - cat >> $CONFIG_STATUS <<\EOF rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in --- 6359,6368 ---- *************** *** 6474,6482 **** cat >> $CONFIG_STATUS <<\EOF exit 0 EOF chmod +x $CONFIG_STATUS - rm -f CONFIG.STATUS.old rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 --- 6388,6395 ---- diff --new-file -c5 -r 3-3.orig/src/func_spec 3-3.export/src/func_spec *** 3-3.orig/src/func_spec Sun Feb 10 10:11:19 2002 --- 3-3.export/src/func_spec Thu Feb 14 23:36:29 2002 *************** *** 473,482 **** --- 473,488 ---- int query_mud_port(int|object default: F_THIS_PLAYER); int set_buffer_size(int); void set_combine_charset(int *|string); void set_connection_charset(int *|string, int default: F_CONST1); mixed set_prompt(string|closure|int, object default: F_THIS_PLAYER); + #ifdef USE_MCCP + mixed query_mccp(object default: F_THIS_PLAYER); + int *query_mccp_stats(object default: F_THIS_PLAYER); + int start_mccp_compress(int); + int end_mccp_compress(); + #endif void write(mixed); object *users(); #ifdef ERQ_DEMON diff --new-file -c5 -r 3-3.orig/src/lex.c 3-3.export/src/lex.c *** 3-3.orig/src/lex.c Sun Feb 10 10:11:19 2002 --- 3-3.export/src/lex.c Thu Feb 14 11:58:33 2002 *************** *** 739,748 **** --- 739,751 ---- add_permanent_define("__IPV6__", -1, string_copy("1"), MY_FALSE); #endif #ifdef USE_MYSQL add_permanent_define("__MYSQL__", -1, string_copy("1"), MY_FALSE); #endif + #ifdef USE_MCCP + add_permanent_define("__MCCP__", -1, string_copy("1"), MY_FALSE); + #endif #ifdef USE_ALISTS add_permanent_define("__ALISTS__", -1, string_copy("1"), MY_FALSE); #endif #ifdef USE_PCRE add_permanent_define("__PCRE__", -1, string_copy("1"), MY_FALSE); diff --new-file -c5 -r 3-3.orig/src/main.c 3-3.export/src/main.c *** 3-3.orig/src/main.c Sun Feb 10 10:11:19 2002 --- 3-3.export/src/main.c Sat Feb 16 15:54:31 2002 *************** *** 1086,1095 **** --- 1086,1101 ---- fputs(" IPv6: not supported.\n", stdout); #else fputs(" IPv6: supported.\n", stdout); #endif + #ifndef USE_MCCP + fputs(" MCCP: not supported.\n", stdout); + #else + fputs(" MCCP: supported.\n", stdout); + #endif + #ifndef USE_MYSQL fputs(" mySQL: not supported.\n", stdout); #else fputs(" mySQL: supported.\n", stdout); #endif ---------- From: "Bastian Hoyer" <dafire@dafire.de> Subject: mccp-patch update Date: Sat, 29 Dec 2001 15:37:38 +0100 Hallo Lars, ich hab schon eine weile eine neue Version meines mccp-patch hier liegen.. diesmal passt er an den 3-2... aber ich mach den auch 3-3 fit... Geaendert hat sich seit der letzten Version das der zlib-stream beim disconnecten ordentlich beendet wird und der dazu gehoerige Speicher wieder freigegeben wird. :) Der Patch laeuft jetzt seit 3 Tagen im Final problemlos und scheint auch allen Speicher wieder freizugeben :) Ich habs nicht getestet, aber der patch wird bisher nicht funktionieren bei muds die alle telnegs selbst machen ueber den gesamt hook.. und um das compress dem client anzubieten muss man einmal aus der lib folgendes aufrufen: #define REPLY(x) binary_message(x, 3); REPLY( ({IAC,WILL,TELOPT_COMPRESS2}) ); REPLY( ({IAC,WILL,TELOPT_COMPRESS}) ); Die Antwort darauf wird dann im Driver abgefangen und bei bedarf das compress gestartet :) Gruss Bastian ------=_NextPart_000_0001_01C1907E.C2625DB0 diff -c5 -r 3-2-dev/src/comm.c 3-2/src/comm.c *** 3-2-dev/src/comm.c Thu Dec 13 05:31:28 2001 --- 3-2/src/comm.c Sat Dec 29 15:08:16 2001 *************** *** 423,432 **** --- 423,436 ---- /*-------------------------------------------------------------------------*/ /* Forward declarations */ + static int start_compress(interactive_t *,unsigned char telopt); + static int end_compress(interactive_t *); + static void mccp_telnet_neg(int); + static void free_input_to(input_to_t *); static void telnet_neg(interactive_t *); static void send_will(int); static void send_wont(int); static void send_do(int); *************** *** 1409,1432 **** /* Check how much data there is in .message_buf[]. * If it is enough, send it, else terminate the outer loop * (because *source must be exhausted for this to happen). */ chunk = dest - ip->message_buf; if (chunk < min_length) { break; } ! /* Write .message_buf[] to the network. */ ! for (retries = 6;;) { ! ! if ((n = (int)socket_write(ip->socket, ip->message_buf, (size_t)chunk)) != -1) ! { break; ! } switch (errno) { case EINTR: if (--retries) continue; ip->msg_discarded = MY_TRUE; --- 1413,1473 ---- /* Check how much data there is in .message_buf[]. * If it is enough, send it, else terminate the outer loop * (because *source must be exhausted for this to happen). */ + chunk = dest - ip->message_buf; if (chunk < min_length) { break; } + + + if (ip->out_compress) + { + + ip->out_compress->next_in = (unsigned char *) ip->message_buf; + ip->out_compress->avail_in = chunk; + + ip->out_compress->avail_out = COMPRESS_BUF_SIZE - + (ip->out_compress->next_out - + ip->out_compress_buf); + + { + int status = deflate(ip->out_compress, Z_SYNC_FLUSH); + + if (status != Z_OK) + return; + } + + /* ok.. perhaps i should take care that all data in message_buf + is compressed, but i guess there is no chance that 1024 byte compressed + won't fit into the 8192 byte buffer */ + + length = ip->out_compress->next_out - ip->out_compress_buf; + } ! /* now sending the buffer... */ ! for (retries = 6;;) { ! ! if (!ip->out_compress) /* here we choose the correct buffer */ ! { ! if ((n = (int)socket_write(ip->socket, ip->message_buf, (size_t)chunk)) != -1) ! { break; ! } ! } ! else ! { ! if ((n = (int)socket_write(ip->socket, ip->out_compress_buf, (size_t)length)) != -1) ! { ! break; ! } ! } ! switch (errno) { case EINTR: if (--retries) continue; ip->msg_discarded = MY_TRUE; *************** *** 1482,1495 **** #ifdef COMM_STAT inet_packets++; inet_volume += n; #endif - if (n != chunk) - fprintf(stderr, "%s write socket: wrote %ld, should be %ld.\n" - , time_stamp(), (long)n, (long)chunk); /* Continue with the processing of source */ dest = &ip->message_buf[0]; if (c) *dest++ = c; } while (*source); --- 1523,1548 ---- #ifdef COMM_STAT inet_packets++; inet_volume += n; #endif + if (ip->out_compress) + { + /* we update the compressed buffer here */ + ip->out_compress->next_out = ip->out_compress_buf + length - n; + if (n != length) + fprintf(stderr, "%s write socket (compressed): wrote %ld, should be %ld.\n" + , time_stamp(), (long)n, (long)chunk); + } + else + { + if (n != chunk) + fprintf(stderr, "%s write socket: wrote %ld, should be %ld.\n" + , time_stamp(), (long)n, (long)chunk); + } + /* Continue with the processing of source */ dest = &ip->message_buf[0]; if (c) *dest++ = c; } while (*source); *************** *** 2587,2596 **** --- 2640,2653 ---- { /* Say goodbye to the user. */ trace_level |= interactive->trace_level; add_message(message_flush); } + + if (interactive->out_compress) + end_compress(interactive); + shutdown(interactive->socket, 2); socket_close(interactive->socket); } /* if (erq or user) */ #if defined(ACCESS_CONTROL) *************** *** 2613,2622 **** --- 2670,2684 ---- if (interactive->modify_command) { free_object(interactive->modify_command, "remove_interactive"); } + if (interactive->out_compress_buf) + free(interactive->out_compress_buf); + if (interactive->out_compress) + free(interactive->out_compress); + prompt_from_ed_buffer(interactive); free_svalue(&interactive->prompt); /* Unlink the interactive structure from the shadow sentence * of the object. *************** *** 2844,2853 **** --- 2906,2919 ---- master_ob->flags |= O_ONCE_INTERACTIVE; new_interactive->ob = master_ob; /* Initialize the rest of the interactive structure */ + new_interactive->compressing = 0; + new_interactive->out_compress = NULL; + new_interactive->out_compress_buf=NULL; + new_interactive->input_to = NULL; put_volatile_string(&new_interactive->prompt, "> "); new_interactive->modify_command = NULL; new_interactive->msg_discarded = MY_FALSE; new_interactive->set_input_to = MY_FALSE; *************** *** 3871,3881 **** break; } } } /* reply_h_telnet_neg() */ ! /*-------------------------------------------------------------------------*/ void init_telopts (void) /* Initialise the telopts_xxx[] tables. * The default setting is such that requests are ignored or rejected. --- 3937,3949 ---- break; } } } /* reply_h_telnet_neg() */ ! /*- ! ! -----------------------------------------------------------------------*/ void init_telopts (void) /* Initialise the telopts_xxx[] tables. * The default setting is such that requests are ignored or rejected. *************** *** 3960,3978 **** telopts_do[TELOPT_SGA] = reply_to_do_sga; telopts_dont[TELOPT_SGA] = reply_to_dont_sga; /* Mud specific protocols */ ! telopts_do[TELOPT_COMPRESS] = reply_h_telnet_neg; ! telopts_dont[TELOPT_COMPRESS] = reply_h_telnet_neg; ! telopts_will[TELOPT_COMPRESS] = reply_h_telnet_neg; ! telopts_wont[TELOPT_COMPRESS] = reply_h_telnet_neg; ! ! telopts_do[TELOPT_COMPRESS2] = reply_h_telnet_neg; ! telopts_dont[TELOPT_COMPRESS2] = reply_h_telnet_neg; ! telopts_will[TELOPT_COMPRESS2] = reply_h_telnet_neg; ! telopts_wont[TELOPT_COMPRESS2] = reply_h_telnet_neg; telopts_do[TELOPT_MSP] = reply_h_telnet_neg; telopts_dont[TELOPT_MSP] = reply_h_telnet_neg; telopts_will[TELOPT_MSP] = reply_h_telnet_neg; telopts_wont[TELOPT_MSP] = reply_h_telnet_neg; --- 4028,4046 ---- telopts_do[TELOPT_SGA] = reply_to_do_sga; telopts_dont[TELOPT_SGA] = reply_to_dont_sga; /* Mud specific protocols */ ! telopts_do[TELOPT_COMPRESS] = mccp_telnet_neg; ! telopts_dont[TELOPT_COMPRESS] = mccp_telnet_neg; ! telopts_will[TELOPT_COMPRESS] = mccp_telnet_neg; ! telopts_wont[TELOPT_COMPRESS] = mccp_telnet_neg; ! ! telopts_do[TELOPT_COMPRESS2] = mccp_telnet_neg; ! telopts_dont[TELOPT_COMPRESS2] = mccp_telnet_neg; ! telopts_will[TELOPT_COMPRESS2] = mccp_telnet_neg; ! telopts_wont[TELOPT_COMPRESS2] = mccp_telnet_neg; telopts_do[TELOPT_MSP] = reply_h_telnet_neg; telopts_dont[TELOPT_MSP] = reply_h_telnet_neg; telopts_will[TELOPT_MSP] = reply_h_telnet_neg; telopts_wont[TELOPT_MSP] = reply_h_telnet_neg; *************** *** 5770,5779 **** --- 5838,5851 ---- * * The idea behind the flag settings is that sending command * codes for colours and other things needs to bypass the allowed * charset filters, but isn't important enough to waste bandwith * on a synchronous transmission. + * + * If the client uses MCCP compression add_message ist always used + * with flushing buffer _after_ the Message. + * */ { char *message, *p; size_t size; *************** *** 5825,5835 **** && !ip->do_close) { save_command_giver = command_giver; command_giver = current_object; ! if (sp->u.number & 1) { /* Write before flush... */ sending_telnet_command = MY_TRUE; /* turn of IAC quoting */ --- 5897,5907 ---- && !ip->do_close) { save_command_giver = command_giver; command_giver = current_object; ! if ((sp->u.number & 1)||ip->out_compress) { /* Write before flush... */ sending_telnet_command = MY_TRUE; /* turn of IAC quoting */ *************** *** 5874,5884 **** size--; } } /* while(size) */ sending_telnet_command = MY_FALSE; ! if (sp->u.number & 2) add_message(message_flush); wrote = 0; } else --- 5946,5956 ---- size--; } } /* while(size) */ sending_telnet_command = MY_FALSE; ! if ((sp->u.number & 2)||ip->out_compress) add_message(message_flush); wrote = 0; } else *************** *** 6435,6440 **** --- 6507,6750 ---- put_number(sp, ntohs(addr.sin_port)); return sp; } /***************************************************************************/ + + static void + mccp_telnet_neg (int option) + + { + interactive_t *ip = O_GET_INTERACTIVE(command_giver); + + switch(ip->tn_state) { + case TS_DO: + start_compress(ip,option); + break; + default: + printf("MCCP NEG (%d) STATE (%d)\n",option,ip->tn_state); + } + } + + + svalue_t * + f_query_mccp (svalue_t *sp) + + /* EFUN query_mccp() + * + * mixed query_mccp(object ob) + * + * this efun returns 0 if no mccp is used for interactive ob. + * if ob|this_player uses mccp it returns TELOPT_COMPRESS or + * TELOPT_COMPRESS2 + */ + + { + interactive_t *ip; + + /* Make sure the object is interactive */ + if (!(O_SET_INTERACTIVE(ip, sp->u.ob)) + || ip->closing) + { + error("Bad arg 1 to query_mccp(): object not interactive.\n"); + return sp; + } + + free_svalue(sp); + put_number(sp,ip->compressing); + + return sp; + } /* query_mccp() */ + + svalue_t * + f_query_mccp_stats (svalue_t *sp) + + /* EFUN query_mccp_stats() + * + * mixed query_mccp_stats(object ob) + * + */ + + { + interactive_t *ip; + vector_t *mccp_stats; + + /* Make sure the object is interactive */ + if (!(O_SET_INTERACTIVE(ip, sp->u.ob)) + || ip->closing) + { + error("Bad arg 1 to query_mccp_stats(): object not interactive.\n"); + return sp; + } + + free_svalue(sp); + + if (ip->compressing>0) + { + mccp_stats=allocate_uninit_array(2); + put_number(mccp_stats->item,ip->out_compress->total_in); + put_number(mccp_stats->item+1,ip->out_compress->total_out); + put_array(sp,mccp_stats); + } else { + put_number(sp,0); + } + + + return sp; + } /* query_mccp_stats() */ + + + /* + * mccp.c - support functions for the Mud Client Compression Protocol + * + * see http://www.randomly.org/projects/MCCP/ + * + * Copyright (c) 1999, Oliver Jowett <oliver@randomly.org> + * + * This code may be freely distributed and used if this copyright + * notice is retained intact. + */ + + + + void *zlib_alloc(void *opaque, unsigned int items, unsigned int size) + { + return calloc(items, size); + } + + void zlib_free(void *opaque, void *address) + { + free(address); + } + + + static int start_compress(interactive_t *ip, unsigned char telopt ) + { + z_stream *s; + + /* already compressing */ + if (ip->out_compress) + return 1; + + /* allocate and init stream, buffer */ + s = (z_stream *) malloc(sizeof(*s)); + ip->out_compress_buf = (unsigned char *) malloc(COMPRESS_BUF_SIZE); + + s->next_in = NULL; + s->avail_in = 0; + s->next_out = ip->out_compress_buf; + s->avail_out = COMPRESS_BUF_SIZE; + s->zalloc = zlib_alloc; + s->zfree = zlib_free; + s->opaque = NULL; + + if (deflateInit(s, 9) != Z_OK) + { + free(ip->out_compress_buf); + free(s); + return 0; + } + + /* version 1 or 2 support */ + if (telopt == TELOPT_COMPRESS) + { + DTF(("%s TDEBUG: send IAC SB %02x WILL SE\n", time_stamp(), telopt)); + SEND_TELNET_COMMAND( + add_message("%c", IAC); + add_message("%c%c%c%c", SB, telopt, WILL, SE); + add_message(message_flush); + ); + } + else if (telopt == TELOPT_COMPRESS2) + { + DTF(("%s TDEBUG: send IAC SB %02x WILL SE\n", time_stamp(), telopt)); + SEND_TELNET_COMMAND( + add_message("%c", IAC); + add_message("%c%c%c%c", SB, telopt, IAC, SE); + add_message(message_flush); + ); + } + else + { + printf("Bad teleoption %d passed", telopt); + free(ip->out_compress_buf); + free(s); + return 0; + } + + ip->compressing = telopt; + ip->out_compress = s; + + /* success */ + return 1; + } + + /* Try to send any pending compressed-but-not-sent data in `desc' */ + int process_compressed(interactive_t *ip) + { + int iStart, nBlock, nWrite, len; + + if (!ip->out_compress) + return 1; + + len = ip->out_compress->next_out - ip->out_compress_buf; + if (len > 0) + { + for (iStart = 0; iStart < len; iStart += nWrite) + { + nBlock = UMIN (len - iStart, 4096); + if ((nWrite = write(ip->socket, ip->out_compress_buf + iStart, nBlock)) < 0) + { + if (errno == EAGAIN || errno == ENOSR) + break; + + /* write error */ + return 0; + } + if (nWrite <= 0) + break; + } + + if (iStart) + { + if (iStart < len) + memmove(ip->out_compress_buf, ip->out_compress_buf+iStart, len - iStart); + + ip->out_compress->next_out = ip->out_compress_buf + len - iStart; + } + } + + /* success */ + return 1; + } + + /* Cleanly shut down compression on `desc' */ + static int end_compress(interactive_t *ip) + { + unsigned char dummy[1]; + + if (!ip->out_compress) + return 1; + + ip->out_compress->avail_in = 0; + ip->out_compress->next_in = dummy; + + /* No terminating signature is needed - receiver will get Z_STREAM_END */ + if (deflate(ip->out_compress, Z_FINISH) != Z_STREAM_END) + return 0; + + /* try to send any residual data */ + if (!process_compressed(ip)) + return 0; + + /* reset compression values */ + deflateEnd(ip->out_compress); + free(ip->out_compress_buf); + free(ip->out_compress); + ip->compressing = 0; + ip->out_compress = NULL; + ip->out_compress_buf = NULL; + + /* success */ + return 1; + } diff -c5 -r 3-2-dev/src/comm.h 3-2/src/comm.h *** 3-2-dev/src/comm.h Sun Nov 18 07:24:27 2001 --- 3-2/src/comm.h Tue Nov 27 12:05:56 2001 *************** *** 2,11 **** --- 2,12 ---- #define COMM_H__ 1 #include "driver.h" #include "typedefs.h" #include <sys/types.h> + #include <zlib.h> #include "simulate.h" /* callback_t for input_to_t */ #include "svalue.h" /* TODO: Make the following a separate "my-socket.h" include, also *************** *** 160,169 **** --- 161,175 ---- * and a terminating '\0'. */ char message_buf[MAX_SOCKET_PACKET_SIZE]; /* The send buffer. */ + + unsigned char compressing; /* MCCP support */ + z_stream * out_compress; /* MCCP support */ + unsigned char * out_compress_buf; /* MCCP support */ + }; /* --- Bitflags and masks for interactive.noecho --- * * 'noecho' is a historical misnomer as it actually represents several *************** *** 299,305 **** --- 305,314 ---- extern svalue_t *query_ip_port(svalue_t *sp); #if defined(ACCESS_CONTROL) extern void refresh_access_data(void (*add_entry)(struct sockaddr_in *, int, long*) ); #endif /* ACCESS_CONTROL */ + + #define COMPRESS_BUF_SIZE 8192 + #define UMIN(a,b) ((a) < (b) ? (a) : (b)) #endif /* COMM_H__ */ diff -c5 -r 3-2-dev/src/func_spec 3-2/src/func_spec *** 3-2-dev/src/func_spec Mon Nov 26 03:15:17 2001 --- 3-2/src/func_spec Tue Nov 27 12:05:56 2001 *************** *** 558,567 **** --- 558,569 ---- int remove_input_to(object, void|object|string|closure); int set_buffer_size(int); void set_combine_charset(int *|string); void set_connection_charset(int *|string, int default: F_CONST1); mixed set_prompt(string|closure|int, object default: F_THIS_PLAYER); + mixed query_mccp(object default: F_THIS_PLAYER); + int *query_mccp_stats(object default: F_THIS_PLAYER); #ifdef ERQ_DEMON int attach_erq_demon(object|string, int default: F_CONST0); int send_erq(int, int*|string, closure default: F_CONST0); #endif ------=_NextPart_000_0001_01C1907E.C2625DB0-- ---------- From: "Bastian Hoyer" <dafire@dafire.de> Date: Thu Oct 11 21:02:00 2001 Also .. ich hab den patch gleich fuer die 3-3-111 gemacht :) Hier eine Beschreibung was ich geaendert hab: 1. Das schreiben des zlib-stream geht ueber ein extra write in add_message:) das koennte man vielleicht umschreiben das das ueber die normale ausgabe geht :) 2. 3 neue variablen in der interactive_t struct ( der zlib_stream, ein puffer und welche mccp version verwendet wird) 3. in new_player wird dem client gesagt das wir compress 2 oder 1 wollen (send_will) 4. die telopts werden statt in den hook in eine neue funktion umgeleitet und da bearbeitet 5. bei mccp verbindungen geht binary_message immer ueber add_message 6. neue efun query_mccp(object) (default this_player) gibt 0 wenn kein mccp laeuft, ansonsten TELOPT_COMPRESS oder TELOPT_COMPRESS2 --- And on 13.10.2001 Bastian wrote about the new patch: ich hab jetzt in der add_message funktion den patch so umgebaut das er mit compression praktisch genauso schreibt wie ohne.. also ich verwende auch die 6 retry schleife :) Ausserdem hab ich ein paar Sicherungen ausgebaut, weil ich davon ausgehen kann, das der message puffer von 1024 bytes immer in den zlib buffer von 8192 bytes passt :) Was noch fehlt ist ein erkennen der zlib im configure.. mal sehen ob ich das hinbekomme :) ------------------------------------------------------------------ diff -r -c3 3-3/src/comm.c 3-3.daf/src/comm.c *** 3-3/src/comm.c Sat Oct 13 20:57:28 2001 --- 3-3.daf/src/comm.c Sat Oct 13 21:29:39 2001 *************** *** 408,413 **** --- 408,416 ---- /* Forward declarations */ + static int start_compress(interactive_t *,unsigned char telopt); + static void mccp_telnet_neg(int); + static void free_input_to(input_to_t *); static void telnet_neg(interactive_t *); static void send_will(int); *************** *** 1466,1485 **** * If it is enough, send it, else terminate the outer loop * (because *source must be exhausted for this to happen). */ chunk = dest - ip->message_buf; if (chunk < min_length) { break; } ! /* Write .message_buf[] to the network. */ ! for (retries = 6;;) { ! ! if ((n = (int)socket_write(ip->socket, ip->message_buf, (size_t)chunk)) != -1) ! { break; ! } switch (errno) { case EINTR: if (--retries) --- 1469,1525 ---- * If it is enough, send it, else terminate the outer loop * (because *source must be exhausted for this to happen). */ + chunk = dest - ip->message_buf; if (chunk < min_length) { break; } + + + if (ip->out_compress) + { + + ip->out_compress->next_in = (unsigned char *) ip->message_buf; + ip->out_compress->avail_in = chunk; + + ip->out_compress->avail_out = COMPRESS_BUF_SIZE - + (ip->out_compress->next_out - + ip->out_compress_buf); + + { + int status = deflate(ip->out_compress, Z_SYNC_FLUSH); + + if (status != Z_OK) + return; + } + + /* ok.. perhaps i should take care that all data in message_buf + is compressed, but i guess there is no chance that 1024 byte compressed + won't fit into the 8192 byte buffer */ + + length = ip->out_compress->next_out - ip->out_compress_buf; + } ! /* now sending the buffer... */ ! for (retries = 6;;) { ! ! if (!ip->out_compress) /* here we choose the correct buffer */ ! { ! if ((n = (int)socket_write(ip->socket, ip->message_buf, (size_t)chunk)) != -1) ! { break; ! } ! } ! else ! { ! if ((n = (int)socket_write(ip->socket, ip->out_compress_buf, (size_t)length)) != -1) ! { ! break; ! } ! } ! switch (errno) { case EINTR: if (--retries) *************** *** 1539,1548 **** inet_packets++; inet_volume += n; #endif - if (n != chunk) - fprintf(stderr, "%s write socket: wrote %ld, should be %ld.\n" - , time_stamp(), (long)n, (long)chunk); /* Continue with the processing of source */ dest = &ip->message_buf[0]; } while (srclen != 0); --- 1579,1600 ---- inet_packets++; inet_volume += n; #endif + if (ip->out_compress) + { + /* we update the compressed buffer here */ + ip->out_compress->next_out = ip->out_compress_buf + length - n; + if (n != length) + fprintf(stderr, "%s write socket (compressed): wrote %ld, should be %ld.\n" + , time_stamp(), (long)n, (long)chunk); + } + else + { + if (n != chunk) + fprintf(stderr, "%s write socket: wrote %ld, should be %ld.\n" + , time_stamp(), (long)n, (long)chunk); + } + /* Continue with the processing of source */ dest = &ip->message_buf[0]; } while (srclen != 0); *************** *** 2875,2880 **** --- 2927,2934 ---- /* Initialize the rest of the interactive structure */ + new_interactive->compressing = 0; + new_interactive->out_compress = NULL; new_interactive->input_to = NULL; put_ref_string(&new_interactive->prompt, STR_DEFAULT_PROMPT); new_interactive->modify_command = NULL; *************** *** 2963,2970 **** --- 3017,3029 ---- (void) lookup_ip_entry(new_interactive->addr.sin_addr, MY_TRUE); /* TODO: We could pass the retrieved hostname right to login */ #endif + + send_will(TELOPT_COMPRESS2); + send_will(TELOPT_COMPRESS); + logon(ob); flush_all_player_mess(); + } /* new_player() */ /*-------------------------------------------------------------------------*/ *************** *** 3904,3910 **** } } /* reply_h_telnet_neg() */ ! /*-------------------------------------------------------------------------*/ void init_telopts (void) --- 3963,3971 ---- } } /* reply_h_telnet_neg() */ ! /*- ! ! -----------------------------------------------------------------------*/ void init_telopts (void) *************** *** 3989,4003 **** /* Mud specific protocols */ ! telopts_do[TELOPT_COMPRESS] = reply_h_telnet_neg; ! telopts_dont[TELOPT_COMPRESS] = reply_h_telnet_neg; ! telopts_will[TELOPT_COMPRESS] = reply_h_telnet_neg; ! telopts_wont[TELOPT_COMPRESS] = reply_h_telnet_neg; ! ! telopts_do[TELOPT_COMPRESS2] = reply_h_telnet_neg; ! telopts_dont[TELOPT_COMPRESS2] = reply_h_telnet_neg; ! telopts_will[TELOPT_COMPRESS2] = reply_h_telnet_neg; ! telopts_wont[TELOPT_COMPRESS2] = reply_h_telnet_neg; telopts_do[TELOPT_MSP] = reply_h_telnet_neg; telopts_dont[TELOPT_MSP] = reply_h_telnet_neg; --- 4050,4064 ---- /* Mud specific protocols */ ! telopts_do[TELOPT_COMPRESS] = mccp_telnet_neg; ! telopts_dont[TELOPT_COMPRESS] = mccp_telnet_neg; ! telopts_will[TELOPT_COMPRESS] = mccp_telnet_neg; ! telopts_wont[TELOPT_COMPRESS] = mccp_telnet_neg; ! ! telopts_do[TELOPT_COMPRESS2] = mccp_telnet_neg; ! telopts_dont[TELOPT_COMPRESS2] = mccp_telnet_neg; ! telopts_will[TELOPT_COMPRESS2] = mccp_telnet_neg; ! telopts_wont[TELOPT_COMPRESS2] = mccp_telnet_neg; telopts_do[TELOPT_MSP] = reply_h_telnet_neg; telopts_dont[TELOPT_MSP] = reply_h_telnet_neg; *************** *** 5661,5666 **** --- 5722,5731 ---- * codes for colours and other things needs to bypass the allowed * charset filters, but isn't important enough to waste bandwith * on a synchronous transmission. + * + * If the client uses MCCP compression add_message ist always used + * with flushing buffer _after_ the Message. + * */ { *************** *** 5708,5714 **** save_command_giver = command_giver; command_giver = current_object; ! if (sp->u.number & 1) { /* Write before flush... */ --- 5773,5779 ---- save_command_giver = command_giver; command_giver = current_object; ! if ((sp->u.number & 1)||ip->out_compress) { /* Write before flush... */ *************** *** 5718,5724 **** sending_telnet_command = MY_FALSE; ! if (sp->u.number & 2) add_message(message_flush); wrote = 0; } --- 5783,5789 ---- sending_telnet_command = MY_FALSE; ! if ((sp->u.number & 2)||ip->out_compress) add_message(message_flush); wrote = 0; } *************** *** 6515,6518 **** --- 6580,6790 ---- } /* f_query_udp_port() */ /***************************************************************************/ + + static void + mccp_telnet_neg (int option) + + { + interactive_t *ip = O_GET_INTERACTIVE(command_giver); + + switch(ip->tn_state) { + case TS_DO: + start_compress(ip,option); + break; + default: + printf("MCCP NEG (%d) STATE (%d)\n",option,ip->tn_state); + } + } + + + svalue_t * + f_query_mccp (svalue_t *sp) + + /* EFUN query_mccp() + * + * mixed query_mccp(object ob) + * + * this efun returns 0 if no mccp is used for interactive ob. + * if ob|this_player uses mccp it returns TELOPT_COMPRESS or + * TELOPT_COMPRESS2 + */ + + { + interactive_t *ip; + + /* Make sure the object is interactive */ + if (!(O_SET_INTERACTIVE(ip, sp->u.ob)) + || ip->closing) + { + error("Bad arg 1 to query_mccp(): object not interactive.\n"); + return sp; + } + + free_svalue(sp); + put_number(sp,ip->compressing); + + return sp; + } /* query_mccp() */ + + + + /* + * mccp.c - support functions for the Mud Client Compression Protocol + * + * see http://www.randomly.org/projects/MCCP/ + * + * Copyright (c) 1999, Oliver Jowett <oliver@randomly.org> + * + * This code may be freely distributed and used if this copyright + * notice is retained intact. + */ + + + + void *zlib_alloc(void *opaque, unsigned int items, unsigned int size) + { + return calloc(items, size); + } + + void zlib_free(void *opaque, void *address) + { + free(address); + } + + + static int start_compress(interactive_t *ip, unsigned char telopt ) + { + z_stream *s; + + /* already compressing */ + if (ip->out_compress) + return 1; + + /* allocate and init stream, buffer */ + s = (z_stream *) malloc(sizeof(*s)); + ip->out_compress_buf = (unsigned char *) malloc(COMPRESS_BUF_SIZE); + + s->next_in = NULL; + s->avail_in = 0; + s->next_out = ip->out_compress_buf; + s->avail_out = COMPRESS_BUF_SIZE; + s->zalloc = zlib_alloc; + s->zfree = zlib_free; + s->opaque = NULL; + + if (deflateInit(s, 9) != Z_OK) + { + free(ip->out_compress_buf); + free(s); + return 0; + } + + /* version 1 or 2 support */ + if (telopt == TELOPT_COMPRESS) + { + DTF(("%s TDEBUG: send IAC SB %02x WILL SE\n", time_stamp(), telopt)); + SEND_TELNET_COMMAND( + add_message("%c", IAC); + add_message("%c%c%c%c", SB, telopt, WILL, SE); + add_message(message_flush); + ); + } + else if (telopt == TELOPT_COMPRESS2) + { + DTF(("%s TDEBUG: send IAC SB %02x WILL SE\n", time_stamp(), telopt)); + SEND_TELNET_COMMAND( + add_message("%c", IAC); + add_message("%c%c%c%c", SB, telopt, IAC, SE); + add_message(message_flush); + ); + } + else + { + printf("Bad teleoption %d passed", telopt); + free(ip->out_compress_buf); + free(s); + return 0; + } + + ip->compressing = telopt; + ip->out_compress = s; + + /* success */ + return 1; + } + + /* + beenden des compressed zeugs wird noch nicht unterstuetzt :) + also ist der rest des files erst mal ueberfluessig :) + */ + + /* Try to send any pending compressed-but-not-sent data in `desc' */ + int process_compressed(interactive_t *ip) + { + int iStart, nBlock, nWrite, len; + + if (!ip->out_compress) + return 1; + + len = ip->out_compress->next_out - ip->out_compress_buf; + if (len > 0) + { + for (iStart = 0; iStart < len; iStart += nWrite) + { + nBlock = UMIN (len - iStart, 4096); + if ((nWrite = write(ip->socket, ip->out_compress_buf + iStart, nBlock)) < 0) + { + if (errno == EAGAIN || errno == ENOSR) + break; + + /* write error */ + return 0; + } + if (nWrite <= 0) + break; + } + + if (iStart) + { + if (iStart < len) + memmove(ip->out_compress_buf, ip->out_compress_buf+iStart, len - iStart); + + ip->out_compress->next_out = ip->out_compress_buf + len - iStart; + } + } + + /* success */ + return 1; + } + + /* Cleanly shut down compression on `desc' */ + int end_compress(interactive_t *ip) + { + unsigned char dummy[1]; + + if (!ip->out_compress) + return 1; + + ip->out_compress->avail_in = 0; + ip->out_compress->next_in = dummy; + + /* No terminating signature is needed - receiver will get Z_STREAM_END */ + if (deflate(ip->out_compress, Z_FINISH) != Z_STREAM_END) + return 0; + + /* try to send any residual data */ + if (!process_compressed(ip)) + return 0; + + /* reset compression values */ + deflateEnd(ip->out_compress); + free(ip->out_compress_buf); + free(ip->out_compress); + ip->compressing = 0; + ip->out_compress = NULL; + ip->out_compress_buf = NULL; + + /* success */ + return 1; + } diff -r -c3 3-3/src/comm.h 3-3.daf/src/comm.h *** 3-3/src/comm.h Sat Oct 13 20:57:14 2001 --- 3-3.daf/src/comm.h Thu Oct 11 15:46:22 2001 *************** *** 4,9 **** --- 4,10 ---- #include "driver.h" #include "typedefs.h" #include <sys/types.h> + #include <zlib.h> #include "simulate.h" /* callback_t for input_to_t */ #include "svalue.h" *************** *** 167,172 **** --- 168,178 ---- char message_buf[MAX_SOCKET_PACKET_SIZE]; /* The send buffer. */ + + unsigned char compressing; /* MCCP support */ + z_stream * out_compress; /* MCCP support */ + unsigned char * out_compress_buf; /* MCCP support */ + }; /* --- Bitflags and masks for interactive.noecho --- *************** *** 315,319 **** --- 321,328 ---- #if defined(ACCESS_CONTROL) extern void refresh_access_data(void (*add_entry)(struct sockaddr_in *, int, long*) ); #endif /* ACCESS_CONTROL */ + + #define COMPRESS_BUF_SIZE 8192 + #define UMIN(a,b) ((a) < (b) ? (a) : (b)) #endif /* COMM_H__ */ diff -r -c3 3-3/src/func_spec 3-3.daf/src/func_spec *** 3-3/src/func_spec Sat Oct 13 20:57:28 2001 --- 3-3.daf/src/func_spec Sat Oct 13 18:05:43 2001 *************** *** 471,476 **** --- 471,477 ---- void set_combine_charset(int *|string); void set_connection_charset(int *|string, int default: F_CONST1); mixed set_prompt(string|closure|int, object default: F_THIS_PLAYER); + mixed query_mccp(null|object default: F_THIS_PLAYER); void write(mixed); object *users(); ------------------------------------------------------------------