postal-0.75/0000755000000000000000000000000013023761356007643 5ustar postal-0.75/.md5.c.swp0000644000000000000000000005000013023761356011355 0ustar b0VIM 8.0(OXM}7rjcathena~rjc/src/p/postal-0.75/md5.cutf-8 3210#"! Utpyozqad yved"I  _  p Q M L ; :    } n _ Q B 3 $ # l 8 B _/ zy8qmHl]Y4LTP9tR0   } context->state[3] = 0x10325476; context->state[2] = 0x98badcfe; context->state[1] = 0xefcdab89; context->state[0] = 0x67452301;*/ /* Load magic initialization constants. context->count[0] = context->count[1] = 0;{MD5_CTX *context; /* context */void MD5Init (context) *//* MD5 initialization. Begins an MD5 operation, writing a new context.} MD5Final(output, &context); MD5Update(&context, input, inlen); MD5Init(&context); MD5_CTX context;{unsigned int inlen; /* length of input block */unsigned char *input; /* input block */unsigned char *output;void md5_calc(output, input, inlen) } (a) += (b); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \#define II(a, b, c, d, x, s, ac) { \ } (a) += (b); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \#define HH(a, b, c, d, x, s, ac) { \ } (a) += (b); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \#define GG(a, b, c, d, x, s, ac) { \ } (a) += (b); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \#define FF(a, b, c, d, x, s, ac) { \ */Rotation is separate from addition to prevent recomputation./* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) *//* ROTATE_LEFT rotates x left n bits.#define I(x, y, z) ((y) ^ ((x) | (~z)))#define H(x, y, z) ((x) ^ (y) ^ (z))#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) *//* F, G, H and I are basic MD5 functions.}; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,static unsigned char PADDING[64] = {static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int));static void MD5_memcpy PROTO_LIST ((POINTER, CPOINTER, unsigned int)); ((UINT4 *, const unsigned char *, unsigned int));static void Decode PROTO_LIST ((unsigned char *, UINT4 *, unsigned int));static void Encode PROTO_LISTstatic void MD5Transform PROTO_LIST ((UINT4 [4], const unsigned char [64]));#define S44 21#define S43 15#define S42 10#define S41 6#define S34 23#define S33 16#define S32 11#define S31 4#define S24 20#define S23 14#define S22 9#define S21 5#define S14 22#define S13 17#define S12 12#define S11 7 *//* Constants for MD5Transform routine.#include "md5.h" */documentation and/or software.These notices must be retained in any copies of any part of thiswithout express or implied warranty of any kind.software for any particular purpose. It is provided "as is"the merchantability of this software or the suitability of thisRSA Data Security, Inc. makes no representations concerning eithermentioning or referencing the derived work.Security, Inc. MD5 Message-Digest Algorithm" in all materialthat such works are identified as "derived from the RSA DataLicense is also granted to make and use derivative works providedor this function.Algorithm" in all material mentioning or referencing this softwareis identified as the "RSA Data Security, Inc. MD5 Message-DigestLicense to copy and use this software is granted provided that itrights reserved./* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All *//* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithmad7qd0O  K  { G  w C B 2 b . ^ * Z&[YXX){yx3 t6vfTR@?#   nlZY=} ((char *)output)[i] = (char)value; for (i = 0; i < len; i++) unsigned int i;{unsigned int len;int value;POINTER output;static void MD5_memset (output, value, len) *//* Note: Replace "for loop" with standard memset if possible.} output[i] = input[i]; for (i = 0; i < len; i++) unsigned int i;{unsigned int len;CPOINTER input;POINTER output;static void MD5_memcpy (output, input, len) *//* Note: Replace "for loop" with standard memcpy if possible.} (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | for (i = 0, j = 0; j < len; i++, j += 4) unsigned int i, j;{unsigned int len;const unsigned char *input;UINT4 *output;static void Decode (output, input, len) */ a multiple of 4./* Decodes input (unsigned char) into output (UINT4). Assumes len is} } output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); output[j] = (unsigned char)(input[i] & 0xff); for (i = 0, j = 0; j < len; i++, j += 4) { unsigned int i, j;{unsigned int len;UINT4 *input;unsigned char *output;static void Encode (output, input, len) */ a multiple of 4./* Encodes input (UINT4) into output (unsigned char). Assumes len is} MD5_memset ((POINTER)x, 0, sizeof (x));*/ /* Zeroize sensitive information. state[3] += d; state[2] += c; state[1] += b; state[0] += a; II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ /* Round 4 */ HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ /* Round 3 */ GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ad ovrHmkIH! v ` 0 /    N M  k \ Z Y  w 1 /  ] % onJG tr+*g4h5e1QM GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ /* Round 2 */ FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ /* Round 1 */ Decode (x, block, 64); UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];{const unsigned char block[64];UINT4 state[4];static void MD5Transform (state, block) *//* MD5 basic transformation. Transforms state based on block.} MD5_memset ((POINTER)context, 0, sizeof (*context));*/ /* Zeroize sensitive information. Encode (digest, context->state, 16); /* Store state in digest */ MD5Update (context, bits, 8); /* Append length (before padding) */ MD5Update (context, PADDING, padLen); padLen = (index < 56) ? (56 - index) : (120 - index); index = (unsigned int)((context->count[0] >> 3) & 0x3f);*/ /* Pad out to 56 mod 64. Encode (bits, context->count, 8); /* Save number of bits */ unsigned int index, padLen; unsigned char bits[8];{MD5_CTX *context; /* context */unsigned char digest[16]; /* message digest */void MD5Final (digest, context) */ the message digest and zeroizing the context./* MD5 finalization. Ends an MD5 message-digest operation, writing the} inputLen-i); ((POINTER)&context->buffer[index], (CPOINTER)&input[i], MD5_memcpy /* Buffer remaining input */ i = 0; else } index = 0; MD5Transform (context->state, &input[i]); for (i = partLen; i + 63 < inputLen; i += 64) MD5Transform (context->state, context->buffer); ((POINTER)&context->buffer[index], (CPOINTER)input, partLen); MD5_memcpy if (inputLen >= partLen) {*/ /* Transform as many times as possible. partLen = 64 - index; context->count[1] += ((UINT4)inputLen >> 29); context->count[1]++; < ((UINT4)inputLen << 3)) if ((context->count[0] += ((UINT4)inputLen << 3)) /* Update number of bits */ index = (unsigned int)((context->count[0] >> 3) & 0x3F); /* Compute number of bytes mod 64 */ unsigned int i, index, partLen;{unsigned int inputLen; /* length of input block */const unsigned char *input; /* input block */MD5_CTX *context; /* context */void MD5Update (context, input, inputLen) */ context. operation, processing another message block, and updating the/* MD5 block update operation. Continues an MD5 message-digestpostal-0.75/INSTALL0000644000000000000000000000122207542447747010707 0ustar For Debian the best thing to do is to do "apt-get install postal", if you don't want to use the version supplied with your version of Debian you can build a Debian package in the usual manner. Change to the directory containing the unpacked source and use the command: dpkg-buildpackage -rfakeroot -tc -us That will create a .deb in the parent directory. For Red Hat etc there is a portslave.spec file to allow for building with the "rpm -b" command. For Solaris use the command "make -C sun" to build a package in /var/spool/pkg (make sure you have write access to that directory). For other Unix setup "./configure ; make install" should do an install. postal-0.75/Makefile0000644000000000000000000000674413023761356011316 0ustar SEXE=postal rabid bhm EXE=postal-list MAN8=postal.8 rabid.8 bhm.8 MAN1=postal-list.1 all: $(EXE) $(SEXE) prefix=/home/rjc/src/p/postal-0.75/debian/postal/usr eprefix=${prefix} WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wcast-qual -pedantic WPLUS=-Woverloaded-virtual -ffor-scope CXX=g++ $(CFLAGS) -O2 -g $(WFLAGS) $(WPLUS) CC=gcc $(CFLAGS) -O2 -g $(WFLAGS) INSTALL=/usr/bin/install -c TESTEXE=ex-test BASEOBJS=userlist.o thread.o results.o address.o tcp.o cmd5.o mutex.o logit.o expand.o md5.o LFLAGS=-lstdc++ -lpthread CRYPTLFLAGS=-lstdc++ -lpthread -lgnutls ALLOBJS=$(BASEOBJS) smtp.o client.o basictcp.o bhmusers.o smtpserver.o postal: postal.cpp $(BASEOBJS) postal.h smtp.o $(CXX) postal.cpp $(BASEOBJS) smtp.o -o postal $(CRYPTLFLAGS) rabid: rabid.cpp $(BASEOBJS) postal.h client.o $(CXX) rabid.cpp $(BASEOBJS) client.o -o rabid $(CRYPTLFLAGS) bhm: bhm.cpp userlist.o basictcp.o logit.o results.o mutex.o bhmusers.o postal.h $(CXX) bhm.cpp userlist.o basictcp.o logit.o results.o mutex.o bhmusers.o -o bhm $(CRYPTLFLAGS) ex-test: ex-test.cpp expand.o $(CXX) ex-test.cpp expand.o -o ex-test $(LFLAGS) postal-list: postal-list.cpp expand.o $(CXX) postal-list.cpp expand.o -o postal-list $(LFLAGS) install-bin: $(EXE) $(SEXE) mkdir -p $(DESTDIR)$(eprefix)/sbin $(DESTDIR)$(eprefix)/bin ${INSTALL} $(SEXE) $(DESTDIR)$(eprefix)/sbin ${INSTALL} $(EXE) $(DESTDIR)$(eprefix)/bin install: install-bin mkdir -p $(DESTDIR)${prefix}/share/man/man8 $(DESTDIR)${prefix}/share/man/man1 ${INSTALL} -m 644 $(MAN8) $(DESTDIR)${prefix}/share/man/man8 ${INSTALL} -m 644 $(MAN1) $(DESTDIR)${prefix}/share/man/man1 %.o: %.cpp %.h postal.h $(CXX) -c $< %.o: %.c %.h $(CC) -c $< dep: makedepend -Y *.cpp *.h makedepend -f Makefile.in -Y *.cpp *.h clean: rm -f $(EXE) $(SEXE) $(TESTEXE) $(ALLOBJS) md5.o build-stamp install-stamp rm -rf debian/tmp core debian/*.debhelper rm -f debian/{substvars,files} config.log realclean: clean rm -f config.* Makefile postal.spec sun/pkginfo # DO NOT DELETE address.o: address.h basictcp.o: basictcp.h postal.h userlist.h conf.h address.h logit.h results.h basictcp.o: mutex.h bhm.o: bhmusers.h conf.h postal.h logit.h results.h mutex.h basictcp.h bhmusers.o: bhmusers.h conf.h postal.h expand.h client.o: client.h tcp.h postal.h cmd5.h md5.h thread.h port.h userlist.h client.o: conf.h logit.h results.h mutex.h cmd5.o: postal.h cmd5.h md5.h expand.o: expand.h ex-test.o: expand.h logit.o: logit.h mutex.o: postal.h mutex.h postal.o: userlist.h conf.h postal.h smtp.h tcp.h cmd5.h md5.h thread.h postal.o: port.h mutex.h logit.h postal-list.o: expand.h rabid.o: userlist.h conf.h postal.h client.h tcp.h cmd5.h md5.h thread.h rabid.o: port.h logit.h results.o: postal.h results.h mutex.h smtp.o: smtp.h conf.h tcp.h postal.h cmd5.h md5.h thread.h port.h mutex.h smtp.o: userlist.h logit.h results.h smtpserver.o: smtpserver.h logit.h tcp.h postal.h cmd5.h md5.h thread.h smtpserver.o: port.h results.h mutex.h tcp.o: tcp.h postal.h cmd5.h md5.h thread.h port.h userlist.h conf.h tcp.o: address.h logit.h thread.o: thread.h port.h userlist.o: userlist.h conf.h postal.h expand.h basictcp.o: postal.h bhmusers.o: conf.h postal.h client.o: tcp.h postal.h cmd5.h md5.h thread.h port.h cmd5.o: md5.h results.o: mutex.h smtp.o: conf.h tcp.h postal.h cmd5.h md5.h thread.h port.h mutex.h smtpserver.o: logit.h tcp.h postal.h cmd5.h md5.h thread.h port.h results.h smtpserver.o: mutex.h tcp.o: postal.h cmd5.h md5.h thread.h port.h thread.o: port.h userlist.o: conf.h postal.h postal-0.75/Makefile.in0000644000000000000000000000664013023761356011716 0ustar SEXE=postal rabid bhm EXE=postal-list MAN8=postal.8 rabid.8 bhm.8 MAN1=postal-list.1 all: $(EXE) $(SEXE) prefix=@prefix@ eprefix=@exec_prefix@ WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wcast-qual -pedantic WPLUS=-Woverloaded-virtual -ffor-scope CXX=@CXX@ $(CFLAGS) -O2 -g $(WFLAGS) $(WPLUS) CC=@CC@ $(CFLAGS) -O2 -g $(WFLAGS) INSTALL=@INSTALL@ TESTEXE=ex-test BASEOBJS=userlist.o thread.o results.o address.o tcp.o cmd5.o mutex.o logit.o expand.o @extra_objs@ LFLAGS=-lstdc++ @extra_ldflags@ CRYPTLFLAGS=-lstdc++ @crypt_ldflags@ ALLOBJS=$(BASEOBJS) smtp.o client.o basictcp.o bhmusers.o smtpserver.o postal: postal.cpp $(BASEOBJS) postal.h smtp.o $(CXX) postal.cpp $(BASEOBJS) smtp.o -o postal $(CRYPTLFLAGS) rabid: rabid.cpp $(BASEOBJS) postal.h client.o $(CXX) rabid.cpp $(BASEOBJS) client.o -o rabid $(CRYPTLFLAGS) bhm: bhm.cpp userlist.o basictcp.o logit.o results.o mutex.o bhmusers.o postal.h $(CXX) bhm.cpp userlist.o basictcp.o logit.o results.o mutex.o bhmusers.o -o bhm $(CRYPTLFLAGS) ex-test: ex-test.cpp expand.o $(CXX) ex-test.cpp expand.o -o ex-test $(LFLAGS) postal-list: postal-list.cpp expand.o $(CXX) postal-list.cpp expand.o -o postal-list $(LFLAGS) install-bin: $(EXE) $(SEXE) mkdir -p $(DESTDIR)$(eprefix)/sbin $(DESTDIR)$(eprefix)/bin @INSTALL_PROGRAM@ $(SEXE) $(DESTDIR)$(eprefix)/sbin @INSTALL_PROGRAM@ $(EXE) $(DESTDIR)$(eprefix)/bin install: install-bin mkdir -p $(DESTDIR)@mandir@/man8 $(DESTDIR)@mandir@/man1 @INSTALL_DATA@ $(MAN8) $(DESTDIR)@mandir@/man8 @INSTALL_DATA@ $(MAN1) $(DESTDIR)@mandir@/man1 %.o: %.cpp %.h postal.h $(CXX) -c $< %.o: %.c %.h $(CC) -c $< dep: makedepend -Y *.cpp *.h makedepend -f Makefile.in -Y *.cpp *.h clean: rm -f $(EXE) $(SEXE) $(TESTEXE) $(ALLOBJS) md5.o build-stamp install-stamp rm -rf debian/tmp core debian/*.debhelper rm -f debian/{substvars,files} config.log realclean: clean rm -f config.* Makefile postal.spec sun/pkginfo # DO NOT DELETE address.o: address.h basictcp.o: basictcp.h postal.h userlist.h conf.h address.h logit.h results.h basictcp.o: mutex.h bhm.o: bhmusers.h conf.h postal.h logit.h results.h mutex.h basictcp.h bhmusers.o: bhmusers.h conf.h postal.h expand.h client.o: client.h tcp.h postal.h cmd5.h md5.h thread.h port.h userlist.h client.o: conf.h logit.h results.h mutex.h cmd5.o: postal.h cmd5.h md5.h expand.o: expand.h ex-test.o: expand.h logit.o: logit.h mutex.o: postal.h mutex.h postal.o: userlist.h conf.h postal.h smtp.h tcp.h cmd5.h md5.h thread.h postal.o: port.h mutex.h logit.h postal-list.o: expand.h rabid.o: userlist.h conf.h postal.h client.h tcp.h cmd5.h md5.h thread.h rabid.o: port.h logit.h results.o: postal.h results.h mutex.h smtp.o: smtp.h conf.h tcp.h postal.h cmd5.h md5.h thread.h port.h mutex.h smtp.o: userlist.h logit.h results.h smtpserver.o: smtpserver.h logit.h tcp.h postal.h cmd5.h md5.h thread.h smtpserver.o: port.h results.h mutex.h tcp.o: tcp.h postal.h cmd5.h md5.h thread.h port.h userlist.h conf.h tcp.o: address.h logit.h thread.o: thread.h port.h userlist.o: userlist.h conf.h postal.h expand.h basictcp.o: postal.h bhmusers.o: conf.h postal.h client.o: tcp.h postal.h cmd5.h md5.h thread.h port.h cmd5.o: md5.h results.o: mutex.h smtp.o: conf.h tcp.h postal.h cmd5.h md5.h thread.h port.h mutex.h smtpserver.o: logit.h tcp.h postal.h cmd5.h md5.h thread.h port.h results.h smtpserver.o: mutex.h tcp.o: postal.h cmd5.h md5.h thread.h port.h thread.o: port.h userlist.o: conf.h postal.h postal-0.75/address.cpp0000644000000000000000000000442211704270673011777 0ustar #include "address.h" #include #include #include #include #include typedef char *PCHAR; address::address(const char *addr, unsigned short default_port) { unsigned short port = default_port; char *addr_copy = strdup(addr); int len = strlen(addr); m_count = 1; int i; for(i = 0; i < len; i++) { if(addr_copy[i] == ',') m_count++; } char **names = (char **)malloc(m_count * sizeof(char *)); int ind = 0; for(i = 0; i < m_count; i++) { names[i] = &addr_copy[ind]; while(addr_copy[ind] && addr_copy[ind] != ',') ind++; addr_copy[ind] = '\0'; ind++; } m_rr_dns = (bool *)malloc(m_count * sizeof(bool)); m_addr = (sockaddr_in *)malloc(m_count * sizeof(sockaddr_in)); m_hostname = (char **)malloc(m_count * sizeof(char *)); for(i = 0; i < m_count; i++) { char *hostname = names[i]; if(hostname[0] == '+') { m_rr_dns[i] = true; hostname++; } else { m_rr_dns[i] = false; } if(hostname[0] == '[') { hostname++; int j; for(j = 0; hostname[j] && hostname[j] != ']'; j++) {} if(!hostname[j]) { fprintf(stderr, "Bad address: %s\n", addr); exit(1); } hostname[j] = '\0'; port = atoi(&hostname[j + 1]); } m_hostname[i] = strdup(hostname); m_addr[i].sin_family = AF_INET; m_addr[i].sin_port = htons(port); if(!m_rr_dns[i]) { if(resolve_name(i)) exit(1); } } free(names); free(addr_copy); } address::~address() { for(int i = 0; i < m_count; i++) free(m_hostname[i]); free(m_hostname); free(m_rr_dns); free(m_addr); } int address::resolve_name(int ind) { hostent *he = gethostbyname(m_hostname[ind]); if(!he) { fprintf(stderr, "Bad address \"%s\" for server.\n", m_hostname[ind]); return 1; } m_addr[ind].sin_addr.s_addr = *((unsigned int *)he->h_addr_list[0]); return 0; } sockaddr *address::get_rand_addr() { int ind = 0; if(m_count > 1) ind = rand() % m_count; return get_addr(ind); } sockaddr *address::get_addr(int ind) { if(ind < 0 || ind > m_count) return get_rand_addr(); if(m_rr_dns[ind]) { if(resolve_name(ind)) return NULL; } return (sockaddr *)&m_addr[ind]; } postal-0.75/address.h0000644000000000000000000000076707205762236011456 0ustar #ifndef ADDRESS_H #define ADDRESS_H #include #include struct sockaddr; class address { public: address(const char *addr, unsigned short default_port = 0); ~address(); sockaddr *get_addr(int ind); sockaddr *get_rand_addr(); int addressCount() const { return m_count; } private: int resolve_name(int ind); sockaddr_in *m_addr; char **m_hostname; bool *m_rr_dns; int m_count; address(const address&); address & operator=(const address&); }; #endif postal-0.75/basictcp.cpp0000644000000000000000000001742111700042473012134 0ustar #define TCP_BODY #include "basictcp.h" #include #include #include #include #include #include #include "postal.h" #include "userlist.h" #include "address.h" #include "logit.h" #include "results.h" #ifdef USE_GNUTLS int base_tcp::m_init_dh_params = 0; gnutls_dh_params_t base_tcp::m_dh_params; #endif base_tcp::base_tcp(int fd, Logit *log, Logit *debug, results *res #ifdef USE_SSL , int ssl #endif ) : #ifdef USE_SSL m_canTLS(false), m_useTLS(ssl), #endif m_sock(fd) , m_start(0) , m_end(0) , m_open(true) , m_log(log) , m_debug(debug) , m_res(res) #ifdef USE_SSL #ifdef USE_OPENSSL , m_sslMeth(NULL) , m_sslCtx(NULL) , m_ssl(NULL) #else , m_gnutls_session(NULL) #endif , m_isTLS(false) #endif { m_poll.fd = m_sock; #ifdef USE_SSL if(m_useTLS) { #ifdef USE_OPENSSL //don't seem to need this SSL_library_init(); SSLeay_add_ssl_algorithms(); SSL_load_error_strings(); #endif } #endif } base_tcp::~base_tcp() { } #ifdef USE_SSL #ifdef USE_GNUTLS #define DH_BITS 1024 void base_tcp::m_initialize_tls_session() { gnutls_init(&m_gnutls_session, GNUTLS_SERVER); /* avoid calling all the priority functions, since the defaults * are adequate. */ gnutls_set_default_priority(m_gnutls_session); // Need to enable anonymous specifically gnutls_priority_set_direct(m_gnutls_session, "NORMAL:+ANON-DH", NULL); gnutls_credentials_set(m_gnutls_session, GNUTLS_CRD_ANON, m_anoncred); gnutls_dh_set_prime_bits(m_gnutls_session, DH_BITS); } void base_tcp::m_generate_dh_params() { /* Generate Diffie Hellman parameters - for use with DHE * kx algorithms. These should be discarded and regenerated * once a day, once a week or once a month. Depending on the * security requirements. */ gnutls_dh_params_init(&m_dh_params); gnutls_dh_params_generate2(m_dh_params, DH_BITS); } #endif // USE_GNUTLS int base_tcp::ConnectTLS() { #ifdef USE_OPENSSL m_sslMeth = NULL; m_sslCtx = NULL; m_ssl = NULL; m_sslMeth = SSLv2_client_method(); if(m_sslMeth == NULL) { fprintf(stderr, "Can't get SSLv2_client_method.\n"); return 2; } m_sslCtx = SSL_CTX_new(m_sslMeth); if(m_sslCtx == NULL) { fprintf(stderr, "Can't SSL_CTX_new\n"); return 2; } if((m_ssl = SSL_new(m_sslCtx)) == NULL) { fprintf(stderr, "Can't SSL_new\n"); SSL_CTX_free(m_sslCtx); return 2; } SSL_set_fd(m_ssl, m_sock); if(-1 == SSL_connect(m_ssl)) { fprintf(stderr, "Can't SSL_CONNECT\n"); SSL_free(m_ssl); SSL_CTX_free(m_sslCtx); return 1; } m_isTLS = true; // debugging code that may be useful to have around in a commented-out state. #if 0 /* Following two steps are optional and not required for data exchange to be successful. */ /* Get the cipher - opt */ printf ("SSL connection using %s\n", SSL_get_cipher(m_ssl)); /* Get server's certificate (note: beware of dynamic allocation) - opt */ X509 *server_cert; server_cert = SSL_get_peer_certificate(m_ssl); if(!server_cert) { fprintf(stderr, "Can't SSL_get_peer_certificate\n"); return 2; } printf ("Server certificate:\n"); char *str = X509_NAME_oneline(X509_get_subject_name(server_cert),0,0); if(!str) { fprintf(stderr, "Can't X509_NAME_oneline\n"); return 2; } printf ("\t subject: %s\n", str); Free (str); str = X509_NAME_oneline (X509_get_issuer_name(server_cert),0,0); if(!str) { fprintf(stderr, "Can't X509_get_issuer_name\n"); return 2; } printf ("\t issuer: %s\n", str); Free (str); /* We could do all sorts of certificate verification stuff here before deallocating the certificate. */ X509_free(server_cert); #endif // 0 #else gnutls_anon_allocate_server_credentials(&m_anoncred); m_initialize_tls_session(); if(!m_init_dh_params) { m_init_dh_params = 1; m_generate_dh_params(); } gnutls_anon_set_server_dh_params(m_anoncred, m_dh_params); gnutls_transport_set_ptr(m_gnutls_session, (gnutls_transport_ptr_t)m_sock); int rc = gnutls_handshake(m_gnutls_session); if(rc < 0) { gnutls_deinit(m_gnutls_session); return 2; } m_isTLS = 1; /* request client certificate if any. */ gnutls_certificate_server_set_request(m_gnutls_session, GNUTLS_CERT_REQUEST); #endif // USE_OPENSSL return 0; } #endif // USE_SSL int base_tcp::disconnect() { if(m_open) { #ifdef USE_SSL if(m_isTLS) { #ifdef USE_OPENSSL SSL_shutdown(m_ssl); close(m_sock); SSL_free(m_ssl); SSL_CTX_free(m_sslCtx); m_isTLS = false; #else #endif } else #endif { close(m_sock); } } m_open = false; return 0; } ERROR_TYPE base_tcp::printf(CPCCHAR fmt, ...) { va_list argp; va_start(argp, fmt); char buf[1024]; int len = vsnprintf(buf, sizeof(buf), fmt, argp); if(len > (int)sizeof(buf)) len = sizeof(buf); return sendData(buf, len); } ERROR_TYPE base_tcp::sendData(CPCCHAR buf, int size) { if(!m_open) return eCorrupt; int sent = 0; m_poll.events = POLLOUT | POLLERR | POLLHUP; int rc; while(sent != size) { rc = poll(&m_poll, 1, 60000); if(rc == 0) { fprintf(stderr, "Server timed out on write.\n"); return eTimeout; } if(rc < 0) { fprintf(stderr, "Poll error.\n"); return eSocket; } #ifdef USE_SSL if(m_isTLS) { #ifdef USE_OPENSSL rc = SSL_write(m_ssl, &buf[sent], size - sent); #else rc = gnutls_record_send(m_gnutls_session, &buf[sent], size - sent); #endif } else #endif { rc = write(m_sock, &buf[sent], size - sent); } if(rc < 1) { // fprintf(stderr, "Can't write to socket.\n"); return eSocket; } if(m_debug) m_debug->Write(buf, rc); sent += rc; } sentData(size); return eNoError; } int base_tcp::readLine(char *buf, int bufSize, bool stripCR, int timeout) { if(!m_open) return eCorrupt; int ind = 0; if(m_start < m_end) { do { buf[ind] = m_buf[m_start]; ind++; m_start++; } while(m_start < m_end && m_buf[m_start - 1] != '\n' && ind < bufSize); } if(ind == bufSize || (ind > 0 && buf[ind - 1] == '\n') ) { receivedData(ind); if(m_debug) m_debug->Write(buf, ind); if(ind < bufSize) { ind--; buf[ind] = '\0'; if(stripCR && buf[ind - 1] == '\r') { ind--; buf[ind] = '\0'; } } return ind; } // buffer is empty m_start = 0; m_end = 0; time_t now = time(NULL); m_poll.events = POLLIN | POLLERR | POLLHUP; while(1) { int tmo = timeout - (time(NULL) - now); int rc; if(tmo < 0 || (rc = poll(&m_poll, 1, tmo * 1000)) == 0) { return eTimeout; } if(rc < 0) { fprintf(stderr, "Poll error.\n"); return eCorrupt; } #ifdef USE_SSL if(m_isTLS) { #ifdef USE_OPENSSL rc = SSL_read(m_ssl, m_buf, sizeof(m_buf)); #else rc = gnutls_record_recv(m_gnutls_session, m_buf, sizeof(m_buf)); #endif } else #endif { rc = read(m_sock, m_buf, sizeof(m_buf)); } if(rc < 0) return eSocket; m_end = rc; do { buf[ind] = m_buf[m_start]; ind++; m_start++; } while(m_start < m_end && m_buf[m_start - 1] != '\n' && ind < bufSize); if(ind == bufSize || (ind > 0 && buf[ind - 1] == '\n') ) { receivedData(ind); if(m_debug) m_debug->Write(buf, ind); if(ind < bufSize) { ind--; buf[ind] = '\0'; if(stripCR && buf[ind - 1] == '\r') { ind--; buf[ind] = '\0'; } } return ind; } if(m_start == m_end) { m_start = 0; m_end = 0; } } return 0; // never reached } void base_tcp::sentData(int) { } void base_tcp::receivedData(int bytes) { m_res->dataBytes(bytes); } postal-0.75/basictcp.h0000644000000000000000000000432411016502724011577 0ustar #ifndef BASE_TCP_H #define BASE_TCP_H using namespace std; #include "postal.h" #include #include #include #include #include class Logit; class address; #ifdef USE_SSL #ifdef USE_OPENSSL #ifndef TCP_BODY struct SSL_METHOD; struct SSL_CTX; struct SSL; struct X509; #else // TCP_BODY #include #include #include #include #include #endif // TCP_BODY #else // USE_OPENSSL #include #endif // USE_OPENSSL #endif class results; class base_tcp { public: base_tcp(int fd, Logit *log, Logit *debug, results *res #ifdef USE_SSL , int ssl #endif ); virtual ~base_tcp(); int do_stuff(); int disconnect(); #ifdef USE_SSL // after calling Connect() and getting high-level protocol ready call // ConnectTLS() to start TLS. int ConnectTLS(); int isTLS() { return m_isTLS; } #endif // returns negative error or the number of bytes read int readLine(char *buf, int bufSize, bool stripCR = false, int timeout = 60); ERROR_TYPE sendData(CPCCHAR buf, int size); ERROR_TYPE sendCstr(CPCCHAR buf) { return sendData(buf, strlen(buf)); } ERROR_TYPE sendString(const string &s) { return sendData(s.c_str(), s.size()); } ERROR_TYPE printf(CPCCHAR fmt, ...); protected: struct sockaddr_in m_localAddr, m_remoteAddr; #ifdef USE_SSL bool m_canTLS; int m_useTLS; #endif void sentData(int bytes); virtual void receivedData(int bytes); private: int m_sock; pollfd m_poll; char m_buf[4096]; int m_start; int m_end; bool m_open; Logit *m_log; // debug file management object (NULL if no debugging) // if used a new Logit object is created for each instance unlike the // m_log instance Logit *m_debug; results *m_res; #ifdef USE_SSL #ifdef USE_OPENSSL SSL_METHOD *m_sslMeth; SSL_CTX* m_sslCtx; SSL *m_ssl; #else gnutls_session_t m_gnutls_session; gnutls_anon_server_credentials_t m_anoncred; void m_generate_dh_params(); void m_initialize_tls_session(); static gnutls_dh_params_t m_dh_params; static int m_init_dh_params; #endif bool m_isTLS; #endif base_tcp(const base_tcp&); base_tcp & operator=(const base_tcp&); }; #endif postal-0.75/bhm.80000644000000000000000000000534612735160146010511 0ustar .TH "bhm" "8" "0.70" "russell@coker.com.au" "Postal" .SH "NAME" bhm \- program to send SMTP mail to /dev/null .SH "SYNOPSIS" .B bhm .I [\-m maximum\-message\-size] [\-t threads] [\-b bind\-address] [\-p listen\-port] .I [ \-s ] .I [\-a] [\-[z|Z] debug\-file] [\-r reverse\-dns] user\-list\-filename .SH "DESCRIPTION" This manual page documents briefly the .BR bhm , program. .P It is designed to test the performance of SMTP relay servers by receiving mail to /dev/null at random speeds. .P The .B user\-list\-filename is the name of a file which contains a list of valid user's email addresses. The file may have three fields separated by spaces, the email address, the password (used for rabid) and an optional third field to specify what is to be done with the mail. A 'd' character means that it is to be deferred (SMTP 45x), a 'r' means that it is to be rejected (SMTP 55x), a 'b' means that it is to be accepted and bounced, and a 'g' means that it is to be grey-listed. .P The .B reverse\-dns file is in the same format as /etc/hosts and gives the value that will be used in the 220 message. Otherwise it will be .B bhm .P The .B maximum\-message\-size indicates the size in Kilobytes that will be the maximum size of a message that will be accepted. The default is 10240k. .P The .B \-s parameter enables SSL. .P The .B listen\-port parameter specifies the TCP port to listen on (default 25). .P The .B bind\-address parameter specifies the IP address to bind to (default is INADDR_ANY - accept connections on all local addresses). .P The .B threads parameter is the number of threads that may be created to receive mail. Note that your BHM machine may have hardware and OS limits that determine how many connections it may receive. .P The .B \-a command turns on all logging. All message data received will be logged. This will make it slow and it may not be able to saturate a fast Ethernet link... .P The .B \-z switch allows you to specify a debugging file base. From this base one file is created for each thread (with a ':' and the thread number appended), each file is used to log all IO performed by that thread for debugging purposes. .P The .B \-Z switch is the same but creates a separate file for each connection as well with an attitional ':' appended followed by the connection number. .SH "RETURN CODES" .TP .B 0 No Error .TP .B 1 Bad Parameters .TP .B 2 System Error, lack of memory or some other resource .SH "AUTHOR" This program, it's manual page, and the Debian package were written by Russell Coker . .SH "AVAILABILITY" The source is available from http://doc.coker.com.au/projects/postal/ . .P See http://etbe.coker.com.au/category/benchmark for further information. .SH "SEE ALSO" .BR postal (8), postal\-list (8), rabid (8) postal-0.75/bhm.cpp0000644000000000000000000002606712735160230011121 0ustar #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include "bhmusers.h" #include #include #include #include #include #include #include #include #include #include #include #include "postal.h" #include "logit.h" #include "results.h" #include "basictcp.h" #ifdef USE_GNUTLS #include #if GNUTLS_VERSION_NUMBER <= 0x020b00 #include GCRY_THREAD_OPTION_PTHREAD_IMPL; #endif /* GNUTLS_VERSION_NUMBER */ #endif int processes = 0; int *thread_status; void usage(CPCCHAR msg = NULL) { if(msg) printf("Error: %s\n\n", msg); printf("Usage: bhm [-m maximum-message-size] [-t threads] [-p port]" #ifdef USE_SSL " [-s]" #endif "\n" " [-a] [-(z|Z) debug-file] [-r reverse-dns] [-b bind address ]\n" " user-list-filename\n" "\n" "Postal Version: " VER_STR "\n"); close(1); exit(eParam); } int maxMsgSize = 10240; results res; Logit *log; int exitCount = 0; void endit(int) { exitCount++; if(exitCount > 2) exit(1); } typedef struct { int threadNum; int fd; struct sockaddr_in addr; int ssl; Logit *debug; } thread_data; enum { eFree = 0, eUsed, eFinished }; int check_sender(CPCCHAR addr) { return 0; } int readCommand(base_tcp &t, char *buf, int bufSize, bool stripCR, int timeout = 60); // return 1 for successfully accepting an address, 0 for quit, <0 for error // return 2 for data int recv_addr(base_tcp &t, char *buf, const size_t buf_len, CPCCHAR msg, string &addr, bool do_data) { while(1) { char *tmp; bool syntax_warn = false; int len = readCommand(t, buf, buf_len, true); if(len < 0) return len; if(!strncasecmp(buf, "quit", 4) && (isblank(buf[4]) || buf[4] == '\0')) return 0; if(do_data && !strncasecmp(buf, "data", 4) && (len == 4 || (isblank(buf[4]) && len == 5))) return 2; if(!strncasecmp(buf, msg, strlen(msg))) { CPCCHAR bad_sender_msg = "501 Bad address syntax\r\n"; if(buf[len - 1] == '\r') { len--; buf[len] = '\0'; } tmp = buf + strlen(msg); while(isblank(*tmp)) tmp++; if(*tmp != '<' && buf[len - 1] != '>') { syntax_warn = true; } else if(*tmp != '<' || buf[len - 1] != '>') { t.sendCstr(bad_sender_msg); res.error(); continue; } else { tmp++; len--; buf[len] = '\0'; } if(check_sender(tmp)) { t.sendCstr(bad_sender_msg); res.error(); continue; } addr = tmp; if(syntax_warn) t.sendCstr("250 Ok but you should use \r\n"); else t.sendCstr("250 Ok\r\n"); break; } res.error(); int rc = t.sendCstr("502 Error: Command not recognised or not appropriate at this time\r\n"); if(rc < 0) return rc; } return 1; } // return 1 for successfully accepting a message, 0 for quit, -1 for error int recv_msg(base_tcp &t, char *buf, const size_t buf_len) { string sender; string recipient; int rc = recv_addr(t, buf, buf_len, "mail from:", sender, false); if(rc != 1) return rc; int recipient_count = 0; while( (rc = recv_addr(t, buf, buf_len, "rcpt to:", recipient, recipient_count)) == 1) { recipient_count++; } if(rc <= 0) return rc; t.sendCstr("354 End data with .\r\n"); while( (rc = readCommand(t, buf, buf_len, true)) >= 0) { if(!strcmp(".", buf)) break; } if(rc < 0) { res.error(); return rc; } struct timespec req; req.tv_sec = 0; req.tv_nsec = 1000000; nanosleep(&req, NULL); t.sendCstr("250 Ok: queued on /dev/null\r\n"); res.message(); return 1; } const char *hostname = "bhm.coker.com.au"; int do_helo(base_tcp &t, char *buf, const size_t buf_len) { int len; while(1) { int rc; if( (len = t.readLine(buf, buf_len, true)) < 0) { res.error(); return -1; } if(buf[len - 1] == '\r') { len--; buf[len] = '\0'; } bool basicHello = false; if(!strncasecmp("quit", buf, 4)) { t.sendCstr("221 Bye\r\n"); return -2; } if(!strncasecmp("helo", buf, 4)) { basicHello = true; } else if(strncasecmp("ehlo", buf, 4)) { res.error(); if(t.sendCstr("502 Error: command not recognized\r\n") < 0) return -3; continue; } if(len < 6 || !isblank(buf[4])) { res.error(); if(t.sendCstr("501 Syntax: EHLO hostname or HELO hostname\r\n") < 0) return -3; continue; } string remoteName(buf + 5); if(basicHello) rc = t.printf("250 %s\r\n", hostname); else rc = t.printf("250-%s\r\n250-PIPELINING\r\n" #ifdef USE_SSL "250-STARTTLS\r\n" #endif "250 SIZE %d\r\n", hostname, maxMsgSize * 1024); if(rc < 0) { res.error(); return -1; } break; } return 0; } int readCommand(base_tcp &t, char *buf, int bufSize, bool stripCR, int timeout) { #ifdef USE_SSL if(!t.isTLS()) { int rc = t.readLine(buf, bufSize, stripCR, timeout); if(rc < 0 || strcasecmp(buf, "starttls")) return rc; t.printf("220 2.0.0 Ready to start TLS\r\n"); if(t.ConnectTLS()) return -1; res.connect_ssl(); rc = do_helo(t, buf, bufSize); if(rc < 0) return rc; // need to make sure values are consistent rc = t.readLine(buf, bufSize, stripCR, timeout); return rc; } else #endif return t.readLine(buf, bufSize, stripCR, timeout); } void do_work(thread_data *td) { base_tcp t(td->fd, log, td->debug, &res #ifdef USE_SSL , td->ssl #endif ); struct sockaddr_in name; socklen_t namelen = sizeof(name); char buf[1024]; int rc = getsockname(td->fd, (sockaddr *)&name, &namelen); if(rc) { fprintf(stderr, "Error getting socket name.\n"); return; } /* if(!inet_ntop(name.sin_family, &name.sin_addr, buf, sizeof(buf))) printf("error decoding\n"); else printf("Addr:%s\n", buf); */ t.printf("220 %s ESMTP BHM\r\n", hostname); do_helo(t, buf, sizeof(buf)); while( (rc = recv_msg(t, buf, sizeof(buf))) == 1) { } if(rc == eTimeout) t.printf("421 %s Error: timeout exceeded\r\n", hostname); if(rc < 0) { res.error(); return; } if(rc == 0) t.sendCstr("221 2.0.0 Bye\r\n"); } PVOID smtp_worker(PVOID param) { thread_data *td = (thread_data *)param; do_work(td); if(td->debug) delete td->debug; thread_status[td->threadNum] = eFinished; close(td->fd); free(td); return 0; } int main(int argc, char **argv) { int maxThreads = 100; bool allLog = false; PCCHAR debugName = NULL; bool debugMultipleFiles = false; #ifdef USE_SSL int use_ssl = false; #endif unsigned short port = 25; struct in_addr sin_addr; sin_addr.s_addr = INADDR_ANY; #ifdef USE_GNUTLS #if GNUTLS_VERSION_NUMBER <= 0x020b00 gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); #endif gnutls_global_init(); if(!gnutls_check_version(GNUTLS_VER)) { fprintf(stderr, "Needs version " GNUTLS_VER " of GNUTLS\n"); exit(1); } #endif int c; while(-1 != (c = getopt(argc, argv, "b:m:p:st:z:Z:")) ) { switch(char(c)) { case '?': case ':': usage(); break; case 'a': allLog = true; break; case 'b': if(!inet_aton(optarg, &sin_addr)) { fprintf(stderr, "Invalid bind address \"%s\"\n", optarg); return 1; } break; case 'm': maxMsgSize = atoi(optarg); break; case 'p': port = atoi(optarg); break; case 's': #ifdef USE_SSL use_ssl = true; #else usage("SSL not supported.\n"); #endif break; case 't': maxThreads = atoi(optarg); break; case 'Z': debugMultipleFiles = true; case 'z': debugName = optarg; break; } } if(maxMsgSize < 0 || maxMsgSize > MAX_MSG_SIZE) usage("Bad maximum message size.\n"); if(maxThreads < 0 || maxThreads > MAX_PROCESSES) usage("Bad maximum process limit.\n"); if(optind + 1 != argc) usage(); BHMUsers user_list(argv[optind]); struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_sigaction = NULL; sa.sa_handler = SIG_IGN; sa.sa_flags = 0; if(sigaction(SIGPIPE, &sa, NULL)) { printf("Can't block SIGPIPE.\n"); return eSystem; } sa.sa_flags = SA_SIGINFO; sa.sa_handler = &endit; if(sigaction(SIGINT, &sa, NULL)) { printf("Can't handle SIGINT.\n"); return eSystem; } printf("time,messages,data(K),errors,connections" #ifdef USE_SSL ",SSL connections" #endif "\n"); log = new Logit("bhm.log", allLog, false, 0); Logit *debug = NULL; if(debugName) debug = new Logit(debugName, false, debugMultipleFiles, 0); int listen_fd = socket(PF_INET, SOCK_STREAM, 0); struct sockaddr_in in; in.sin_family = AF_INET; in.sin_port = htons(port); memcpy(&in.sin_addr, &sin_addr, sizeof(sin_addr)); if(listen_fd == -1 || bind(listen_fd, (sockaddr *)&in, sizeof(in)) || listen(listen_fd, 10)) { fprintf(stderr, "Can't bind to port.\n"); return 1; } struct pollfd pfd; pfd.fd = listen_fd; pfd.events = POLLIN; pthread_t *thread_info = (pthread_t *)calloc(sizeof(thread_info), maxThreads); thread_status = (int *)calloc(sizeof(int), maxThreads); time_t nextPrint = time(NULL)/60*60+60; while(1) { time_t t = time(NULL); if(t >= nextPrint) { res.print(); nextPrint += 60; } int timeout = (nextPrint - t) * 1000; int rc = poll(&pfd, 1, timeout); if(rc < 0) { if(errno == EINTR) continue; fprintf(stderr, "Poll error on accept.\n"); return 1; } int fd; struct sockaddr_in addr; socklen_t addrlen = sizeof(addr); if(rc == 1) { fd = accept(listen_fd, (sockaddr*)&addr, &addrlen); if(fd == -1) { res.error(); continue; } res.connection(); processes++; int i; for(i = 0; i < maxThreads && thread_status[i] == eUsed; i++) ; if(thread_status[i] == eFinished) { void *value_ptr; pthread_join(thread_info[i], &value_ptr); processes--; } thread_status[i] = eUsed; pthread_attr_t attr; if(pthread_attr_init(&attr) || pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE) || pthread_attr_setstacksize(&attr, 32*1024)) fprintf(stderr, "Can't set thread attributes.\n"); thread_data *td = (thread_data *)malloc(sizeof(thread_data)); td->threadNum = i; td->fd = fd; memcpy(&td->addr, &addr, sizeof(addr)); td->debug = debug ? new Logit(*debug, i) : NULL; #ifdef USE_SSL td->ssl = use_ssl; #endif int p = pthread_create(&thread_info[i], &attr, smtp_worker, PVOID(td)); pthread_attr_destroy(&attr); if(p) { fprintf(stderr, "Can't create a thread.\n"); return 1; if(debug) delete debug; } } } if(debug) delete debug; return 0; } postal-0.75/bhmusers.cpp0000644000000000000000000000146110777267433012213 0ustar #include "bhmusers.h" #include #include #include "expand.h" BHMUsers::BHMUsers(const char *userListFile) { char buf[1024]; FILE *fp = fopen(userListFile, "r"); if(!fp) { printf("Can't open \"%s\".\n", userListFile); exit(1); } while(fgets(buf, sizeof(buf), fp) ) { USER_SMTP_ACTION action = eNone; strtok(buf, "\n"); BHM_DATA data; if(buf[0] && buf[0] != '#') { strtok(buf, " "); char *pass = strtok(NULL, " "); if(pass) { char *type_char = strtok(NULL, " "); if(type_char) action = chrToAction(type_char[0]); } data.action = action; data.sync_time = 0; m_map[buf] = data; } } if(m_map.size() == 0) { printf("No users in file.\n"); exit(1); } fclose(fp); } postal-0.75/bhmusers.h0000644000000000000000000000147712735157365011665 0ustar #ifndef USERLIST_H #define USERLIST_H using namespace std; #include #include "conf.h" #include #include "postal.h" typedef enum { eNone = 0, eDefer, eReject, eBounce, eGrey } USER_SMTP_ACTION; typedef struct { USER_SMTP_ACTION action; int sync_time; } BHM_DATA; typedef std::tr1::unordered_map > NAME_MAP; class BHMUsers { public: BHMUsers(const char *userListFile); ~BHMUsers() {}; private: BHMUsers(BHMUsers &list); NAME_MAP m_map; USER_SMTP_ACTION chrToAction(char c) { switch(c) { case 'd': return eDefer; case 'r': return eReject; case 'b': return eBounce; case 'g': return eGrey; } return eNone; } BHMUsers(const BHMUsers&); BHMUsers & operator=(const BHMUsers&); }; #endif postal-0.75/changes.txt0000777000000000000000000000000011016510362015072 2debian/changelogustar postal-0.75/client.cpp0000644000000000000000000002472013023761052011623 0ustar #include "client.h" #include #include #include #include "userlist.h" #include "logit.h" #include "results.h" #include "mutex.h" class clientResults : public results { public: clientResults(); void imap_connection(); private: virtual void childPrint(); int m_imap_connections; }; clientResults::clientResults() : results() , m_imap_connections(0) { } void clientResults::childPrint() { printf(",%d", m_imap_connections); m_imap_connections = 0; } void clientResults::imap_connection() { Lock l(m_mut); m_connections++; m_imap_connections++; } Thread *client::newThread(int threadNum) { return new client(threadNum, this); } int client::action(PVOID) { bool logAll = false; if(m_log && m_log->verbose()) logAll = true; while(1) { string user, pass; getUser(user, pass); if(CHECK_PERCENT(m_useIMAP)) m_isIMAP = true; else m_isIMAP = false; int rc = Connect(user, pass); if(rc == 0) { int msgs = 0; if(m_msgsPerConnection != 0) msgs = list(); if(m_msgsPerConnection > 0 && msgs > m_msgsPerConnection) msgs = m_msgsPerConnection; if(msgs > 0) { for(int i = 1; i <= msgs && !rc; i++) { if(CHECK_PERCENT(m_downloadPercent)) rc = getMsg(i, user, logAll); } } // if msgs < 0 means we already had a serious error if(!rc && msgs >= 0) { rc = disconnect(); } } if(rc) sleep(10); } return 0; } client::client(int *exitCount, const char *addr, const char *ourAddr , UserList &ul, int processes, int msgsPerConnection, Logit *log #ifdef USE_SSL , int ssl #endif , TRISTATE qmail_pop, int imap, int downloadPercent, int deletePercent , Logit *debug) : tcp(exitCount, addr, 110, log #ifdef USE_SSL , ssl #endif , ourAddr, debug) , m_ul(ul) , m_maxNameLen(ul.maxNameLen() + 1) , m_namesBuf(new char[m_maxNameLen * (processes + 1)]) , m_sem(new Mutex(true) ) , m_res(new clientResults) , m_msgsPerConnection(msgsPerConnection) , m_useIMAP(imap) , m_isIMAP(false) , m_imapID(0) , m_qmail_pop(qmail_pop) , m_downloadPercent(downloadPercent) , m_deletePercent(deletePercent) { go(NULL, processes); } client::client(int threadNum, const client *parent) : tcp(threadNum, parent) , m_ul(parent->m_ul) , m_maxNameLen(parent->m_maxNameLen) , m_namesBuf(parent->m_namesBuf) , m_sem(parent->m_sem) , m_res(parent->m_res) , m_msgsPerConnection(parent->m_msgsPerConnection) , m_useIMAP(parent->m_useIMAP) , m_isIMAP(false) , m_imapID(0) , m_qmail_pop(parent->m_qmail_pop) , m_downloadPercent(parent->m_downloadPercent) , m_deletePercent(parent->m_deletePercent) { } client::~client() { if(getThreadNum() < 1) { delete m_namesBuf; delete m_sem; } } void client::sentData(int) { } void client::receivedData(int bytes) { m_res->dataBytes(bytes); } void client::error() { m_res->error(); tcp::disconnect(); } ERROR_TYPE client::readCommandResp(bool important) { char recvBuf[1024]; int rc; if(m_isIMAP) { do { rc = readLine(recvBuf, sizeof(recvBuf)); if(rc < 0) return ERROR_TYPE(rc); } while(recvBuf[0] == '*'); if(strncmp(recvBuf, m_imapIDtxt, strlen(m_imapIDtxt)) || strncmp(&recvBuf[strlen(m_imapIDtxt)], "OK", 2) ) { if(important) { strtok(recvBuf, "\r\n"); fprintf(stderr, "Server error:%s.\n", recvBuf); error(); } return eServer; } } else { rc = readLine(recvBuf, sizeof(recvBuf)); if(rc < 0) return ERROR_TYPE(rc); if(recvBuf[0] != '+') { if(important) { strtok(recvBuf, "\r\n"); fprintf(stderr, "Server error:%s.\n", recvBuf); error(); } return eServer; } } return eNoError; } int client::Connect(const string &user, const string &pass) { char aByte; int rc = Read(&aByte, 1, 0); if(rc != 1) return eCorrupt; if(m_isIMAP) return connectIMAP(user, pass); return connectPOP(user, pass); } int client::connectPOP(const string &user, const string &pass) { int rc = tcp::Connect(); if(rc) return rc; m_res->connection(); rc = readCommandResp(); if(rc) { fprintf(stderr, "Can't establish connection.\n"); disconnect(); return rc; } // not supporting CAPA is OK. rc = sendCommandString("CAPA\r\n", false); if(rc > 1) return rc; if(rc == 0) // successful { char buf[1024]; // read all lines of the capa field until the ".\r\n" do { rc = readLine(buf, sizeof(buf) - 1); if(rc < 0) return 2; buf[sizeof(buf) - 1] = '\0'; strtok(buf, "\r\n"); #ifdef USE_SSL if(!strcasecmp(buf, "STLS")) m_canTLS = true; #endif } while(strcmp(".", buf)); } string u("user "); u += user; u += "\r\n"; rc = sendCommandString(u); //printf("%s\n", u.c_str()); if(rc) return rc; string p("pass "); p += pass; p += "\r\n"; rc = sendCommandString(p); //printf("%s\n", p.c_str()); if(rc) return rc; return 0; } int client::connectIMAP(const string &user, const string &pass) { m_imapID = 0; int rc = tcp::Connect(143); if(rc) return rc; m_res->connection(); rc = sendCommandString("C CAPABILITY\r\n"); // check for sub-string "STARTTLS" if(rc) return rc; string u("C LOGIN "); u += user + " " + pass; u += "\r\n"; rc = sendCommandString(u); if(rc) return rc; return 0; } int client::disconnect() { int rc; if(m_isIMAP) rc = sendCommandData("C LOGOUT\r\n", 6); else rc = sendCommandData("quit\r\n", 6); if(!rc) rc = tcp::disconnect(); // Comment the next line to make it that if the number of threads equals the // number of accounts then each thread always does the same account. // This makes things easy to debug and has no real down-side, I don't do this // by default because it lightens the load a little on mail servers. memset(&m_namesBuf[getThreadNum() * m_maxNameLen], 0, m_maxNameLen); // NB The sendCommandData will wait for a +OK or -ERR response, in either // case the server is (or should be ;) ready for another connection. return rc; } int client::getMsg(int num, const string &user, bool log) { char command[14]; sprintf(command, "retr %d\r\n", num); int rc; rc = sendCommandData(command, strlen(command)); if(rc) return rc + 1; char buf[1024]; enum STATE { eHeader, eBody, eEnd } state = eHeader; m_md5.init(); bool md5Error = false; string logData; char *from = NULL, *to = NULL, *subject = NULL, *msgid = NULL; char *date = NULL, *postalHash = NULL; while(state != eEnd) { rc = readLine(buf, sizeof(buf)); if(rc < 0) return rc; if(log) logData += string(buf); switch(state) { case eHeader: if(!from && !strncmp(buf, "From: ", 6)) from = strdup(buf); else if(!to && !strncmp(buf, "To: ", 4)) to = strdup(buf); else if(!subject && !strncmp(buf, "Subject: ", 9)) subject = strdup(buf); else if(!date && !strncmp(buf, "Date: ", 6)) date = strdup(buf); else if(!msgid && !strncmp(buf, "Message-Id: ", 12)) msgid = strdup(buf); else if(!postalHash && !strncmp(buf, "X-PostalHash: ", 14)) { postalHash = strdup(buf + 14); char *tmp = strchr(postalHash, '\r'); if(tmp) *tmp = 0; } else if(!strcmp(buf, "\r\n")) { state = eBody; if(from) m_md5.addData(from, strlen(from)); if(to) m_md5.addData(to, strlen(to)); if(subject) m_md5.addData(subject, strlen(subject)); if(date) m_md5.addData(date, strlen(date)); if(msgid) m_md5.addData(msgid, strlen(msgid)); } break; case eBody: if(strcmp(buf, ".\r\n")) { if(postalHash) m_md5.addData(buf, strlen(buf)); } else { state = eEnd; if(postalHash) { string sum(m_md5.getSum()); if(strcmp(sum.c_str(), postalHash)) { if(log || !m_log) { string errStr("MD5 mis-match, calculated:"); errStr += sum + ", expected " + postalHash + "! Account name " + user + "\n"; if(m_log) m_log->Write(errStr); fprintf(stderr, "%s", errStr.c_str()); } md5Error = true; } else { if(m_log) { sum += "\n"; m_log->Write(sum); } } } break; } // end else \r\n break; case eEnd: break; } } if(log) m_log->Write(logData); // if we didn't log this, but we can do logging and there was an error, then // retrieve the message again with logging so we know what went wrong. if(!log && m_log && md5Error) return getMsg(num, user, true); if(md5Error) m_res->error(); if(CHECK_PERCENT(m_deletePercent)) { sprintf(command, "dele %d\r\n", num); rc = sendCommandData(command, strlen(command)); } if(rc) return rc; m_res->message(); return 0; } int client::list() { int rc = sendCommandData("list\r\n", 6); if(rc) return rc; // The number of messages is the number of lines of response -1 because // we get one line of ".\r\n" at the end. int i = -1; char buf[1024]; do { rc = readLine(buf, sizeof(buf)); if(rc < 0) return rc; i++; } while(buf[0] != '.'); return i; } bool client::checkUser(const char *user) { int num = getNumThreads(); if(num == 1) return true; for(int i = 1; i <= num; i++) { if(i != getThreadNum() && !strcmp(user, &m_namesBuf[i * m_maxNameLen])) { return false; } } strcpy(&m_namesBuf[getThreadNum() * m_maxNameLen], user); return true; } void client::getUser(string &user, string &pass) { Lock l(*m_sem); user = m_ul.randomUser(); while(!checkUser(user.c_str()) ) { user = m_ul.sequentialUser(); } pass = m_ul.password(); } int client::pollRead() { return 0; } int client::WriteWork(PVOID buf, int size, int timeout) { return Write(buf, size, timeout); } ERROR_TYPE client::sendCommandString(const string &s, bool important) { if(m_isIMAP) { m_imapID++; sprintf(m_imapIDtxt, "%d ", m_imapID); string command(m_imapIDtxt); command += s; return sendCommandData(command.c_str(), command.size(), important); } return sendCommandData(s.c_str(), s.size(), important); } postal-0.75/client.h0000644000000000000000000000321310536511012011255 0ustar #ifndef CLIENT_H #define CLIENT_H #include #include "tcp.h" class clientResults; class UserList; class Mutex; class client : public tcp { public: client(int *exitCount, const char *addr, const char *ourAddr, UserList &ul , int processes, int msgsPerConnection, Logit *log #ifdef USE_SSL , int ssl #endif , TRISTATE qmail_pop, int imap, int downloadPercent, int deletePercent , Logit *debug); client(int threadNum, const client *parent); virtual ~client(); // Connect returns 0 for connect, 1 for can't connect, and 2 for serious // errors. int Connect(const string &user, const string &pass); virtual int disconnect(); int list(); int getMsg(int num, const string &user, bool log = false); void getUser(string &user, string &pass); private: int connectPOP(const string &user, const string &pass); int connectIMAP(const string &user, const string &pass); virtual int action(PVOID); virtual Thread *newThread(int threadNum); virtual int pollRead(); virtual int WriteWork(PVOID buf, int size, int timeout); virtual ERROR_TYPE readCommandResp(bool important = true); bool checkUser(const char *user); void error(); virtual void sentData(int); virtual void receivedData(int bytes); virtual ERROR_TYPE sendCommandString(const string &s, bool important = true); UserList &m_ul; int m_maxNameLen; char *m_namesBuf; Mutex *m_sem; clientResults *m_res; int m_msgsPerConnection; int m_useIMAP; bool m_isIMAP; int m_imapID; char m_imapIDtxt[9]; TRISTATE m_qmail_pop; int m_downloadPercent, m_deletePercent; client(const client&); client & operator=(const client&); }; #endif postal-0.75/cmd5.cpp0000644000000000000000000000161413023761337011200 0ustar #include "postal.h" #include "cmd5.h" #include Cmd5::Cmd5() { init(); } void Cmd5::init() { #ifdef USE_OPENSSL MD5_Init(&m_context); #else MD5Init(&m_context); #endif } void Cmd5::getSum(char *buf) { #ifdef USE_OPENSSL MD5_Final((unsigned char *)buf, &m_context); #else MD5Final((unsigned char *)buf, &m_context); #endif } // get the sum into a string reference string Cmd5::getSum() { unsigned char output[16]; getSum((char *)output); char str_output[33]; for(int i = 0; i < 16; i++) { sprintf(&str_output[2 * i], "%02x", (int)output[i]); } return str_output; } void Cmd5::addData(const char *buf, size_t bytes) { #ifdef USE_OPENSSL MD5_Update(&m_context, (const unsigned char *)buf, bytes); #else MD5Update(&m_context, (const unsigned char *)buf, bytes); #endif } void Cmd5::addData(const string &buf) { addData((const char *)buf.c_str(), buf.size()); } postal-0.75/cmd5.h0000644000000000000000000000100310551114176010631 0ustar #ifndef CMD5_H #define CMD5_H extern "C" { #ifdef USE_OPENSSL #include #else #include "md5.h" #endif } using namespace std; #include class Cmd5 { public: Cmd5(); void init(); // get the sum as a 16byte buffer void getSum(char *buf); // get the sum into a string reference string getSum(); // add some more data to the data that has been summed. void addData(const char *buf, size_t bytes); void addData(const string &buf); private: MD5_CTX m_context; }; #endif postal-0.75/conf.h0000644000000000000000000000016412735156423010744 0ustar /* conf.h. Generated from conf.h.in by configure. */ #ifndef CONF_H #define CONF_H #define HAVE_VECTOR 1 #endif postal-0.75/conf.h.in0000644000000000000000000000007212735156246011352 0ustar #ifndef CONF_H #define CONF_H #undef HAVE_VECTOR #endif postal-0.75/config.cache0000644000000000000000000000277407503156146012110 0ustar # 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. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # ac_cv_c_const=${ac_cv_c_const=no} ac_cv_header_openssl_crypto_h=${ac_cv_header_openssl_crypto_h=yes} ac_cv_header_stdc=${ac_cv_header_stdc=yes} ac_cv_lib_socket_bind=${ac_cv_lib_socket_bind=no} ac_cv_path_install=${ac_cv_path_install='/usr/bin/install -c'} ac_cv_prog_CC=${ac_cv_prog_CC=gcc} ac_cv_prog_CXX=${ac_cv_prog_CXX=c++} ac_cv_prog_CXXCPP=${ac_cv_prog_CXXCPP='c++ -E'} ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross=no} ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes} ac_cv_prog_cc_works=${ac_cv_prog_cc_works=yes} ac_cv_prog_cxx_cross=${ac_cv_prog_cxx_cross=no} ac_cv_prog_cxx_g=${ac_cv_prog_cxx_g=yes} ac_cv_prog_cxx_works=${ac_cv_prog_cxx_works=yes} ac_cv_prog_gcc=${ac_cv_prog_gcc=yes} ac_cv_prog_gxx=${ac_cv_prog_gxx=yes} ac_cv_type_size_t=${ac_cv_type_size_t=yes} postal-0.75/config.status0000755000000000000000000006664213023761356012376 0ustar #! /bin/sh # Generated by configure. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=${CONFIG_SHELL-/bin/sh} export SHELL ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " # Files that config.status was made for. config_files=" Makefile postal.h port.h postal.spec sun/pkginfo" config_headers=" conf.h" ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to the package provider." ac_cs_config="'--prefix=/home/rjc/src/p/postal-0.75/debian/postal/usr' '--without-openssl'" ac_cs_version="\ config.status configured by ./configure, generated by GNU Autoconf 2.69, with options \"$ac_cs_config\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='/home/rjc/src/p/postal-0.75' srcdir='.' INSTALL='/usr/bin/install -c' test -n "$AWK" || AWK=awk # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi if $ac_cs_recheck; then set X /bin/sh './configure' '--prefix=/home/rjc/src/p/postal-0.75/debian/postal/usr' '--without-openssl' $ac_configure_extra_args --no-create --no-recursion shift $as_echo "running CONFIG_SHELL=/bin/sh $*" >&6 CONFIG_SHELL='/bin/sh' export CONFIG_SHELL exec "$@" fi exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "conf.h") CONFIG_HEADERS="$CONFIG_HEADERS conf.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "postal.h") CONFIG_FILES="$CONFIG_FILES postal.h" ;; "port.h") CONFIG_FILES="$CONFIG_FILES port.h" ;; "postal.spec") CONFIG_FILES="$CONFIG_FILES postal.spec" ;; "sun/pkginfo") CONFIG_FILES="$CONFIG_FILES sun/pkginfo" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && cat >>"$ac_tmp/subs1.awk" <<\_ACAWK && S["LTLIBOBJS"]="" S["LIBOBJS"]="" S["socklen_t"]="" S["large_file"]="" S["crypt_ldflags"]=" -lpthread -lgnutls" S["linux_pthread"]="#define LINUX_PTHREAD" S["extra_objs"]="md5.o" S["openssl"]="" S["gnutls"]="#define USE_GNUTLS" S["extra_ldflags"]=" -lpthread" S["snprintf"]="" S["true_false"]="0" S["bool"]="" S["semun"]="" S["EGREP"]="/bin/grep -E" S["GREP"]="/bin/grep" S["INSTALL_DATA"]="${INSTALL} -m 644" S["INSTALL_SCRIPT"]="${INSTALL}" S["INSTALL_PROGRAM"]="${INSTALL}" S["CXXCPP"]="g++ -E" S["ac_ct_CXX"]="g++" S["CXXFLAGS"]="-g -O2" S["CXX"]="g++" S["OBJEXT"]="o" S["EXEEXT"]="" S["ac_ct_CC"]="gcc" S["CPPFLAGS"]="" S["LDFLAGS"]="-lpthread" S["CFLAGS"]="-g -O2" S["CC"]="gcc" S["version"]="0.75" S["target_alias"]="" S["host_alias"]="" S["build_alias"]="" S["LIBS"]="" S["ECHO_T"]="" S["ECHO_N"]="-n" S["ECHO_C"]="" S["DEFS"]="-DHAVE_CONFIG_H" S["mandir"]="${datarootdir}/man" S["localedir"]="${datarootdir}/locale" S["libdir"]="${exec_prefix}/lib" S["psdir"]="${docdir}" S["pdfdir"]="${docdir}" S["dvidir"]="${docdir}" S["htmldir"]="${docdir}" S["infodir"]="${datarootdir}/info" S["docdir"]="${datarootdir}/doc/${PACKAGE}" S["oldincludedir"]="/usr/include" S["includedir"]="${prefix}/include" S["runstatedir"]="${localstatedir}/run" S["localstatedir"]="${prefix}/var" S["sharedstatedir"]="${prefix}/com" S["sysconfdir"]="${prefix}/etc" S["datadir"]="${datarootdir}" S["datarootdir"]="${prefix}/share" S["libexecdir"]="${exec_prefix}/libexec" S["sbindir"]="${exec_prefix}/sbin" S["bindir"]="${exec_prefix}/bin" S["program_transform_name"]="s,x,x," S["prefix"]="/home/rjc/src/p/postal-0.75/debian/postal/usr" S["exec_prefix"]="${prefix}" S["PACKAGE_URL"]="" S["PACKAGE_BUGREPORT"]="" S["PACKAGE_STRING"]="" S["PACKAGE_VERSION"]="" S["PACKAGE_TARNAME"]="" S["PACKAGE_NAME"]="" S["PATH_SEPARATOR"]=":" S["SHELL"]="/bin/sh" _ACAWK cat >>"$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { D["PACKAGE_NAME"]=" \"\"" D["PACKAGE_TARNAME"]=" \"\"" D["PACKAGE_VERSION"]=" \"\"" D["PACKAGE_STRING"]=" \"\"" D["PACKAGE_BUGREPORT"]=" \"\"" D["PACKAGE_URL"]=" \"\"" D["STDC_HEADERS"]=" 1" D["HAVE_SYS_TYPES_H"]=" 1" D["HAVE_SYS_STAT_H"]=" 1" D["HAVE_STDLIB_H"]=" 1" D["HAVE_STRING_H"]=" 1" D["HAVE_MEMORY_H"]=" 1" D["HAVE_STRINGS_H"]=" 1" D["HAVE_INTTYPES_H"]=" 1" D["HAVE_STDINT_H"]=" 1" D["HAVE_UNISTD_H"]=" 1" D["HAVE_VECTOR"]=" 1" for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\t (]|$)/ { line = $ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} ac_datarootdir_hack=' s&@datadir@&${datarootdir}&g s&@docdir@&${datarootdir}/doc/${PACKAGE}&g s&@infodir@&${datarootdir}/info&g s&@localedir@&${datarootdir}/locale&g s&@mandir@&${datarootdir}/man&g s&\${datarootdir}&${prefix}/share&g' ;; esac ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// } :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 postal-0.75/configure0000755000000000000000000045603513023761356011567 0ustar #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="postal.cpp" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS socklen_t large_file crypt_ldflags linux_pthread extra_objs openssl gnutls extra_ldflags snprintf true_false bool semun EGREP GREP INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM CXXCPP ac_ct_CXX CXXFLAGS CXX OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC version target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_openssl enable_gnutls with_extra_libs ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CXXCPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-openssl disables openssl support --disable-gnutls disables gnutls support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-extra-libs=DIR adds non standard library paths Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES # --------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_cxx_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_type # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_cxx_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_compile # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers conf.h" version="0.75" # Check whether --enable-openssl was given. if test "${enable_openssl+set}" = set; then : enableval=$enable_openssl; DISABLEOPENSSL=$opensslval else DISABLEOPENSSL=no fi # Check whether --enable-gnutls was given. if test "${enable_gnutls+set}" = set; then : enableval=$enable_gnutls; DISABLEGNUTLS=$gnutlsval else DISABLEGNUTLS=no fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # 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" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /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 for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #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)) return 2; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { union semun sem; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : semun="yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if [ -n "$semun" ]; then semun="#define SEMUN_IN_SEM_H" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { bool var; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else bool="typedef bool char;" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { char c = true; char d = false; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : true_false="0" else true_false="1" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char buf[10]; snprintf(buf, sizeof(buf), "abc"); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : else snprintf="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext; if [ -n "$snprintf" ]; then snprintf="#define NO_SNPRINTF" fi extra_ldflags= # Check whether --with-extra-libs was given. if test "${with_extra_libs+set}" = set; then : withval=$with_extra_libs; use_extra_libs=$withval else use_extra_libs=NONE fi if test -n "$use_extra_libs" && \ test "$use_extra_libs" != "NONE"; then ac_save_ifs=$IFS IFS=':' for dir in $use_extra_libs; do extra_ldflags="$extra_ldflags -L$dir" done IFS=$ac_save_ifs fi extra_ldflags=`/usr/bin/uname -a | grep -q SunOS && echo -lrt` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bind in -lsocket" >&5 $as_echo_n "checking for bind in -lsocket... " >&6; } if ${ac_cv_lib_socket_bind+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bind (); int main () { return bind (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_socket_bind=yes else ac_cv_lib_socket_bind=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_bind" >&5 $as_echo "$ac_cv_lib_socket_bind" >&6; } if test "x$ac_cv_lib_socket_bind" = xyes; then : extra_ldflags="$extra_ldflags -lsocket -lnsl" fi if [ "$DISABLEGNUTLS" = "no" ]; then ac_fn_cxx_check_header_mongrel "$LINENO" "gnutls/gnutls.h" "ac_cv_header_gnutls_gnutls_h" "$ac_includes_default" if test "x$ac_cv_header_gnutls_gnutls_h" = xyes; then : GNUTLS=yes else GNUTLS=no fi else GNUTLS=no fi if [ "$GNUTLS" = "yes" ]; then DISABLEOPENSSL=yes fi if [ "$DISABLEOPENSSL" = "no" ]; then ac_fn_cxx_check_header_mongrel "$LINENO" "openssl/crypto.h" "ac_cv_header_openssl_crypto_h" "$ac_includes_default" if test "x$ac_cv_header_openssl_crypto_h" = xyes; then : OPENSSL=yes else OPENSSL=no fi else OPENSSL=no fi if [ "$OPENSSL" = "no" ]; then extra_objs="md5.o" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _GNU_SOURCE #include int main () { pthread_mutexattr_t attr; pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : linux_pthread="yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if [ -n "$linux_pthread" ]; then linux_pthread="#define LINUX_PTHREAD" fi LDFLAGS=-lpthread cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void * thread_func(void * param) { return NULL; } int main () { pthread_t thread_info; pthread_attr_t attr; pthread_create(&thread_info, &attr, &thread_func, NULL); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : extra_ldflags="$extra_ldflags -lpthread" else extra_ldflags="$extra_ldflags -pthread" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext crypt_ldflags="$extra_ldflags" if [ "$GNUTLS" = "no" ]; then gnutls="" else gnutls="#define USE_GNUTLS" crypt_ldflags="$extra_ldflags -lgnutls" fi if [ "$OPENSSL" = "no" ]; then openssl="" else openssl="#define USE_OPENSSL" crypt_ldflags="$extra_ldflags -lssl -lcrypto" fi large_file="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { socklen_t * namelen; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else no_socklen_t="true" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if [ -n "$no_socklen_t" ]; then socklen_t="#define socklen_t int" fi for ac_header in vector do : ac_fn_cxx_check_header_mongrel "$LINENO" "vector" "ac_cv_header_vector" "$ac_includes_default" if test "x$ac_cv_header_vector" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VECTOR 1 _ACEOF fi done ac_config_files="$ac_config_files Makefile postal.h port.h postal.spec sun/pkginfo" cat >confcache <<\_ACEOF # 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, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "conf.h") CONFIG_HEADERS="$CONFIG_HEADERS conf.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "postal.h") CONFIG_FILES="$CONFIG_FILES postal.h" ;; "port.h") CONFIG_FILES="$CONFIG_FILES port.h" ;; "postal.spec") CONFIG_FILES="$CONFIG_FILES postal.spec" ;; "sun/pkginfo") CONFIG_FILES="$CONFIG_FILES sun/pkginfo" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi postal-0.75/configure.in0000644000000000000000000000656413023761356012167 0ustar dnl Process this file with autoconf to produce a configure script. AC_INIT(postal.cpp) AC_CONFIG_HEADER(conf.h) AC_SUBST(version) version="0.75" AC_ARG_ENABLE(openssl, [ --disable-openssl disables openssl support], DISABLEOPENSSL=$opensslval, DISABLEOPENSSL=no) AC_ARG_ENABLE(gnutls, [ --disable-gnutls disables gnutls support], DISABLEGNUTLS=$gnutlsval, DISABLEGNUTLS=no) dnl Checks for programs. AC_LANG_CPLUSPLUS AC_PROG_CC AC_PROG_CXX AC_PROG_CXXCPP AC_PROG_INSTALL dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_SUBST(semun) AC_TRY_COMPILE(#include #include #include , union semun sem; , semun="yes") if [[ -n "$semun" ]]; then semun="#define SEMUN_IN_SEM_H" fi AC_SUBST(bool) AC_TRY_COMPILE([], [bool var;] , , bool="typedef bool char;") AC_SUBST(true_false) AC_TRY_COMPILE(, [char c = true; char d = false; ] , true_false="0", true_false="1") AC_SUBST(snprintf) AC_TRY_LINK([#include ], char buf[[10]]; snprintf(buf, sizeof(buf), "abc");,,snprintf="no"); if [[ -n "$snprintf" ]]; then snprintf="#define NO_SNPRINTF" fi AC_SUBST(extra_ldflags) extra_ldflags= AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths], use_extra_libs=$withval, use_extra_libs=NONE ) if test -n "$use_extra_libs" && \ test "$use_extra_libs" != "NONE"; then ac_save_ifs=$IFS IFS=':' for dir in $use_extra_libs; do extra_ldflags="$extra_ldflags -L$dir" done IFS=$ac_save_ifs fi extra_ldflags=`/usr/bin/uname -a | grep -q SunOS && echo -lrt` dnl Checks for library -l socket. AC_CHECK_LIB(socket, bind, extra_ldflags="$extra_ldflags -lsocket -lnsl") dnl Checks for header files. AC_SUBST(gnutls) AC_SUBST(openssl) AC_SUBST(extra_objs) if [[ "$DISABLEGNUTLS" = "no" ]]; then AC_CHECK_HEADER(gnutls/gnutls.h, GNUTLS=yes, GNUTLS=no) else GNUTLS=no fi if [[ "$GNUTLS" = "yes" ]]; then DISABLEOPENSSL=yes fi if [[ "$DISABLEOPENSSL" = "no" ]]; then AC_CHECK_HEADER(openssl/crypto.h, OPENSSL=yes, OPENSSL=no) else OPENSSL=no fi if [[ "$OPENSSL" = "no" ]]; then extra_objs="md5.o" fi AC_SUBST(linux_pthread) AC_TRY_COMPILE([#define _GNU_SOURCE #include ] , [pthread_mutexattr_t attr; pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);] , linux_pthread="yes") if [[ -n "$linux_pthread" ]]; then linux_pthread="#define LINUX_PTHREAD" fi LDFLAGS=-lpthread AC_TRY_LINK([#include void * thread_func(void * param) { return NULL; } ] , [pthread_t thread_info; pthread_attr_t attr; pthread_create(&thread_info, &attr, &thread_func, NULL);] , extra_ldflags="$extra_ldflags -lpthread" , extra_ldflags="$extra_ldflags -pthread") AC_SUBST(crypt_ldflags) crypt_ldflags="$extra_ldflags" if [[ "$GNUTLS" = "no" ]]; then gnutls="" else gnutls="#define USE_GNUTLS" crypt_ldflags="$extra_ldflags -lgnutls" fi if [[ "$OPENSSL" = "no" ]]; then openssl="" else openssl="#define USE_OPENSSL" crypt_ldflags="$extra_ldflags -lssl -lcrypto" fi AC_SUBST(large_file) large_file="" AC_SUBST(socklen_t) AC_TRY_COMPILE([#include #include ] , [socklen_t * namelen;], , no_socklen_t="true") if [[ -n "$no_socklen_t" ]]; then socklen_t="#define socklen_t int" fi AC_CHECK_HEADERS(vector) dnl Checks for library functions. AC_OUTPUT(Makefile postal.h port.h postal.spec sun/pkginfo) postal-0.75/credits.txt0000644000000000000000000000033107205765255012045 0ustar Brian A. May Sponsored the Debianization of this and other programs I am writing. Brian Candler for solving some of the *BSD portability issues and contributing code. postal-0.75/debian/0000755000000000000000000000000013023761356011065 5ustar postal-0.75/debian/changelog0000644000000000000000000003665113023761356012752 0ustar postal (0.75) unstable; urgency=medium * Fix some compiler warnings. * Stop autoconf controlling stripping. Closes: #437782 -- Russell Coker Tue, 13 Dec 2016 23:00:46 +1100 postal (0.74) unstable; urgency=medium * Add -b option to bind to an address to bhm * Add changes from NMU and use Debhelper compat level 9. * Fix buffer underrun. Closes: #784704 * Made it build with GCC-6. Closes: #811884 -- Russell Coker Thu, 30 Jun 2016 18:07:19 +1000 postal (0.73+nmu1) unstable; urgency=medium * Non-maintainer upload. * Do not #include when unnecessary. * Stop linking against libgcrypt. * Build against GnuTLS v3. Closes: #638654 -- Andreas Metzler Mon, 18 Aug 2014 19:25:50 +0200 postal (0.73) unstable; urgency=low * Make postal correctly issue the quit command after delivery failure. * Fixed a bunch of valgrind errors. * Fixed a nasty bug with tab separated fields. -- Russell Coker Tue, 17 Jan 2012 07:48:14 +1100 postal (0.72) unstable; urgency=low * Make LMTP work. * Accept a tab as a field delimiter for the user-list file. -- Russell Coker Sat, 14 Jan 2012 19:27:21 +1100 postal (0.71) unstable; urgency=low * Made rabid get the password right when -u is used. Thanks to Lars Nordin for the patch. * Made rabid correctly check for the '.' at the end of the results of the list command. * Made all the programs correctly handle a userlist that has empty lines. * Use the -lgcrypt option when using gcrypt. * Only call gcry_control() if GNUTLS_VERSION_NUMBER <= 0x020b00 * Ignore blank lines in user list. * Add subject, date, and msgid to the md5sum in the client. Closes: #611907 * Stop using gnutls_kx_set_priority() Closes: #624038 * Added a patch from Michael Brown to make an RPM build on RHEL5 (and probably other RPM systems). * Added a patch from Brad Hards to fix typos in the man page. * Rewrote a lot of the md5 checking code, now the md5 hash is stored in a header. It should work now. -- Russell Coker Mon, 02 Jan 2012 17:08:50 +1100 postal (0.70) unstable; urgency=low * Made it build correctly when no SSL support is configured. Also tidy up the documentation. -- Russell Coker Mon, 26 May 2008 19:33:48 +1000 postal (0.69) unstable; urgency=low * Really fix the GCC 4.3 issues. The main change was to remove the OS/2 and Win32 support (which probably didn't work anyway). The previous version actually fixed GCC 4.2 issues. I don't plan to fix the ext/hash_map issue yet, it doesn't stop anything from working and I'm afraid of breaking things for the majority of systems which use older headers. Thanks to Bradley Smith and Chris Lamb for sending a patch. Closes: #474831 Thanks to Martin Michlmayr for sending a patch. Closes: #417480 -- Russell Coker Sat, 19 Apr 2008 08:07:00 +1000 postal (0.68) unstable; urgency=low * Added $(DESTDIR) support to the Makefile and -lrt for nanosleep() on OpenSolaris (the OpenSolaris code is not tested). * Fixed a minor compilation bug when not using GNUTLS. Thanks Frank Fegert . * Made it not use C++ warning flags on C compilation. * Updated it to the latest Debian standards for Lenny and compile with GCC 4.3. Closes: #474831 -- Russell Coker Wed, 9 Apr 2008 11:16:00 +1000 postal (0.67-0.1) unstable; urgency=medium * Non-maintainer upload. * Fix FTBFS with gcc-4.3. Thanks to MArtin Michlmayr. Closes: #417480 -- Andreas Barth Sun, 16 Mar 2008 23:48:44 +0000 postal (0.67) unstable; urgency=low * Changed license to GPLv3. -- Russell Coker Mon, 2 Jul 2007 20:12:00 +1000 postal (0.66) unstable; urgency=low * Added MessageId to Postal. * Added "make dep". * Made GNUTLS work in bhm. -- Russell Coker Fri, 2 Mar 2007 18:44:00 +1100 postal (0.65) unstable; urgency=low * Added new program bhm to listen on port 25 and send mail to /dev/null. This allows testing mail relay systems. * Fixed a minor bug in reporting when compiled without SSL. * Made postal write the date header in correct RFC2822 format. * Removed the name-expansion feature, it confused many people and is not needed now that desktop machines typically have 1G of RAM. Now postal and rabid can have the same user-list file. * Moved postal-list into the bin directory. * Changed the thread stack size to 32K (used to be the default of 10M) to save virtual memory size (not that this makes much difference to anything other than the maximum number of threads on i386). * Added a minimum message size option to Postal. * Added a Postal option to specify a list of sender addresses separately to the list of recipient addresses. * Removed some unnecessary error messages. * Handle EINTR to allow ^Z and "bg" from the command line. I probably don't handle all cases, but now that I agree that failure to handle ^Z is an error I expect bug reports. * Made the test programs display output on the minute, previously they displayed once per minute (EG 11:10:35) while now it will be 11:10:00. This also means that the first minute reported will have something less than 60 seconds of data - this does not matter as a mail server takes longer than that to get up to speed. * Added support for GNUTLS and made the Debian package build with it. Note that BHM doesn't yet work correctly with TLS. * Made the programs exit cleanly. -- Russell Coker Thu, 18 Jan 2007 08:14:00 +1100 postal (0.62.1) unstable; urgency=low * NMU * Build-Depend: libssl-dev, not libssl096-dev. Closes: #176956 -- LaMont Jones Sun, 25 May 2003 21:33:07 -0600 postal (0.62) unstable; urgency=high * Added an INSTALL document. * Made it compile with GCC 3.2. -- Russell Coker Tue, 14 Jan 2003 13:28:00 +0100 postal (0.61-1) unstable; urgency=high * Changed the section to main. -- Russell Coker Sun, 16 Jun 2002 23:17:00 +0200 postal (0.61) unstable; urgency=high * Fixed the makefile to not use "-d" or "-p" options to $(INSTALL). * Changed connect() functions to Connect() because of some problems with Solaris. * Removed the optind=0 which caused problems on BSD. -- Russell Coker Sun, 16 Jun 2002 21:16:00 +0200 postal (0.60) unstable; urgency=high * Added #include to mutex.cpp to make exit() be resolved correctly. * Fixed the delete percentage code for rabid. The option "-d100:0" will mean that no messages get deleted. * Added a new version of the thread code from Bonnie++, fixes a few bugs. * Made the configure.in more like that from Bonnie++. * Added new debugging code to log to disk all network IO. * Made IMAP default to port 143, not that it matters much as IMAP is still broken. * Tidied up some of the error handling code. * Changed the threading code to monitor when threads exit so solve some exit time crashes. * Changed the header files to work with GCC 3.0. Closes: #99859, #104965 -- Russell Coker Sun, 9 Sep 2001 00:41:20 +0200 postal (0.59) unstable; urgency=high * Closes: #86932 Fixed the Build-Depends. * Added stdlib.h to mutex.cpp to make it compile on all systems. * Added rule "install-bin" to the makefile to install binaries without man pages, "make install" will install everything. * Removed the code to disable compiling with user-name conversion. It should compile on all systems now! -- Russell Coker Mon, 6 Mar 2001 20:59:39 +0100 postal (0.58) unstable; urgency=high * Closes:#79647 Now removes the md5.o file on "make clean" regardless if it'll be generated by a compile. * Puts the version in Autoconf. * Now with new thread class with Win32 and OS/2 portability. * Added RPM .spec file. * Closes:#63973 Was closed before but BTS didn't recognise it. * Closes:#71184 Was closed before but BTS didn't recognise it. * Closes:#71913 Was closed before but BTS didn't recognise it. -- Russell Coker Mon, 19 Feb 2001 23:47:23 +0100 postal (0.57) unstable; urgency=high * Added extra compiler checks and fixed many trivial bugs. * Fixed some *BSD portability problems, should work on *BSD now. -- Russell Coker Thu, 7 Dec 2000 06:58:38 +0100 postal (0.56) unstable; urgency=high * Fixed a bug in client.cpp that stopped compiling without SSL. * Closes:#71913 Added build-depends on libssl095a-dev. * Changed the autoconf support for checking for C++ slightly. It should now work better for some strange setups and work the same for everyone else (I hope). * Added --disable-stripping option for ./configure if you don't want binaries stripped. * Added --disable-ssl option for ./configure if you don't want to compile with SSL. * Added Solaris package manager support. -- Russell Coker Sun, 8 Oct 2000 14:21:54 +0100 postal (0.55) unstable; urgency=low * Closes:#71184 Now in "non-US" instead of "non-us". * Stopped rabid breaking on POP servers that support "CAPA" and added check for STLS in CAPA output. * Added better autoconf support for Solaris, now checks for link flags and uses int for the size of sockaddr_in instead of socklen_t on Linux or size_t (which the stupid Solaris documentation recommends). * Made rabid support not downloading all messages and not deleting all messages it downloads. * Added the following option to ./configure: --with-extra-libs=DIR adds non standard library paths * Added Build-Depends (NOT FINISHED). * Fixed a warning about an unused variable for Mutex class on non-Linux. -- Russell Coker Sat, 9 Sep 2000 10:00:52 +0100 postal (0.54) unstable; urgency=low * Fixed the locking so that Rabid won't access the same account from two threads at the same time. This fixes a variety of error conditions that a POP server can return. Also the old buggy code may have caused Postal to crash in some situations. * Renamed class Fork to Thread. * Added extra gcc warning options and fixed some suspect code. * Added ./configure option --disable-conversion, it removes the user-name expansion facility and allows compilation on Slackware and BSD machines with broken regex headers. -- Russell Coker Tue, 1 Aug 2000 10:46:00 +0100 postal (0.53) unstable; urgency=low * Removed all utsname() code, so the hostname/domainname kernel values are not used any more at all! Now do gethostbyaddr() to get the name of the local end of the connection for EHLO. Closes: #63973 -- Russell Coker Sun, 23 Jul 2000 17:42:48 +0100 postal (0.52) unstable; urgency=low * Changed section to non-us/utils. * Added autoconf support for easier portability. Should be almost portable to Solaris now. ;) -- Russell Coker Sun, 23 Apr 2000 22:14:48 +0100 postal (0.51) unstable; urgency=low * Added support for compiling without SSL. * Some hacky support for porting to Solaris. -- Russell Coker Thu, 20 Apr 2000 17:28:41 +0100 postal (0.50) unstable; urgency=low * Added SSL support. -- Russell Coker Thu, 09 Mar 2000 18:35:59 +0100 postal (0.45) unstable; urgency=low * Use the OpenSSL code for MD5. * Use more warnings in GCC and change the code not to trigger them. * Pthreads code now can track return values (not using them yet though). * Create threads detached. * Made some error messages clearer. * Added check for blank at end of POP message. * Don't crash for really high rate limits. -- Russell Coker Thu, 09 Mar 2000 18:35:59 +0100 postal (0.40) unstable; urgency=low * Changed from fork() to pthreads. This will allow easier portability with OS/2 and NT and also should make it a bit faster. * Added support for just connecting and quiting without doing anything, good for testing a LocalDirector. * Added flag for broken Netscape mail server. -- Russell Coker Fri, 25 Feb 2000 11:41:05 +0100 postal (0.30) unstable; urgency=low * Now use getopt() for options processing. All command-line parameters are now changed. * Changed man pages to section 8 and moved binaries to /usr/sbin, this is a sys-admin type program. * Added support for specifying which local IP address to use. Also added support for specifying multiple servers (for round-robin without DNS configured). -- Russell Coker Sun, 20 Feb 2000 00:19:03 +0100 postal (0.25) unstable; urgency=low * Cleaned up some of the error message code. * Fixed a race condition and a buffer overrun in the locking code which prevents multiple processes from accessing the same account. I'm surprised that the previous version appeared to work properly. * Added rate limiting code to Postal (msgs per minute) and Rabid (connections per minute). * Added support for DNS lookups on every connection (for round-robin DNS). -- Russell Coker Sun, 13 Feb 2000 20:10:37 +0100 postal (0.20) unstable; urgency=low * Postal now supports sending multiple messages per connection. * Postal now sends "EHLO" and supports multi-line responses. * For Postal you now specify the maximum message size not the average. * Hostname format now supports a preceeding '+' to specify round-robin DNS (IE a DNS lookup before every connection). * Hostname format now can be a name or IP address inside square brackets followed by a port number (for non-default port). * DNS lookup code is now in tcp.{c,h} as it should be. * Rabid now sends "\r\n" at the end of each line (used to send "\n"). -- Russell Coker Thu, 10 Feb 2000 21:22:38 +0100 postal (0.15) unstable; urgency=low * Fixed the headers bug. * Debugged Rabid, it seems to work perfectly now. ;) * Postal now adds an md5 checksum to all messages it sends. * Rabid now checks the md5 checksum's on messages it receives that have an X-Postal header field. It displays an error message on a mis-match. -- Russell Coker Mon, 7 Feb 2000 16:55:00 +0100 postal (0.10) unstable; urgency=low * Made the stats report more accurately and faster. * Added "Rabid" the POP benchmark (still needs some debugging). * Made the code more object oriented and portable. * Added the postal-list program to list all the possible ways of expanding names. -- Russell Coker Fri, 4 Feb 2000 22:02:38 +0100 postal (0.06) unstable; urgency=low * Made it use much less CPU time. -- Russell Coker Sat, 22 Jan 2000 17:06:51 +0100 postal (0.05) unstable; urgency=low * Fixed some minor bugs and added some portability code. -- Russell Coker Thu, 12 Jan 2000 21:52:50 +1100 postal (0.01) unstable; urgency=low * Initial Release. * Sponsored by Brian May -- Russell Coker Thu, 30 Dec 1999 01:22:45 +0100 Local variables: mode: debian-changelog End: postal-0.75/debian/compat0000644000000000000000000000000212735151311012254 0ustar 9 postal-0.75/debian/control0000644000000000000000000000101312735151342012460 0ustar Source: postal Build-Depends: debhelper (>= 9), libgnutls28-dev Section: utils Priority: optional Maintainer: Russell Coker Standards-Version: 3.0.1 Package: postal Architecture: any Depends: ${shlibs:Depends} Description: SMTP benchmark - the mad postman. This program starts a specified number of processes to send as much random data to random accounts as possible. . Adds the X-Postal header to email it sends, so if someone uses it unethically then it will be easy to filter via procmail. postal-0.75/debian/copyright0000644000000000000000000000042410642147567013026 0ustar This package was debianized by Russell Coker russell@coker.com.au on Mon, 29 Nov 1999 18:03:12 +0100. It was downloaded from http://www.coker.com.au/postal/ Upstream Author(s): Russell Coker Copyright: GPL 3.0 See /usr/share/common-licenses/GPL*3* postal-0.75/debian/dirs0000644000000000000000000000001107053547447011752 0ustar usr/sbin postal-0.75/debian/docs0000644000000000000000000000000007022713253011721 0ustar postal-0.75/debian/rules0000755000000000000000000000242713023760234012144 0ustar #!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 build: build-stamp build-stamp: dh_testdir # Add here commands to compile the package. ./configure --prefix=`pwd`/debian/postal/usr --without-openssl $(MAKE) touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp # Add here commands to clean up after the build process. -$(MAKE) clean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/postal $(MAKE) install-bin # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install # dh_testversion dh_testdir dh_testroot # dh_installdebconf dh_installdocs dh_installexamples dh_installmenu # dh_installemacsen # dh_installpam # dh_installinit dh_installcron dh_installman *.8 *.1 # dh_undocumented dh_installchangelogs dh_strip dh_compress dh_fixperms # dh_makeshlibs dh_installdeb # dh_perl dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install postal-0.75/ex-test.cpp0000644000000000000000000000114707046635333011746 0ustar #include "expand.h" #include #include void usage() { printf("Usage: ex-test input-file conversion-file\n"); exit(1); } int main(int argc, char **argv) { if(argc != 3) usage(); NameExpand exp(argv[2]); FILE *fp = fopen(argv[1], "r"); if(!fp) usage(); char buf[1024]; while(fgets(buf, sizeof(buf), fp) ) { if(buf[0] && buf[0] != '\n') { strtok(buf, "\n"); for(int i = 0; i < 1000; i++) { string str; if(exp.expand(str, buf)) return 1; printf("%s\n", str.c_str()); } } } fclose(fp); return 0; } postal-0.75/expand.cpp0000644000000000000000000001245510777267676011660 0ustar #include "expand.h" // for strdup() and strtok() #include // for random() #include #include typedef char * PCHAR; NamePattern::NamePattern(const char *match, const char *replace) : m_match(strdup(match)) , m_replace(strdup(replace)) , m_conv_len(strlen(m_replace)) , m_convert(new PCHAR[m_conv_len]) , m_conv_item_len(new int[m_conv_len]) , m_next_value(new int[m_conv_len]) , m_no_seq(false) , m_next(NULL) { regcomp(&m_match_regex, m_match, REG_NOSUB); int i; for(i = 0; i < m_conv_len; i++) m_next_value[i] = 0; int pos = 0; bool paren = false; bool escape = false; bool hyphen = false; char buf[1024]; int buf_pos = 0; for(i = 0; replace[i]; i++) { switch(replace[i]) { case '.': if(!paren) { m_convert[pos] = NULL; m_conv_item_len[pos] = 0; pos++; } else { buf[buf_pos] = '.'; buf_pos++; } break; case '[': if(paren) { if(!escape) { printf("Unmatched brackets in \"%s\".\n", replace); exit(1); } else { buf[buf_pos] = '['; buf_pos++; } } else { paren = true; } break; case ']': if(!paren) { printf("Unmatched brackets in \"%s\".\n", replace); exit(1); } if(!escape) { if(hyphen) { printf("Unfinished hyphen in \"%s\".\n", replace); exit(1); } buf[buf_pos] = '\0'; m_convert[pos] = strdup(buf); m_conv_item_len[pos] = strlen(m_convert[pos]); pos++; buf_pos = 0; paren = false; break; } // if escape then fall-through case '-': if(!paren) { printf("Misplaced hyphen in \"%s\".\n", replace); exit(1); } hyphen = true; break; default: if(paren) { if(!hyphen) { buf[buf_pos] = replace[i]; buf_pos++; if(buf_pos == sizeof(buf)) { printf("Out of buffer space for \"%s\".\n", replace); exit(1); } } else { for(char c = buf[buf_pos - 1] + 1; c <= replace[i] && c < 127; c++) { buf[buf_pos] = c; buf_pos++; if(buf_pos == sizeof(buf)) { printf("Out of buffer space for \"%s\".\n", replace); exit(1); } } hyphen = false; } } else { printf("Can't parse replace string \"%s\".\n", replace); exit(1); } } // end switch } // end for m_conv_len = pos; } NamePattern::~NamePattern() { for(int i = 0; i < m_conv_len; i++) delete m_convert[i]; delete m_convert; delete m_conv_item_len; delete m_next_value; regfree(&m_match_regex); delete m_match; delete m_replace; } int NamePattern::expand(string &output, const string &input, bool sequential) { int i; if(sequential && m_no_seq) { for(i = 0; i < m_conv_len; i++) m_next_value[i] = 0; m_no_seq = false; return 1; } if(regexec(&m_match_regex, input.c_str(), 0, NULL, 0)) { if(m_next) return m_next->expand(output, input, sequential); else return 1; } output = input; for(i = 0; i < m_conv_len; i++) { if(m_convert[i]) { if(!sequential) { output[i] = m_convert[i][random()%m_conv_item_len[i]]; } else { output[i] = m_convert[i][m_next_value[i]]; } } } if(sequential) { for(i = m_conv_len - 1; i >= 0; i--) { if(m_convert[i]) { m_next_value[i]++; if(m_next_value[i] >= m_conv_item_len[i]) m_next_value[i] = 0; else return 0; } } m_no_seq = true; } return 0; } NameExpand::NameExpand(const char *filename) : m_no_seq(true) , m_names(NULL) { if(!filename || strcmp(filename, "-") == 0) { return; } FILE *fp = fopen(filename, "r"); if(!fp) { printf("Can't open config file \"%s\". Doing no expansion.\n", filename); return; } char match[1024]; NamePattern *np = NULL, *old_np = NULL; while(fgets(match, sizeof(match), fp)) { match[sizeof(match) - 1] = '\0'; strtok(match, "\n"); unsigned int i; int blank_pos = -1; for(i = 0; match[i]; i++) { if(match[i] == ' ') { if(blank_pos != -1) { printf("Can't parse pattern line \"%s\".\n", match); exit(1); } blank_pos = i; } } if(blank_pos == -1) { printf("Can't parse pattern line \"%s\".\n", match); exit(1); } char *replace = &match[blank_pos + 1]; match[blank_pos] = '\0'; np = new NamePattern(match, replace); if(!m_names) m_names = np; if(old_np) old_np->AddNext(np); old_np = np; } fclose(fp); } int NameExpand::expand(string &output, const string &input, bool sequential) { if(!m_names) { if(sequential) { if(m_no_seq) { m_no_seq = false; return 1; } else { output = input; m_no_seq = true; return 0; } } output = input; return 1; } return m_names->expand(output, input, sequential); } postal-0.75/expand.h0000644000000000000000000000543607266777627011327 0ustar #ifndef EXPAND_H #define EXPAND_H using namespace std; #include #include #include class NamePattern; // This class stores a set of patterns to match and the replacement data for // each pattern. class NameExpand { public: // Read the file with the specified name and parse it as a list of // expansions to perform. NameExpand(const char *filename); // expand the input to a random output based on our replacement patterns. int expand(string &output, const string &input, bool sequential = false); private: // past the end of the sequence bool m_no_seq; NamePattern *m_names; NameExpand(const NameExpand&); NameExpand & operator=(const NameExpand&); }; // This class stores a pattern to match and the replacement data. // It also can have a pointer to another NamePattern, if so it will search // recursively if it's pattern is not matched. class NamePattern { public: // match is a regular expression that input string should match. // replace is the pattern for replacing. An unescaped (escape is back-slash // '.' will mean not to change that character. Otherwise it's either a // single character to replace it with, or a list of characters inside // '[' and ']'. Ranges can be denoted with a hyphen as usual for globbing. NamePattern(const char *match, const char *replace); ~NamePattern(); // expand the input to a random output based on our replacement pattern (if // our regex is matched). If not then call recursively if we have a next // NamePattern. int expand(string &output, const string &input, bool sequential = false); // Add the next pattern to the list. void AddNext(NamePattern *np) { m_next = np; } private: // The pattern we are matching. Not actually used after startup. const char *m_match; // The pattern we replace with. Again not used other than diagnostics // after startup. const char *m_replace; // The number of elements in the arrays == characters to replace int m_conv_len; // The compiled regular expression for matching. regex_t m_match_regex; // The array of strings used for conversion. For every character position // that is to be changed there will be a pointer in this array (NULL means // no change). Each character in each string is a random character to be // used for replacement. If a character happens to occur twice then it will // be twice as likely to occur in output. char **m_convert; // The length of the strings above. Saves lots of strlen() calls. int *m_conv_item_len; // The next number to be used for each element int *m_next_value; // past the end of the sequence bool m_no_seq; // Pointer to the next pattern (or NULL). NamePattern *m_next; NamePattern(const NamePattern&); NamePattern & operator=(const NamePattern&); }; #endif postal-0.75/install.sh0000755000000000000000000001067507170063606011660 0ustar ## ## install -- Install a program, script or datafile ## Copyright (c) 1997-2000 Ralf S. Engelschall ## Originally written for shtool ## ## This file is part of shtool and free software; you can redistribute ## it and/or modify it under the terms of the GNU General Public ## License as published by the Free Software Foundation; either version ## 2 of the License, or (at your option) any later version. ## ## This file is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## str_tool="install" str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " arg_spec="2+" opt_spec="v.t.c.C.s.m:o:g:e:" opt_v=no opt_t=no opt_c=no opt_C=no opt_s=no opt_m="" opt_o="" opt_g="" opt_e="" . ./sh.common # determine source(s) and destination argc=$# srcs="" while [ $# -gt 1 ]; do srcs="$srcs $1" shift done dstpath="$1" # type check for destination dstisdir=0 if [ -d $dstpath ]; then dstpath=`echo "$dstpath" | sed -e 's:/$::'` dstisdir=1 fi # consistency check for destination if [ $argc -gt 2 -a $dstisdir = 0 ]; then echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 exit 1 fi # iterate over all source(s) for src in $srcs; do dst=$dstpath # If destination is a directory, append the input filename if [ $dstisdir = 1 ]; then dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` dst="$dst/$dstfile" fi # Add a possible extension to src and dst if [ ".$opt_e" != . ]; then src="$src$opt_e" dst="$dst$opt_e" fi # Check for correct arguments if [ ".$src" = ".$dst" ]; then echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 continue fi if [ -d "$src" ]; then echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 continue fi # Make a temp file name in the destination directory dsttmp=`echo $dst |\ sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ -e "s;\$;/#INST@$$#;"` # Verbosity if [ ".$opt_v" = .yes ]; then echo "$src -> $dst" 1>&2 fi # Copy or move the file name to the temp name # (because we might be not allowed to change the source) if [ ".$opt_C" = .yes ]; then opt_c=yes fi if [ ".$opt_c" = .yes ]; then if [ ".$opt_t" = .yes ]; then echo "cp $src $dsttmp" 1>&2 fi cp $src $dsttmp || exit $? else if [ ".$opt_t" = .yes ]; then echo "mv $src $dsttmp" 1>&2 fi mv $src $dsttmp || exit $? fi # Adjust the target file # (we do chmod last to preserve setuid bits) if [ ".$opt_s" = .yes ]; then if [ ".$opt_t" = .yes ]; then echo "strip $dsttmp" 1>&2 fi strip $dsttmp || exit $? fi if [ ".$opt_o" != . ]; then if [ ".$opt_t" = .yes ]; then echo "chown $opt_o $dsttmp" 1>&2 fi chown $opt_o $dsttmp || exit $? fi if [ ".$opt_g" != . ]; then if [ ".$opt_t" = .yes ]; then echo "chgrp $opt_g $dsttmp" 1>&2 fi chgrp $opt_g $dsttmp || exit $? fi if [ ".$opt_m" != . ]; then if [ ".$opt_t" = .yes ]; then echo "chmod $opt_m $dsttmp" 1>&2 fi chmod $opt_m $dsttmp || exit $? fi # Determine whether to do a quick install # (has to be done _after_ the strip was already done) quick=no if [ ".$opt_C" = .yes ]; then if [ -r $dst ]; then if cmp -s $src $dst; then quick=yes fi fi fi # Finally install the file to the real destination if [ $quick = yes ]; then if [ ".$opt_t" = .yes ]; then echo "rm -f $dsttmp" 1>&2 fi rm -f $dsttmp else if [ ".$opt_t" = .yes ]; then echo "rm -f $dst && mv $dsttmp $dst" 1>&2 fi rm -f $dst && mv $dsttmp $dst fi done postal-0.75/logit.cpp0000644000000000000000000000243110777267477011507 0ustar #include "logit.h" #include #include Logit::Logit(const char *filename, bool is_verbose, bool numbered_files, int pid) : m_verbose(is_verbose) , m_fp(NULL) , m_count(0) , m_numbered_files(numbered_files) , m_filename(filename) , m_pid(pid) { } Logit::Logit(const Logit &l, int pid) : m_verbose(l.m_verbose) , m_fp(NULL) , m_count(0) , m_numbered_files(l.m_numbered_files) , m_filename(l.m_filename) , m_pid(pid) { } bool Logit::reopen() { if(!m_numbered_files && m_fp) return false; char buf[PATH_MAX]; if(m_fp) { fflush(m_fp); fclose(m_fp); } char pid[12], count[12]; sprintf(pid, "%d", m_pid); sprintf(count, "%d", m_count); strncpy(buf, m_filename.c_str(), PATH_MAX - 25); buf[PATH_MAX - 25] = '\0'; if(m_pid) { strcat(buf, ":"); strcat(buf, pid); } if(m_numbered_files) { strcat(buf, ":"); strcat(buf, count); } m_count++; m_fp = fopen(buf, "w"); if(!m_fp) { fprintf(stderr, "Can't open file %s\n", buf); m_fp = fdopen(2, "w"); } return false; } Logit::~Logit() { if(m_fp) { fflush(m_fp); fclose(m_fp); } } int Logit::Write(const char *data, size_t len) { if(!m_fp) reopen(); if(fwrite(data, 1, len, m_fp) != len) return -1; fflush(m_fp); return 0; } postal-0.75/logit.h0000644000000000000000000000113707346516673011147 0ustar #ifndef LOGIT_H #define LOGIT_H using namespace std; #include #include class Logit { public: Logit(const char *filename, bool is_verbose, bool numbered_files, int pid); ~Logit(); int Write(const char *data, size_t len); int Write(const string &str) { return Write(str.c_str(), str.size() ); } bool verbose() const { return m_verbose; } bool reopen(); Logit(const Logit &l, int pid); private: bool m_verbose; FILE *m_fp; int m_count; int m_numbered_files; string m_filename; int m_pid; Logit(const Logit&); Logit & operator=(const Logit&); }; #endif postal-0.75/md5.c0000644000000000000000000002477113023761356010507 0ustar /* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #include "md5.h" /* Constants for MD5Transform routine. */ #define S11 7 #define S12 12 #define S13 17 #define S14 22 #define S21 5 #define S22 9 #define S23 14 #define S24 20 #define S31 4 #define S32 11 #define S33 16 #define S34 23 #define S41 6 #define S42 10 #define S43 15 #define S44 21 static void MD5Transform PROTO_LIST ((UINT4 [4], const unsigned char [64])); static void Encode PROTO_LIST ((unsigned char *, UINT4 *, unsigned int)); static void Decode PROTO_LIST ((UINT4 *, const unsigned char *, unsigned int)); static void MD5_memcpy PROTO_LIST ((POINTER, CPOINTER, unsigned int)); static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int)); static unsigned char PADDING[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* F, G, H and I are basic MD5 functions. */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (z)) | ((y) & (~z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) #define I(x, y, z) ((y) ^ ((x) | (~z))) /* ROTATE_LEFT rotates x left n bits. */ #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. Rotation is separate from addition to prevent recomputation. */ #define FF(a, b, c, d, x, s, ac) { \ (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define GG(a, b, c, d, x, s, ac) { \ (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define HH(a, b, c, d, x, s, ac) { \ (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define II(a, b, c, d, x, s, ac) { \ (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } void md5_calc(output, input, inlen) unsigned char *output; unsigned char *input; /* input block */ unsigned int inlen; /* length of input block */ { MD5_CTX context; MD5Init(&context); MD5Update(&context, input, inlen); MD5Final(output, &context); } /* MD5 initialization. Begins an MD5 operation, writing a new context. */ void MD5Init (context) MD5_CTX *context; /* context */ { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ context->state[0] = 0x67452301; context->state[1] = 0xefcdab89; context->state[2] = 0x98badcfe; context->state[3] = 0x10325476; } /* MD5 block update operation. Continues an MD5 message-digest operation, processing another message block, and updating the context. */ void MD5Update (context, input, inputLen) MD5_CTX *context; /* context */ const unsigned char *input; /* input block */ unsigned int inputLen; /* length of input block */ { unsigned int i, index, partLen; /* Compute number of bytes mod 64 */ index = (unsigned int)((context->count[0] >> 3) & 0x3F); /* Update number of bits */ if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3)) context->count[1]++; context->count[1] += ((UINT4)inputLen >> 29); partLen = 64 - index; /* Transform as many times as possible. */ if (inputLen >= partLen) { MD5_memcpy ((POINTER)&context->buffer[index], (CPOINTER)input, partLen); MD5Transform (context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) MD5Transform (context->state, &input[i]); index = 0; } else i = 0; /* Buffer remaining input */ MD5_memcpy ((POINTER)&context->buffer[index], (CPOINTER)&input[i], inputLen-i); } /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ void MD5Final (digest, context) unsigned char digest[16]; /* message digest */ MD5_CTX *context; /* context */ { unsigned char bits[8]; unsigned int index, padLen; /* Save number of bits */ Encode (bits, context->count, 8); /* Pad out to 56 mod 64. */ index = (unsigned int)((context->count[0] >> 3) & 0x3f); padLen = (index < 56) ? (56 - index) : (120 - index); MD5Update (context, PADDING, padLen); /* Append length (before padding) */ MD5Update (context, bits, 8); /* Store state in digest */ Encode (digest, context->state, 16); /* Zeroize sensitive information. */ MD5_memset ((POINTER)context, 0, sizeof (*context)); } /* MD5 basic transformation. Transforms state based on block. */ static void MD5Transform (state, block) UINT4 state[4]; const unsigned char block[64]; { UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; Decode (x, block, 64); /* Round 1 */ FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ /* Round 2 */ GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ /* Round 3 */ HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ /* Round 4 */ II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; /* Zeroize sensitive information. */ MD5_memset ((POINTER)x, 0, sizeof (x)); } /* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ static void Encode (output, input, len) unsigned char *output; UINT4 *input; unsigned int len; { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) { output[j] = (unsigned char)(input[i] & 0xff); output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); } } /* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */ static void Decode (output, input, len) UINT4 *output; const unsigned char *input; unsigned int len; { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); } /* Note: Replace "for loop" with standard memcpy if possible. */ static void MD5_memcpy (output, input, len) POINTER output; CPOINTER input; unsigned int len; { unsigned int i; for (i = 0; i < len; i++) output[i] = input[i]; } /* Note: Replace "for loop" with standard memset if possible. */ static void MD5_memset (output, value, len) POINTER output; int value; unsigned int len; { unsigned int i; for (i = 0; i < len; i++) ((char *)output)[i] = (char)value; } postal-0.75/md5.h0000644000000000000000000000445613023761235010506 0ustar /* GLOBAL.H - RSAREF types and constants */ /* PROTOTYPES should be set to one if and only if the compiler supports function argument prototyping. The following makes PROTOTYPES default to 0 if it has not already been defined with C compiler flags. */ #ifndef PROTOTYPES # if __STDC__ # define PROTOTYPES 1 # else # define PROTOTYPES 0 # endif #endif /* POINTER defines a generic pointer type */ typedef unsigned char *POINTER; typedef const unsigned char *CPOINTER; /* UINT2 defines a two byte word */ typedef unsigned short int UINT2; /* UINT4 defines a four byte word */ #if defined(__alpha) && (defined(__osf__) || defined(__linux__)) typedef unsigned int UINT4; #else typedef unsigned long int UINT4; #endif /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it returns an empty list. */ #if PROTOTYPES #define PROTO_LIST(list) list #else #define PROTO_LIST(list) () #endif /* MD5.H - header file for MD5C.C */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ /* MD5 context. */ typedef struct { UINT4 state[4]; /* state (ABCD) */ UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ } MD5_CTX; void MD5Init PROTO_LIST ((MD5_CTX *)); void MD5Update PROTO_LIST ((MD5_CTX *, const unsigned char *, unsigned int)); void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); postal-0.75/missing0000755000000000000000000001421307100561576011244 0ustar #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 postal-0.75/mkinstalldirs0000755000000000000000000000132207100561576012450 0ustar #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here postal-0.75/mutex.cpp0000644000000000000000000000232107610771634011514 0ustar #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include "postal.h" #include "mutex.h" #include #include #include Mutex::Mutex(bool #ifdef LINUX_PTHREAD fastMutex #endif ) { int rc; #ifdef LINUX_PTHREAD if(!fastMutex) { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); if(!rc) rc = pthread_mutex_init(&m_mut, &attr); pthread_mutexattr_destroy(&attr); } else #endif { rc = pthread_mutex_init(&m_mut, NULL); } if(rc) { fprintf(stderr, "Can't create mutex.\n"); exit(1); } } Mutex::~Mutex() { pthread_mutex_destroy(&m_mut); } int Mutex::get_mutex(bool block) { if(block) { if(pthread_mutex_lock(&m_mut)) return -1; } else { if(pthread_mutex_trylock(&m_mut)) return -1; } return 0; } int Mutex::put_mutex() { if(pthread_mutex_unlock(&m_mut)) return -1; return 0; } Lock::Lock(Mutex &mut) : m_mut(mut) { if(m_mut.get_mutex()) { perror(""); fprintf(stderr, "Can't lock mutex.\n"); exit(1); } } Lock::~Lock() { if(m_mut.put_mutex()) { fprintf(stderr, "Can't unlock mutex.\n"); exit(1); } } postal-0.75/mutex.h0000644000000000000000000000045507054254173011163 0ustar #ifndef MUTEX_H #define MUTEX_H #include class Mutex { public: Mutex(bool fastMutex); ~Mutex(); int get_mutex(bool block = true); int put_mutex(); private: pthread_mutex_t m_mut; }; class Lock { public: Lock(Mutex &mut); ~Lock(); private: Mutex &m_mut; }; #endif postal-0.75/port.h0000644000000000000000000000134613023761356011004 0ustar #ifndef PORT_H #define PORT_H #ifndef _LARGEFILE64_SOURCE #endif #ifdef _LARGEFILE64_SOURCE #define OFF_T_PRINTF "%lld" #else #define OFF_T_PRINTF "%d" #endif #if 0 #define false 0 #define true 1 #endif typedef struct timeval TIMEVAL_TYPE; #ifdef _LARGEFILE64_SOURCE #define OFF_TYPE off64_t #define file_lseek lseek64 #define file_creat creat64 #define file_open open64 #else #define OFF_TYPE off_t #define file_lseek lseek #define file_creat creat #define file_open open #endif typedef unsigned int UINT; typedef unsigned long ULONG; typedef const char * PCCHAR; typedef char * PCHAR; typedef PCHAR const CPCHAR; typedef PCCHAR const CPCCHAR; typedef void * PVOID; typedef PVOID const CPVOID; typedef const CPVOID CPCVOID; #endif postal-0.75/port.h.in0000644000000000000000000000142410777264635011421 0ustar #ifndef PORT_H #define PORT_H @semun@ @bool@ @snprintf@ #ifndef _LARGEFILE64_SOURCE @large_file@ #endif #ifdef _LARGEFILE64_SOURCE #define OFF_T_PRINTF "%lld" #else #define OFF_T_PRINTF "%d" #endif #if @true_false@ #define false 0 #define true 1 #endif typedef struct timeval TIMEVAL_TYPE; #ifdef _LARGEFILE64_SOURCE #define OFF_TYPE off64_t #define file_lseek lseek64 #define file_creat creat64 #define file_open open64 #else #define OFF_TYPE off_t #define file_lseek lseek #define file_creat creat #define file_open open #endif typedef unsigned int UINT; typedef unsigned long ULONG; typedef const char * PCCHAR; typedef char * PCHAR; typedef PCHAR const CPCHAR; typedef PCCHAR const CPCCHAR; typedef void * PVOID; typedef PVOID const CPVOID; typedef const CPVOID CPCVOID; #endif postal-0.75/postal-list.10000644000000000000000000000404011016501144012161 0ustar .TH "postal-list" "1" "0.70" "russell@coker.com.au" "Postal" .SH "NAME" postal\-list \- program to show how postal expands user names .SH "SYNOPSIS" .B postal\-list .I user\-list\-filename conversion\-filename .SH "DESCRIPTION" This program shows the expansion that the .B postal program uses on email addresses. This can be used to make sure that you're configuration files do what you expect them to, and can also be used to produce a list of user\-names for an account creation script (in case you want to create a million test accounts in a conveniant fashion). .P The .B user\-list\-filename is the name of a file which contains a list of user's email addresses. This can be just user\-names or fully qualified email addresses. .P The .B conversion\-filename parameter will be the name of a file containing the conversions to apply to email addresses. Each line in the file can either be a comment (starting with "#") or is to contain two parameters. The first parameter is the regular expression. For each email that is to be sent a randomly selected user\-name will be checked against all regular expressions, the first match will determine the translation that is to be applied. The translation will be the second parameter on the line. It will contain a number of "." characters specifying characters in the name that are not to be translated. To specify the translations a range of characters can be specified inside square brackets. For example to have every address starting with "a" have a character from "01234567890abc" as it's second character and a character from "xyz" as it's third character you would have the following: .B ^a .[0\-9abc][xyz] .SH "RETURN CODES" .TP .B 0 No Error .TP .B 1 Bad Parameters .SH "AUTHOR" This program, it's manual page, and the Debian package were written by Russell Coker . .SH "AVAILABILITY" The source is available from http://doc.coker.com.au/projects/postal/ . .P See http://etbe.coker.com.au/category/benchmark for further information. .SH "SEE ALSO" .BR postal (8), rabid (8), regex (7) postal-0.75/postal-list.cpp0000644000000000000000000000111610777267540012632 0ustar #include "expand.h" #include #include #include void usage() { printf("Usage: postal-list input-file conversion-file\n"); exit(1); } int main(int argc, char **argv) { if(argc != 3) usage(); NameExpand exp(argv[2]); FILE *fp = fopen(argv[1], "r"); if(!fp) usage(); char buf[1024]; while(fgets(buf, sizeof(buf), fp) ) { if(buf[0] && buf[0] != '\n') { strtok(buf, "\n"); string str; while(!exp.expand(str, buf, true)) { printf("%s\n", str.c_str()); } } } fclose(fp); return 0; } postal-0.75/postal.80000644000000000000000000001415711700164435011241 0ustar .TH "postal" "8" "0.70" "russell@coker.com.au" "Postal" .SH "NAME" postal \- program to test SMTP mail server throughput. .SH "SYNOPSIS" .B postal .I [\-m maximum\-message\-size] [\-M minimum\-message\-size] [\-t threads] .I [\-c messages\-per\-connection] [\-r messages\-per\-minute] [\-s ssl\-percentage] .I [\-L] [\-l local\-address] [\-a] [\-b [no]netscape] [\-[z|Z] debug\-file] .I [\-f sender\-file] smtp\-server user\-list\-filename .SH "DESCRIPTION" This manual page documents briefly the .BR postal program. .P It is designed to test the performance of SMTP email servers by sending random messages to the specified server as fast as possible. .P The .B smtp\-server parameter specifies the IP address or name of the mail server that the mail is to be sent to. Mail sent by .B Postal will not use MX records, this is to allow testing outbound relays etc. If you want to specify a port other than port 25 then enclose the host address in square brackets and have the port address immediately following. If you want a DNS lookup for every connection (for testing round\-robin DNS) then immediately precede the host address with a '+' character. To specify multiple servers for round\-robin use then separate the addresses with commas. Note that .B localhost is used for connecting to the same machine. .P The .B user\-list\-filename is the name of a file which contains a list of user's email addresses. This can be just user\-names or fully qualified email addresses. Whatever you specify will be sent exactly in the SMTP protocol so make sure you do whatever is appropriate. If unsure then use fully qualified addresses (IE user@example.com). .P The .B sender\-file contains a list of users that will be in the From: field and envelope sender of the messages. If it is not specified then the user\-list\-filename will be used for the sender list. .P The .B maximum\-message\-size indicates the size in Kilobytes that will be the maximum size of the message body. The size of each message body will be a random number between 0 and the maximum size. Specify "0" if you want just headers to test the connection rate. The default value is 10. .P The .B threads parameter is the number of threads that should be created to attempt separate connections. A well configured mail server won't accept an unlimited number of connections so make sure you don't specify a number larger than the number your mail server is configured to handle. Also for sensible results make sure that you don't use enough to make your server thrash as the results won't be representative of real\-world use. The default value is 1, this default is not suitable for real tests, it's just for testing your configuration. If you specify multiple server addresses for round\-robin use then this number of threads will be created per server, IE 4 servers and .B \-p5 will give 20 threads total. .P The .B messages\-per\-connection parameter is for sending more than one message per SMTP connection. The default value is "1". A value of \-1 means to send an indefinite number of messages on one connection (~4 billion). If a value > 1 is specified then the number sent on each connection is a random number between 1 and the number specified. For simulating a mail server connected directly to the net use a value of 2 or 3. For simulating a mail server connected to a front\-end relay use a large number. For testing for bugs in your mail server use the value 0 and leave it running for a week. ;) A value of 0 means to disconnect without sending any messages. Good for testing a LocalDirector. .P The .B max\-messages\-per\-minute parameter is for limiting the throughput of the program. This is designed to be used when you want to test the performance of other programs when the system is under load. The default is effectively 24000 messages per minute. .P The .B local\-address parameter specifies which local IP address(es) are used to make the outbound connections. Specified in the same way as the remote address. This is good for testing LocalDirectors or other devices that perform differently depending on which source IP address was used. .P The \-L command specifies that LMTP is to be used instead of SMTP. .P The .B \-a command turns on all logging. All message data received will be logged. This will make it slow and it may not be able to saturate a fast Ethernet link... .P The .B \-b switch allows you to specify breakage strings. Currently the only option is for Netscape mail server which strips spaces from the start of subject lines. .B \-b netscape means to avoid leading spaces on subject fields to not break Netscape. .B \-b nonetscape means to always put extra space to test for the bug in Netscape and similar products. Some people say that the RFCs are open to interpretation on this issue, I am interested to see whether anyone else interprets it the way that Netscape does. .P The .B \-s switch specifies the percentage of connections which are to use .B TLS AKA .B SSL. Use 0 for no SSL, or 100 for always SSL, or any number in between. Default is 0. .P The .B \-z switch allows you to specify a debugging file base. From this base one file is created for each thread (with a ':' and the thread number appended), each file is used to log all IO performed by that thread for debugging purposes. .P The .B \-Z switch is the same but creates a separate file for each connection as well with an additional ':' appended followed by the connection number. .SH "NOTES" When testing mail servers please use domains defined in http://www.rfc-editor.org/rfc/rfc2606.txt - example.com, example.net, and example.org are all good options. Please don't use anything related to a valid name, since that will cause pain for you and others on the net. .SH "RETURN CODES" .TP .B 0 No Error .TP .B 1 Bad Parameters .TP .B 2 System Error, lack of memory or some other resource .SH "AUTHOR" This program, it's manual page, and the Debian package were written by Russell Coker . .SH "AVAILABILITY" The source is available from http://doc.coker.com.au/projects/postal/ . .P See http://etbe.coker.com.au/category/benchmark for further information. .SH "SEE ALSO" .BR bhm (8), postal\-list (8), rabid (8) postal-0.75/postal.cpp0000644000000000000000000001047612374433304011656 0ustar #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include "userlist.h" #include "smtp.h" #include #include #include #include #include "postal.h" #include "logit.h" #ifdef USE_GNUTLS #include #if GNUTLS_VERSION_NUMBER <= 0x020b00 #include GCRY_THREAD_OPTION_PTHREAD_IMPL; #endif /* GNUTLS_VERSION_NUMBER */ #endif void usage() { printf("Usage: postal [-m maximum-message-size] [-M minimum-message-size] [-t threads]\n" " [-c messages-per-connection] [-r messages-per-minute] [-a]\n" " [-b [no]netscape] [-p port] [-[z|Z] debug-file]\n" #ifdef USE_SSL " [-s ssl-percentage]\n" #endif " [-L] [-l local-address] [-f sender-file]\n" " smtp-server user-list-filename\n" "\n" "Postal Version: " VER_STR "\n"); exit(eParam); } int exitCount = 0; void endit(int) { exitCount++; if(exitCount > 2) exit(1); } int main(int argc, char **argv) { int maxMsgSize = 10; int minMsgSize = 0; int processes = 1; int msgsPerMinute = 0; // 0 for unlimited int msgsPerConnection = 1; const char *ourAddr = NULL; bool allLog = false; TRISTATE netscape = eNONE; PCCHAR debugName = NULL; PCCHAR senderFile = NULL; bool debugMultipleFiles = false; bool useLMTP = false; #ifdef USE_SSL int ssl = 0; #endif #ifdef USE_GNUTLS #if GNUTLS_VERSION_NUMBER <= 0x020b00 gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); #endif gnutls_global_init(); if(!gnutls_check_version(GNUTLS_VER)) { fprintf(stderr, "Needs version " GNUTLS_VER " of GNUTLS\n"); exit(1); } #endif unsigned short port = 25; int c; while(-1 != (c = getopt(argc, argv, "ab:f:m:M:p:s:t:c:r:Ll:z:Z:")) ) { switch(char(c)) { case '?': case ':': usage(); break; case 'a': allLog = true; break; case 'b': if(!strcasecmp(optarg, "netscape")) netscape = eWONT; else if(!strcasecmp(optarg, "nonetscape")) netscape = eMUST; break; case 'f': senderFile = optarg; break; case 'L': useLMTP = true; break; case 'l': ourAddr = optarg; break; case 'm': maxMsgSize = atoi(optarg); break; case 'M': minMsgSize = atoi(optarg); break; case 'p': port = atoi(optarg); break; case 's': #ifdef USE_SSL ssl = atoi(optarg); #else usage(); #endif break; case 't': processes = atoi(optarg); break; case 'c': msgsPerConnection = atoi(optarg); break; case 'r': msgsPerMinute = atoi(optarg); break; case 'Z': debugMultipleFiles = true; case 'z': debugName = optarg; break; } } if(minMsgSize < 0 || maxMsgSize > MAX_MSG_SIZE || maxMsgSize < minMsgSize) usage(); if(processes < 1 || processes > MAX_PROCESSES) usage(); if(msgsPerMinute < 0 || msgsPerConnection < -1 ) usage(); #ifdef USE_SSL if(ssl < 0 || ssl > 100) usage(); #endif if(optind + 2 != argc) usage(); UserList ul(argv[optind + 1], false); UserList *senderList = NULL; if(senderFile) senderList = new UserList(senderFile, false); int fd[2]; if(pipe(fd)) { printf("Can't create pipe.\n"); return eSystem; } struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_sigaction = NULL; sa.sa_handler = SIG_IGN; sa.sa_flags = 0; if(sigaction(SIGPIPE, &sa, NULL)) { printf("Can't block SIGPIPE.\n"); return eSystem; } sa.sa_flags = SA_SIGINFO; sa.sa_handler = &endit; if(sigaction(SIGINT, &sa, NULL)) { printf("Can't handle SIGINT.\n"); return eSystem; } printf("time,messages,data(K),errors,connections" #ifdef USE_SSL ",SSL connections" #endif "\n"); Logit log("postal.log", allLog, false, 0); Logit *debug = NULL; if(debugName) debug = new Logit(debugName, false, debugMultipleFiles, 0); smtp mailer(&exitCount, argv[optind], ourAddr, ul, senderList, minMsgSize , maxMsgSize, msgsPerConnection, processes, &log, netscape, useLMTP #ifdef USE_SSL , ssl #endif , port, debug); int rc = mailer.doAllWork(msgsPerMinute); if(debug) delete debug; return rc; } postal-0.75/postal.h0000644000000000000000000000221613023761356011317 0ustar #ifndef POSTAL_H #define POSTAL_H typedef enum { eWONT, eMUST, eNONE } TRISTATE; #define VER_STR "0.75" #define USE_GNUTLS #ifdef USE_GNUTLS #define GNUTLS_VER "1.4.4" #define USE_SSL #endif #ifdef USE_OPENSSL #define USE_SSL #endif #define LINUX_PTHREAD #if 0 #define false 0 #define true 1 #endif #include #define MAX_PROCESSES 400 #define MAX_MSG_SIZE 40960 // The amount of time between updates to the shared memory region for random // data. #define RAND_TIME 5 // The allowable amount of time for results to lag behind the actions that // generated them. Should be a small fraction of a minute. The smaller it // is the more IPC there is. #define RESULTS_LAG 5 #define MAX_BYTES_UNREPORTED 40960 #define SEM_KEY 4710 #define CHECK_PERCENT(XX) ((XX) == 100 || rand() % 100 < (XX)) typedef const char * PCCHAR; typedef char * PCHAR; typedef PCHAR const CPCHAR; typedef PCCHAR const CPCCHAR; typedef void * PVOID; typedef PVOID const CPVOID; typedef const CPVOID CPCVOID; typedef enum { eParam = 1, eSystem = 2, eCtrl_C = 5, eNoError = 0, eSocket = -1, eCorrupt = -2, eTimeout = -3, eServer = -4 } ERROR_TYPE; #endif postal-0.75/postal.h.in0000644000000000000000000000225010551115065011713 0ustar #ifndef POSTAL_H #define POSTAL_H typedef enum { eWONT, eMUST, eNONE } TRISTATE; #define VER_STR "@version@" @openssl@ @gnutls@ #ifdef USE_GNUTLS #define GNUTLS_VER "1.4.4" #define USE_SSL #endif #ifdef USE_OPENSSL #define USE_SSL #endif @linux_pthread@ @socklen_t@ @bool@ #if @true_false@ #define false 0 #define true 1 #endif #include #define MAX_PROCESSES 400 #define MAX_MSG_SIZE 40960 // The amount of time between updates to the shared memory region for random // data. #define RAND_TIME 5 // The allowable amount of time for results to lag behind the actions that // generated them. Should be a small fraction of a minute. The smaller it // is the more IPC there is. #define RESULTS_LAG 5 #define MAX_BYTES_UNREPORTED 40960 #define SEM_KEY 4710 #define CHECK_PERCENT(XX) ((XX) == 100 || rand() % 100 < (XX)) typedef const char * PCCHAR; typedef char * PCHAR; typedef PCHAR const CPCHAR; typedef PCCHAR const CPCCHAR; typedef void * PVOID; typedef PVOID const CPVOID; typedef const CPVOID CPCVOID; typedef enum { eParam = 1, eSystem = 2, eCtrl_C = 5, eNoError = 0, eSocket = -1, eCorrupt = -2, eTimeout = -3, eServer = -4 } ERROR_TYPE; #endif postal-0.75/postal.spec0000644000000000000000000000203213023761356012016 0ustar Summary: A program for benchmarking mail servers Name: postal Version: 0.75 Release: 1 License: GPL Group: Utilities/Benchmarking Source: http://www.coker.com.au/postal/postal_%{version}.tar.gz BuildRoot: /tmp/%{name}-buildroot %description The Postal suite consists of an SMTP delivery benchmark (postal), a POP retrieval benchmark (rabid) and other programs soon to be added. %prep %setup -q %build ./configure --prefix=${RPM_BUILD_ROOT} make %install rm -rf $RPM_BUILD_ROOT DESTDIR=${RPM_BUILD_ROOT} make install install -d ${RPM_BUILD_ROOT}/usr/share/man/man8 install -d ${RPM_BUILD_ROOT}/usr/share/man/man1 install -m 644 *.8 $RPM_BUILD_ROOT/usr/share/man/man8 install -m 644 *.1 $RPM_BUILD_ROOT/usr/share/man/man1 %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc changelog.txt readme.html /usr/sbin/postal /usr/sbin/postal-list /usr/sbin/rabid /usr/share/man/man8/postal.8 /usr/share/man/man8/postal-list.8 /usr/share/man/man8/rabid.8 %changelog * Mon Feb 19 2001 Russell Coker - first packaging postal-0.75/postal.spec.in0000644000000000000000000000203710505132671012422 0ustar Summary: A program for benchmarking mail servers Name: postal Version: @version@ Release: 1 License: GPL Group: Utilities/Benchmarking Source: http://www.coker.com.au/postal/postal_%{version}.tar.gz BuildRoot: /tmp/%{name}-buildroot %description The Postal suite consists of an SMTP delivery benchmark (postal), a POP retrieval benchmark (rabid) and other programs soon to be added. %prep %setup -q %build ./configure --prefix=${RPM_BUILD_ROOT} make %install rm -rf $RPM_BUILD_ROOT DESTDIR=${RPM_BUILD_ROOT} make install install -d ${RPM_BUILD_ROOT}/usr/share/man/man8 install -d ${RPM_BUILD_ROOT}/usr/share/man/man1 install -m 644 *.8 $RPM_BUILD_ROOT/usr/share/man/man8 install -m 644 *.1 $RPM_BUILD_ROOT/usr/share/man/man1 %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc changelog.txt readme.html /usr/sbin/postal /usr/sbin/postal-list /usr/sbin/rabid /usr/share/man/man8/postal.8 /usr/share/man/man8/postal-list.8 /usr/share/man/man8/rabid.8 %changelog * Mon Feb 19 2001 Russell Coker - first packaging postal-0.75/rabid.80000644000000000000000000001140111024335101010772 0ustar .TH "rabid" "8" "0.70" "russell@coker.com.au" "Postal" .SH "NAME" rabid \- program to test POP server throughput. .SH "SYNOPSIS" .B rabid .I [\-r max\-connections\-per\-minute] [\-p processes] [\-l local\-address] .I [\-c messages\-per\-connection] [\-a] [\-s ssl\-percentage] [\-i imap\-percentage] .I [\-b qmail\-pop] [\-d download\-percentage[:delete\-percentage]] .I [\-[z|Z] debug\-file] [\-u] .I pop\-server user\-list\-filename .SH "DESCRIPTION" This manual page documents briefly the .BR rabid , program. .P It is designed to test the performance of POP email servers by reading all messages from randomly selected accounts as fast as possible. A future version will support rate limiting to provide a constant load (for testing SMTP servers). .P The .B pop\-server parameter specifies the IP address or name of the mail server that the mail is to downloaded from. If you want to specify a port other than port 110 then enclose the host address in square brackets and have the port address immidiately following. If you want a DNS lookup for every connection (for testing round\-robin DNS) then immediately preceed the host address with a '+' character. .P The .B user\-list\-filename is the name of a file which contains a list of user's email addresses and passwords. It will have one address per line and the password follows the address with a space to seperate. .P The .B processes parameter is the number of processes that should be forked off to attempt seperate connections. A well configured mail server won't accept an unlimited number of connections so make sure you don't specify a number larger than the number your mail server is configured to handle. Also for sensible results make sure that you don't use enough to make your server thrash as the results won't be representative of real\-world use. .P The .B max\-connections\-per\-minute parameter is for limiting the number of connections that the program makes. This is designed to be used when you want to test the performance of other programs when the system is under load. The default is 24000 connections per minute. .P The .B messages\-per\-connection parameter specifies the maximum number of messages to download in a single POP session. The default is \-1 (unlimited). .P The .B local\-address parameter specifies which local IP address(es) are used to make the outbound connections. Specified in the same way as the remote address. This is good for testing LocalDirectors or other devices that perform differently depending on which source IP address was used. .P The .B \-a command turns on all logging. All message data received will be logged. This will make it slow and it may not be able to saturate a fast Ethernet link... .P The .B \-s switch specifies the percentage of connections which are to use .B TLS AKA .B SSL. Use 0 for no SSL, or 100 for always SSL, or any number in between. Default is 0. .P The .B \-i switch specifies the percentage of IMAP connections (default is POP). .P The .B \-b switch allows you to specify breakage strings. Currently the only option is for Qmail POP server which adds an extra blank line at the end of each message. .B \-b qmail\-pop means to not report this as an error. .P .B \-d download\-percentage[:delete\-percentage] allows you to specify what percentage of the messages are downloaded and what percentage of the downloaded messages are deleted. Default is 100%. .P The .B \-u switch causes the domain of user-names to be ignored. This allows you to have a single file with user-names and passwords which can be used by postal and rabid when using a server which doesn't accept a domain. By default postal will ignore the password field, rabid may or may not need the domain depending on the configuration of the POP server. The default is to use the domain (which is required if the same user is present in multiple domains), this switch causes the domain part to be stripped from the user-name field. .P The .B \-z switch allows you to specify a debugging file base. From this base one file is created for each thread (with a ':' and the thread number appended), each file is used to log all IO performed by that thread for debugging purposes. .P The .B \-Z switch is the same but creates a separate file for each connection as well with an attitional ':' appended followed by the connection number. .SH "BUGS" Doesn't actually do SSL or IMAP yet. .SH "RETURN CODES" .TP .B 0 No Error .TP .B 1 Bad Parameters .TP .B 2 System Error, lack of memory or some other resource .SH "AUTHOR" This program, it's manual page, and the Debian package were written by Russell Coker . .SH "AVAILABILITY" The source is available from http://doc.coker.com.au/projects/postal/ . .P See http://etbe.coker.com.au/category/benchmark for further information. .SH "SEE ALSO" .BR postal (8), bhm (8) postal-0.75/rabid.cpp0000644000000000000000000001004112374433304011421 0ustar #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include "userlist.h" #include "client.h" #include #include #include #include #include #include #include "postal.h" #include "logit.h" #ifdef USE_GNUTLS #include #if GNUTLS_VERSION_NUMBER <= 0x020b00 #include GCRY_THREAD_OPTION_PTHREAD_IMPL; #endif /* GNUTLS_VERSION_NUMBER */ #endif #include void usage() { printf("Usage: rabid [-r max-connections-per-minute] [-p processes] [-l local-address]\n" " [-c messages-per-connection] [-a] [-i imap-percentage]\n" #ifdef USE_SSL " [-s ssl-percentage] [-d download-percentage[:delete-percentage]]\n" #endif " [-[z|Z] debug-file] [-u]\n" " pop-server user-list-filename\n" "\n" "Rabid Version: " VER_STR "\n"); exit(eParam); } int exitCount = 0; void endit(int) { exitCount++; if(exitCount > 2) exit(1); } int main(int argc, char **argv) { int processes = 1; int connectionsPerMinute = 0; int msgsPerConnection = -1; const char *ourAddr = NULL; bool logAll = false; #ifdef USE_SSL int ssl = 0; #endif int imap = 0; int downloadPercent = 100, deletePercent = 100; TRISTATE qmail_pop = eNONE; PCCHAR debugName = NULL; bool debugMultipleFiles = false; bool strip_domain = false; #ifdef USE_GNUTLS #if GNUTLS_VERSION_NUMBER <= 0x020b00 gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); #endif gnutls_global_init(); if(!gnutls_check_version(GNUTLS_VER)) { fprintf(stderr, "Needs version " GNUTLS_VER " of GNUTLS\n"); exit(1); } #endif int c; while(-1 != (c = getopt(argc, argv, "ab:d:c:i:l:p:r:s:uz:Z:")) ) { switch(char(c)) { case '?': case ':': usage(); break; case 'a': logAll = true; break; case 'b': if(!strcasecmp(optarg, "qmail-pop")) qmail_pop = eWONT; break; case 'c': msgsPerConnection = atoi(optarg); break; case 'd': if(sscanf(optarg, "%d:%d", &downloadPercent, &deletePercent) < 2) deletePercent = 100; break; case 'i': imap = atoi(optarg); break; case 'l': ourAddr = optarg; break; case 'p': processes = atoi(optarg); break; case 'r': connectionsPerMinute = atoi(optarg); break; case 's': #ifdef USE_SSL ssl = atoi(optarg); #else usage(); #endif break; case 'u': strip_domain = true; break; case 'Z': debugMultipleFiles = true; case 'z': debugName = optarg; break; } } if(processes < 1 || processes > MAX_PROCESSES || connectionsPerMinute < 0) usage(); #ifdef USE_SSL if(ssl < 0 || ssl > 100) usage(); #endif if(imap < 0 || imap > 100) usage(); if(downloadPercent < 0 || downloadPercent > 100) usage(); if(deletePercent < 0 || deletePercent > 100) usage(); if(optind + 2 != argc) usage(); UserList ul(argv[optind + 1], true, strip_domain); struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_sigaction = NULL; sa.sa_handler = SIG_IGN; sa.sa_flags = 0; if(sigaction(SIGPIPE, &sa, NULL)) { printf("Can't block SIGPIPE.\n"); return eSystem; } sa.sa_flags = SA_SIGINFO; sa.sa_handler = &endit; if(sigaction(SIGINT, &sa, NULL)) { printf("Can't handle SIGINT.\n"); return eSystem; } printf("time,messages,data(K),errors,connections" #ifdef USE_SSL ",SSL connections" #endif ",IMAP connections\n"); Logit log("rabid.log", logAll, false, 0); Logit *debug = NULL; if(debugName) debug = new Logit(debugName, false, debugMultipleFiles, 0); client popper(&exitCount, argv[optind], ourAddr, ul, processes, msgsPerConnection, &log #ifdef USE_SSL , ssl #endif , qmail_pop, imap, downloadPercent, deletePercent, debug); int rc = popper.doAllWork(connectionsPerMinute); if(debug) delete debug; return rc; } postal-0.75/results.cpp0000644000000000000000000000225611700037465012052 0ustar #include #include "postal.h" #include "results.h" results::results() : m_connections(0) #ifdef USE_SSL , m_ssl_connections(0) #endif , m_mut(true) , m_msgs(0) , m_bytes(0) , m_errors(0) { } results::~results() { m_print(); } void results::error() { Lock l(m_mut); m_errors++; } void results::dataBytes(int bytes) { Lock l(m_mut); m_bytes += bytes; } void results::message() { Lock l(m_mut); m_msgs++; } void results::connection() { Lock l(m_mut); m_connections++; } #ifdef USE_SSL void results::connect_ssl() { Lock l(m_mut); m_ssl_connections++; } #endif void results::print() { Lock l(m_mut); m_print(); } void results::childPrint() { } void results::m_print() { time_t now = time(NULL); tm *t = localtime(&now); printf("%02d:%02d,%u,%u,%u", t->tm_hour, t->tm_min, m_msgs , (unsigned int)m_bytes / 1024, m_errors); #ifdef USE_SSL printf(",%d,%d", m_connections, m_ssl_connections); m_ssl_connections = 0; #else printf(",%d", m_connections); #endif childPrint(); printf("\n"); fflush(NULL); m_msgs = 0; m_connections = 0; m_bytes = m_bytes % 1024; m_errors = 0; } postal-0.75/results.h0000644000000000000000000000101311700037432011477 0ustar #ifndef RESULTS_H #define RESULTS_H #include #include "mutex.h" class results { public: results(); virtual ~results(); void error(); void dataBytes(int bytes); void message(); void connection(); #ifdef USE_SSL void connect_ssl(); #endif void print(); protected: virtual void childPrint(); int m_connections; #ifdef USE_SSL int m_ssl_connections; #endif void m_print(); Mutex m_mut; private: unsigned int m_msgs; unsigned long long m_bytes; unsigned int m_errors; }; #endif postal-0.75/sh.common0000644000000000000000000001067307170063640011473 0ustar ## ## This file is part of shtool and free software; you can redistribute ## it and/or modify it under the terms of the GNU General Public ## License as published by the Free Software Foundation; either version ## 2 of the License, or (at your option) any later version. ## ## This file is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## ## ## COMMON UTILITY CODE ## # determine name of tool if [ ".$tool" != . ]; then # used inside shtool script toolcmd="$0 $tool" toolcmdhelp="shtool $tool" msgprefix="shtool:$tool" else # used as standalone script toolcmd="$0" toolcmdhelp="sh $0" msgprefix="$str_tool" fi # parse argument specification string eval `echo $arg_spec |\ sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'` # parse option specification string eval `echo h.$opt_spec |\ sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'` # interate over argument line opt_PREV='' while [ $# -gt 0 ]; do # special option stops processing if [ ".$1" = ".--" ]; then shift break fi # determine option and argument opt_ARG_OK=no if [ ".$opt_PREV" != . ]; then # merge previous seen option with argument opt_OPT="$opt_PREV" opt_ARG="$1" opt_ARG_OK=yes opt_PREV='' else # split argument into option and argument case "$1" in -[a-zA-Z0-9]*) eval `echo "x$1" |\ sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \ -e 's/";\(.*\)$/"; opt_ARG="\1"/'` ;; -[a-zA-Z0-9]) opt_OPT=`echo "x$1" | cut -c3-` opt_ARG='' ;; *) break ;; esac fi # eat up option shift # determine whether option needs an argument eval "opt_MODE=\$opt_MODE_${opt_OPT}" if [ ".$opt_ARG" = . -a ".$opt_ARG_OK" != .yes ]; then if [ ".$opt_MODE" = ".:" -o ".$opt_MODE" = ".+" ]; then opt_PREV="$opt_OPT" continue fi fi # process option case $opt_MODE in '.' ) # boolean option eval "opt_${opt_OPT}=yes" ;; ':' ) # option with argument (multiple occurances override) eval "opt_${opt_OPT}=\"\$opt_ARG\"" ;; '+' ) # option with argument (multiple occurances append) eval "opt_${opt_OPT}=\"\$opt_${opt_OPT} \$opt_ARG\"" ;; * ) echo "$msgprefix:Error: unknown option: \`-$opt_OPT'" 1>&2 echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 exit 1 ;; esac done if [ ".$opt_PREV" != . ]; then echo "$msgprefix:Error: missing argument to option \`-$opt_PREV'" 1>&2 echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 exit 1 fi # process help option if [ ".$opt_h" = .yes ]; then echo "Usage: $toolcmdhelp $str_usage" exit 0 fi # complain about incorrect number of arguments case $arg_MODE in '=' ) if [ $# -ne $arg_NUMS ]; then echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 exit 1 fi ;; '+' ) if [ $# -lt $arg_NUMS ]; then echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 exit 1 fi ;; esac # establish a temporary file on request if [ ".$gen_tmpfile" = .yes ]; then if [ ".$TMPDIR" != . ]; then tmpdir="$TMPDIR" elif [ ".$TEMPDIR" != . ]; then tmpdir="$TEMPDIR" else tmpdir="/tmp" fi tmpfile="$tmpdir/.shtool.$$" rm -f $tmpfile >/dev/null 2>&1 touch $tmpfile fi postal-0.75/smtp.cpp0000644000000000000000000002204112735152067011333 0ustar #include "smtp.h" #include #include #include #include #include #include #include "userlist.h" #include "logit.h" #include "results.h" #include smtpData::smtpData() : m_quit("QUIT\r\n") , m_randomLetters("abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 `~!@#$%^&*()-_=+[]{};:'\"|/?<>,") , m_randomLen(strlen(m_randomLetters)) , m_postalMsg("\r\nX-Postal: " VER_STR " - the mad postman.\r\n" "X-Postal: http://www.coker.com.au/postal/\r\n" "X-Postal: This is not a real email.\r\n\r\n") , m_dnsLock(true) , m_timeLastAction(time(NULL)) { setRand(0); } const string *smtpData::getMailName(struct sockaddr_in &in) { Lock l(m_dnsLock); unsigned long ip = in.sin_addr.s_addr; string *name = m_names[ip]; if(name != NULL) return name; struct hostent *h; h = gethostbyaddr((char *)&(in.sin_addr), sizeof(in.sin_addr), AF_INET); if(!h) { FILE *fp = fopen("/etc/mailname", "r"); char buf[100]; if(fp && fgets(buf, sizeof(buf), fp)) { char *tmp = strchr(buf, '\n'); if(tmp) *tmp = 0; name = new string(buf); } else { name = new string(inet_ntoa(in.sin_addr)); } } else { name = new string(h->h_name); } m_names[ip] = name; return name; } smtpData::~smtpData() { } void smtpData::setRand(int frequency) { if(time(NULL) - m_timeLastAction < frequency) return; for(int i = 0; i < MAP_SIZE; i++) m_randBuf[i] = m_randomLetters[random() % m_randomLen]; m_timeLastAction = time(NULL); } void smtpData::randomString(char *buf, int len) const { if(len < 2) return; if(len > 2) { int offset = random() % (MAP_SIZE - (len - 2)); memcpy(buf, &m_randBuf[offset], len - 2); } strcpy(buf + len - 2, "\r\n"); } const int max_line_len = 79; void smtpData::randomBuf(char *buf, int len) const { while(len) { int line_len = random() % max_line_len; if(line_len < 2) line_len = 2; if(len - line_len < 2) line_len = len; randomString(buf, line_len); len -= line_len; buf += line_len; } } // Return a random date that may be as much as 60 seconds in the future or 600 seconds in the past. // buffer must be at least 34 bytes for "Day, dd Mon yyyy hh:mm:ss +zzzz\r\n" void smtpData::date(char *buf) const { time_t t = time(NULL); struct tm broken; t += 60 - random() % 600; if(!gmtime_r(&t, &broken) || !strftime(buf, 34, "%a, %d %b %Y %H:%M:%S %z\r\n", &broken)) strcpy(buf, "Error making date"); } const string smtpData::msgId(const char *sender, const unsigned threadNum) const { char msgId_buf[256]; const unsigned int max_sender_len = sizeof(msgId_buf) - 35; if(strlen(sender) > max_sender_len) sender += strlen(sender) - max_sender_len; else if(*sender == '<') sender++; struct timeval tv; gettimeofday(&tv, NULL); snprintf(msgId_buf, sizeof(msgId_buf), "<%08X.%03X.%03X.%s\r\n", unsigned(tv.tv_sec), unsigned(tv.tv_usec % 2048), threadNum % 2048, sender); return string(msgId_buf); } Thread *smtp::newThread(int threadNum) { return new smtp(threadNum, this); } int smtp::action(PVOID) { while(1) { int rc = Connect(); if(rc > 1) return 1; if(rc == 0) { #ifdef USE_SSL if(m_canTLS && CHECK_PERCENT(m_useTLS) ) { rc = sendCommandString("STARTTLS\r\n"); if(!rc) rc = ConnectTLS(); if(!rc) rc = sendCommandString(m_helo); if(rc > 1) return rc; m_res->connect_ssl(); } #endif int msgs; if(m_msgsPerConnection == 0) msgs = -1; else if(m_msgsPerConnection < 0) msgs = 0; else msgs = random() % m_msgsPerConnection + 1; if(rc) msgs = 0; for(int i = 0; i != msgs; i++) { if(*m_exitCount) { disconnect(); return 1; } rc = sendMsg(); if(rc > 1) return 1; if(rc) break; } if(!rc) rc = disconnect(); if(rc > 1) return 1; } if(rc) { sleep(5); } } } smtp::smtp(int *exitCount, const char *addr, const char *ourAddr, UserList &ul , UserList *senderList, int minMsgSize, int maxMsgSize , int numMsgsPerConnection , int processes, Logit *log, TRISTATE netscape, bool useLMTP #ifdef USE_SSL , int ssl #endif , unsigned short port, Logit *debug) : tcp(exitCount, addr, port, log #ifdef USE_SSL , ssl #endif , ourAddr, debug) , m_ul(ul) , m_senderList(senderList ? senderList : &ul) , m_minMsgSize(minMsgSize * 1024) , m_maxMsgSize(maxMsgSize * 1024) , m_data(new smtpData()) , m_msgsPerConnection(numMsgsPerConnection) , m_res(new results) , m_netscape(netscape) , m_nextPrint(time(NULL)/60*60+60) , m_useLMTP(useLMTP) { go(NULL, processes); } smtp::smtp(int threadNum, const smtp *parent) : tcp(threadNum, parent) , m_ul(parent->m_ul) , m_senderList(parent->m_senderList) , m_minMsgSize(parent->m_minMsgSize) , m_maxMsgSize(parent->m_maxMsgSize) , m_data(parent->m_data) , m_msgsPerConnection(parent->m_msgsPerConnection) , m_res(parent->m_res) , m_netscape(parent->m_netscape) , m_nextPrint(0) , m_useLMTP(parent->m_useLMTP) { } smtp::~smtp() { if(getThreadNum() < 1) delete m_data; } void smtp::sentData(int bytes) { m_res->dataBytes(bytes); } void smtp::receivedData(int) { } void smtp::error() { m_res->error(); disconnect(); } int smtp::Connect() { int rc = tcp::Connect(); if(rc) return rc; m_res->connection(); rc = readCommandResp(); if(rc) return rc; const string *mailName = m_data->getMailName(m_connectionLocalAddr); if(m_useLMTP) m_helo = string("LHLO ") + *mailName + "\r\n"; else m_helo = string("EHLO ") + *mailName + "\r\n"; rc = sendCommandString(m_helo); if(rc) return rc; return 0; } int smtp::disconnect() { int rc = sendCommandString(m_data->quit()); rc |= tcp::disconnect(); return rc; } int smtp::sendMsg() { int rc; int size = 0; if(m_maxMsgSize > m_minMsgSize) size = random() % (m_maxMsgSize - m_minMsgSize) + m_minMsgSize; else size = m_maxMsgSize; m_md5.init(); string logData; bool logAll = false; if(m_log && m_log->verbose()) logAll = true; char aByte; rc = Read(&aByte, 1, 0); if(rc != 1) return 1; string sender = m_senderList->randomUser(); string from = string("<") + sender + '>'; string to = string("<") + m_ul.randomUser() + '>'; rc = sendCommandString(string("MAIL FROM: ") + from + "\r\n"); if(rc) return rc; rc = sendCommandString(string("RCPT TO: ") + to + "\r\n"); if(rc) return rc; rc = sendCommandString("DATA\r\n"); if(rc) return rc; string subject = string("Subject: "); if(m_netscape == eWONT) subject += "N"; else if(m_netscape == eMUST) subject += " "; char subj_buf[61]; // random string from 2 to buffer len int subj_len = random() % (sizeof(subj_buf) - 3) + 2; m_data->randomString(subj_buf, subj_len); subj_buf[subj_len] = 0; subject += subj_buf; char date[34]; m_data->date(date); string msgId = m_data->msgId(from.c_str(), getThreadNum()); string str = string("From: ") + from + "\r\nTo: " + to + "\r\n" + subject + "Date: " + date + "Message-Id: " + msgId; m_md5.addData(str); char *sendbuf = (char *)malloc(size + 1); m_data->randomBuf(sendbuf, size); m_md5.addData(sendbuf, size); string sum = m_md5.getSum(); str += "X-PostalHash: " + sum + m_data->postalMsg(); rc = sendString(str); if(rc) { free(sendbuf); return rc; } if(logAll) logData = str; rc = sendData(sendbuf, size); if(rc) return rc; if(logAll) logData += sendbuf; free(sendbuf); str = ".\r\n"; rc = sendCommandString(str); if(rc) return rc; m_res->message(); if(logAll) { logData += str; m_log->Write(logData); } else if(m_log) { sum += " " + from + " " + to + "\n"; m_log->Write(sum); } return 0; } ERROR_TYPE smtp::readCommandResp() { char recvBuf[1024]; do { int rc = readLine(recvBuf, sizeof(recvBuf)); if(rc < 0) return ERROR_TYPE(rc); if(recvBuf[0] != '2' && recvBuf[0] != '3') { fprintf(stderr, "Server error:%s.\n", recvBuf); error(); return eServer; } #ifdef USE_SSL if(!m_canTLS) { if(!strncmp("250-STARTTLS", recvBuf, 12) || !strncmp("250 STARTTLS", recvBuf, 12)) { m_canTLS = true; } } #endif } while(recvBuf[3] == '-'); return eNoError; } int smtp::pollRead() { m_data->setRand(RAND_TIME); if(time(NULL) >= m_nextPrint) { m_res->print(); m_nextPrint += 60; } return 0; } int smtp::WriteWork(PVOID buf, int size, int timeout) { int t1 = time(NULL); if(t1 + timeout > m_nextPrint) timeout = m_nextPrint - t1; if(timeout < 0) timeout = 0; int rc = Write(buf, size, timeout); int t2 = time(NULL); if(t2 < t1 + timeout) { struct timespec req; req.tv_sec = t1 + timeout - t2; req.tv_nsec = 0; nanosleep(&req, NULL); } return rc; } postal-0.75/smtp.h0000644000000000000000000000576612735156617011024 0ustar #ifndef SMTP_H #define SMTP_H using namespace std; #include #include #include #include "conf.h" #include #include "tcp.h" #include "mutex.h" class results; class UserList; #define MAP_SIZE 8 * 1024 // Comparison operator for hash map of names to unsigned longs struct eqlng { bool operator()(unsigned long l1, unsigned long l2) const { return (l1 == l2); } }; typedef std::tr1::unordered_map, eqlng> NAME_MAP; class smtpData { public: smtpData(); ~smtpData(); const string &quit() const { return m_quit; } // create a random string of length len that includes a trailing "\r\n" // string is not zero terminated void randomString(char *buf, int len) const; // fill a buffer with random lines of text void randomBuf(char *buf, int len) const; void date(char *buf) const; const string msgId(const char *sender, const unsigned threadNum) const; // return the X-Postal lines const string &postalMsg() const { return m_postalMsg; } // frequency determines how long it should have been since the last // operation for this function to actually do anything. // It will not sleep for that many seconds or block on IO in any way. void setRand(int frequency); // get the mail name for an IP address const string *getMailName(struct sockaddr_in &in); private: // Some const strings that we only want one copy of const string m_quit; const char *m_randomLetters; const int m_randomLen; const string m_postalMsg; Mutex m_dnsLock; // time of the last randomise time_t m_timeLastAction; char m_randBuf[MAP_SIZE]; // Map of IP addresses to names NAME_MAP m_names; smtpData(const smtpData&); smtpData & operator=(const smtpData&); }; class smtp : public tcp { public: smtp(int *exitCount, const char *addr, const char *ourAddr , UserList &ul, UserList *senderList, int minMsgSize, int maxMsgSize , int numMsgsPerConnection, int processes, Logit *log, TRISTATE netscape , bool useLMTP #ifdef USE_SSL , int ssl #endif , unsigned short port, Logit *debug); virtual ~smtp(); // Connect returns 0 for connect, 1 for can't connect, and 2 for serious // errors. int Connect(); int sendMsg(); virtual int disconnect(); int msgsPerConnection() const { return m_msgsPerConnection; } private: virtual int action(PVOID); smtp(int threadNum, const smtp *parent); virtual Thread *newThread(int threadNum); int pollRead(); virtual int WriteWork(PVOID buf, int size, int timeout); virtual ERROR_TYPE readCommandResp(bool) { return readCommandResp(); } ERROR_TYPE readCommandResp(); void error(); virtual void sentData(int bytes); virtual void receivedData(int); UserList &m_ul, *m_senderList; const int m_minMsgSize, m_maxMsgSize; smtpData *m_data; int m_msgsPerConnection; results *m_res; TRISTATE m_netscape; string m_helo; time_t m_nextPrint; bool m_useLMTP; smtp(const smtp&); smtp & operator=(const smtp&); }; #endif postal-0.75/smtpserver.cpp0000644000000000000000000000333210505470452012556 0ustar #include "smtpserver.h" int smtp_server::m_processes = 0; int smtp_server::m_max_conn = 0; int smtp_server::m_nextThread = 0; smtp_server::smtp_server(short port, UserList &ul, int maxMsgSize , int processes, Logit *log, Logit *debug #ifdef USE_SSL , bool use_ssl #endif ) : tcp(NULL, port, log #ifdef USE_SSL , use_ssl #endif , debug) , m_ul(ul) , m_res(new results) , m_maxMsgSize(maxMsgSize) { m_max_conn = processes; } smtp_server::smtp_server(int threadNum, const smtp_server *parent) : tcp(threadNum, parent) , m_ul(parent->m_ul) , m_res(parent->m_res) , m_maxMsgSize(parent->m_maxMsgSize) { } Thread *smtp_server::newThread(int threadNum) { return new smtp_server(threadNum, this); } smtp_server::~smtp_server() { } int smtp_server::action(PVOID) { while(1) { } } int smtp_server::pollRead() { m_res->pollPrint(); if(m_max_conn && m_processes < m_max_conn) { int rc = pollForAccept(); if(rc == -1) return -1; if(rc == 1) { smtp_server *n = (smtp_server *)newThread(m_nextThread); if(n->isOpen()) { m_nextThread++; m_processes++; } else delete n; } } return 0; } void smtp_server::error() { m_res->error(); tcp::disconnect(); } int smtp_server::WriteWork(PVOID buf, int size, int timeout) { return Write(buf, size, timeout); } void smtp_server::sentData(int bytes) { m_res->dataBytes(bytes); } ERROR_TYPE smtp_server::readCommandResp() { char recvBuf[1024]; } int smtp_server::doAllWork() { } int smtp_server::disconnect() { const char * str = "550 disconnect\r\n"; const len = strlen(str); rc = sendData(str, len); if(rc != len) return -1; rc = } postal-0.75/smtpserver.h0000644000000000000000000000171410505465273012232 0ustar #ifndef SMTP_SERVER_H #define SMTP_SERVER_H #include "logit.h" #include "tcp.h" #include "results.h" using namespace std; class UserList; class smtp_server : public tcp { public: smtp_server(short port, UserList &ul, int maxMsgSize , int processes, Logit *log, Logit *debug #ifdef USE_SSL , bool use_ssl #endif ); smtp_server(int threadNum, const smtp_server *parent); virtual ~smtp_server(); virtual int disconnect(); int doAllWork(); private: virtual int action(PVOID); virtual Thread *newThread(int threadNum); int pollRead(); virtual int WriteWork(PVOID buf, int size, int timeout); virtual ERROR_TYPE readCommandResp(bool) { return readCommandResp(); } ERROR_TYPE readCommandResp(); void error(); virtual void sentData(int bytes); virtual void receivedData(int); static int m_processes; static int m_max_conn; UserList &m_ul; results *m_res; int m_maxMsgSize; static int m_nextThread; }; #endif postal-0.75/sun/0000755000000000000000000000000013023761356010450 5ustar postal-0.75/sun/Makefile0000644000000000000000000000054707164426413012117 0ustar all: pkg INSTROOT=`pwd`/tmp PKGNAME=postal pkg: ( cd .. ; ./configure --prefix=/usr --mandir=`pwd`/sun/tmp/usr/share/man ) make -C .. WFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wwrite-strings" make -C .. prefix=${INSTROOT}/usr install pkgmk -o -r ${INSTROOT} pkgtrans -s spool ${PKGNAME}.pkg ${PKGNAME} echo "/var/spool/pkg/${PKGNAME}.pkg complete!" postal-0.75/sun/pkginfo0000644000000000000000000000023713023761356012032 0ustar PKG=postal ARCH=sparc VERSION=0.75 CATEGORY=application NAME=Postal DESC=Mail server benchmark suite VENDOR=Russell Coker EMAIL=russell@coker.com.au MAXINST=1 postal-0.75/sun/pkginfo.in0000644000000000000000000000024407244317340012433 0ustar PKG=postal ARCH=sparc VERSION=@version@ CATEGORY=application NAME=Postal DESC=Mail server benchmark suite VENDOR=Russell Coker EMAIL=russell@coker.com.au MAXINST=1 postal-0.75/sun/prototype0000644000000000000000000000044007164426737012450 0ustar i pkginfo f none /usr/sbin/postal 0755 root root f none /usr/sbin/postal-list 0755 root root f none /usr/sbin/rabid 0755 root root f none /usr/share/man/man8/postal.8 0644 root root f none /usr/share/man/man8/postal-list.8 0644 root root f none /usr/share/man/man8/rabid.8 0644 root root postal-0.75/tcp.cpp0000644000000000000000000002546711700041175011141 0ustar #define TCP_BODY #include "tcp.h" #include #include #include #include #include #include #include "postal.h" #include "userlist.h" #include "address.h" #include "logit.h" tcp::tcp(int *exitCount, const char *addr, unsigned short default_port , Logit *log #ifdef USE_SSL , int ssl #endif , const char *sourceAddr, Logit *debug) : m_md5() , m_destAffinity(0) , m_log(log) #ifdef USE_SSL , m_canTLS(false) , m_useTLS(ssl) #endif , m_exitCount(exitCount) , m_fd(-1) , m_start(0) , m_end(0) , m_open(false) , m_addr(new address(addr, default_port)) , m_sourceAddr(NULL) , m_debug(debug) #ifdef USE_SSL #ifdef USE_OPENSSL , m_sslMeth(NULL) , m_sslCtx(NULL) , m_ssl(NULL) #else , m_gnutls_session(NULL) , m_gnutls_anoncred(NULL) #endif , m_isTLS(false) #endif { if(sourceAddr) m_sourceAddr = new address(sourceAddr); m_destAffinity = getThreadNum() % m_addr->addressCount(); #ifdef USE_SSL if(m_useTLS) { #ifdef USE_OPENSSL //don't seem to need this SSL_library_init(); SSLeay_add_ssl_algorithms(); SSL_load_error_strings(); #endif } #endif } tcp::tcp(int threadNum, const tcp *parent) : Thread(threadNum, parent) , m_md5() , m_destAffinity(parent->m_destAffinity) , m_log(parent->m_log) #ifdef USE_SSL , m_canTLS(false) , m_useTLS(parent->m_useTLS) #endif , m_exitCount(parent->m_exitCount) , m_fd(-1) , m_start(0) , m_end(0) , m_open(false) , m_addr(parent->m_addr) , m_sourceAddr(parent->m_sourceAddr) , m_debug(parent->m_debug ? new Logit(*(parent->m_debug), threadNum) : NULL) #ifdef USE_SSL #ifdef USE_OPENSSL , m_sslMeth(NULL) , m_sslCtx(NULL) , m_ssl(NULL) #else , m_gnutls_session(NULL) , m_gnutls_anoncred(NULL) #endif , m_isTLS(false) #endif { } tcp::~tcp() { disconnect(); if(getThreadNum() < 1) { delete m_addr; delete m_sourceAddr; } if(m_debug) delete m_debug; } int tcp::Connect(short port) { if(*m_exitCount) return 1; #ifdef USE_SSL m_canTLS = false; #endif m_start = 0; m_end = 0; #ifdef USE_SSL m_isTLS = false; #endif sockaddr *sa; sa = m_addr->get_addr(m_destAffinity); if(!sa) return 1; m_fd = socket(PF_INET, SOCK_STREAM, 0); if(m_fd < 0) { fprintf(stderr, "Can't open socket.\n"); error(); return 2; } int rc; if(m_sourceAddr) { sockaddr *source; source = (sockaddr *)m_sourceAddr->get_rand_addr(); rc = bind(m_fd, source, sizeof(struct sockaddr_in)); if(rc) { fprintf(stderr, "Can't bind to port.\n"); error(); close(m_fd); return 2; } } m_poll.fd = m_fd; if(port) { struct sockaddr_in newAddr; memcpy(&newAddr, sa, sizeof(newAddr)); newAddr.sin_port = htons(port); rc = connect(m_fd, (sockaddr *)&newAddr, sizeof(struct sockaddr_in)); } else { rc = connect(m_fd, sa, sizeof(struct sockaddr_in)); } if(rc) { fprintf(stderr, "Can't connect to %s port %d.\n" , inet_ntoa(((sockaddr_in *)sa)->sin_addr) , int(ntohs(((sockaddr_in *)sa)->sin_port)) ); error(); close(m_fd); return 1; } socklen_t namelen = sizeof(m_connectionLocalAddr); rc = getsockname(m_fd, (struct sockaddr *)&m_connectionLocalAddr, &namelen); if(rc) fprintf(stderr, "Can't getsockname!\n"); if(m_debug) m_debug->reopen(); m_open = true; return 0; } #ifdef USE_SSL int tcp::ConnectTLS() { #ifdef USE_OPENSSL m_sslCtx = NULL; m_ssl = NULL; m_sslMeth = SSLv2_client_method(); if(m_sslMeth == NULL) { fprintf(stderr, "Can't get SSLv2_client_method.\n"); error(); return 2; } m_sslCtx = SSL_CTX_new(m_sslMeth); if(m_sslCtx == NULL) { fprintf(stderr, "Can't SSL_CTX_new\n"); error(); return 2; } if((m_ssl = SSL_new(m_sslCtx)) == NULL) { fprintf(stderr, "Can't SSL_new\n"); SSL_CTX_free(m_sslCtx); error(); return 2; } SSL_set_fd(m_ssl, m_fd); if(-1 == SSL_connect(m_ssl)) { fprintf(stderr, "Can't SSL_CONNECT\n"); SSL_free(m_ssl); SSL_CTX_free(m_sslCtx); error(); return 1; } #else gnutls_anon_allocate_client_credentials(&m_gnutls_anoncred); m_gnutls_session = new gnutls_session_t; // Initialize TLS session gnutls_init (m_gnutls_session, GNUTLS_CLIENT); // Use default priorities gnutls_set_default_priority(*m_gnutls_session); // bug in gnutls interface? // Need to enable anonymous specifically gnutls_priority_set_direct(*m_gnutls_session, "NORMAL:+ANON-DH", NULL); // put the anonymous credentials to the current session gnutls_credentials_set(*m_gnutls_session, GNUTLS_CRD_ANON, m_gnutls_anoncred); gnutls_transport_set_ptr(*m_gnutls_session, (gnutls_transport_ptr_t)m_fd); // Perform the TLS handshake if(gnutls_handshake(*m_gnutls_session) < 0) { fprintf(stderr, "Can't gnutls_handshake\n"); gnutls_deinit(*m_gnutls_session); gnutls_anon_free_client_credentials(m_gnutls_anoncred); error(); return 1; } #endif if(*m_exitCount > 1) return 3; m_isTLS = true; #if 0 // openssl debugging code that may be useful to have around // in a commented-out state. /* Following two steps are optional and not required for data exchange to be successful. */ /* Get the cipher - opt */ printf ("SSL connection using %s\n", SSL_get_cipher(m_ssl)); /* Get server's certificate (note: beware of dynamic allocation) - opt */ X509 *server_cert; server_cert = SSL_get_peer_certificate(m_ssl); if(!server_cert) { fprintf(stderr, "Can't SSL_get_peer_certificate\n"); return 2; } printf ("Server certificate:\n"); char *str = X509_NAME_oneline(X509_get_subject_name(server_cert),0,0); if(!str) { fprintf(stderr, "Can't X509_NAME_oneline\n"); return 2; } printf ("\t subject: %s\n", str); Free (str); str = X509_NAME_oneline (X509_get_issuer_name(server_cert),0,0); if(!str) { fprintf(stderr, "Can't X509_get_issuer_name\n"); return 2; } printf ("\t issuer: %s\n", str); Free (str); /* We could do all sorts of certificate verification stuff here before deallocating the certificate. */ X509_free(server_cert); #endif return 0; } #endif int tcp::disconnect() { if(m_open) { #ifdef USE_SSL if(m_isTLS) { #ifdef USE_OPENSSL SSL_shutdown(m_ssl); close(m_fd); SSL_free(m_ssl); SSL_CTX_free(m_sslCtx); #else gnutls_bye(*m_gnutls_session, GNUTLS_SHUT_RDWR); close(m_fd); gnutls_deinit(*m_gnutls_session); gnutls_anon_free_client_credentials(m_gnutls_anoncred); #endif m_isTLS = false; } else #endif { close(m_fd); } } m_open = false; return 0; } ERROR_TYPE tcp::sendData(CPCCHAR buf, int size) { if(!m_open) return eCorrupt; int sent = 0; m_poll.events = POLLOUT | POLLERR | POLLHUP | POLLNVAL; int rc; while(sent != size) { if(*m_exitCount > 1) return eCtrl_C; rc = poll(&m_poll, 1, 60000); if(rc == 0) { fprintf(stderr, "Server timed out on write.\n"); error(); return eTimeout; } if(rc < 0) { fprintf(stderr, "Poll error.\n"); error(); return eSocket; } #ifdef USE_SSL if(m_isTLS) { #ifdef USE_OPENSSL rc = SSL_write(m_ssl, &buf[sent], size - sent); #else rc = gnutls_record_send(*m_gnutls_session, &buf[sent], size - sent); #endif } else #endif { rc = write(m_fd, &buf[sent], size - sent); } if(rc < 1) { fprintf(stderr, "Can't write to socket.\n"); error(); return eSocket; } if(m_debug) m_debug->Write(buf, rc); sent += rc; } sentData(size); return eNoError; } // fgets() doesn't int tcp::readLine(char *buf, int bufSize) { if(!m_open) return eCorrupt; int ind = 0; if(m_start < m_end) { do { buf[ind] = m_buf[m_start]; ind++; m_start++; } while(m_start < m_end && m_buf[m_start - 1] != '\n' && ind < bufSize); } if(ind == bufSize || (ind > 0 && buf[ind - 1] == '\n') ) { if(ind < bufSize) buf[ind] = '\0'; receivedData(ind); if(m_debug) m_debug->Write(buf, ind); return ind; } // buffer is empty m_start = 0; m_end = 0; time_t now = time(NULL); m_poll.events = POLLIN | POLLERR | POLLHUP | POLLNVAL; while(1) { if(*m_exitCount > 1) return 3; int timeout = 60 - (time(NULL) - now); int rc; if(timeout < 0 || (rc = poll(&m_poll, 1, timeout * 1000)) == 0) { fprintf(stderr, "Server timed out on read.\n"); error(); return eSocket; } if(rc < 0) { if(errno == EINTR) continue; fprintf(stderr, "Poll error.\n"); error(); return eCorrupt; } #ifdef USE_SSL if(m_isTLS) { #ifdef USE_OPENSSL rc = SSL_read(m_ssl, m_buf, sizeof(m_buf)); #else rc = gnutls_record_recv(*m_gnutls_session, m_buf, sizeof(m_buf)); #endif } else #endif { rc = read(m_fd, m_buf, sizeof(m_buf)); } if(rc < 0) { error(); return eSocket; } m_end = rc; do { buf[ind] = m_buf[m_start]; ind++; m_start++; } while(m_start < m_end && m_buf[m_start - 1] != '\n' && ind < bufSize); if(ind == bufSize || (ind > 0 && buf[ind - 1] == '\n') ) { if(ind < bufSize) buf[ind] = '\0'; receivedData(ind); if(m_debug) m_debug->Write(buf, ind); return ind; } if(m_start == m_end) { m_start = 0; m_end = 0; } } return 0; } ERROR_TYPE tcp::sendCommandString(const string &str, bool important) { return sendCommandData(str.c_str(), str.size(), important); } ERROR_TYPE tcp::sendCommandData(const char *buf, int size, bool important) { ERROR_TYPE rc = sendData(buf, size); if(rc) return rc; return readCommandResp(important); } void tcp::endIt() { if(m_open) close(m_fd); m_open = false; } int tcp::doAllWork(int rate) { double workCount = 0.0; char data[2048]; time_t lastTime = time(NULL) - RESULTS_LAG; int toSend; for(unsigned int i = 0; i < sizeof(data); i++) data[i] = 1; while(1) { int rc; if(rate) { time_t newTime = time(NULL); workCount += double(newTime - lastTime) / 60.0 * double(rate); toSend = int(workCount); if(toSend > int(sizeof(data)) ) { toSend = sizeof(data); workCount = 0.0; } else { workCount -= double(toSend); } lastTime = newTime; } else toSend = sizeof(data); // NB if data can't be written then it is discarded. // Buffer size will be at least 1024 bytes, if worker threads aren't // keeping up then we don't really want more than that in the queue. if(toSend) { rc = WriteWork(data, toSend, 5); if(rc < 0) return -rc; } if(*m_exitCount > 1) return -1; rc = pollRead(); if(rc) return rc; } return 0; } postal-0.75/tcp.h0000644000000000000000000000522610551632312010577 0ustar #ifndef TCP_H #define TCP_H // Misnamed really. This class does all the common functionality between SMTP // and POP clients. using namespace std; #include "postal.h" #include #include #include "cmd5.h" #include "thread.h" #include #include class Logit; class address; #ifdef USE_SSL #ifdef USE_OPENSSL #ifndef TCP_BODY struct SSL_METHOD; struct SSL_CTX; struct SSL; struct X509; #else // TCP_BODY #include #include #include #include #include #endif // TCP_BODY #else // USE_OPENSSL #include #endif // USE_OPENSSL #endif // USE_SSL class tcp : public Thread { public: tcp(int *exitCount, const char *addr, unsigned short default_port, Logit *log #ifdef USE_SSL , int ssl #endif , const char *sourceAddr, Logit *debug); tcp(int threadNum, const tcp *parent); virtual ~tcp(); // connect returns 0 for connect, 1 for can't connect, and 2 for serious // errors. int Connect(short port = 0); #ifdef USE_SSL // after calling Connect() and getting high-level protocol ready call // ConnectTLS() to start TLS. int ConnectTLS(); #endif int sendMsg(); virtual int disconnect(); int doAllWork(int rate); protected: virtual int pollRead() = 0; virtual int WriteWork(PVOID buf, int size, int timeout) = 0; int readLine(char *buf, int bufSize); ERROR_TYPE sendData(CPCCHAR buf, int size); ERROR_TYPE sendString(const string &s) { return sendData(s.c_str(), s.size()); } void endIt(); virtual void error() = 0; virtual void sentData(int bytes) = 0; virtual void receivedData(int bytes) = 0; Cmd5 m_md5; virtual ERROR_TYPE readCommandResp(bool important = true) = 0; virtual ERROR_TYPE sendCommandData(const char *buf, int size, bool important = true); virtual ERROR_TYPE sendCommandString(const string &str, bool important = true); int m_destAffinity; Logit *m_log; struct sockaddr_in m_connectionLocalAddr; #ifdef USE_SSL bool m_canTLS; int m_useTLS; #endif int *m_exitCount; private: int m_fd; pollfd m_poll; char m_buf[4096]; int m_start; int m_end; bool m_open; address *m_addr; // destination address *m_sourceAddr; // debug file management object (NULL if no debugging) // if used a new Logit object is created for each instance unlike the // m_log instance Logit *m_debug; #ifdef USE_SSL #ifdef USE_OPENSSL SSL_METHOD *m_sslMeth; SSL_CTX* m_sslCtx; SSL *m_ssl; #else gnutls_session_t *m_gnutls_session; gnutls_anon_client_credentials_t m_gnutls_anoncred; #endif bool m_isTLS; #endif tcp(const tcp&); tcp & operator=(const tcp&); }; #endif postal-0.75/thread.cpp0000644000000000000000000000711610777264342011631 0ustar #include #include "thread.h" #include #include #include #include #include #include #include Thread::Thread() : m_read(-1) , m_write(-1) , m_threadNum(-1) , m_parentRead(-1) , m_parentWrite(-1) , m_childRead(-1) , m_childWrite(-1) , m_numThreads(0) , m_retVal(NULL) , m_thread_info(NULL) { } Thread::Thread(int threadNum, const Thread *parent) : m_read(parent->m_childRead) , m_write(parent->m_childWrite) , m_threadNum(threadNum) , m_parentRead(-1) , m_parentWrite(-1) , m_childRead(-1) , m_childWrite(-1) , m_numThreads(parent->m_numThreads) , m_retVal(&parent->m_retVal[threadNum]) , m_thread_info(NULL) { } Thread::~Thread() { if(m_threadNum == -1) { for(int i = 0; i < m_numThreads; i++) { pthread_join(m_thread_info[i], NULL); } close(m_parentRead); close(m_parentWrite); close(m_childRead); close(m_childWrite); delete m_thread_info; delete m_retVal; } } // for the benefit of this function and the new Thread class it may create // the Thread class must do nothing of note in it's constructor or it's // go() member function. PVOID thread_func(PVOID param) { THREAD_DATA *td = (THREAD_DATA *)param; Thread *thread = td->f->newThread(td->threadNum); thread->setRetVal(thread->action(td->param)); delete thread; delete td; return NULL; } void Thread::go(PVOID param, int num) { m_numThreads += num; int control[2]; int feedback[2]; if (pipe(feedback) || pipe(control)) { fprintf(stderr, "Can't open pipes.\n"); exit(1); } m_parentRead = feedback[0]; m_parentWrite = control[1]; m_childRead = control[0]; m_childWrite = feedback[1]; m_read = m_parentRead; m_write = m_parentWrite; m_readPoll.events = POLLIN | POLLERR | POLLHUP | POLLNVAL; m_writePoll.events = POLLOUT | POLLERR | POLLHUP | POLLNVAL; m_readPoll.fd = m_parentRead; m_writePoll.fd = m_parentWrite; pthread_attr_t attr; if(pthread_attr_init(&attr) || pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE) || pthread_attr_setstacksize(&attr, 32*1024)) fprintf(stderr, "Can't set thread attributes.\n"); m_retVal = new int[num + 1]; m_thread_info = new pthread_t[num]; for(int i = 1; i <= num; i++) { m_retVal[i] = -1; THREAD_DATA *td = new THREAD_DATA; td->f = this; td->param = param; td->threadNum = i; int p = pthread_create(&m_thread_info[i - 1], &attr, thread_func, PVOID(td)); if(p) { fprintf(stderr, "Can't create a thread.\n"); exit(1); } } if(pthread_attr_destroy(&attr)) fprintf(stderr, "Can't destroy thread attributes.\n"); m_readPoll.fd = m_read; m_writePoll.fd = m_write; } void Thread::setRetVal(int rc) { *m_retVal = rc; } int Thread::Read(PVOID buf, int size, int timeout) { if(timeout) { int rc = poll(&m_readPoll, 1, timeout * 1000); if(rc < 0) { fprintf(stderr, "Can't poll read ITC.\n"); return -1; } if(!rc) return 0; } if(size != read(m_read, buf, size) ) { fprintf(stderr, "Can't read data from ITC pipe.\n"); return -1; } return size; } int Thread::Write(PVOID buf, int size, int timeout) { if(timeout) { int rc; do { rc = poll(&m_writePoll, 1, timeout * 1000); if(rc < 0 && errno != EINTR) { fprintf(stderr, "Can't poll write ITC.\n"); return -1; } } while(rc == -1); if(!rc) return 0; } if(size != write(m_write, buf, size)) { fprintf(stderr, "Can't write data to ITC pipe.\n"); return -1; } return size; } postal-0.75/thread.h0000644000000000000000000000274110777264452011277 0ustar #ifndef THREAD_H #define THREAD_H #include "port.h" #include #include class Thread; typedef void *PVOID; typedef struct { Thread *f; PVOID param; int threadNum; } THREAD_DATA; class Thread { protected: // Virtual function that is called when the thread is started. // The parameter is the pointer that is passed first to the go() function virtual int action(PVOID param) = 0; // constructor for main thread class Thread(); // constructor for children. Thread(int threadNum, const Thread *parent); virtual ~Thread(); void go(PVOID param, int num); // creates all threads int getNumThreads() const { return m_numThreads; } // Virtual function to construct a new class. // the following comment has the implementation // return new class(threadNum, this); virtual Thread *newThread(int threadNum) = 0; // set the return value of the thread, probably not needed void setRetVal(int rc); protected: int getThreadNum() const { return m_threadNum; } int Read(PVOID buf, int size, int timeout = 60); int Write(PVOID buf, int size, int timeout = 60); protected: int m_read; int m_write; private: int m_threadNum; pollfd m_readPoll; pollfd m_writePoll; int m_parentRead; int m_parentWrite; int m_childRead; int m_childWrite; int m_numThreads; int *m_retVal; pthread_t *m_thread_info; Thread(const Thread &f); Thread & operator =(const Thread &f); friend PVOID thread_func(PVOID param); }; #endif postal-0.75/userlist.cpp0000644000000000000000000000316611704272700012221 0ustar #include "userlist.h" #include #include #include #include "expand.h" UserList::UserList(const char *userListFile, bool usePass, bool stripDom) : m_users(new STR_VEC) , m_passwords(NULL) , m_index(0) , m_maxNameLen(0) , m_primary(true) { char buf[1024]; FILE *fp = fopen(userListFile, "r"); if(!fp) { printf("Can't open \"%s\".\n", userListFile); exit(1); } if(usePass) m_passwords = new STR_VEC; while(fgets(buf, sizeof(buf), fp) ) { strtok(buf, "\n"); if(buf[0] != '\n' && buf[0] != '\r' && buf[0] != '#') { strtok(buf, " \t"); char *pass = strtok(NULL, " \t"); if(!pass && usePass) { printf("Need a password for \"%s\".", buf); continue; } if(usePass) m_passwords->push_back(buf + strlen(buf) + 1); if(stripDom) strtok(buf, "@"); m_users->push_back(buf); if(strlen(buf) > m_maxNameLen) m_maxNameLen = strlen(buf); } } if(m_users->size() == 0) { printf("No users in file.\n"); exit(1); } fclose(fp); } UserList::UserList(UserList &list) : m_users(list.m_users) , m_passwords(list.m_passwords) , m_index(0) , m_maxNameLen(0) , m_primary(false) { } UserList::~UserList() { if(m_primary) { delete m_users; delete m_passwords; } } const string &UserList::randomUser() { m_index = random() % m_users->size(); return m_users[0][m_index]; } string UserList::sequentialUser() { m_index++; if(m_index == m_users->size()) m_index = 0; return m_users[0][m_index]; } string UserList::password() { return m_passwords[0][m_index]; } postal-0.75/userlist.h0000644000000000000000000000135210777120711011664 0ustar #ifndef USERLIST_H #define USERLIST_H using namespace std; #include "conf.h" #ifdef HAVE_VECTOR #include #else #include #endif #include typedef vector STR_VEC; #include "postal.h" class UserList { public: UserList(const char *userListFile, bool usePass, bool stripDom = false); UserList(UserList &list); ~UserList(); const string &randomUser(); string password(); // get the password from the last user we got string sequentialUser(); size_t maxNameLen() const { return m_maxNameLen; } private: STR_VEC *m_users; STR_VEC *m_passwords; unsigned int m_index; size_t m_maxNameLen; bool m_primary; UserList(const UserList&); UserList & operator=(const UserList&); }; #endif