c_icap-0.5.6/0000775000175000017500000000000013570504160007744 500000000000000c_icap-0.5.6/c-icap-libicapapi-config.in0000664000175000017500000000134413371253152014711 00000000000000#!/bin/sh prefix=@prefix@ PKGLIBDIR=@PKGLIBDIR@/ LIBDIR=@LIBDIR@/ CONFIGDIR=@SYSCONFDIR@/ DATADIR=@PKGDATADIR@/ #LOGDIR= SOCKDIR=@SOCKDIR@ INCDIR=@INCLUDEDIR@ INCDIR2=@PKGINCLUDEDIR@ VERSION=@PACKAGE_VERSION@ CFLAGS="@CFLAGS@" LIBS="-L$LIBDIR -licapapi @EXT_PROGRAMS_LIBADD@" LDFLAGS="" usage() { cat < #include "body.h" #include "debug.h" #include "simple_api.h" #include "util.h" #include #include #ifdef _WIN32 #include #include #endif #if defined USE_POSIX_MAPPED_FILES #include #endif #define STARTLEN 8192 /*8*1024*1024 */ #define INCSTEP 4096 #define min(x,y) ((x)>(y)?(y):(x)) #define max(x,y) ((x)>(y)?(x):(y)) static int MEMBUF_POOL = -1; static int CACHED_FILE_POOL = -1; static int SIMPLE_FILE_POOL = -1; static int RING_BUF_POOL = -1; CI_DECLARE_FUNC(int) init_body_system() { MEMBUF_POOL = ci_object_pool_register("ci_membuf_t", sizeof(ci_membuf_t)); if (MEMBUF_POOL < 0) return CI_ERROR; CACHED_FILE_POOL = ci_object_pool_register("ci_cached_file_t", sizeof(ci_cached_file_t)); if (CACHED_FILE_POOL < 0) return CI_ERROR; SIMPLE_FILE_POOL = ci_object_pool_register("ci_simple_file_t", sizeof(ci_simple_file_t)); if (SIMPLE_FILE_POOL < 0) return CI_ERROR; RING_BUF_POOL = ci_object_pool_register("ci_ring_buf_t", sizeof(ci_ring_buf_t)); if (RING_BUF_POOL < 0) return CI_ERROR; return CI_OK; } void release_body_system() { ci_object_pool_unregister(MEMBUF_POOL); ci_object_pool_unregister(CACHED_FILE_POOL); ci_object_pool_unregister(SIMPLE_FILE_POOL); ci_object_pool_unregister(RING_BUF_POOL); } struct ci_membuf *ci_membuf_new() { return ci_membuf_new_sized(STARTLEN); } struct ci_membuf *ci_membuf_new_sized(int size) { struct ci_membuf *b; b = ci_object_pool_alloc(MEMBUF_POOL); if (!b) return NULL; b->endpos = 0; b->readpos = 0; b->flags = 0; b->buf = ci_buffer_alloc(size * sizeof(char)); if (b->buf == NULL) { ci_object_pool_free(b); return NULL; } b->bufsize = size; b->unlocked = -1; b->attributes = NULL; return b; } struct ci_membuf *ci_membuf_from_content(char *buf, size_t buf_size, size_t content_size, unsigned int flags) { struct ci_membuf *b; if (!buf || buf_size <= 0 || buf_size < content_size) { ci_debug_printf(1, "ci_membuf_from_content: Wrong arguments: %p, of size=%u and content size=%u\n", buf, (unsigned int)buf_size, (unsigned int)content_size); return NULL; } if ((flags & CI_MEMBUF_FROM_CONTENT_FLAGS) != flags) { ci_debug_printf(1, "ci_membuf_from_content: Wrong flags: %u\n", flags); return NULL; } if ((flags & CI_MEMBUF_NULL_TERMINATED)) { if (buf[content_size - 1] == '\0') content_size--; else if (content_size >= buf_size || buf[content_size] != '\0') { ci_debug_printf(1, "ci_membuf_from_content: content is not NULL terminated!\n"); return NULL; } } b = ci_object_pool_alloc(MEMBUF_POOL); if (!b) { ci_debug_printf(1, "ci_membuf_from_content: memory allocation failed\n"); return NULL; } b->flags = CI_MEMBUF_FOREIGN_BUF | flags; b->endpos = content_size; b->readpos = 0; b->buf = buf; b->bufsize = buf_size; b->unlocked = -1; b->attributes = NULL; return b; } void ci_membuf_free(struct ci_membuf *b) { if (!b) return; if (b->buf && !(b->flags & CI_MEMBUF_FOREIGN_BUF)) ci_buffer_free(b->buf); if (b->attributes) ci_array_destroy(b->attributes); ci_object_pool_free(b); } unsigned int ci_membuf_set_flag(struct ci_membuf *body, unsigned int flag) { if (!(flag & CI_MEMBUF_USER_FLAGS)) return 0; body->flags |= flag; return body->flags; } int ci_membuf_write(struct ci_membuf *b, const char *data, int len, int iseof) { int remains, newsize; char *newbuf; int terminate = b->flags & CI_MEMBUF_NULL_TERMINATED; if ((b->flags & CI_MEMBUF_RO) || (b->flags & CI_MEMBUF_CONST)) { ci_debug_printf(1, "ci_membuf_write: can not write: buffer is read-only!\n"); return 0; } if ((b->flags & CI_MEMBUF_HAS_EOF)) { if (len > 0) { ci_debug_printf(1, "Cannot write to membuf: the eof flag is set!\n"); } return 0; } if (iseof) { b->flags |= CI_MEMBUF_HAS_EOF; /* ci_debug_printf(10,"Buffer size=%d, Data size=%d\n ", ((struct membuf *)b)->bufsize,((struct membuf *)b)->endpos); */ } remains = b->bufsize - b->endpos - (terminate ? 1 : 0); assert(remains >= -1); /*can be -1 when NULL_TERMINATED flag just set by user and no space to*/ while (remains < len) { newsize = b->bufsize + INCSTEP; newbuf = ci_buffer_realloc(b->buf, newsize); if (newbuf == NULL) { ci_debug_printf(1, "ci_membuf_write: Failed to grow membuf for new data!\n"); if (remains >= 0) { if (remains) memcpy(b->buf + b->endpos, data, remains); if (terminate) { b->endpos = b->bufsize - 1; b->buf[b->endpos] = '\0'; } else b->endpos = b->bufsize; } else { ci_debug_printf(1, "ci_membuf_write: Failed to NULL terminate membuf!\n"); } return remains; } b->buf = newbuf; b->bufsize = newsize; remains = b->bufsize - b->endpos - (terminate ? 1 : 0); } /*while remainsbuf + b->endpos, data, len); b->endpos += len; } if (terminate) b->buf[b->endpos] = '\0'; return len; } int ci_membuf_read(struct ci_membuf *b, char *data, int len) { int remains, copybytes; if (b->unlocked >= 0) remains = b->unlocked - b->readpos; else remains = b->endpos - b->readpos; assert(remains >= 0); if (remains == 0 && (b->flags & CI_MEMBUF_HAS_EOF)) return CI_EOF; copybytes = (len <= remains ? len : remains); if (copybytes) { memcpy(data, b->buf + b->readpos, copybytes); b->readpos += copybytes; } return copybytes; } #define BODY_ATTRS_SIZE 1024 int ci_membuf_attr_add(struct ci_membuf *body,const char *attr, const void *val, size_t val_size) { if (!body->attributes) body->attributes = ci_array_new(BODY_ATTRS_SIZE); if (body->attributes) return (ci_array_add(body->attributes, attr, val, val_size) != NULL); return 0; } const void * ci_membuf_attr_get(struct ci_membuf *body,const char *attr) { if (body->attributes) return ci_array_search(body->attributes, attr); return NULL; } int ci_membuf_truncate(struct ci_membuf *body, int new_size) { if (body->endpos < new_size) return 0; body->endpos = new_size; if (body->flags & CI_MEMBUF_NULL_TERMINATED) body->buf[body->endpos] = '\0'; if (body->readpos > body->endpos) body->readpos = body->endpos; if (body->unlocked > body->endpos) body->unlocked = body->endpos; return 1; } /****/ int do_write(int fd, const void *buf, size_t count) { int bytes; errno = 0; do { bytes = write(fd, buf, count); } while (bytes < 0 && errno == EINTR); return bytes; } int do_read(int fd, void *buf, size_t count) { int bytes; errno = 0; do { bytes = read(fd, buf, count); } while (bytes < 0 && errno == EINTR); return bytes; } #ifdef _WIN32 #define F_PERM S_IREAD|S_IWRITE #else #define F_PERM S_IREAD|S_IWRITE|S_IRGRP|S_IROTH #endif int do_open(const char *pathname, int flags) { int fd; errno = 0; do { fd = open(pathname, flags, F_PERM); } while (fd < 0 && errno == EINTR); return fd; } void do_close(int fd) { errno = 0; while (close(fd) < 0 && errno == EINTR); } /**************************************************************************/ /* */ /* */ #define tmp_template "CI_TMP_XXXXXX" /* extern int BODY_MAX_MEM; extern char *TMPDIR; */ int CI_BODY_MAX_MEM = 131072; char *CI_TMPDIR = "/var/tmp/"; /* int open_tmp_file(char *tmpdir,char *filename){ return ci_mktemp_file(tmpdir,tmp_template,filename); } */ int resize_buffer(ci_cached_file_t * body, int new_size) { char *newbuf; if (new_size < body->bufsize) return 1; if (new_size > CI_BODY_MAX_MEM) return 0; newbuf = ci_buffer_realloc(body->buf, new_size); if (newbuf) { body->buf = newbuf; body->bufsize = new_size; } return 1; } ci_cached_file_t *ci_cached_file_new(int size) { ci_cached_file_t *body; if (!(body = ci_object_pool_alloc(CACHED_FILE_POOL))) return NULL; if (size == 0) size = CI_BODY_MAX_MEM; if (size > 0 && size <= CI_BODY_MAX_MEM) { body->buf = ci_buffer_alloc(size * sizeof(char)); } else body->buf = NULL; if (body->buf == NULL) { body->bufsize = 0; if ((body->fd = ci_mktemp_file(CI_TMPDIR, tmp_template, body->filename)) < 0) { ci_debug_printf(1, "Can not open temporary filename in directory:%s\n", CI_TMPDIR); ci_object_pool_free(body); return NULL; } } else { body->bufsize = size; body->fd = -1; } body->endpos = 0; body->readpos = 0; body->flags = 0; body->unlocked = 0; body->attributes = NULL; return body; } void ci_cached_file_reset(ci_cached_file_t * body, int new_size) { if (body->fd > 0) { do_close(body->fd); unlink(body->filename); /*Comment out for debuging reasons */ } body->endpos = 0; body->readpos = 0; body->flags = 0; body->unlocked = 0; body->fd = -1; if (body->attributes) ci_array_destroy(body->attributes); body->attributes = NULL; if (!resize_buffer(body, new_size)) { /*free memory and open a file. */ } } void ci_cached_file_destroy(ci_cached_file_t * body) { if (!body) return; if (body->buf) ci_buffer_free(body->buf); if (body->fd >= 0) { do_close(body->fd); unlink(body->filename); /*Comment out for debuging reasons */ } if (body->attributes) ci_array_destroy(body->attributes); ci_object_pool_free(body); } void ci_cached_file_release(ci_cached_file_t * body) { if (!body) return; if (body->buf) ci_buffer_free(body->buf); if (body->fd >= 0) { do_close(body->fd); } if (body->attributes) ci_array_destroy(body->attributes); ci_object_pool_free(body); } int ci_cached_file_write(ci_cached_file_t * body, const char *buf, int len, int iseof) { int remains; int ret; if (iseof) { body->flags |= CI_FILE_HAS_EOF; ci_debug_printf(10, "Buffer size=%d, Data size=%" PRINTF_OFF_T "\n ", ((ci_cached_file_t *) body)->bufsize, (CAST_OFF_T) ((ci_cached_file_t *) body)->endpos); } if (len == 0) /*If no data to write just return 0;*/ return 0; if (body->fd > 0) { /*A file was open so write the data at the end of file....... */ lseek(body->fd, 0, SEEK_END); if ((ret = do_write(body->fd, buf, len)) < 0) { ci_debug_printf(1, "Cannot write to file!!! (errno=%d)\n", errno); } body->endpos += len; return len; } remains = body->bufsize - body->endpos; assert(remains >= 0); if (remains < len) { if ((body->fd = ci_mktemp_file(CI_TMPDIR, tmp_template, body->filename)) < 0) { ci_debug_printf(1, "I cannot create the temporary file: %s!!!!!!\n", body->filename); return -1; } ret = do_write(body->fd, body->buf, body->endpos); if (ret >= 0 && do_write(body->fd, buf, len) >= 0) { body->endpos += len; return len; } else { ci_debug_printf(1, "Cannot write to cachefile: %s\n", strerror(errno)); return CI_ERROR; } } /* if remains 0) { memcpy(body->buf + body->endpos, buf, len); body->endpos += len; } return len; } /* body->unlocked=? */ int ci_cached_file_read(ci_cached_file_t * body, char *buf, int len) { int remains, bytes; if ((body->readpos == body->endpos) && (body->flags & CI_FILE_HAS_EOF)) return CI_EOF; if (len == 0) /*If no data to read just return 0*/ return 0; if (body->fd > 0) { if ((body->flags & CI_FILE_USELOCK) && body->unlocked >= 0) remains = body->unlocked - body->readpos; else remains = len; assert(remains >= 0); bytes = (remains > len ? len : remains); /*Number of bytes that we are going to read from file..... */ lseek(body->fd, body->readpos, SEEK_SET); if ((bytes = do_read(body->fd, buf, bytes)) > 0) body->readpos += bytes; return bytes; } if ((body->flags & CI_FILE_USELOCK) && body->unlocked >= 0) remains = body->unlocked - body->readpos; else remains = body->endpos - body->readpos; assert(remains >= 0); bytes = (len <= remains ? len : remains); if (bytes > 0) { memcpy(buf, body->buf + body->readpos, bytes); body->readpos += bytes; } else { /*?????????????????????????????? */ bytes = 0; ci_debug_printf(10, "Read 0, %" PRINTF_OFF_T " %" PRINTF_OFF_T "\n", (CAST_OFF_T) body->readpos, (CAST_OFF_T) body->endpos); } return bytes; } /********************************************************************************/ /*ci_simple_file function implementation */ ci_simple_file_t *ci_simple_file_new(ci_off_t maxsize) { ci_simple_file_t *body; if (!(body = ci_object_pool_alloc(SIMPLE_FILE_POOL))) return NULL; if ((body->fd = ci_mktemp_file(CI_TMPDIR, tmp_template, body->filename)) < 0) { ci_debug_printf(1, "ci_simple_file_new: Can not open temporary filename in directory:%s\n", CI_TMPDIR); ci_object_pool_free(body); return NULL; } ci_debug_printf(5, "ci_simple_file_new: Use temporary filename: %s\n", body->filename); body->endpos = 0; body->readpos = 0; body->flags = 0; body->unlocked = 0; /*Not use look */ body->max_store_size = (maxsize>0?maxsize:0); body->bytes_in = 0; body->bytes_out = 0; body->attributes = NULL; #if defined(USE_POSIX_MAPPED_FILES) body->mmap_addr = NULL; body->mmap_size = 0; #endif return body; } ci_simple_file_t *ci_simple_file_named_new(char *dir, char *filename,ci_off_t maxsize) { ci_simple_file_t *body; if (!(body = ci_object_pool_alloc(SIMPLE_FILE_POOL))) return NULL; if (filename) { snprintf(body->filename, CI_FILENAME_LEN, "%s/%s", dir, filename); if ((body->fd = do_open(body->filename, O_CREAT | O_RDWR | O_EXCL)) < 0) { ci_debug_printf(1, "Can not open temporary filename: %s\n", body->filename); ci_object_pool_free(body); return NULL; } } else if ((body->fd = ci_mktemp_file(dir, tmp_template, body->filename)) < 0) { ci_debug_printf(1, "Can not open temporary filename in directory: %s\n", dir); ci_object_pool_free(body); return NULL; } body->endpos = 0; body->readpos = 0; body->flags = 0; body->unlocked = 0; body->max_store_size = (maxsize>0?maxsize:0); body->bytes_in = 0; body->bytes_out = 0; body->attributes = NULL; #if defined(USE_POSIX_MAPPED_FILES) body->mmap_addr = NULL; body->mmap_size = 0; #endif return body; } void ci_simple_file_destroy(ci_simple_file_t * body) { if (!body) return; if (body->fd >= 0) { do_close(body->fd); unlink(body->filename); /*Comment out for debuging reasons */ } if (body->attributes) ci_array_destroy(body->attributes); #if defined(USE_POSIX_MAPPED_FILES) if (body->mmap_addr) munmap(body->mmap_addr, body->mmap_size); #endif ci_object_pool_free(body); } void ci_simple_file_release(ci_simple_file_t * body) { if (!body) return; if (body->fd >= 0) { do_close(body->fd); } if (body->attributes) ci_array_destroy(body->attributes); #if defined(USE_POSIX_MAPPED_FILES) if (body->mmap_addr) munmap(body->mmap_addr, body->mmap_size); #endif ci_object_pool_free(body); } int ci_simple_file_write(ci_simple_file_t * body, const char *buf, int len, int iseof) { int ret; int wsize = 0; if (body->flags & CI_FILE_HAS_EOF) { if (len > 0) { ci_debug_printf(1, "Cannot write to file: '%s', the eof flag is set!\n", body->filename); } return 0; } if (len <= 0) { if (iseof) body->flags |= CI_FILE_HAS_EOF; return 0; } if (body->endpos < body->readpos) { wsize = min(body->readpos-body->endpos-1, len); } else if (body->max_store_size && body->endpos >= body->max_store_size) { /*If we are going to entre ring mode. If we are using locking we can not enter ring mode.*/ if (body->readpos != 0 && (body->flags & CI_FILE_USELOCK) == 0) { body->endpos = 0; if (!(body->flags & CI_FILE_RING_MODE)) { body->flags |= CI_FILE_RING_MODE; ci_debug_printf(9, "Entering Ring mode!\n"); } wsize = min(body->readpos-body->endpos-1, len); } else { if ((body->flags & CI_FILE_USELOCK) != 0) ci_debug_printf(1, "File locked and no space on file for writing data, (Is this a bug?)!\n"); return 0; } } else { if (body->max_store_size) wsize = min(body->max_store_size - body->endpos, len); else wsize = len; } lseek(body->fd, body->endpos, SEEK_SET); if ((ret = do_write(body->fd, buf, wsize)) < 0) { ci_debug_printf(1, "Cannot write to file: %s\n", strerror(errno)); } else { body->endpos += ret; body->bytes_in += ret; } if (iseof && ret == len) { body->flags |= CI_FILE_HAS_EOF; ci_debug_printf(9, "Body data size=%" PRINTF_OFF_T "\n ", (CAST_OFF_T) body->endpos); } return ret; } int ci_simple_file_read(ci_simple_file_t * body, char *buf, int len) { int remains, bytes; if (len <= 0) return 0; if ((body->readpos == body->endpos)) { if ((body->flags & CI_FILE_HAS_EOF)) { ci_debug_printf(9, "Has EOF and no data to read, send EOF\n"); return CI_EOF; } else { return 0; } } if (body->max_store_size && body->readpos == body->max_store_size) { body->readpos = 0; } if ((body->flags & CI_FILE_USELOCK) && body->unlocked >= 0) { remains = body->unlocked - body->readpos; } else if (body->endpos > body->readpos) { remains = body->endpos - body->readpos; } else { if (body->max_store_size) { remains = body->max_store_size - body->readpos; } else { ci_debug_printf(9, "Error? anyway send EOF\n"); return CI_EOF; } } assert(remains >= 0); bytes = (remains > len ? len : remains); /*Number of bytes that we are going to read from file..... */ lseek(body->fd, body->readpos, SEEK_SET); if ((bytes = do_read(body->fd, buf, bytes)) > 0) { body->readpos += bytes; body->bytes_out += bytes; } return bytes; } int ci_simple_file_truncate(ci_simple_file_t *body, ci_off_t new_size) { if (new_size > body->endpos) return 0; if (new_size == 0) { new_size = lseek(body->fd, 0, SEEK_END); if (new_size > body->endpos) /* ????? */ return 0; } else { if (ftruncate(body->fd, new_size) != 0) return 0; /*failed to resize*/ } body->endpos = new_size; if (body->readpos > new_size) body->readpos = new_size; if (body->unlocked > new_size) body->unlocked = new_size; return 1; } const char * ci_simple_file_to_const_string(ci_simple_file_t *body) { #if defined(USE_POSIX_MAPPED_FILES) ci_off_t map_size; char *addr = NULL; if (!(body->flags & CI_FILE_HAS_EOF)) { ci_debug_printf(1, "mmap to file: '%s' failed, the eof flag is not set!\n", body->filename); return NULL; } /* We need one more byte for string termination*/ map_size = body->endpos + 1; if (ftruncate(body->fd, map_size) != 0) return NULL; /*failed to resize*/ if (body->mmap_addr == NULL) { addr = mmap(NULL, map_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, body->fd, 0); if (!addr) return NULL; /*Terminate buffer (already terminated by ftruncate?) */ addr[map_size - 1] = '\0'; body->mmap_addr = addr; body->mmap_size = map_size; } return body->mmap_addr; #else ci_debug_printf( 1, "ci_simple_file_to_const_string: Requires posix mapped files to work, which is not supported."); return NULL; #endif } #define CI_MEMBUF_SF_FLAGS (CI_MEMBUF_CONST | CI_MEMBUF_RO | CI_MEMBUF_NULL_TERMINATED) ci_membuf_t *ci_simple_file_to_membuf(ci_simple_file_t *body, unsigned int flags) { assert((CI_MEMBUF_SF_FLAGS & flags) == flags); assert(flags & CI_MEMBUF_CONST); void *addr = (void *)ci_simple_file_to_const_string(body); if (!addr) return NULL; return ci_membuf_from_content(body->mmap_addr, body->mmap_size, body->endpos, CI_MEMBUF_CONST | CI_MEMBUF_RO | CI_MEMBUF_NULL_TERMINATED | CI_MEMBUF_HAS_EOF); } /*******************************************************************/ /*ring memory buffer implementation */ struct ci_ring_buf *ci_ring_buf_new(int size) { struct ci_ring_buf *buf = ci_object_pool_alloc(RING_BUF_POOL); if (!buf) return NULL; buf->buf = ci_buffer_alloc(size); if (!buf->buf) { ci_object_pool_free(buf); return NULL; } buf->end_buf = buf->buf+size-1; buf->read_pos = buf->buf; buf->write_pos = buf->buf; buf->full = 0; return buf; } void ci_ring_buf_destroy(struct ci_ring_buf *buf) { ci_buffer_free(buf->buf); ci_object_pool_free(buf); } int ci_ring_buf_is_empty(struct ci_ring_buf *buf) { return (buf->read_pos == buf->write_pos) && (buf->full == 0); } int ci_ring_buf_write_block(struct ci_ring_buf *buf, char **wb, int *len) { if (buf->read_pos == buf->write_pos && buf->full == 0) { *wb = buf->write_pos; *len = buf->end_buf - buf->write_pos + 1; return 0; } else if (buf->read_pos >= buf->write_pos) { *wb = buf->write_pos; *len = buf->read_pos - buf->write_pos; return 0; } else { /*buf->read_pos < buf->write_pos*/ *wb = buf->write_pos; *len = buf->end_buf - buf->write_pos + 1; return 1; } } int ci_ring_buf_read_block(struct ci_ring_buf *buf, char **rb, int *len) { if (buf->read_pos == buf->write_pos && buf->full == 0) { *rb = buf->read_pos; *len = 0; return 0; } else if (buf->read_pos >= buf->write_pos) { *rb = buf->read_pos; *len = buf->end_buf - buf->read_pos +1; return (buf->read_pos != buf->buf? 1:0); } else { /*buf->read_pos < buf->write_pos*/ *rb = buf->read_pos; *len = buf->write_pos - buf->read_pos; return 0; } } void ci_ring_buf_consume(struct ci_ring_buf *buf, int len) { if (len <= 0) return; buf->read_pos += len; if (buf->read_pos > buf->end_buf) buf->read_pos = buf->buf; if (buf->full) buf->full = 0; } void ci_ring_buf_produce(struct ci_ring_buf *buf, int len) { if (len <= 0) return; buf->write_pos += len; if (buf->write_pos > buf->end_buf) buf->write_pos = buf->buf; if (buf->write_pos == buf->read_pos) buf->full = 1; } int ci_ring_buf_write(struct ci_ring_buf *buf, const char *data,int size) { char *wb; int wb_len, ret, written; written = 0; do { ret = ci_ring_buf_write_block(buf, &wb, &wb_len); if (wb_len) { wb_len = min(size, wb_len); memcpy(wb, data, wb_len); ci_ring_buf_produce(buf, wb_len); size -= wb_len; data += wb_len; written += wb_len; } } while ((ret != 0) && (size > 0)); return written; } int ci_ring_buf_read(struct ci_ring_buf *buf, char *data,int size) { char *rb; int rb_len, ret, data_read; data_read = 0; do { ret = ci_ring_buf_read_block(buf, &rb, &rb_len); if (rb_len) { rb_len = min(size, rb_len); memcpy(data, rb, rb_len); ci_ring_buf_consume(buf, rb_len); size -= rb_len; data += rb_len; data_read += rb_len; } } while ((ret != 0) && (size > 0)); return data_read; } c_icap-0.5.6/missing0000755000175000017500000001533013570504056011267 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: c_icap-0.5.6/info.c0000664000175000017500000003453213371253152010773 00000000000000/* * Copyright (C) 2004-2009 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "service.h" #include "header.h" #include "body.h" #include "simple_api.h" #include "stats.h" #include "proc_threads_queues.h" #include "debug.h" int info_init_service(ci_service_xdata_t * srv_xdata, struct ci_server_conf *server_conf); int info_check_preview_handler(char *preview_data, int preview_data_len, ci_request_t *); int info_end_of_data_handler(ci_request_t * req); void *info_init_request_data(ci_request_t * req); void info_close_service(); void info_release_request_data(void *data); int info_io(char *wbuf, int *wlen, char *rbuf, int *rlen, int iseof, ci_request_t * req); CI_DECLARE_MOD_DATA ci_service_module_t info_service = { "info", /* mod_name, The module name */ "C-icap run-time information", /* mod_short_descr, Module short description */ ICAP_REQMOD, /* mod_type, The service type is request modification */ info_init_service, /* mod_init_service. Service initialization */ NULL, /* post_init_service. Service initialization after c-icap configured. Not used here */ info_close_service, /* mod_close_service. Called when service shutdowns. */ info_init_request_data, /* mod_init_request_data */ info_release_request_data, /* mod_release_request_data */ info_check_preview_handler, /* mod_check_preview_handler */ info_end_of_data_handler, /* mod_end_of_data_handler */ info_io, /* mod_service_io */ NULL, NULL }; struct info_req_data { ci_membuf_t *body; int txt_mode; int childs; int *child_pids; int free_servers; int used_servers; unsigned int closing_childs; int *closing_child_pids; unsigned int started_childs; unsigned int closed_childs; unsigned int crashed_childs; struct stat_memblock *collect_stats; }; extern struct childs_queue *childs_queue; extern ci_proc_mutex_t accept_mutex; int build_statistics(struct info_req_data *info_data); int info_init_service(ci_service_xdata_t * srv_xdata, struct ci_server_conf *server_conf) { ci_service_set_xopts(srv_xdata, CI_XAUTHENTICATEDUSER|CI_XAUTHENTICATEDGROUPS); return CI_OK; } void info_close_service() { ci_debug_printf(5,"Service %s shutdown!\n", info_service.mod_name); } void *info_init_request_data(ci_request_t * req) { struct info_req_data *info_data; info_data = malloc(sizeof(struct info_req_data)); info_data->body = ci_membuf_new(); info_data->childs = 0; info_data->child_pids = malloc(childs_queue->size * sizeof(int)); info_data->free_servers = 0; info_data->used_servers = 0; info_data->closing_childs = 0; info_data->closing_child_pids = malloc(childs_queue->size * sizeof(int)); info_data->started_childs = 0; info_data->closed_childs = 0; info_data->crashed_childs = 0; info_data->txt_mode = 0; if (req->args[0] != '\0') { if (strstr(req->args, "view=text")) info_data->txt_mode = 1; } info_data->collect_stats = malloc(ci_stat_memblock_size()); info_data->collect_stats->sig = 0xFAFA; stat_memblock_fix(info_data->collect_stats); ci_stat_memblock_reset(info_data->collect_stats); return info_data; } void info_release_request_data(void *data) { struct info_req_data *info_data = (struct info_req_data *)data; if (info_data->body) ci_membuf_free(info_data->body); if (info_data->collect_stats) free(info_data->collect_stats); free(info_data); } int info_check_preview_handler(char *preview_data, int preview_data_len, ci_request_t * req) { struct info_req_data *info_data = ci_service_data(req); if (ci_req_hasbody(req)) return CI_MOD_ALLOW204; ci_req_unlock_data(req); ci_http_response_create(req, 1, 1); /*Build the responce headers */ ci_http_response_add_header(req, "HTTP/1.0 200 OK"); ci_http_response_add_header(req, "Server: C-ICAP"); ci_http_response_add_header(req, "Content-Type: text/html"); ci_http_response_add_header(req, "Content-Language: en"); ci_http_response_add_header(req, "Connection: close"); if (info_data->body) { build_statistics (info_data); } return CI_MOD_CONTINUE; } int info_end_of_data_handler(ci_request_t * req) { return CI_MOD_DONE; } int info_io(char *wbuf, int *wlen, char *rbuf, int *rlen, int iseof, ci_request_t * req) { int ret; struct info_req_data *info_data = ci_service_data(req); ret = CI_OK; if (wbuf && wlen) { if (info_data->body) *wlen = ci_membuf_read(info_data->body, wbuf, *wlen); else *wlen = CI_EOF; } return ret; } /*Statistisc implementation .....*/ void fill_queue_statistics(struct childs_queue *q, struct info_req_data *info_data) { int i; int requests = 0; struct stat_memblock *stats, copy_stats; struct server_statistics *srv_stats; if (!q->childs) return; /*Merge childs data*/ for (i = 0; i < q->size; i++) { if (q->childs[i].pid != 0 && q->childs[i].to_be_killed == 0) { if (info_data->child_pids) info_data->child_pids[info_data->childs] = q->childs[i].pid; info_data->childs++; info_data->free_servers += q->childs[i].freeservers; info_data->used_servers += q->childs[i].usedservers; requests += q->childs[i].requests; stats = q->stats_area + i * (q->stats_block_size); copy_stats.counters64_size = stats->counters64_size; copy_stats.counterskbs_size = stats->counterskbs_size; copy_stats.counters64 = (void *)stats + _CI_ALIGN(sizeof(struct stat_memblock)); copy_stats.counterskbs = (void *)stats + _CI_ALIGN(sizeof(struct stat_memblock)) + stats->counters64_size*sizeof(uint64_t); ci_stat_memblock_merge(info_data->collect_stats, ©_stats); } else if (q->childs[i].pid != 0 && q->childs[i].to_be_killed) { if (info_data->closing_child_pids) info_data->closing_child_pids[info_data->closing_childs] = q->childs[i].pid; info_data->closing_childs++; } } /*Merge history data*/ stats = q->stats_area + q->size * q->stats_block_size; copy_stats.counters64_size = stats->counters64_size; copy_stats.counterskbs_size = stats->counterskbs_size; copy_stats.counters64 = (void *)stats + _CI_ALIGN(sizeof(struct stat_memblock)); copy_stats.counterskbs = (void *)stats + _CI_ALIGN(sizeof(struct stat_memblock)) + stats->counters64_size*sizeof(uint64_t); ci_stat_memblock_merge(info_data->collect_stats, ©_stats); srv_stats = (struct server_statistics *)(q->stats_area + q->size * q->stats_block_size + q->stats_block_size); /*Compute server statistics*/ info_data->started_childs = srv_stats->started_childs; info_data->closed_childs = srv_stats->closed_childs; info_data->crashed_childs = srv_stats->crashed_childs; } struct stats_tmpl { char *gen_template; char *statsHeader; char *statsEnd; char *childsHeader; char *childs_tmpl; char *childsEnd; char *closingChildsHeader; char *d1TableHeader_tmpl; char *d1TableEntry_tmpl; char *d1TableEnd_tmpl; char *statline_tmpl_int; char *statline_tmpl_kbs; }; struct stats_tmpl txt_tmpl = { "Running Servers Statistics\n===========================\n"\ "Children number: %d\nFree Servers: %d\nUsed Servers: %d\n"\ "Started Processes: %u\nClosed Processes: %u\nCrashed Processes: %u\n"\ "Closing Processes: %u"\ "\n\n", "\n%s Statistics\n==================\n", "", "Child pids:", " %d", "\n", "Closing children pids:", "%s\n", "\t %s\n", "\n\n", "%s : %lld\n", "%s : %lld Kbs %d bytes\n" }; struct stats_tmpl html_tmpl = { "

Running Servers Statistics

\n"\ "" \ "
Children number: %d" \ "
Free Servers: %d" \ "
Used Servers: %d" \ "
Started Processes : %u" \ "
Closed Processes: %u" \ "
Crashed Processes: %u" \ "
Closing Processes: %u" \ "
\n", "

%s Statistics

\n", "
", "", "", "
Child pids: %d
\n", "", "
Closing children pids:
\n", "\n", "
%s
%s
\n", "%s: %lld\n", "%s: %lld Kbs %d bytes\n" }; #define LOCAL_BUF_SIZE 1024 int build_statistics(struct info_req_data *info_data) { char buf[LOCAL_BUF_SIZE]; char buf2[LOCAL_BUF_SIZE]; int sz, gid, k; char *stat_group; struct stats_tmpl *tmpl; if (info_data->txt_mode) tmpl = &txt_tmpl; else tmpl = &html_tmpl; if (!info_data->body) return 0; fill_queue_statistics(childs_queue, info_data); sz = snprintf(buf, LOCAL_BUF_SIZE,tmpl->gen_template, info_data->childs, info_data->free_servers, info_data->used_servers, info_data->started_childs, info_data->closed_childs, info_data->crashed_childs, info_data->closing_childs ); if (sz > LOCAL_BUF_SIZE) sz = LOCAL_BUF_SIZE; ci_membuf_write(info_data->body,buf, sz, 0); /*print childs pids ...*/ ci_membuf_write(info_data->body, tmpl->childsHeader, strlen(tmpl->childsHeader), 0); for (k = 0; k < info_data->childs; k++) { sz = snprintf(buf, LOCAL_BUF_SIZE, tmpl->childs_tmpl, info_data->child_pids[k]); if (sz > LOCAL_BUF_SIZE) sz = LOCAL_BUF_SIZE; ci_membuf_write(info_data->body,buf, sz, 0); } ci_membuf_write(info_data->body, tmpl->childsEnd, strlen(tmpl->childsEnd), 0); /*print closing childs pids ...*/ ci_membuf_write(info_data->body, tmpl->closingChildsHeader, strlen(tmpl->closingChildsHeader), 0); for (k = 0; k < info_data->closing_childs; k++) { sz = snprintf(buf, LOCAL_BUF_SIZE, tmpl->childs_tmpl, info_data->closing_child_pids[k]); if (sz > LOCAL_BUF_SIZE) sz = LOCAL_BUF_SIZE; ci_membuf_write(info_data->body,buf, sz, 0); } ci_membuf_write(info_data->body, tmpl->childsEnd, strlen(tmpl->childsEnd), 0); /*Print semaphores*/ sz = snprintf(buf, LOCAL_BUF_SIZE, tmpl->d1TableHeader_tmpl, "Semaphores in use"); if (sz > LOCAL_BUF_SIZE) sz = LOCAL_BUF_SIZE; ci_membuf_write(info_data->body,buf, sz, 0); accept_mutex.scheme->proc_mutex_print_info(&accept_mutex, buf2, LOCAL_BUF_SIZE); sz = snprintf(buf, LOCAL_BUF_SIZE, tmpl->d1TableEntry_tmpl, buf2); ci_membuf_write(info_data->body,buf, sz, 0); childs_queue->queue_mtx.scheme->proc_mutex_print_info(&childs_queue->queue_mtx, buf2, LOCAL_BUF_SIZE); sz = snprintf(buf, LOCAL_BUF_SIZE, tmpl->d1TableEntry_tmpl, buf2); ci_membuf_write(info_data->body,buf, sz, 0); ci_membuf_write(info_data->body, tmpl->d1TableEnd_tmpl, strlen(tmpl->d1TableEnd_tmpl), 0); /*Print shared mem*/ sz = snprintf(buf, LOCAL_BUF_SIZE, tmpl->d1TableHeader_tmpl, "Shared mem blocks in use"); if (sz > LOCAL_BUF_SIZE) sz = LOCAL_BUF_SIZE; ci_membuf_write(info_data->body,buf, sz, 0); if (childs_queue->shmid.scheme) { childs_queue->shmid.scheme->shared_mem_print_info(&childs_queue->shmid, buf2, LOCAL_BUF_SIZE); sz = snprintf(buf, LOCAL_BUF_SIZE, tmpl->d1TableEntry_tmpl, buf2); ci_membuf_write(info_data->body,buf, sz, 0); } ci_membuf_write(info_data->body, tmpl->d1TableEnd_tmpl, strlen(tmpl->d1TableEnd_tmpl), 0); for (gid = 0; gid < STAT_GROUPS.entries_num; gid++) { stat_group = STAT_GROUPS.groups[gid]; sz = snprintf(buf, LOCAL_BUF_SIZE, tmpl->statsHeader, stat_group); if (sz > LOCAL_BUF_SIZE) sz = LOCAL_BUF_SIZE; ci_membuf_write(info_data->body, buf, sz, 0); for (k = 0; k < info_data->collect_stats->counters64_size && k < STAT_INT64.entries_num; k++) { if (gid == STAT_INT64.entries[k].gid) { sz = snprintf(buf, LOCAL_BUF_SIZE, tmpl->statline_tmpl_int, STAT_INT64.entries[k].label, info_data->collect_stats->counters64[k]); if (sz > LOCAL_BUF_SIZE) sz = LOCAL_BUF_SIZE; ci_membuf_write(info_data->body,buf, sz, 0); } } for (k = 0; k < info_data->collect_stats->counterskbs_size && k < STAT_KBS.entries_num; k++) { if (gid == STAT_KBS.entries[k].gid) { sz = snprintf(buf, LOCAL_BUF_SIZE, tmpl->statline_tmpl_kbs, STAT_KBS.entries[k].label, info_data->collect_stats->counterskbs[k]); if (sz > LOCAL_BUF_SIZE) sz = LOCAL_BUF_SIZE; ci_membuf_write(info_data->body,buf, sz, 0); } } ci_membuf_write(info_data->body,tmpl->statsEnd, strlen(tmpl->statsEnd), 0); } ci_membuf_write(info_data->body, NULL, 0, 1); return 1; } c_icap-0.5.6/encode.c0000664000175000017500000003710013422052062011261 00000000000000/* * Copyright (C) 2017 Jeffrey Merkey * Copyright (C) 2017 Trever L. Adams * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "body.h" #include "simple_api.h" #include "debug.h" #include #ifdef HAVE_ZLIB #include #endif #ifdef HAVE_BZLIB #include #endif #ifdef HAVE_BROTLI #include "brotli/decode.h" #include "brotli/encode.h" #include "brotli/types.h" #include "brotli/port.h" #endif /*return CI_DEFLATE_ERRORS */ int ci_compress_to_membuf(int encoding_format, const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { switch (encoding_format) { case CI_ENCODE_NONE: return CI_COMP_OK; break; #ifdef HAVE_ZLIB case CI_ENCODE_GZIP: return ci_gzip_to_membuf(inbuf, inlen, outbuf, max_size); break; case CI_ENCODE_DEFLATE: return ci_deflate_to_membuf(inbuf, inlen, outbuf, max_size); break; #endif #ifdef HAVE_BZLIB case CI_ENCODE_BZIP2: return ci_bzzip_to_membuf(inbuf, inlen, outbuf, max_size); break; #endif #ifdef HAVE_BROTLI case CI_ENCODE_BROTLI: return ci_brdeflate_to_membuf(inbuf, inlen, outbuf, max_size); break; #endif case CI_ENCODE_UNKNOWN: default: return CI_COMP_ERR_ERROR; break; } } /*return CI_DEFLATE_ERRORS */ int ci_compress_to_simple_file(int encoding_format, const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { switch (encoding_format) { case CI_ENCODE_NONE: return CI_COMP_OK; break; #ifdef HAVE_ZLIB case CI_ENCODE_GZIP: return ci_gzip_to_simple_file(inbuf, inlen, outbuf, max_size); break; case CI_ENCODE_DEFLATE: return ci_deflate_to_simple_file(inbuf, inlen, outbuf, max_size); break; #endif #ifdef HAVE_BZLIB case CI_ENCODE_BZIP2: return ci_bzzip_to_simple_file(inbuf, inlen, outbuf, max_size); break; #endif #ifdef HAVE_BROTLI case CI_ENCODE_BROTLI: return ci_brdeflate_to_simple_file(inbuf, inlen, outbuf, max_size); break; #endif case CI_ENCODE_UNKNOWN: default: return CI_COMP_ERR_ERROR; break; } } #define CHUNK 8192 static int write_membuf_func(void *obj, const char *buf, size_t len) { return ci_membuf_write((ci_membuf_t *)obj, buf, len, 0); } static int write_simple_file_func(void *obj, const char *buf, size_t len) { return ci_simple_file_write((ci_simple_file_t *)obj, buf, len, 0); } #ifdef HAVE_BROTLI #define DEFAULT_LGWIN 22 #define DEFAULT_QUALITY 11 #define kFileBufferSize 16384 BROTLI_BOOL brotli_compress(BrotliEncoderState* s, const char *buf, int inlen, void *outbuf, char *(*get_outbuf)(void *obj, unsigned int *len), int (*writefunc)(void *obj, const char *buf, size_t len), ci_off_t max_size) { size_t available_in; const uint8_t* next_in; size_t available_out; uint8_t* next_out; unsigned have, written; long long outsize; int result; size_t total_out = 0; uint8_t out[kFileBufferSize]; ci_debug_printf(4, "data-compression: brotli compress called size: %d\n", inlen); next_in = (uint8_t *)buf; available_in = inlen; outsize = 0; for (;;) { available_out = kFileBufferSize; next_out = out; result = BrotliEncoderCompressStream(s, available_in ? BROTLI_OPERATION_PROCESS : BROTLI_OPERATION_FINISH, &available_in, &next_in, &available_out, &next_out, &total_out); if (!result) { /* Should detect OOM? */ ci_debug_printf(4, "data-compression: brotli failed to compress data\n"); return BROTLI_FALSE; } if (available_out != kFileBufferSize) { have = kFileBufferSize - available_out; if (!have || (written = writefunc(outbuf, (char *)out, have)) != have) { ci_debug_printf(4, "data-compression: brotli data corrupt\n"); return BROTLI_FALSE; } outsize += written; } if (BrotliEncoderIsFinished(s)) { ci_debug_printf(4, "data-compression: brotli total compressed size %lld (%lld) ...\n", outsize, (long long) total_out); return BROTLI_TRUE; } } } int ci_mem_brdeflate(const char *inbuf, int inlen, void *outbuf, char *(*get_outbuf)(void *obj, unsigned int *len), int (*writefunc)(void *obj, const char *buf, size_t len), ci_off_t max_size) { BROTLI_BOOL ccode = BROTLI_TRUE; BrotliEncoderState *s; s = BrotliEncoderCreateInstance(NULL, NULL, NULL); if (!s) { ci_debug_printf(4, "data-compression: brotli out of memory\n"); return -1; } BrotliEncoderSetParameter(s, BROTLI_PARAM_MODE, BROTLI_MODE_TEXT); BrotliEncoderSetParameter(s, BROTLI_PARAM_QUALITY, DEFAULT_QUALITY); BrotliEncoderSetParameter(s, BROTLI_PARAM_LGWIN, DEFAULT_LGWIN); ccode = brotli_compress(s, inbuf, inlen, outbuf, get_outbuf, writefunc, max_size); BrotliEncoderDestroyInstance(s); if (!ccode) return -1; return 1; } int ci_brdeflate_to_membuf(const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { int ret = ci_mem_brdeflate(inbuf, inlen, outbuf, NULL, write_membuf_func, max_size); ci_membuf_write(outbuf, "", 0, 1); return ret; } int ci_brdeflate_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { int ret = ci_mem_brdeflate(inbuf, inlen, outbuf, NULL, write_simple_file_func, max_size); ci_simple_file_write(outbuf, "", 0, 1); return ret; } #else int ci_brdeflate_to_membuf(const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { ci_debug_printf(1, "brotliencode is not supported.\n"); return CI_COMP_ERR_NONE; } int ci_brdeflate_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { ci_debug_printf(1, "brotliencode is not supported.\n"); return CI_COMP_ERR_NONE; } #endif #ifdef HAVE_ZLIB #define ZIP_HEAD_CRC 0x02 /* bit 1 set: header CRC present */ #define ZIP_EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ #define ZIP_ORIG_NAME 0x08 /* bit 3 set: original file name present */ #define ZIP_COMMENT 0x10 /* bit 4 set: file comment present */ #define windowBits 15 #define GZIP_ENCODING 16 static void *alloc_a_buffer(void *op, unsigned int items, unsigned int size) { return ci_buffer_alloc(items*size); } static void free_a_buffer(void *op, void *ptr) { ci_buffer_free(ptr); } /*return CI_DEFLATE_ERRORS */ static int strm_init(z_stream * strm, int which, int inlen) { int ret; strm->zalloc = alloc_a_buffer; strm->zfree = free_a_buffer; strm->opaque = Z_NULL; switch (which) { case CI_ENCODE_DEFLATE: ci_debug_printf(4, "data-compression: deflate called size: %d\n", inlen); ret = deflateInit(strm, Z_DEFAULT_COMPRESSION); break; case CI_ENCODE_GZIP: default: ci_debug_printf(4, "data-compression: gzip called size: %d\n", inlen); ret = deflateInit2(strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, windowBits | GZIP_ENCODING, 8, Z_DEFAULT_STRATEGY); break; } return ret; } int ci_mem_deflate(const char *inbuf, size_t inlen, void *out_obj, char *(*get_outbuf)(void *obj, unsigned int *len), int (*writefunc)(void *obj, const char *buf, size_t len), ci_off_t max_size, int which) { int ret = Z_STREAM_END, written, outsize = 0; unsigned char out[CHUNK]; z_stream strm; strm_init(&strm, which, inlen); strm.next_in = (unsigned char *) inbuf; strm.avail_in = inlen; do { int have; strm.avail_out = CHUNK; strm.next_out = out; ret = deflate(&strm, Z_FINISH); have = CHUNK - strm.avail_out; if ((written = writefunc(out_obj, (char *)out, have)) != have) { deflateEnd(&strm); return CI_COMP_ERR_CORRUPT; } outsize += written; } while (strm.avail_out == 0); deflateEnd (&strm); switch (which) { case CI_ENCODE_GZIP: ci_debug_printf(4, "data-compression: gzip total compressed size %d ...\n", outsize); break; case CI_ENCODE_DEFLATE: default: ci_debug_printf(4, "data-compression: deflate total compressed size %d ...\n", outsize); break; } return ret == Z_STREAM_END ? CI_COMP_OK : CI_COMP_ERR_CORRUPT; } int ci_deflate_to_membuf(const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { int ret = ci_mem_deflate(inbuf, inlen, outbuf, NULL, write_membuf_func, max_size, CI_ENCODE_DEFLATE); ci_membuf_write(outbuf, "", 0, 1); return ret; } int ci_deflate_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { int ret = ci_mem_deflate(inbuf, inlen, outbuf, NULL, write_simple_file_func, max_size, CI_ENCODE_DEFLATE); ci_simple_file_write(outbuf, "", 0, 1); return ret; } int ci_gzip_to_membuf(const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { int ret = ci_mem_deflate(inbuf, inlen, outbuf, NULL, write_membuf_func, max_size, CI_ENCODE_GZIP); ci_membuf_write(outbuf, "", 0, 1); return ret; } int ci_gzip_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { int ret = ci_mem_deflate(inbuf, inlen, outbuf, NULL, write_simple_file_func, max_size, CI_ENCODE_GZIP); ci_simple_file_write(outbuf, "", 0, 1); return ret; } #else int ci_deflate_to_membuf(const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { ci_debug_printf(1, "zlib/inflate is not supported.\n"); return CI_COMP_ERR_NONE; } int ci_deflate_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { ci_debug_printf(1, "zlib/inflate is not supported.\n"); return CI_COMP_ERR_NONE; } int ci_gzip_to_membuf(const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { ci_debug_printf(1, "gzip is not supported.\n"); return CI_COMP_ERR_NONE; } int ci_gzip_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { ci_debug_printf(1, "gzip is not supported.\n"); return CI_COMP_ERR_NONE; } #endif #ifdef HAVE_BZLIB static void *bzalloc_a_buffer(void *op, int items, int size) { return ci_buffer_alloc(items*size); } static void bzfree_a_buffer(void *op, void *ptr) { ci_buffer_free(ptr); } int ci_mem_bzzip(const char *buf, int inlen, void *out_obj, char *(*get_outbuf)(void *obj, unsigned int *len), int (*writefunc)(void *obj, const char *buf, size_t len), ci_off_t max_size) { int ret; unsigned have, written; long long outsize; bz_stream strm; char out[CHUNK]; ci_debug_printf(4, "data-compression: bzip called size: %d\n", inlen); strm.bzalloc = bzalloc_a_buffer; strm.bzfree = bzfree_a_buffer; strm.opaque = NULL; strm.avail_in = 0; strm.next_in = NULL; ret = BZ2_bzCompressInit(&strm, 9, // number of 100k blocks 9 is best compression (1-9) 0, // verbosity (0-4) 0-none 4 max 30); // work factor - 30 is default (0-250) if (ret != BZ_OK) { ci_debug_printf(1, "data-compression: error initializing bzlib (BZ2_bzCompressInit return:%d)\n", ret); return CI_ERROR; } strm.next_in = (char *)buf; strm.avail_in = inlen; outsize = 0; do { strm.avail_out = CHUNK; strm.next_out = out; ret = BZ2_bzCompress(&strm, BZ_FINISH); switch (ret) { case BZ_PARAM_ERROR: case BZ_DATA_ERROR: case BZ_DATA_ERROR_MAGIC: case BZ_MEM_ERROR: BZ2_bzCompressEnd(&strm); return CI_ERROR; } have = CHUNK - strm.avail_out; if (!have || (written = writefunc(out_obj, (char *)out, have)) != have) { BZ2_bzCompressEnd(&strm); return CI_COMP_ERR_OUTPUT; } outsize += written; } while (strm.avail_out == 0); BZ2_bzCompressEnd(&strm); ci_debug_printf(4, "data-compression: bzip total compressed size %lld ...\n", outsize); return CI_COMP_OK; } int ci_bzzip_to_membuf(const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { int ret = ci_mem_bzzip(inbuf, inlen, outbuf, NULL, write_membuf_func, max_size); ci_membuf_write(outbuf, "", 0, 1); return ret; } int ci_bzzip_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { int ret = ci_mem_bzzip(inbuf, inlen, outbuf, NULL, write_simple_file_func, max_size); ci_simple_file_write(outbuf, "", 0, 1); return ret; } #else int ci_bzzip_to_membuf(const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { ci_debug_printf(1, "bzlib/bzzip is not supported.\n"); return CI_COMP_ERR_NONE; } int ci_bzzip_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { ci_debug_printf(1, "bzlib/bzzip is not supported.\n"); return CI_COMP_ERR_NONE; } #endif c_icap-0.5.6/include/0000775000175000017500000000000013570504157011375 500000000000000c_icap-0.5.6/include/access.h0000664000175000017500000000330513371253152012723 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __ACCESS_H #define __ACCESS_H #include "c-icap.h" #include "request.h" #include "net_io.h" #ifdef __cplusplus extern "C" { #endif #define CI_ACCESS_ALLOW 1 #define CI_ACCESS_UNKNOWN 0 #define CI_ACCESS_DENY -1 #define CI_ACCESS_PARTIAL -2 #define CI_ACCESS_HTTP_AUTH -3 /**************************************************/ /*Basic authentication method definitions ...... */ #define HTTP_MAX_PASS_LEN 256 struct http_basic_auth_data { char http_user[MAX_USERNAME_LEN+1]; char http_pass[HTTP_MAX_PASS_LEN+1]; }; int access_reset(); int http_authorize(ci_request_t *req, char *method); int http_authenticate(ci_request_t *req, char *method); int access_check_client(ci_request_t *req); int access_check_request(ci_request_t *req); int access_authenticate_request(ci_request_t *req); int access_check_logging(ci_request_t *req); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/md5.h0000664000175000017500000000102713371253152012146 00000000000000#ifndef CI_MD5_H #define CI_MD5_H #include "c-icap.h" #ifdef __cplusplus extern "C" { #endif struct ci_MD5Context { uint32_t buf[4]; uint32_t bits[2]; unsigned char in[64]; }; typedef struct ci_MD5Context ci_MD5_CTX; CI_DECLARE_FUNC(void) ci_MD5Init(struct ci_MD5Context *ctx); CI_DECLARE_FUNC(void) ci_MD5Update(struct ci_MD5Context *ctx, const unsigned char *buf, size_t len); CI_DECLARE_FUNC(void) ci_MD5Final(unsigned char digest[16], struct ci_MD5Context *ctx); #ifdef __cplusplus } #endif #endif /* !CI_MD5_H */ c_icap-0.5.6/include/ci_regex.h0000664000175000017500000000323113371253152013245 00000000000000/* * Copyright (C) 2014 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __CI_REGEX_H #define __CI_REGEX_H #include "c-icap.h" #ifdef __cplusplus extern "C" { #endif typedef void * ci_regex_t; struct ci_regex_match { size_t s; size_t e; }; typedef struct ci_regex_match ci_regex_matches_t[10]; typedef struct ci_regex_replace_part { const void *user_data; ci_regex_matches_t matches; } ci_regex_replace_part_t; #define ci_regex_create_match_list() ci_list_create(32768, sizeof(ci_regex_replace_part_t)) CI_DECLARE_FUNC(char *) ci_regex_parse(const char *str, int *flags, int *recursive); CI_DECLARE_FUNC(ci_regex_t) ci_regex_build(const char *regex_str, int regex_flags); CI_DECLARE_FUNC(void) ci_regex_free(ci_regex_t regex); CI_DECLARE_FUNC(int) ci_regex_apply(const ci_regex_t regex, const char *str, int len, int recurs, ci_list_t *matches, const void *user_data); #ifdef __cplusplus } #endif #endif /*__CI_REGEX_H*/ c_icap-0.5.6/include/cfg_param.h0000664000175000017500000001642513541155572013416 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __CFG_PARAM_H #define __CFG_PARAM_H #include "c-icap.h" #include "array.h" #ifdef __cplusplus extern "C" { #endif struct ci_magics_db; struct ci_port; /** \defgroup CONFIG c-icap server configuration API \ingroup API * */ /** * This struct holds the basic configurations of c-icap server. It passed as * argument to services and modules inititalization functions \ingroup CONFIG * * Do not use directly this struct but better use the documended macros and * functions. */ struct ci_server_conf { ci_vector_t *PORTS; char *TMPDIR; char *PIDFILE; char *COMMANDS_SOCKET; char *RUN_USER; char *RUN_GROUP; char *cfg_file; char *magics_file; struct ci_magics_db *MAGIC_DB; char *SERVICES_DIR; char *MODULES_DIR; char *SERVER_ADMIN; char *SERVER_NAME; int START_SERVERS; int MAX_SERVERS; int THREADS_PER_CHILD; int MIN_SPARE_THREADS; int MAX_SPARE_THREADS; #ifdef USE_OPENSSL char *TLS_PASSPHRASE; int TLS_ENABLED; #endif }; /** * This struct holds a configuration parameter of c-icap server. \ingroup CONFIG * An array of ci_conf_entry structs can be used to define the configuration * directives of a service or module which can be set in c-icap configuration * file. \code int AParam; struct ci_conf_entry conf_table[] = { {"Aparameter", &AParam, ci_cfg_set_int, "This is a simple configuration parameter"}, {NULL,NULL,NULL,NULL} } \endcode * In the above example the ci_cfg_set_int function is predefined. * If the table "conf_table" attached to the service "AService" then the AParam * integer variable can be set from the c-icap configuration file using the * directive "AService.Aparameter" */ struct ci_conf_entry { /** * The configuration directive */ const char *name; /** * A pointer to the configuration data */ void *data; /** * Pointer to the function which will be used to set configuration data. \param name is the configuration directive.It passed as argument by the * c-icap server \param argv is a NULL termined string array which holds the list of * arguments of configuration parameter \param setdata is o pointer to set data which passed as argument by * c-icap server \return Non zero on success, zero otherwise */ int (*action)(const char *name, const char **argv,void *setdata); /** * A description message */ const char *msg; }; /* Command line options implementation structure */ struct ci_options_entry { const char *name; const char *parameter; void *data; int (*action)(const char *name, const char **argv,void *setdata); const char *msg; }; /*Struct for storing default parameter values*/ struct cfg_default_value { void *param; void *value; int size; struct cfg_default_value *next; }; #define MAIN_TABLE 1 #define ALIAS_TABLE 2 #ifndef CI_BUILD_LIB extern struct ci_server_conf CI_CONF; struct cfg_default_value * cfg_default_value_store(void *param, void *value,int size); struct cfg_default_value * cfg_default_value_replace(void *param, void *value); void * cfg_default_value_restore(void *value); struct cfg_default_value * cfg_default_value_search(void *param); int register_conf_table(const char *name,struct ci_conf_entry *table,int type); struct ci_conf_entry * unregister_conf_table(const char *name); int config(int argc, char **argv); int intl_cfg_set_str(const char *directive,const char **argv,void *setdata); int intl_cfg_set_int(const char *directive,const char **argv,void *setdata); int intl_cfg_onoff(const char *directive,const char **argv,void *setdata); int intl_cfg_disable(const char *directive,const char **argv,void *setdata); int intl_cfg_enable(const char *directive,const char **argv,void *setdata); int intl_cfg_size_off(const char *directive,const char **argv,void *setdata); int intl_cfg_size_long(const char *directive,const char **argv,void *setdata); #endif CI_DECLARE_FUNC(void) ci_cfg_lib_init(); CI_DECLARE_FUNC(void) ci_cfg_lib_reset(); CI_DECLARE_FUNC(void *) ci_cfg_alloc_mem(int size); /** * Sets a string configuration parameter. The setdata are a pointer to a * string pointer \ingroup CONFIG */ CI_DECLARE_FUNC(int) ci_cfg_set_str(const char *directive,const char **argv,void *setdata); /** * Sets an int configuration parameter. The setdata is a pointer to an integer \ingroup CONFIG */ CI_DECLARE_FUNC(int) ci_cfg_set_int(const char *directive,const char **argv,void *setdata); /** * Sets an on/off configuration parameter. The setdata is a pointer to an * integer, which when the argument is "on" it is set to 1 and when the * argument is "off" it is set to 0. \ingroup CONFIG */ CI_DECLARE_FUNC(int) ci_cfg_onoff(const char *directive,const char **argv,void *setdata); /** * Can used with configuration parameters which does not takes arguments but * when defined just disable a feature. * The setdata is a pointer to an int which is set to zero. \ingroup CONFIG */ CI_DECLARE_FUNC(int) ci_cfg_disable(const char *directive,const char **argv,void *setdata); /** * Can used with configuration parameters which does not takes arguments but * when defined just enable a feature. * The setdata is a pointer to an int which is set to non zero. \ingroup CONFIG */ CI_DECLARE_FUNC(int) ci_cfg_enable(const char *directive,const char **argv,void *setdata); /** * Sets a configuration parameter of type ci_off_t (typedef of off_t type). \ingroup CONFIG */ CI_DECLARE_FUNC(int) ci_cfg_size_off(const char *directive,const char **argv,void *setdata); /** * Sets a configuration parameter of type long. \ingroup CONFIG */ CI_DECLARE_FUNC(int) ci_cfg_size_long(const char *directive,const char **argv,void *setdata); /** * Sets a configuration parameter of type int to 1 and prints c-icap version. \ingroup CONFIG */ CI_DECLARE_FUNC(int) ci_cfg_version(const char *directive, const char **argv, void *setdata); /** * Sets a configuration parameter of type int to 1 and prints c-icap build * information. \ingroup CONFIG */ CI_DECLARE_FUNC(int) ci_cfg_build_info(const char *directive, const char **argv, void *setdata); CI_DECLARE_FUNC(void) ci_args_usage(const char *progname,struct ci_options_entry *options); CI_DECLARE_FUNC(int) ci_args_apply(int argc, char *argv[],struct ci_options_entry *options); #ifdef __CI_COMPAT #define icap_server_conf ci_server_conf #define conf_entry ci_conf_entry #define options_entry ci_options_entry #endif #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/stats.h0000664000175000017500000000700313371253152012617 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __STATS_H #define __STATS_H #include "c-icap.h" #include "ci_threads.h" #ifdef __cplusplus extern "C" { #endif typedef struct kbs { uint64_t kb; unsigned int bytes; } kbs_t; #define MEMBLOCK_SIG 0xFAFA struct stat_memblock { unsigned int sig; int counters64_size; int counterskbs_size; uint64_t *counters64; kbs_t *counterskbs; }; struct stat_area { ci_thread_mutex_t mtx; void (*release_mem)(void *); struct stat_memblock *mem_block; }; struct stat_entry { char *label; int type; int gid; }; struct stat_entry_list { struct stat_entry *entries; int size; int entries_num; }; struct stat_groups_list { char **groups; int size; int entries_num; }; CI_DECLARE_DATA extern struct stat_entry_list STAT_INT64; CI_DECLARE_DATA extern struct stat_entry_list STAT_KBS; CI_DECLARE_DATA extern struct stat_groups_list STAT_GROUPS; enum ci_stat_type {STAT_INT64_T, STAT_KBS_T}; CI_DECLARE_DATA extern struct stat_area *STATS; CI_DECLARE_FUNC(int) ci_stat_memblock_size(void); CI_DECLARE_FUNC(int) ci_stat_entry_register(char *label, int type, char *group); CI_DECLARE_FUNC(void) ci_stat_entry_release_lists(); CI_DECLARE_FUNC(void) ci_stat_attach_mem(void *mem_block, int size,void (*release_mem)(void *)); CI_DECLARE_FUNC(void) ci_stat_release(); CI_DECLARE_FUNC(void) ci_stat_uint64_inc(int ID, int count); CI_DECLARE_FUNC(void) ci_stat_kbs_inc(int ID, int count); /*Low level functions */ CI_DECLARE_FUNC(struct stat_area *) ci_stat_area_construct(void *mem_block, int size, void (*release_mem)(void *)); CI_DECLARE_FUNC(void) ci_stat_area_destroy(struct stat_area *area); CI_DECLARE_FUNC(void) ci_stat_area_reset(struct stat_area *area); CI_DECLARE_FUNC(void) ci_stat_area_merge(struct stat_area *dest, struct stat_area *src); /*Stats memblocks low level functions*/ CI_DECLARE_FUNC(void) ci_stat_memblock_merge(struct stat_memblock *dest_block, struct stat_memblock *mem_block); CI_DECLARE_FUNC(void) ci_stat_memblock_reset(struct stat_memblock *block); /*DO NOT USE the folllowings are only for internal c-icap server use!*/ CI_DECLARE_FUNC(void) stat_memblock_fix(struct stat_memblock *mem_block); CI_DECLARE_FUNC(void) stat_memblock_reconstruct(struct stat_memblock *mem_block); /*Private defines and functions*/ #define STATS_LOCK() ci_thread_mutex_lock(&STATS->mtx) #define STATS_UNLOCK() ci_thread_mutex_unlock(&STATS->mtx) #define STATS_INT64_INC(ID, count) (STATS->mem_block->counters64[ID] += count) #define STATS_KBS_INC(ID, count) (STATS->mem_block->counterskbs[ID].bytes += count, STATS->mem_block->counterskbs[ID].kb += (STATS->mem_block->counterskbs[ID].bytes >> 10), STATS->mem_block->counterskbs[ID].bytes &= 0x3FF) #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/proc_threads_queues.h0000664000175000017500000000677513371253152015544 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef _PROC_THREADS_QUEUES_H #define _PROC_THREADS_QUEUES_H #include "net_io.h" #include "ci_threads.h" #include "proc_mutex.h" #include "shared_mem.h" #include "stats.h" #ifdef __cplusplus extern "C" { #endif enum KILL_MODE {NO_KILL = 0,GRACEFULLY,IMMEDIATELY}; #ifdef _WIN32 #define process_pid_t HANDLE #define ci_pipe_t HANDLE #else #define process_pid_t int #define ci_pipe_t int #endif struct connections_queue { ci_connection_t *connections; int used; int size; ci_thread_mutex_t queue_mtx; ci_thread_mutex_t cond_mtx; ci_thread_cond_t queue_cond; }; typedef struct child_shared_data { int freeservers; int usedservers; int requests; int connections; process_pid_t pid; int idle; int to_be_killed; int father_said; ci_pipe_t pipe; struct stat_memblock *stats; int stats_size; } child_shared_data_t; struct server_statistics { unsigned int started_childs; unsigned int closed_childs; unsigned int crashed_childs; }; struct childs_queue { child_shared_data_t *childs; int size; int shared_mem_size; int stats_block_size; void *stats_area; struct stat_memblock *stats_history; ci_shared_mem_id_t shmid; ci_proc_mutex_t queue_mtx; struct server_statistics *srv_stats; }; struct connections_queue *init_queue(int size); void destroy_queue(struct connections_queue *q); int put_to_queue(struct connections_queue *q,ci_connection_t *con); int get_from_queue(struct connections_queue *q, ci_connection_t *con); int wait_for_queue(struct connections_queue *q); #define connections_pending(q) (q->used) int create_childs_queue(struct childs_queue *q, int size); int destroy_childs_queue(struct childs_queue *q); void announce_child(struct childs_queue *q, process_pid_t pid); int attach_childs_queue(struct childs_queue *q); int dettach_childs_queue(struct childs_queue *q); int childs_queue_is_empty(struct childs_queue *q); child_shared_data_t *get_child_data(struct childs_queue *q, process_pid_t pid); child_shared_data_t *register_child(struct childs_queue *q, process_pid_t pid, int maxservers, ci_pipe_t pipe ); int remove_child(struct childs_queue *q, process_pid_t pid, int status); int find_a_child_to_be_killed(struct childs_queue *q); int find_a_child_nrequests(struct childs_queue *q,int max_requests); int find_an_idle_child(struct childs_queue *q); int childs_queue_stats(struct childs_queue *q, int *childs, int *freeservers, int *used, int *maxrequests); void dump_queue_statistics(struct childs_queue *q); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/acl.h0000664000175000017500000001627213371253152012230 00000000000000/* * Copyright (C) 2004-2009 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __ACL_H #define __ACL_H #include "c-icap.h" #include "net_io.h" #include "types_ops.h" #ifdef __cplusplus extern "C" { #endif /** \defgroup ACL Access lists API \ingroup API * Access control lists related API. Structures, functions and macros used * to define custom acl types, and use access control lists in services * and modules. */ #define MAX_NAME_LEN 31 /*ACL type structures and functions */ struct ci_request; /** \ingroup ACL * This is the struct used to implement an acl type object. */ typedef struct ci_acl_type { /** \brief The acl type name */ char name[MAX_NAME_LEN+1]; /** \brief Pointer to the functions which retrieves the test data for * this acl type * * This method extract the test data from request object for this acl * object. For example for the "src" acl type this function will extract * the icap client ip address \param req Pointer to the related ci_request_t object \param param Some acl types supports one parameter passed by the c-icap * administrator \return A pointer to the test data */ void *(*get_test_data)(struct ci_request *req, char *param); /** \brief Pointer to the function which release the acl test data * (if required) * * This method releases the acl test data,which allocated using the * get_test_data method \param req Pointer to the related ci_request_t object \param data Pointer to allocated test data */ void (*free_test_data)(struct ci_request *req, void *data); /** \brief Pointer to the ci_types_ops_t struct which implements basic * operations for the acl test data */ const ci_type_ops_t *type; } ci_acl_type_t; struct ci_acl_type_list { ci_acl_type_t *acl_type_list; int acl_type_list_size; int acl_type_list_num; }; int ci_acl_typelist_init(struct ci_acl_type_list *list); int ci_acl_typelist_add(struct ci_acl_type_list *list, const ci_acl_type_t *type); int ci_acl_typelist_release(struct ci_acl_type_list *list); int ci_acl_typelist_reset(struct ci_acl_type_list *list); const ci_acl_type_t *ci_acl_typelist_search(struct ci_acl_type_list *list, const char *name); /*ACL specs structures and functions */ typedef struct ci_acl_data ci_acl_data_t; struct ci_acl_data { void *data; ci_acl_data_t *next; }; /** \brief This struct holds an access control list (acl). \ingroup ACL * * Imagine the following access control list defined in the c-icap config * file:\n * \code acl LOCALNET 127.0.0.1/255.255.255.255 192.168.1.0/255.255.255.0 * \endcode * This struct represents access control lists like the above */ typedef struct ci_acl_spec ci_acl_spec_t; struct ci_acl_spec { char name[MAX_NAME_LEN + 1]; const ci_acl_type_t *type; char *parameter; ci_acl_data_t *data; ci_acl_spec_t *next; }; /*Specs lists and access entries structures and functions */ typedef struct ci_specs_list ci_specs_list_t; struct ci_specs_list { const ci_acl_spec_t *spec; int negate; ci_specs_list_t *next; }; /** \brief An access entry object holds an access control list, and can be * connected to linked lists of access entries. \ingroup ACL * * This struct used to implement lists of access control lists. * Each access entry can hold an "allow" or "deny" access control list. * An access entries list represents the following c-icap config lines: * \code * icap_access allow LOCALNET LOCALHOST * icap_access deny ALL * \endcode * each of the above lines represented by an ci_access_entry object. * The ci_access_entry objects can be connected to a simple linked list. * */ typedef struct ci_access_entry ci_access_entry_t; struct ci_access_entry { int type; /*CI_ACCESS_DENY or CI_ACCESS_ALLOW*/ ci_specs_list_t *spec_list; ci_access_entry_t *next; }; /** \brief Append a new access entry object to an access entries list \ingroup ACL * \param list Pointer to the access entry list \param type CI_ACCESS_ALLOW if CI_ACCESS_DENY to specify if this access entry holds an "allow" or "deny" access control list \return A pointer to the newly created access entry object */ CI_DECLARE_FUNC(ci_access_entry_t *) ci_access_entry_new(ci_access_entry_t **list, int type); /** \brief Destroy an access entries list \ingroup ACL * \param list Pointer to the access entries list */ CI_DECLARE_FUNC(void) ci_access_entry_release(ci_access_entry_t *list); CI_DECLARE_FUNC(const ci_acl_spec_t *) ci_access_entry_add_acl(ci_access_entry_t *access_entry, const ci_acl_spec_t *acl, int negate); /** \brief Add an acl to an access entry object \ingroup ACL * \param access_entry Pointer to the access entry object \param aclname The name of the acl to be added. \return non zero on success, zero otherwise */ CI_DECLARE_FUNC(int) ci_access_entry_add_acl_by_name(ci_access_entry_t *access_entry, const char *aclname); /** \brief Check if an access entries list matches a request object \ingroup ACL * \param access_entry Pointer to the access entries list (a linked list of * ci_access_entry_t objects) \param req pointer to the request object (ci_request_t object) \return CI_ACCESS_ALLOW if request matches the access list, CI_ACCESS_DENY * otherwise */ CI_DECLARE_FUNC(int) ci_access_entry_match_request(ci_access_entry_t *access_entry, ci_request_t *req); /*Inititalizing, reseting and tools acl library functions */ /** \brief Initializes the c-icap acl subsystem. It is not thread safe \ingroup ACL */ CI_DECLARE_FUNC(void) ci_acl_init(); /** \brief Resets the c-icap acl subsystem. It is not thread safe \ingroup ACL */ CI_DECLARE_FUNC(void) ci_acl_reset(); CI_DECLARE_FUNC(const ci_acl_spec_t *) ci_acl_search(const char *name); CI_DECLARE_FUNC(int) ci_acl_add_data(const char *name, const char *type, const char *data); /** \brief Search for an acl type \ingroup ACL * \param name The name of the acl type \return Pointer to the ci_acl_type_t structure which implements the acl type, * or NULL */ CI_DECLARE_FUNC(const ci_acl_type_t *) ci_acl_type_search(const char *name); /** \brief Add a custom acl type to the c-icap acl subsystem \ingroup ACL * \param type Pointer to the c-acl_type_t struct which implements the acl type \return non zero on success, zero otherwise */ CI_DECLARE_FUNC(int) ci_acl_type_add(const ci_acl_type_t *type); #ifdef __cplusplus } #endif #endif/* __ACL_H*/ c_icap-0.5.6/include/log.h0000664000175000017500000000242213371253152012242 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __LOG_H #define __LOG_H #include "request.h" #ifdef __cplusplus extern "C" { #endif int log_open(); void log_close(); void log_reset(); void log_flush(); void log_access(ci_request_t *req,int status); void log_server(ci_request_t *req, const char *format, ... ); void vlog_server(ci_request_t *req, const char *format, va_list ap); /* The followings can be used by modules */ CI_DECLARE_FUNC(char *) logformat_fmt(const char *name); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/registry.h0000664000175000017500000000321013371253152013325 00000000000000/* * Copyright (C) 2013 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __REGISTRY_H #define __REGISTRY_H #include "c-icap.h" #ifdef __cplusplus extern "C" { #endif CI_DECLARE_FUNC(int) ci_registry_create(const char *name); CI_DECLARE_FUNC(void) ci_registry_clean(); CI_DECLARE_FUNC(int) ci_registry_iterate(const char *name, void *data, int (*fn)(void *data, const char *label, const void *)); CI_DECLARE_FUNC(int) ci_registry_add_item(const char *name, const char *label, const void *obj); CI_DECLARE_FUNC(const void *) ci_registry_get_item(const char *name, const char *label); CI_DECLARE_FUNC(int) ci_registry_get_id(const char *name); CI_DECLARE_FUNC(int) ci_registry_id_iterate(int reg_id, void *data, int (*fn)(void *data, const char *label, const void *)); CI_DECLARE_FUNC(const void *) ci_registry_id_get_item(int reg_id, const char *label); #ifdef __cplusplus } /*extern "C"*/ #endif #endif /*__REGISTRY_H*/ c_icap-0.5.6/include/cache.h0000664000175000017500000001230113371253152012521 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __CACHE_H #define __CACHE_H #include "hash.h" #ifdef __cplusplus extern "C" { #endif /** \defgroup CACHE cache api \ingroup API \brief Macros, functions and structures used to implement and use c-icap cache. */ struct ci_cache; /** \ingroup CACHE \brief A struct which implements a cache type. * Modules implement a cache type, needs to implement members of this structure. */ typedef struct ci_cache_type { int (*init)(struct ci_cache *cache, const char *name); const void *(*search)(struct ci_cache *cache, const void *key, void **val, void *data, void *(*dup_from_cache)(const void *stored_val, size_t stored_val_size, void *data)); int (*update)(struct ci_cache *cache, const void *key, const void *val, size_t val_size, void *(*copy_to_cache)(void *cache_buf, const void *val, size_t cache_buf_size)); void (*destroy)(struct ci_cache *cache); const char *name; } ci_cache_type_t; /** * Register a cache type to c-icap server. \ingroup CACHE */ CI_DECLARE_FUNC(void) ci_cache_type_register(const struct ci_cache_type *type); /** * The ci_cache_t struct \ingroup CACHE */ typedef struct ci_cache { int (*init)(struct ci_cache *cache, const char *name); // If dup_from_cache is NULL return a ci_buffer object const void * (*search)(struct ci_cache *cache, const void *key, void **val, void *data, void *(*dup_from_cache)(const void *stored_val, size_t stored_val_size, void *data)); // buf is of size val_size and buf_size == val_size int (*update)(struct ci_cache *cache, const void *key, const void *val, size_t val_size, void *(*copy_to_cache)(void *buf, const void *val, size_t buf_size)); void (*destroy)(struct ci_cache *cache); time_t ttl; unsigned int mem_size; unsigned int max_object_size; unsigned int flags; const ci_type_ops_t *key_ops; const ci_cache_type_t *_cache_type; void *cache_data; } ci_cache_t; /** * Builds a cache and return a pointer to the ci_cache_t object \ingroup CACHE \param cache_type The cache type to use. If the cache type not found return * a cache object of type "local" \param cache_size The size of the cache \param max_object_size The maximum object size to store in cache \param ttl The ttl value for cached items in this cache \param key_ops If not null, the ci_types_ops_t object to use for comparing * keys. By default keys are considered as c strings. */ CI_DECLARE_FUNC(ci_cache_t *) ci_cache_build( const char *name, const char *cache_type, unsigned int cache_size, unsigned int max_object_size, int ttl, const ci_type_ops_t *key_ops ); /** * Searchs a cache for a stored object * If the dup_from_cache parameter is NULL, the returned value must be * released using the ci_buffer_free function. \ingroup CACHE \param cache Pointer to the ci_cache_t object \param key Pointer to the key to search for \param val Pointer to store the pointer of returned value \param data Pointer to void object which will be passed to dup_from_cache * function \param dup_from_cache Pointer to function which will be used to allocate * memory and copy the stored value. */ CI_DECLARE_FUNC(const void *) ci_cache_search(ci_cache_t *cache, const void *key, void **val, void *data, void *(*dup_from_cache)(const void *stored_val, size_t stored_val_size, void *data)); /** * Stores an object to cache \ingroup CACHE \param cache Pointer to the ci_cache_t object \param key The key of the stored object \param val Pointer to the object to be stored \param val_size The size of the object to be stored \param copy_to_cache The function to use to copy object to cache. * If it is NULL the memcpy is used. */ CI_DECLARE_FUNC(int) ci_cache_update(ci_cache_t *cache, const void *key, const void *val, size_t val_size, void *(*copy_to_cache)(void *buf, const void *val, size_t buf_size)); /** * Destroy a cache_t object \ingroup CACHE */ CI_DECLARE_FUNC(void) ci_cache_destroy(ci_cache_t *cache); /* Only for internal use only: cb functions to store/retrieve vectors from cache.... */ CI_DECLARE_FUNC(size_t) ci_cache_store_vector_size(ci_vector_t *v); CI_DECLARE_FUNC(void *) ci_cache_store_vector_val(void *buf, const void *val, size_t buf_size); CI_DECLARE_FUNC(void *) ci_cache_read_vector_val(const void *val, size_t val_size, void *); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/service.h0000664000175000017500000004615713371253152013136 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __SERVICE_H #define __SERVICE_H #include "header.h" #include "cfg_param.h" #include "ci_threads.h" #ifdef __cplusplus extern "C" { #endif /** \defgroup SERVICES Services API \ingroup API * Services related API. For detailed information about implementing a service * look the documentation of struct ci_service_module */ #define CI_MOD_NOT_READY 0 #define CI_MOD_DONE 1 #define CI_MOD_CONTINUE 100 #define CI_MOD_ALLOW204 204 #define CI_MOD_ALLOW206 206 #define CI_MOD_ERROR -1 #define MAX_SERVICE_NAME 63 #define MAX_SERVICE_ARGS 255 #define SRV_ISTAG_SIZE 39 /* contains the ISTag: field, the istag part of server and the istag part of service (32+7) */ #define SRV_ISTAG_POS 13 /* strlen("ISTAG: ")+6, 6 is the size of server part of istag */ #define SERVICE_ISTAG_SIZE 26 #define XINCLUDES_SIZE 511 /* it is enough I think ....*/ #define CI_XCLIENTIP 1 #define CI_XSERVERIP 2 #define CI_XSUBSCRIBERID 4 #define CI_XAUTHENTICATEDUSER 8 #define CI_XAUTHENTICATEDGROUPS 16 struct ci_request; struct ci_list; typedef struct ci_service_module ci_service_module_t; enum SERVICE_STATUS {CI_SERVICE_NOT_INITIALIZED = -1, CI_SERVICE_OK = 0, CI_SERVICE_ERROR = 1 }; /*For internal use only*/ struct ci_option_handler { char name[64]; int (*handler)(struct ci_request *); }; /** \typedef ci_service_xdata_t \ingroup SERVICES *Stores required data and settings for a service */ typedef struct ci_service_xdata { ci_thread_rwlock_t lock; int status; struct ci_conf_entry *intl_srv_conf_table; uint64_t xopts; char ISTag[SRV_ISTAG_SIZE+1]; char xincludes[XINCLUDES_SIZE+1]; char TransferPreview[MAX_HEADER_SIZE+1]; char TransferIgnore[MAX_HEADER_SIZE+1]; char TransferComplete[MAX_HEADER_SIZE+1]; int preview_size; int max_connections; int options_ttl; int allow_204; int allow_206; int disable_206; /*even if service support it do not use 206*/ struct ci_list *option_handlers; /*statistics IDS*/ int stat_bytes_in; int stat_bytes_out; int stat_http_bytes_in; int stat_http_bytes_out; int stat_body_bytes_in; int stat_body_bytes_out; int stat_reqmods; int stat_respmods; int stat_options; int stat_allow204; } ci_service_xdata_t; /** \ingroup SERVICES * Is the structure which implements a service * * To implement a service someones needs to implement the member functions of * this struct. These functions will be called by c-icap as follows: * - When a new request arrives for this service then the * ci_service_module::mod_init_request_data is called * - When the icap client sends preview data then the * ci_service_module::mod_check_preview_handler is called. * If this function return CI_MOD_ALLOW204 the ICAP transaction stops here. * If this function return CI_MOD_CONTINUE the ICAP client will send the * rest body data if exists. * - When he client starts sends more data then the * ci_service_module::mod_service_io is called multiple times * untill the client has send all the body data. The service * can start send data using this function to the client * before all data received * - When the client finishes sending body data the * ci_service_module::mod_end_of_data_handler is called * - While the icap client waits to read the body data from * the c-icap then the ci_service_module::mod_service_io * is called multiple times until all the body data sent to * the client */ struct ci_service_module { /** \example services/echo/srv_echo.c \ingroup SERVICES \brief The srv_echo.c is an example service implementation, * which does not modifies the content * */ /** \brief The service name */ const char *mod_name; /** \brief Service short description */ const char *mod_short_descr; /** \brief Service type * * The service type can be ICAP_RESPMOD for a responce modification * service, ICAP_REQMOD for request modification service or * ICAP_RESPMOD|ICAP_REQMOD for a service implements both response and * request modification */ int mod_type; /** \brief Pointer to the function called when the service loaded. * * This function called exactly when the service loaded by c-icap. Can * be used to initialize the service. \param srv_xdata Pointer to the ci_service_xdata_t object of this service \param server_conf Pointer to the struct holds the main c-icap server configuration \return CI_OK on success, CI_ERROR on any error. */ int (*mod_init_service)(ci_service_xdata_t *srv_xdata,struct ci_server_conf *server_conf); /** \brief Pointer to the function which called after the c-icap initialized, * but before the c-icap start serves requests. * * This function can be used to initialize the service. Unlike to the * ci_service_module::mod_init_service, when this function called the * c-icap has initialized and it is known system parameters like the * services and modules which are loaded, network ports and addresses * the c-icap is listening to, etc. \param srv_xdata Pointer to the ci_service_xadata_t object of this service \param server_conf Pointer to the struct holds the main c-icap server configuration \return CI_OK on success, CI_ERROR on errors. */ int (*mod_post_init_service)(ci_service_xdata_t *srv_xdata,struct ci_server_conf *server_conf); /** \brief Pointer to the function which called on c-icap server shutdown * * This function can be used to release service allocated resources */ void (*mod_close_service)(); /** \brief Pointer to the function called when a new request for this services * arrives to c-icap server. * * This function should inititalize the data and structures required for * serving the request. * \param req a pointer to the related ci_request_t structure \return a void pointer to the "service data", the user defined data * required for serving the * request.The developer can obtain the service data from the * related ci_request_t object using the macro ci_service_data */ void *(*mod_init_request_data)(struct ci_request *req); /** \brief Pointer to the function which releases the service data. * * This function called after the user request served to release the * service data \param srv_data pointer to the service data returned by the * ci_service_module::mod_init_request_data call */ void (*mod_release_request_data)(void *srv_data); /** \brief Pointer to the function which is used to preview the ICAP client * request * * The client if supports preview sends some data for examination. * The service using this function will decide if the client request must * processed so the client must send more data or no processing is needed * so the request ended here. \param preview_data Pointer to the preview data \param preview_data_len The size of preview data \param req Pointer to the related ci_request struct \return CI_MOD_CONTINUE if the client must send more data, CI_MOD_ALLOW204 * if the service does not want to modify anything, or CI_ERROR on errors. */ int (*mod_check_preview_handler)(char *preview_data,int preview_data_len,struct ci_request *req); /** \brief Pointer to the function called when the icap client has send all the data to the service * *This function called when the ICAP client has send all data. \param req pointer to the related ci_request struct \return CI_MOD_DONE if all are OK, CI_MOD_ALLOW204 if the ICAP client * request supports 204 responses and we are not planning to modify * anything, or CI_ERROR on errors. * The service must not return CI_MOD_ALLOW204 if has already send * some data to the client, or when the client does not support * allow204 responses. To examine if client supports 204 responses * the ci_req_allow204 macro can be used */ int (*mod_end_of_data_handler)(struct ci_request *req); /** \brief Pointer to the function called to read/send body data from/to * icap client. * * This function reads body data from the ICAP client and sends back the * modified body data. To allow c-icap send data to the ICAP client before * all data received by the c-icap, a call to the ci_req_unlock_data * function is required. \param wbuf The buffer for writing data to the ICAP client \param wlen The size of the write buffer. It must modified to be the size * of writing data. If the service has send all the data to the * client, this parameter must set to CI_EOF. \param rbuf Pointer to the data read from the ICAP client \param rlen The lenght of the data read from the ICAP client. If this * function for a reason can not read all the data, it must modify * the rlen to be equal to the read data \param iseof It has non zero value if the data in rbuf buffer are the * last data from the ICAP client. \param req pointer to the related ci_request struct \return Return CI_OK if all are OK or CI_ERROR on errors */ int (*mod_service_io)(char *wbuf,int *wlen,char *rbuf,int *rlen,int iseof, struct ci_request *req); /** \brief Pointer to the config table of the service * * Is an array which contains the definitions of configuration parameters * used by the service. The configuration parameters defined in this array * can be used in c-icap.conf file. */ struct ci_conf_entry *mod_conf_table; /** \brief NULL pointer * * This field does not used. Set it to NULL. */ void *mod_data; }; typedef struct service_alias { char alias[MAX_SERVICE_NAME+1]; char args[MAX_SERVICE_ARGS+1]; ci_service_module_t *service; } service_alias_t; /*Internal function */ ci_service_module_t *add_service(ci_service_module_t *service); ci_service_module_t *register_service(const char *module_file, const char *argv[]); service_alias_t *add_service_alias(const char *service_alias, const char *service_name,const char *args); ci_service_module_t *find_service(const char *service_name); service_alias_t *find_service_alias(const char *service_name); ci_service_xdata_t *service_data(ci_service_module_t *srv); int init_services(); int post_init_services(); int release_services(); int run_services_option_handlers(ci_service_xdata_t *srv_xdata, struct ci_request *req); /*Library functions */ /*Undocumented, are not usefull to users*/ CI_DECLARE_FUNC(void) ci_service_data_read_lock(ci_service_xdata_t *srv_xdata); CI_DECLARE_FUNC(void) ci_service_data_read_unlock(ci_service_xdata_t *srv_xdata); /** \ingroup SERVICES \brief Sets the ISTAG for the service. * *Normally this function called in ci_service_module::mod_init_service() or * ci_service_module::mod_post_init_service() function, while the service * initialization. \param srv_xdata is a pointer to the c-icap internal service data. \param istag is a string contains the new ISTAG for the service. The istag * size can not be more than a size of SERVICE_ISTAG_SIZE. If the length * of istag is greater than SERVICE_ISTAG_SIZE the extra bytes are ignored. */ CI_DECLARE_FUNC(void) ci_service_set_istag(ci_service_xdata_t *srv_xdata, const char *istag); /** \ingroup SERVICES \brief Sets the service x-headers mask which defines the X-Headers supported * by the service.The c-icap server will advertise these headers in * options responses. * * Normally this function called in ci_service_module::mod_init_service() or * ci_service_module::mod_post_init_service() function, while the service * is initialized. \param srv_xdata is a pointer to the c-icap internal service data. \param xopts is a compination of one or more of the following defines: * - CI_XCLIENTIP: Refers to the X-Client-IP header. The HTTP proxy (or the * ICAP client) will sends the ip address of the HTTP client using this * header if supports this header. * - CI_XSERVERIP: The X-Server-IP header. The HTTP proxy will incluse the IP * of the HTTP destination host in the X-Server-IP header if supports this * header. * - CI_XSUBSCRIBERID: The X-Subscriber-ID header. This header can include a * unique subscriber ID of the user who issued the HTTP request * - CI_XAUTHENTICATEDUSER: The X-Authenticated-User header. If the user * authenticated on HTTP proxy side includes the username * - CI_XAUTHENTICATEDGROUPS: The X-Authenticated-Group header. If the user is * authenticated on HTTP proxy side includes the user groups * * example usage: \code * ci_service_set_xopts(srv_xdata,CI_XCLIENTIP|CI_XAUTHENTICATEDUSER); \endcode * * For more informations about ICAP common X-Headers look at: * http://www.icap-forum.org/documents/specification/draft-stecher-icap-subid-00.txt */ CI_DECLARE_FUNC(void) ci_service_set_xopts(ci_service_xdata_t *srv_xdata, uint64_t xopts); /** \ingroup SERVICES \brief it is similar to the function ci_service_set_xopts but just adds * (not sets) the X-Headers defined by the xopts parameter to the * existing x-headers mask of service. * */ CI_DECLARE_FUNC(void) ci_service_add_xopts(ci_service_xdata_t *srv_xdata, uint64_t xopts); /** \ingroup SERVICES \brief Set the list of file extensions that should previewed by the service. * * The c-icap will inform the ICAP client that should send preview data for the * files which have the extensions contained in the preview string. The * wildcard value "*" specifies all files extensions, which is the default. \param srv_xdata is a pointer to the c-icap internal service data. \param preview is the string which contains the list of the file extensions. * * example usage: \code * ci_service_set_transfer_preview(srv_xdata,"zip, tar"); \endcode */ CI_DECLARE_FUNC(void) ci_service_set_transfer_preview(ci_service_xdata_t *srv_xdata,const char *preview); /** \ingroup SERVICES \brief Set the list of file extensions that should NOT be send for this * service. * * The c-icap will inform the ICAP client that should not send files which * have the extensions contained in the ignore string. \param srv_xdata is a pointer to the c-icap internal service data. \param ignore is the string which contains the list of the file extensions. * * example usage: \code * ci_service_set_transfer_ignore(srv_xdata,"gif, jpeg"); \endcode */ CI_DECLARE_FUNC(void) ci_service_set_transfer_ignore(ci_service_xdata_t *srv_xdata, const char *ignore); /** \ingroup SERVICES \brief Set the list of file extensions that should be send in their entirety * (without preview) to this service. * * The c-icap will inform the ICAP client that should send files which have * the extensions contained in the complete string, in their entirety to this * service. \param srv_xdata is a pointer to the c-icap internal service data. \param complete is the string which contains the list of the file extensions. * *example usage: \code * ci_service_set_transfer_complete(srv_xdata,"exe, bat, com, ole"); \endcode */ CI_DECLARE_FUNC(void) ci_service_set_transfer_complete(ci_service_xdata_t *srv_xdata, const char *complete); /** \ingroup SERVICES \brief Sets the maximum preview size supported by this service * \param srv_xdata is a pointer to the c-icap internal service data. \param preview is the size of preview data supported by this service */ CI_DECLARE_FUNC(void) ci_service_set_preview(ci_service_xdata_t *srv_xdata, int preview); /** \ingroup SERVICES \brief Enable the allow 204 responses for this service. * * The service will supports the allow 204 responses if the icap client * support it too. \param srv_xdata is a pointer to the c-icap internal service data. */ CI_DECLARE_FUNC(void) ci_service_enable_204(ci_service_xdata_t *srv_xdata); /** \ingroup SERVICES \brief Enable the Partial Content 206 responses for this service. * * The service will supports the Partial Content 206 responses if the icap * client support it too. \param srv_xdata is a pointer to the c-icap internal service data. */ CI_DECLARE_FUNC(void) ci_service_enable_206(ci_service_xdata_t *srv_xdata); /** \ingroup SERVICES \brief Sets the maximum connection should opened by icap client to the c-icap * for this service * \param srv_xdata is a pointer to the c-icap internal service data. \param max_connections is the maximum connections */ CI_DECLARE_FUNC(void) ci_service_set_max_connections(ci_service_xdata_t *srv_xdata, int max_connections); /** \ingroup SERVICES \brief Sets the Options ttl for this service * \param srv_xdata is a pointer to the c-icap internal service data. \param ttl is the ttl value in seconds */ CI_DECLARE_FUNC(void) ci_service_set_options_ttl(ci_service_xdata_t *srv_xdata, int ttl); CI_DECLARE_FUNC(void) ci_service_add_xincludes(ci_service_xdata_t *srv_xdata, char **xincludes); /** \ingroup SERVICES \brief Add a service handler for the service * * Normally this function called in ci_service_module::mod_init_service() or * ci_service_module::mod_post_init_service() function. * The options handlers are running when the service receives an OPTIONS * request to check for service health. They can add ICAP headers to the * OPTIONS response and must return CI_OK on success, or CI_ERROR on failure. * If one or more handlers failed the c-icap will produce a "500 Server Error" * response. * \param srv_xdata is a pointer to the c-icap internal service data. \param name a name for the handler, used for debuging reasons \param handler the handler */ CI_DECLARE_FUNC(void) ci_service_add_option_handler(ci_service_xdata_t *srv_xdata, const char *name, int (*handler)(struct ci_request *)); #ifdef __CI_COMPAT #define service_module_t ci_service_module_t #define service_extra_data_t ci_service_xdata_t /*The Old CI_X* defines*/ #define CI_XClientIP 1 #define CI_XServerIP 2 #define CI_XSubscriberID 4 #define CI_XAuthenticatedUser 8 #define CI_XAuthenticatedGroups 16 #endif #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/c-icap.h0000664000175000017500000001202413371253152012614 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __C_ICAP_H #define __C_ICAP_H #if defined (_MSC_VER) #include "c-icap-conf-w32.h" #else #include "c-icap-conf.h" #endif #ifdef __SYS_TYPES_H_EXISTS #include #endif #ifdef __INTTYPES_H_EXISTS #include #endif /*some defines */ #ifdef _WIN32 # define CI_FILENAME_LEN _MAX_PATH # define CI_MAX_PATH _MAX_PATH #else # if defined(MAXPATHLEN) # define CI_MAX_PATH MAXPATHLEN # elif defined(PATH_MAX) # define CI_MAX_PATH PATH_MAX # else # define CI_MAX_PATH 4096 # endif # define CI_FILENAME_LEN CI_MAX_PATH #endif #ifdef _WIN32 # if defined(CI_BUILD_LIB) # define CI_DECLARE_FUNC(type) __declspec(dllexport) type # define CI_DECLARE_DATA __declspec(dllexport) # else # define CI_DECLARE_FUNC(type) __declspec(dllimport) type # define CI_DECLARE_DATA __declspec(dllimport) # endif # if defined (CI_BUILD_MODULE) # define CI_DECLARE_MOD_DATA __declspec(dllexport) # define CI_DECLARE_MOD_FUNC(type) __declspec(dllexport) type # endif #else /* */ #if defined (USE_VISIBILITY_ATTRIBUTE) #define CI_DECLARE_FUNC(type) __attribute__ ((visibility ("default"))) type #define CI_DECLARE_DATA __attribute__ ((visibility ("default"))) #define CI_DECLARE_MOD_DATA __attribute__ ((visibility ("default"))) #else #define CI_DECLARE_FUNC(type) type #define CI_DECLARE_DATA #define CI_DECLARE_MOD_DATA #endif #endif /* Here we are define the ci_off_t type to support large files. -A comment about lfs: In Solaris and Linux to have lfs support, if you are using only lseek and open function, you are using off_t type for offsets and compile the program with -D_FILE_OFFSET_BITS=64. This flag forces the compiler to typedefs the off_t type as an 64bit integer, uses open64, lseek64, mkstemp64 and fopen64 functions. Instead for fseek and ftell the functions fseeko and ftello must be used. This functions uses off_t argument's instead of long. Currently we are not using fseek and ftell in c-icap. The open's manual page says that the flag O_LARGEFILE must be used. Looks that it does not actually needed for linux and solaris (version 10) (but must be checked again......) The off_t type in my linux system is a signed integer, but I am not sure if it is true for all operating systems */ typedef off_t ci_off_t; #if CI_SIZEOF_OFF_T > 4 # define PRINTF_OFF_T "lld" # define CAST_OFF_T long long int # define ci_strto_off_t strtoll # define CI_STRTO_OFF_T_MAX LLONG_MAX # define CI_STRTO_OFF_T_MIN LLONG_MIN #else # define PRINTF_OFF_T "ld" # define CAST_OFF_T long int # define ci_strto_off_t strtol # define CI_STRTO_OFF_T_MAX LONG_MAX # define CI_STRTO_OFF_T_MIN LONG_MIN #endif /* Detect n-bytes alignment. Old 8 bytes alignment macro: #define _CI_ALIGN(val) ((val+7)&~7) */ struct _ci_align_test {char n[1]; double d;}; #define _CI_NBYTES_ALIGNMENT ((size_t) &(((struct _ci_align_test *)0)[0].d)) #define _CI_ALIGN(val) ((val+(_CI_NBYTES_ALIGNMENT - 1))&~(_CI_NBYTES_ALIGNMENT - 1)) #define ICAP_OPTIONS 0x01 #define ICAP_REQMOD 0x02 #define ICAP_RESPMOD 0x04 CI_DECLARE_DATA extern const char *ci_methods[]; #define ci_method_support(METHOD, METHOD_DEF) (METHOD&METHOD_DEF) #define ci_method_string(method) (method<=ICAP_RESPMOD && method>=ICAP_OPTIONS ?ci_methods[method]:"UNKNOWN") enum ci_error_codes { EC_100, EC_200, EC_204, EC_206, EC_400, EC_401, EC_403, EC_404, EC_405, EC_407, EC_408, EC_500, EC_501, EC_502, EC_503, EC_505, EC_MAX }; typedef struct ci_error_code { int code; char *str; } ci_error_code_t; CI_DECLARE_DATA extern const struct ci_error_code ci_error_codes[]; #define ci_error_code(ec) (ec>=EC_100&&ec=EC_100&&ec #include "util.h" #include "array.h" #ifdef __cplusplus extern "C" { #endif #define CI_MEMBUF_NULL_TERMINATED 0x01 #define CI_MEMBUF_HAS_EOF 0x02 #define CI_MEMBUF_RO 0x04 #define CI_MEMBUF_CONST 0x08 #define CI_MEMBUF_FOREIGN_BUF 0x10 /*Flags can be set by user: */ #define CI_MEMBUF_USER_FLAGS (CI_MEMBUF_NULL_TERMINATED | CI_MEMBUF_RO) #define CI_MEMBUF_FROM_CONTENT_FLAGS (CI_MEMBUF_NULL_TERMINATED | CI_MEMBUF_RO | CI_MEMBUF_CONST | CI_MEMBUF_HAS_EOF) typedef struct ci_membuf { int endpos; int readpos; int bufsize; int unlocked; unsigned int flags; char *buf; ci_array_t *attributes; } ci_membuf_t; CI_DECLARE_FUNC(struct ci_membuf *) ci_membuf_new(); CI_DECLARE_FUNC(struct ci_membuf *) ci_membuf_new_sized(int size); CI_DECLARE_FUNC(struct ci_membuf *) ci_membuf_from_content(char *buf, size_t buf_size, size_t content_size, unsigned int flags); CI_DECLARE_FUNC(void) ci_membuf_free(struct ci_membuf *); CI_DECLARE_FUNC(int) ci_membuf_write(struct ci_membuf *body, const char *buf,int len, int iseof); CI_DECLARE_FUNC(int) ci_membuf_read(struct ci_membuf *body,char *buf,int len); CI_DECLARE_FUNC(int) ci_membuf_attr_add(struct ci_membuf *body,const char *attr, const void *val, size_t val_size); CI_DECLARE_FUNC(const void *) ci_membuf_attr_get(struct ci_membuf *body,const char *attr); CI_DECLARE_FUNC(int) ci_membuf_truncate(struct ci_membuf *body, int new_size); CI_DECLARE_FUNC(unsigned int) ci_membuf_set_flag(struct ci_membuf *body, unsigned int flag); #define ci_membuf_lock_all(body) ((body)->unlocked = 0) #define ci_membuf_unlock(body, len) ((body)->unlocked = ((body->readpos) > len ? (body->readpos) : len)) #define ci_membuf_unlock_all(body) ((body)->unlocked = -1) #define ci_membuf_size(body) ((body)->endpos) #define ci_membuf_flag(body, flag) ((body)->flags & flag) /*****************************************************************/ /* Cached file functions and structure */ #define CI_FILE_USELOCK 0x01 #define CI_FILE_HAS_EOF 0x02 #define CI_FILE_RING_MODE 0x04 typedef struct ci_cached_file { ci_off_t endpos; ci_off_t readpos; int bufsize; int flags; ci_off_t unlocked; char *buf; int fd; char filename[CI_FILENAME_LEN+1]; ci_array_t *attributes; } ci_cached_file_t; CI_DECLARE_DATA extern int CI_BODY_MAX_MEM; CI_DECLARE_DATA extern char *CI_TMPDIR; CI_DECLARE_FUNC(ci_cached_file_t) * ci_cached_file_new(int size); CI_DECLARE_FUNC(void) ci_cached_file_destroy(ci_cached_file_t *); CI_DECLARE_FUNC(int) ci_cached_file_write(ci_cached_file_t *body, const char *buf,int len, int iseof); CI_DECLARE_FUNC(int) ci_cached_file_read(ci_cached_file_t *body,char *buf,int len); CI_DECLARE_FUNC(void) ci_cached_file_reset(ci_cached_file_t *body,int new_size); CI_DECLARE_FUNC(void) ci_cached_file_release(ci_cached_file_t *body); #define ci_cached_file_lock_all(body) (body->flags |= CI_FILE_USELOCK,body->unlocked = 0) #define ci_cached_file_unlock(body, len) (body->unlocked = ((body->readpos) > len ? (body->readpos) : len)) #define ci_cached_file_unlock_all(body) (body->flags &= ~CI_FILE_USELOCK,body->unlocked = 0) #define ci_cached_file_size(body) (body->endpos) #define ci_cached_file_ismem(body) (body->fd < 0) #define ci_cached_file_read_pos(body) (body->readpos) #define ci_cached_file_haseof(body) (body->flags & CI_FILE_HAS_EOF) /*****************************************************************/ /* simple file function and structures */ typedef struct ci_simple_file { ci_off_t endpos; ci_off_t readpos; ci_off_t max_store_size; ci_off_t bytes_in; ci_off_t bytes_out; unsigned int flags; ci_off_t unlocked; int fd; char filename[CI_FILENAME_LEN+1]; ci_array_t *attributes; #if defined(USE_POSIX_MAPPED_FILES) char *mmap_addr; ci_off_t mmap_size; #endif } ci_simple_file_t; CI_DECLARE_FUNC(ci_simple_file_t) * ci_simple_file_new(ci_off_t maxsize); CI_DECLARE_FUNC(ci_simple_file_t) * ci_simple_file_named_new(char *tmp,char*filename,ci_off_t maxsize); CI_DECLARE_FUNC(void) ci_simple_file_release(ci_simple_file_t *); CI_DECLARE_FUNC(void) ci_simple_file_destroy(ci_simple_file_t *body); CI_DECLARE_FUNC(int) ci_simple_file_write(ci_simple_file_t *body, const char *buf,int len, int iseof); CI_DECLARE_FUNC(int) ci_simple_file_read(ci_simple_file_t *body,char *buf,int len); CI_DECLARE_FUNC(int) ci_simple_file_truncate(ci_simple_file_t *body, ci_off_t new_size); /*Currently it is just creates a MAP_PRIVATE memory. Only CI_MEMBUF_CONST flag is supported. */ CI_DECLARE_FUNC(ci_membuf_t *) ci_simple_file_to_membuf(ci_simple_file_t *body, unsigned int flags); CI_DECLARE_FUNC(const char *) ci_simple_file_to_const_string(ci_simple_file_t *body); #define ci_simple_file_lock_all(body) (body->flags |= CI_FILE_USELOCK,body->unlocked = 0) #define ci_simple_file_unlock(body, len) (body->unlocked = ((body->readpos) > len ? (body->readpos) : len)) #define ci_simple_file_unlock_all(body) (body->flags &= ~CI_FILE_USELOCK,body->unlocked = 0) #define ci_simple_file_size(body) (body->endpos) #define ci_simple_file_haseof(body) (body->flags & CI_FILE_HAS_EOF) /*******************************************************************/ /*ring memory buffer functions and structures */ typedef struct ci_ring_buf { char *buf; char *end_buf; char *read_pos; char *write_pos; int full; } ci_ring_buf_t; CI_DECLARE_FUNC(struct ci_ring_buf *) ci_ring_buf_new(int size); CI_DECLARE_FUNC(void) ci_ring_buf_destroy(struct ci_ring_buf *buf); CI_DECLARE_FUNC(int) ci_ring_buf_write(struct ci_ring_buf *buf, const char *data,int size); CI_DECLARE_FUNC(int) ci_ring_buf_read(struct ci_ring_buf *buf, char *data,int size); /*low level functions for ci_ring_buf*/ CI_DECLARE_FUNC(int) ci_ring_buf_write_block(struct ci_ring_buf *buf, char **wb, int *len); CI_DECLARE_FUNC(int) ci_ring_buf_read_block(struct ci_ring_buf *buf, char **rb, int *len); CI_DECLARE_FUNC(void) ci_ring_buf_consume(struct ci_ring_buf *buf, int len); CI_DECLARE_FUNC(void) ci_ring_buf_produce(struct ci_ring_buf *buf, int len); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/dlib.h0000664000175000017500000000275613371253152012405 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __DLIB_H #define __DLIB_H #include "c-icap.h" #ifdef _WIN32 #include #endif #ifdef __cplusplus extern "C" { #endif #ifndef _WIN32 #define CI_DLIB_HANDLE void * #else #define CI_DLIB_HANDLE HMODULE #endif CI_DECLARE_FUNC(CI_DLIB_HANDLE) ci_module_load(const char *module_file, const char *default_path); CI_DECLARE_FUNC(void *) ci_module_sym(CI_DLIB_HANDLE handle,const char *symbol); CI_DECLARE_FUNC(int) ci_module_unload(CI_DLIB_HANDLE handle,const char *name); /*Utility functions */ CI_DECLARE_FUNC(int) ci_dlib_entry(const char *name,const char *file, CI_DLIB_HANDLE handle, int forceUnload); #ifdef __cplusplus } #endif #endif /*__DLIB_H*/ c_icap-0.5.6/include/module.h0000664000175000017500000001064013371253152012747 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __MODULE_H #define __MODULE_H #include #include "c-icap.h" #include "request.h" #include "header.h" #include "service.h" #include "cfg_param.h" #ifdef __cplusplus extern "C" { #endif struct ci_request; #define CI_MOD_DISABLE_FORCE_UNLOAD_STR "__c_icap_module_disable_force_unload" #define CI_MOD_DISABLE_FORCE_UNLOAD() CI_DECLARE_MOD_DATA const char * __c_icap_module_disable_force_unload = "off;" enum module_type { UNKNOWN, SERVICE_HANDLER, LOGGER, ACCESS_CONTROLLER, AUTH_METHOD, AUTHENTICATOR, COMMON, MODS_TABLE_END }; typedef struct service_handler_module { const char *name; const char *extensions; int (*init_service_handler)(struct ci_server_conf *server_conf); int (*post_init_service_handler)(struct ci_server_conf *server_conf); void (*release_service_handler)(); ci_service_module_t *(*create_service)(const char *service_file, const char *argv[]); struct ci_conf_entry *conf_table; } service_handler_module_t; typedef struct common_module { const char *name; int (*init_module)(struct ci_server_conf *server_conf); int (*post_init_module)(struct ci_server_conf *server_conf); void (*close_module)(); struct ci_conf_entry *conf_table; } common_module_t; typedef struct logger_module { const char *name; int (*init_logger)(struct ci_server_conf *server_conf); int (*log_open)(); /*Or better post_init_logger .......*/ void (*log_close)(); void (*log_access)(ci_request_t *req); void (*log_server)(const char *server, const char *format, va_list ap); struct ci_conf_entry *conf_table; } logger_module_t; typedef struct access_control_module { const char *name; int (*init_access_controller)(struct ci_server_conf *server_conf); int (*post_init_access_controller)(struct ci_server_conf *server_conf); void (*release_access_controller)(); int (*client_access)(ci_request_t *req); int (*request_access)(ci_request_t *req); struct ci_conf_entry *conf_table; } access_control_module_t; typedef struct http_auth_method { const char *name; int (*init_auth_method)(struct ci_server_conf *server_conf); int (*post_init_auth_method)(struct ci_server_conf *server_conf); void (*close_auth_method)(); void *(*create_auth_data)(const char *authorization_header,const char **username); void (*release_auth_data)(void *data); char *(*authentication_header)(); void (*release_authentication_header)(); struct ci_conf_entry *conf_table; } http_auth_method_t; typedef struct authenticator_module { const char *name; const char *method; int (*init_authenticator)(struct ci_server_conf *server_conf); int (*post_init_authenticator)(struct ci_server_conf *server_conf); void (*close_authenticator)(); int (*authenticate)(void *data, const char *usedb); struct ci_conf_entry *conf_table; } authenticator_module_t; int init_modules(); int post_init_modules(); void * register_module(const char *module_file, const char *type, const char *argv[]); logger_module_t *find_logger(const char *name); access_control_module_t *find_access_controller(const char *name); service_handler_module_t *find_servicehandler(const char *name); service_handler_module_t *find_servicehandler_by_ext(const char *extension); http_auth_method_t *find_auth_method_n(const char *method, int len, int *method_id); http_auth_method_t * get_authentication_schema(const char *method_name, authenticator_module_t ***authenticators); void *find_module(const char *name,int *type); int set_method_authenticators(const char *method_name, const char **argv); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/ci_threads.h0000664000175000017500000001010213371253152013560 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __CI_THREADS_H #define __CI_THREADS_H #include "c-icap.h" #ifdef __cplusplus extern "C" { #endif #ifndef _WIN32 #include #define ci_thread_mutex_t pthread_mutex_t #define ci_thread_cond_t pthread_cond_t #define ci_thread_t pthread_t CI_DECLARE_FUNC(int) ci_thread_mutex_init(ci_thread_mutex_t *pmutex); CI_DECLARE_FUNC(int) ci_thread_mutex_destroy(ci_thread_mutex_t *pmutex); #define ci_thread_mutex_lock(pmutex) pthread_mutex_lock(pmutex) #define ci_thread_mutex_unlock(pmutex) pthread_mutex_unlock(pmutex) #define ci_thread_self pthread_self #ifdef USE_PTHREADS_RWLOCK #define ci_thread_rwlock_t pthread_rwlock_t CI_DECLARE_FUNC(int) ci_thread_rwlock_init(ci_thread_rwlock_t *); CI_DECLARE_FUNC(int) ci_thread_rwlock_destroy(ci_thread_rwlock_t *); #define ci_thread_rwlock_rdlock(rwlock) pthread_rwlock_rdlock(rwlock) #define ci_thread_rwlock_wrlock(rwlock) pthread_rwlock_wrlock(rwlock) #define ci_thread_rwlock_unlock(rwlock) pthread_rwlock_unlock(rwlock) #else #define ci_thread_rwlock_t pthread_mutex_t CI_DECLARE_FUNC(int) ci_thread_rwlock_init(ci_thread_rwlock_t *); CI_DECLARE_FUNC(int) ci_thread_rwlock_destroy(ci_thread_rwlock_t *); CI_DECLARE_FUNC(int) ci_thread_rwlock_rdlock(ci_thread_rwlock_t *); CI_DECLARE_FUNC(int) ci_thread_rwlock_wrlock(ci_thread_rwlock_t *); CI_DECLARE_FUNC(int) ci_thread_rwlock_unlock(ci_thread_rwlock_t *); #endif CI_DECLARE_FUNC(int) ci_thread_cond_init(ci_thread_cond_t *pcond); CI_DECLARE_FUNC(int) ci_thread_cond_destroy(ci_thread_cond_t *pcond); #define ci_thread_cond_wait(pcond,pmutex) pthread_cond_wait(pcond,pmutex) #define ci_thread_cond_broadcast(pcond) pthread_cond_broadcast(pcond) #define ci_thread_cond_signal(pcond) pthread_cond_signal(pcond) CI_DECLARE_FUNC(int) ci_thread_create(ci_thread_t *pthread_id, void *(*pfunc)(void *), void *parg); CI_DECLARE_FUNC(int) ci_thread_join(ci_thread_t thread_id); #else /*ifdef _WIN32*/ #include #define ci_thread_mutex_t CRITICAL_SECTION #define ci_thread_rwlock_t CRITICAL_SECTION #define ci_thread_cond_t HANDLE #define ci_thread_t DWORD CI_DECLARE_FUNC(int) ci_thread_mutex_init(ci_thread_mutex_t *pmutex); CI_DECLARE_FUNC(int) ci_thread_mutex_destroy(ci_thread_mutex_t *pmutex); CI_DECLARE_FUNC(int) ci_thread_mutex_lock(ci_thread_mutex_t *pmutex); CI_DECLARE_FUNC(int) ci_thread_mutex_unlock(ci_thread_mutex_t *pmutex); CI_DECLARE_FUNC(int) ci_thread_rwlock_init(ci_thread_rwlock_t *); CI_DECLARE_FUNC(int) ci_thread_rwlock_destroy(ci_thread_rwlock_t *); CI_DECLARE_FUNC(int) ci_thread_rwlock_rdlock(ci_thread_rwlock_t *); CI_DECLARE_FUNC(int) ci_thread_rwlock_wrlock(ci_thread_rwlock_t *); CI_DECLARE_FUNC(int) ci_thread_rwlock_unlock(ci_thread_rwlock_t *); CI_DECLARE_FUNC(int) ci_thread_cond_init(ci_thread_cond_t *pcond); CI_DECLARE_FUNC(int) ci_thread_cond_destroy(ci_thread_cond_t *pcond); CI_DECLARE_FUNC(int) ci_thread_cond_wait(ci_thread_cond_t *pcond,ci_thread_mutex_t *pmutex); CI_DECLARE_FUNC(int) ci_thread_cond_broadcast(ci_thread_cond_t *pcond); CI_DECLARE_FUNC(int) ci_thread_cond_signal(ci_thread_cond_t *pcond); CI_DECLARE_FUNC(int) ci_thread_create(ci_thread_t *thread_id, void *(*pfunc)(void *), void *parg); CI_DECLARE_FUNC(int) ci_thread_join(ci_thread_t thread_id); #endif #ifdef __cplusplus } #endif #endif /*__CI_THREADS_H */ c_icap-0.5.6/include/simple_api.h0000664000175000017500000006043013371253152013606 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __SIMPLE_API_H #define __SIMPLE_API_H #include "c-icap.h" #include "request.h" #ifdef __cplusplus extern "C" { #endif /** \defgroup HTTP API for HTTP object manipulation \ingroup API * Macros, functions and structures used for manipulating the encupsulated * HTTP objects (HTTP requests or HTTP responses). */ /** \defgroup UTILITY utility funtions \ingroup API * Utility functions */ /*The following defines are request related and should be moved to request.h include file*/ /** \def ci_req_lock_data(ci_request_t) \ingroup REQUEST * Lock a ci_request_t object. After called the c-icap server stops sending * body data to the ICAP client. \param req is pointer to an object of type ci_request_t */ #define ci_req_lock_data(req) ((req)->data_locked = 1) /** \def ci_req_unlock_data(ci_request_t) \ingroup REQUEST * Unlock a ci_request_t object. When called the c-icap server will start * sending body data to the ICAP client. \param req is pointer to an object of type ci_request_t */ #define ci_req_unlock_data(req) ((req)->data_locked = 0) /** \def ci_req_hasbody(ci_request_t) \ingroup REQUEST \param req is pointer to an object of type ci_request_t \return true (non zero int) if the ICAP request contains body data else zero */ #define ci_req_hasbody(req) ((req)->hasbody) /** \def ci_req_type(ci_request_t) \ingroup REQUEST \return ICAP_OPTIONS, ICAP_REQMOD or ICAP_RESPMOD if the ICAP request is * options, request modification or response modification ICAP request */ #define ci_req_type(req) ((req)->type) /** \def ci_req_preview_size(ci_request_t) \ingroup REQUEST \param req is pointer to an object of type ci_request_t \return The ICAP preview size */ #define ci_req_preview_size(req) ((req)->preview) /*The preview data size*/ /** \def ci_req_allow204(ci_request_t) \ingroup REQUEST \param req is pointer to an object of type ci_request_t \return True (non zero int) if the ICAP request supports "Allow 204" */ #define ci_req_allow204(req) ((req)->allow204) /** \def ci_req_allow206(ci_request_t) \ingroup REQUEST \param req is pointer to an object of type ci_request_t \return True (non zero int) if the ICAP request supports "Allow 206" */ #define ci_req_allow206(req) ((req)->allow206) /** \def ci_req_allow206_outside_preview(ci_request_t) \ingroup REQUEST \param req is pointer to an object of type ci_request_t \return True (non zero int) if the ICAP request supports "Allow 206" outside * preview requests */ #define ci_req_allow206_outside_preview(req) ((req)->allow206 && (req)->allow204) /** \def ci_req_sent_data(ci_request_t) \ingroup REQUEST \param req is pointer to an object of type ci_request_t \return True (non zero int) if the c-icap server has send data to the client */ #define ci_req_sent_data(req)((req)->status) /** \def ci_req_hasalldata(ci_request_t) \ingroup REQUEST \param req is pointer to an object of type ci_request_t \return True (non zero int) if the ICAP client has sent all the data * (headers and body data) to the ICAP server */ #define ci_req_hasalldata(req)((req)->eof_received) /** * Decodes a base64 encoded string. \ingroup UTILITY * \param str is a buffer which holds the base64 encoded data \param result is a buffer where the decoded data will be stored \param len is the length of the result buffer \return the number of decoded bytes */ CI_DECLARE_FUNC(int) ci_base64_decode(const char *str,char *result,int len); /** * Produces a base64 encoded string. \ingroup UTILITY * \param data is a buffer which holds the data to be encoded \param datalen is the length of the data buffer \param out is a buffer where the encoded data will be stored \param outlen is the length of the out buffer \return the number of decoded bytes */ CI_DECLARE_FUNC(int) ci_base64_encode(const unsigned char *data, size_t datalen, char *out, size_t outlen); enum { CI_ENCODE_UNKNOWN = -1, CI_ENCODE_NONE = 0, CI_ENCODE_GZIP, CI_ENCODE_DEFLATE, CI_ENCODE_BZIP2, CI_ENCODE_BROTLI }; /** * Return the encoding method integer representation from string. \ingroup UTILITY * \param content_encoding The content encoding name \return the CI_ENCODE_* representation */ CI_DECLARE_FUNC(int) ci_encoding_method(const char *content_encoding); /** * Uncompress a zipped string. \ingroup UTILITY * \param compress_method CI_ENCODE_GZIP, CI_ENCODED_DEFLATE or CI_CI_ENCODE_BZIP2 \param buf is a buffer which holds the zipped data \param len is the length of the buffer buf \param unzipped_buf is the buffer where to store unzipped data \param unzipped_buf_len is the length of the buffer to store unzipped data, * and updated with the length of unzipped data \return CI_OK on success CI_ERROR on error */ CI_DECLARE_FUNC(int) ci_uncompress_preview(int compress_method, const char *buf, int len, char *unzipped_buf, int *unzipped_buf_len); enum CI_UNCOMPRESS_ERRORS { CI_UNCOMP_ERR_BOMB = -4, CI_UNCOMP_ERR_CORRUPT = -3, CI_UNCOMP_ERR_OUTPUT = -2, CI_UNCOMP_ERR_ERROR = -1, CI_UNCOMP_ERR_NONE = 0, CI_UNCOMP_OK = 1, }; enum CI_COMPRESS_ERRORS { CI_COMP_ERR_BOMB = -4, CI_COMP_ERR_CORRUPT = -3, CI_COMP_ERR_OUTPUT = -2, CI_COMP_ERR_ERROR = -1, CI_COMP_ERR_NONE = 0, CI_COMP_OK = 1, }; /** * Return a string representation of a decompress error code. \ingroup UTILITY * \param err a CI_UNCOMPRESS_ERRORS error code */ CI_DECLARE_FUNC(const char *) ci_decompress_error(int err); /** Deprecated */ CI_DECLARE_FUNC(const char *) ci_inflate_error(int err); struct ci_membuf; struct ci_simple_file; /* Data Decompression core functions */ /** * Uncompress any compressed data that c-icap understands and writes the output to the outbuf * object, regardless of algorithm \ingroup UTILITY * \param encoding_format is the enum for the encoding type \param inbuf is a buffer which holds the zipped data \param inlen is the length of the buffer buf \param outbuf where to put unzipped data \param max_size if it is greater than zero, the output data limit \return CI_UNCOMP_OK on success, CI_UNCOMP_ERR_NONE, if maxsize exceed, an * CI_UNCOMPRESS_ERRORS code otherwise */ CI_DECLARE_FUNC(int) ci_decompress_to_membuf(int encoding_format, const char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size); /** \ingroup UTILITY \copydoc ci_decompress_to_membuf(char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size) */ CI_DECLARE_FUNC(int) ci_decompress_to_simple_file(int encoding_format, const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size); /** * Uncompress deflate/gzip compressed data and writes the output to the outbuf * object \ingroup UTILITY * \param inbuf is a buffer which holds the zipped data \param inlen is the length of the buffer buf \param outbuf where to put unzipped data \param max_size if it is greater than zero, the output data limit \return CI_UNCOMP_OK on success, CI_UNCOMP_ERR_NONE, if maxsize exceed, an * CI_UNCOMPRESS_ERRORS code otherwise */ CI_DECLARE_FUNC(int) ci_inflate_to_membuf(const char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size); /** \ingroup UTILITY \copydoc ci_inflate_to_membuf(char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size) */ CI_DECLARE_FUNC(int) ci_inflate_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size); /** * Uncompress bzip2 compressed data and writes the output to the outbuf object \ingroup UTILITY * \param inbuf is a buffer which holds the zipped data \param inlen is the length of the buffer buf \param outbuf where to put unzipped data \param max_size if it is greater than zero, the output data limit \return CI_UNCOMP_OK on success, CI_UNCOMP_ERR_NONE, if maxsize exceed, an * CI_UNCOMPRESS_ERRORS code otherwise */ CI_DECLARE_FUNC(int) ci_bzunzip_to_membuf(const char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size); /** \ingroup UTILITY \copydoc ci_bzunzip_to_membuf(char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size) */ CI_DECLARE_FUNC(int) ci_bzunzip_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size); /** * Uncompress brotli compressed data and writes the output to the outbuf object \ingroup UTILITY * \param inbuf is a buffer which holds the zipped data \param inlen is the length of the buffer buf \param outbuf where to put unzipped data \param max_size if it is greater than zero, the output data limit \return CI_UNCOMP_OK on success, CI_UNCOMP_ERR_NONE, if maxsize exceed, an * CI_UNCOMPRESS_ERRORS code otherwise */ CI_DECLARE_FUNC(int) ci_brinflate_to_membuf(const char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size); /** \ingroup UTILITY \copydoc ci_brinflate_to_membuf(char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size) */ CI_DECLARE_FUNC(int) ci_brinflate_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size); /* Data Compression core functions */ /** * Compress any uncompressed data that c-icap understands and writes the output to the outbuf * object, regardless of algorithm \ingroup UTILITY * \param encoding_format is the enum for the encoding type \param inbuf is a buffer which holds the unzipped data \param inlen is the length of the buffer buf \param outbuf where to put zipped data \param max_size if it is greater than zero, the output data limit \return CI_COMP_OK on success, CI_COMP_ERR_NONE, if maxsize exceed, an * CI_COMPRESS_ERRORS code otherwise */ CI_DECLARE_FUNC(int) ci_compress_to_membuf(int encoding_format, const char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size); /** \ingroup UTILITY \copydoc ci_compress_to_membuf(char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size) */ CI_DECLARE_FUNC(int) ci_compress_to_simple_file(int encoding_format, const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size); /** * Compress deflate uncompressed data and writes the output to the outbuf * object \ingroup UTILITY * \param inbuf is a buffer which holds the unzipped data \param inlen is the length of the buffer buf \param outbuf where to put zipped data \param max_size if it is greater than zero, the output data limit \return CI_COMP_OK on success, CI_COMP_ERR_NONE, if maxsize exceed, an * CI_COMPRESS_ERRORS code otherwise */ CI_DECLARE_FUNC(int) ci_deflate_to_membuf(const char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size); /** \ingroup UTILITY \copydoc ci_deflate_to_membuf(char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size) */ CI_DECLARE_FUNC(int) ci_deflate_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size); /** * Compress gzip uncompressed data and writes the output to the outbuf * object \ingroup UTILITY * \param inbuf is a buffer which holds the unzipped data \param inlen is the length of the buffer buf \param outbuf where to put zipped data \param max_size if it is greater than zero, the output data limit \return CI_COMP_OK on success, CI_COMP_ERR_NONE, if maxsize exceed, an * CI_COMPRESS_ERRORS code otherwise */ CI_DECLARE_FUNC(int) ci_gzip_to_membuf(const char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size); /** \ingroup UTILITY \copydoc ci_deflate_to_membuf(char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size) */ CI_DECLARE_FUNC(int) ci_gzip_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size); /** * Compress bzip2 uncompressed data and writes the output to the outbuf object \ingroup UTILITY * \param inbuf is a buffer which holds the unzipped data \param inlen is the length of the buffer buf \param outbuf where to put zipped data \param max_size if it is greater than zero, the output data limit \return CI_COMP_OK on success, CI_COMP_ERR_NONE, if maxsize exceed, an * CI_COMPRESS_ERRORS code otherwise */ CI_DECLARE_FUNC(int) ci_bzzip_to_membuf(const char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size); /** \ingroup UTILITY \copydoc ci_bzzip_to_membuf(char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size) */ CI_DECLARE_FUNC(int) ci_bzzip_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size); /** * Compress brotli uncompressed data and writes the output to the outbuf object \ingroup UTILITY * \param inbuf is a buffer which holds the unzipped data \param inlen is the length of the buffer buf \param outbuf where to put zipped data \param max_size if it is greater than zero, the output data limit \return CI_COMP_OK on success, CI_COMP_ERR_NONE, if maxsize exceed, an * CI_COMPRESS_ERRORS code otherwise */ CI_DECLARE_FUNC(int) ci_brdeflate_to_membuf(const char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size); /** \ingroup UTILITY \copydoc ci_brdeflate_to_membuf(char *inbuf, size_t inlen, struct ci_membuf *outbuf, ci_off_t max_size) */ CI_DECLARE_FUNC(int) ci_brdeflate_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size); /** * Decodes a base64 encoded string, and also allocate memory for the result. \ingroup UTILITY * \param str is a buffer which holds the base64 encoded data \return a pointer to the decoded string. It uses malloc to allocate space for * the decoded string so the free function should used to release the * allocated memory. */ CI_DECLARE_FUNC(char *) ci_base64_decode_dup(const char *str); /** */ /** * Returns the HTTP response headers. \ingroup HTTP * * This function is only valid for an ICAP responce modification request. If * the ICAP request is not responce modification ICAP request or there are * not response headers (HTTP 0.9) the function returns NULL. \param req A pointer to the current ICAP request object. \return Pointer to the HTTP response headers or NULL. */ CI_DECLARE_FUNC(ci_headers_list_t *) ci_http_response_headers(ci_request_t *req); /** \ingroup HTTP \brief Returns the HTTP request headers. * * This function can used for an responce or request modification ICAP request * to get the HTTP request headers \param req is a pointer to the current ICAP request object. \return Pointer to the HTTP request headers or NULL if fails. */ CI_DECLARE_FUNC(ci_headers_list_t *) ci_http_request_headers(ci_request_t *req); /** \ingroup HTTP \brief Add a custom header to the HTTP response headers. * * This function can used to add custom headers to the HTTP response and can * be used only for response modification ICAP requests \param req is a pointer to the current ICAP request object. \param header is a string contains the header in the form "Header: value" \return Pointer to the header or NULL if fails. */ CI_DECLARE_FUNC(const char *) ci_http_response_add_header(ci_request_t *req, const char *header); /** \ingroup HTTP \brief Add a custom header to the HTTP request headers. * * This function can used to add custom headers to the HTTP request and can be * used only for request modification ICAP requests \param req is a pointer to the current ICAP request object. \param header is a string contains the header in the form "Header: value" \return Pointer to the header or NULL if fails. */ CI_DECLARE_FUNC(const char *) ci_http_request_add_header(ci_request_t *req, const char *header); /** \ingroup HTTP \brief Remove a header from the HTTP response headers. * * This function can used to remove a header from the HTTP response and can be * used only for response modification ICAP requests \param req is a pointer to the current ICAP request object. \param header is a string contains the header name \return Non zero if success or zero otherwise */ CI_DECLARE_FUNC(int) ci_http_response_remove_header(ci_request_t *req, const char *header); /** \ingroup HTTP \brief Remove a header from the HTTP request headers. * * This function can used to remove a header from the HTTP request and can be * used only for request modification ICAP requests \param req is a pointer to the current ICAP request object. \param header is a string contains the header name \return Non zero if success or zero otherwise */ CI_DECLARE_FUNC(int) ci_http_request_remove_header(ci_request_t *req, const char *header); /** \ingroup HTTP \brief Get the value of the requested header from the HTTP response headers. * * This function can used to get the value of a header from the HTTP response * headers. It can be used only for response modification ICAP requests \param req is a pointer to the current ICAP request object. \param head_name is a string contains the header name \return A string with the header value on success NULL otherwise */ CI_DECLARE_FUNC(const char *) ci_http_response_get_header(ci_request_t *req, const char *head_name); /** \ingroup HTTP \brief Get the value of the requested header from the HTTP request headers. * * This function can used to get the value of a header from the HTTP request * headers. It can be used on both request and response modification ICAP * requests. \param req is a pointer to the current ICAP request object. \param head_name is a string contains the header name \return A string with the header value on success NULL otherwise */ CI_DECLARE_FUNC(const char *) ci_http_request_get_header(ci_request_t *req, const char *head_name); /** \ingroup HTTP \brief Completelly erase and initialize the HTTP response headers. * * This function is usefull when the full rewrite of the HTTP response is * required. After this function called, the HTTP response should be filled * with new HTTP headers, before send back to the ICAP client. * An example of usage of this function is in antivirus service when a * virus detected in HTTP response, so the service blocks the response and * sends a new HTTP object (a new html page, with HTTP headers) informing * the user about the virus. * It can be used with response modification ICAP requests. \param req is a pointer to the current ICAP request object. \return non zero on success zero otherwise */ CI_DECLARE_FUNC(int) ci_http_response_reset_headers(ci_request_t *req); /** \ingroup HTTP \brief Completelly erase and initialize the HTTP request headers. * * This function is usefull when an HTTP request required should replaced by * an other.After this function called, the HTTP request should filled with * new HTTP headers, before send back to the ICAP client. * An example use is to implement an HTTP redirector. * It can be used with request modification ICAP requests. \param req is a pointer to the current ICAP request object. \return non zero on success zero otherwise */ CI_DECLARE_FUNC(int) ci_http_request_reset_headers(ci_request_t *req); /** \ingroup HTTP \brief Creates a new HTTP response. * * This function is usefull when the service wants to respond with a self * created message to a response or request modification ICAP request. * It can be used with both request and response modification ICAP requests. \param req is a pointer to the current ICAP request object. \param has_reshdr if it is non zero the HTTP response contrains HTTP headers * (a non HTTP 0.9 response) \param has_body if it is non zero the HTTP response contains HTTP body data \return non zero on success zero otherwise */ CI_DECLARE_FUNC(int) ci_http_response_create(ci_request_t *req, int has_reshdr, int has_body); /** \ingroup HTTP \brief Creates a new HTTP request. * * This function is usefull to develop icap clients \param req is a pointer to the current ICAP request object. \param has_body if it is non zero the HTTP request contains HTTP body data \return non zero on success zero otherwise */ CI_DECLARE_FUNC(int) ci_http_request_create(ci_request_t *req, int has_body); /** \ingroup HTTP \brief Returns the value of the Content-Length header of the HTTP response * or HTTP request for a response modification or request modification ICAP * requests respectively. * * If the header Content-Length is not included in HTTP response * It can be used with both request and response modification ICAP requests. \param req is a pointer to the current ICAP request object. \return The content length on success or a negative number otherwise */ CI_DECLARE_FUNC(ci_off_t) ci_http_content_length(ci_request_t *req); /** * Return the encoding method integer representation from string. \ingroup UTILITY * \param req is a pointer to the current ICAP request object. \return the content encoding, CI_ENCODE_NONE for no encoding or CI_ENCODE_UNKNOWN for non RESPMOD ICAP requests */ CI_DECLARE_FUNC(int) ci_http_response_content_encoding(ci_request_t *req); /** \ingroup HTTP \brief Returns the request line (e.g "GET /index.html HTTP 1.0") from http * request headers * * It can be used with both request and response modification ICAP requests. \param req is a pointer to the current ICAP request object. \return The request line in success or NULL otherwise */ CI_DECLARE_FUNC(const char *) ci_http_request(ci_request_t *req); /** \ingroup HTTP \brief Returns the URL (e.g "http://www.chtsanti.net") from http request * * It can be used with both request and response modification ICAP requests. \param req is a pointer to the current ICAP request object. \param buf a buffer to store the url \param buf_size the "buf" buffer size \return The bytes written to the "buf" buffer */ CI_DECLARE_FUNC(int) ci_http_request_url(ci_request_t * req, char *buf, int buf_size); /** \ingroup HTTP \brief Return the http client ip address if this information is available \param req is a pointer to the current ICAP request object. \return A const pointer to a ci_ip_t object contain the client ip address * or NULL */ CI_DECLARE_FUNC(const ci_ip_t *) ci_http_client_ip(ci_request_t * req); /** \ingroup REQUEST \brief Add an icap X-header to the icap response headers * * It can be used with both request and response modification ICAP requests. \param req is a pointer to the current ICAP request object. \param header is the header to add in the form "Header: Value" \return pointer to the header in success or NULL otherwise */ CI_DECLARE_FUNC(const char *) ci_icap_add_xheader(ci_request_t *req, const char *header); /** \ingroup REQUEST \brief Append the icap X-headers to the icap response headers * * It can be used with both request and response modification ICAP requests. \param req is a pointer to the current ICAP request object. \param headers is a pointer to the headers object to add \return pointer to the header in success or NULL otherwise */ CI_DECLARE_FUNC(int) ci_icap_append_xheaders(ci_request_t *req, ci_headers_list_t *headers); #ifdef __CI_COMPAT #define ci_respmod_headers ci_http_response_headers #define ci_reqmod_headers ci_http_request_headers #define ci_respmod_add_header ci_http_response_add_header #define ci_reqmod_add_header ci_http_request_add_header #define ci_respmod_remove_header ci_http_response_remove_header #define ci_reqmod_remove_header ci_http_request_remove_header #define ci_respmod_get_header ci_http_response_get_header #define ci_reqmod_get_header ci_http_request_get_header #define ci_respmod_reset_headers ci_http_response_reset_headers #define ci_reqmod_reset_headers ci_http_request_reset_headers #define ci_request_create_respmod ci_http_response_create #define ci_content_lenght ci_http_content_length #define ci_request_add_xheader ci_icap_add_xheader #endif #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/lookup_table.h0000664000175000017500000001126413371253152014145 00000000000000/* * Copyright (C) 2004-2009 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __LOOKUP_TABLE_H #define __LOOKUP_TABLE_H #include "c-icap.h" #include "mem.h" #include "types_ops.h" #include "array.h" #ifdef __cplusplus extern "C" { #endif /** \defgroup LOOKUPTABLE Lookup tables api \ingroup API \brief Macros, functions and structures used to implement and use lookup tables * * Lookup tables can considered as simple read only databases where the user * can search a set of values using a key */ struct ci_lookup_table; struct ci_lookup_table_type { void *(*open)(struct ci_lookup_table *table); void (*close)(struct ci_lookup_table *table); void *(*search)(struct ci_lookup_table *table, void *key, void ***vals); void (*release_result)(struct ci_lookup_table *table_data, void **val); const void * (*get_row)(struct ci_lookup_table *table, const void *key, const char *columns[], void ***vals); char *type; }; /** * \brief The lookup table struct * \ingroup LOOKUPTABLE */ struct ci_lookup_table { void *(*open)(struct ci_lookup_table *table); void (*close)(struct ci_lookup_table *table); void *(*search)(struct ci_lookup_table *table, void *key, void ***vals); void (*release_result)(struct ci_lookup_table *table, void **val); const void * (*get_row)(struct ci_lookup_table *table, const void *key, const char *columns[], void ***vals); char *type; char *path; char *args; int cols; ci_str_vector_t *col_names; const ci_type_ops_t *key_ops; const ci_type_ops_t *val_ops; ci_mem_allocator_t *allocator; const struct ci_lookup_table_type *_lt_type; void *data; }; CI_DECLARE_FUNC(struct ci_lookup_table_type *) ci_lookup_table_type_register(struct ci_lookup_table_type *lt_type); CI_DECLARE_FUNC(void) ci_lookup_table_type_unregister(struct ci_lookup_table_type *lt_type); CI_DECLARE_FUNC(const struct ci_lookup_table_type *) ci_lookup_table_type_search(const char *type); /** * \brief Create a lookup table * \ingroup LOOKUPTABLE * \param table The path of the lookup table (eg file:/etc/c-icap/users.txt or * ldap://hostname/o=base?cn,uid?uid=chtsanti) \return A pointer to a lookup table object */ CI_DECLARE_FUNC(struct ci_lookup_table *) ci_lookup_table_create(const char *table); /** * \brief Destroy a lookup table. * \ingroup LOOKUPTABLE * \param lt Pointer to the lookup table will be destroyed. */ CI_DECLARE_FUNC(void) ci_lookup_table_destroy(struct ci_lookup_table *lt); /** * \brief Initializes the lookup table. * * \param table The lookup table object */ CI_DECLARE_FUNC(void *) ci_lookup_table_open(struct ci_lookup_table *table); /** * \brief Search for an object in the lookup table which matches a key. * * \param table The lookup table object * \param key The key value to search for * \param vals In this variable stored a 2d array which contains the return * values * \return NULL if none object matches, pointer to the object key value. */ CI_DECLARE_FUNC(const char *) ci_lookup_table_search(struct ci_lookup_table *table, const char *key, char ***vals); /** * \brief Releases the data values returned from the search method. * * \param table The lookup table object * \param val The 2d array returned from the search method */ CI_DECLARE_FUNC(void) ci_lookup_table_release_result(struct ci_lookup_table *table, void **val); /** * \brief Search for an object in the lookup table which supports named columns. * * \param table The lookup table object * \param key The key value to search for * \param columns NULL terminated array with the names of the columns to * retrieve. * \param vals In this variable stored a 2d array which contains the * requested row * \return NULL if none object matches, pointer to the object key value. */ CI_DECLARE_FUNC(const char *) ci_lookup_table_get_row(struct ci_lookup_table *table, const char *key, const char *columns[], char ***vals); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/header.h0000664000175000017500000002204713371253152012716 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __HEADERS_H #define __HEADERS_H #include "c-icap.h" #ifdef __cplusplus extern "C" { #endif /** \defgroup HEADERS Headers related API \ingroup API * Headers manipulation related API. */ enum ci_request_headers { ICAP_AUTHORIZATION, ICAP_ALLOW, ICAP_FROM, ICAP_HOST, ICAP_REFERER, ICAP_USERAGENT,ICAP_PREVIEW }; extern const char *ci_common_headers[]; extern const char *ci_request_headers[]; extern const char *ci_responce_headers[]; extern const char *ci_options_headers[]; enum ci_encapsulated_entities {ICAP_REQ_HDR, ICAP_RES_HDR, ICAP_REQ_BODY, ICAP_RES_BODY, ICAP_NULL_BODY,ICAP_OPT_BODY }; CI_DECLARE_DATA extern const char *ci_encaps_entities[]; #ifdef __CYGWIN__ const char *ci_encaps_entity_string(int e); #else #define ci_encaps_entity_string(e) (e <= ICAP_OPT_BODY && e >= ICAP_REQ_HDR?ci_encaps_entities[e]:"UNKNOWN") #endif /** \typedef ci_headers_list_t \ingroup HEADERS * This is a struct which can store a set of headers. * The developers should not touch ci_headers_list_t objects directly but * they should use the documented macros and functions */ typedef struct ci_headers_list { int size; int used; char **headers; int bufsize; int bufused; char *buf; int packed; } ci_headers_list_t; typedef struct ci_encaps_entity { int start; int type; void *entity; } ci_encaps_entity_t; #define BUFSIZE 4096 #define HEADERSTARTSIZE 64 #define HEADSBUFSIZE BUFSIZE #define MAX_HEADER_SIZE 1023 #define ci_headers_not_empty(h) ((h)->used) #define ci_headers_is_empty(h) ((h)->used == 0) /** * Allocate memory for a ci_headers_list_t object and initialize it. \ingroup HEADERS \return the allocated object on success, NULL otherwise. * */ CI_DECLARE_FUNC(ci_headers_list_t *) ci_headers_create(); /** * Destroy a ci_headers_list_t object \ingroup HEADERS \param heads is a pointer to the ci_headers_list_t object to be destroyed * */ CI_DECLARE_FUNC(void) ci_headers_destroy(ci_headers_list_t *heads); /** * Resets and initialize a ci_headers_list_t object \ingroup HEADERS \param heads pointer to the ci_headers_list_t object to be reset * */ CI_DECLARE_FUNC(void) ci_headers_reset(ci_headers_list_t *heads); CI_DECLARE_FUNC(int) ci_headers_setsize(ci_headers_list_t *heads, int size); /** * Add a header to a ci_headers_list_t object \ingroup HEADERS \param heads is a pointer to the ci_headers_list_t object in which the header * will be added \param header is the header to be added \return Pointer to the newly add header on success, NULL otherwise * *example usage: \code ci_headers_add(heads,"Content-Length: 1025") \endcode * */ CI_DECLARE_FUNC(const char *) ci_headers_add(ci_headers_list_t *heads, const char *header); /** * Append a headers list object to an other headers list \ingroup HEADERS \param heads is a pointer to the ci_headers_list_t object in which the * headers will be added \param someheaders is a ci_headers_list_t object which contains the headers * will be added to the heads \return non zero on success zero otherwise */ CI_DECLARE_FUNC(int) ci_headers_addheaders(ci_headers_list_t *heads,const ci_headers_list_t *someheaders); /** * Removes a header from a header list \ingroup HEADERS \param heads is a pointer to the ci_headers_list_t object \param header is the name of the header to be removed \return non zero on success, zero otherwise * *example usage: \code ci_headers_remove(heads,"Content-Length") \endcode * */ CI_DECLARE_FUNC(int) ci_headers_remove(ci_headers_list_t *heads, const char *header); /** * Search for a header in a header list \ingroup HEADERS \param heads is a pointer to the ci_headers_list_t object \param header is the name of the header \return a pointer to the start of the first occurrence of the header on * success, NULL otherwise * *example usage: \code char *head; head = ci_headers_search(heads,"Content-Length") \endcode * In this example on success the head pointer will point to a * \em "Content-Lenght: 1025" string * */ CI_DECLARE_FUNC(const char *) ci_headers_search(ci_headers_list_t *heads, const char *header); /** * Similar to ci_headers_search but also sets to a parameter the size of * returned header \ingroup HEADERS */ CI_DECLARE_FUNC(const char *) ci_headers_search2(ci_headers_list_t * h, const char *header, size_t *return_size); /** * Search for a header in a header list and return the value of the first * occurrence of this header \ingroup HEADERS \param heads is a pointer to the ci_headers_list_t object \param header is the name of the header \return a pointer to the start of the header on success, NULL otherwise * *example usage: \code char *headval; int content_length; headval = ci_headers_value(heads,"Content-Length"); content_length = strtol(headval,NULL,10); \endcode * */ CI_DECLARE_FUNC(const char *) ci_headers_value(ci_headers_list_t *heads, const char *header); /** * Similar to ci_headers_search but also sets to a parameter the size of * returned header value \ingroup HEADERS */ CI_DECLARE_FUNC(const char *) ci_headers_value2(ci_headers_list_t * h, const char *header, size_t *return_size); /** * Search for a header in a header list and copy the value to a buffer if exist \ingroup HEADERS \param heads is a pointer to the ci_headers_list_t object \param header is the name of the header \param buf is the buffer to store header value \param len is the size of the buffer buf \return a pointer to the buf on success, NULL otherwise * *example usage: \code char *headval; char buf[1024]; int content_length; headval = ci_headers_copy_value(heads, "Content-Length", buf, sizeof(buf)); if (headval) printf("Content-Length: %s\n", buf); \endcode * */ CI_DECLARE_FUNC(const char *) ci_headers_copy_value(ci_headers_list_t *heads, const char *header, char *buf, size_t len); /** * Run the given function for each header name/value pair \ingroup HEADERS \param heads is a pointer to the ci_headers_list_t object \param data is a pointer to data which will passed as first argument to the * fn function \param fn is a pointer to a function which will run for each header * name/value pair. \return non zero on success, zero otherwise */ CI_DECLARE_FUNC(int) ci_headers_iterate(ci_headers_list_t *heads, void *data, void (*fn)(void *data, const char *header_name, const char *header_value)); /** * Copy the headers to a buffer in a form they can be transmitted to the * network. * WARNING: It produces an non-NULL-terminated string. \ingroup HEADERS \param heads is a pointer to the ci_headers_list_t object \param buf the buffer to store data. \param size the size of buffer. \return the size of written data, or zero if the headers does not fit to * buffer. */ CI_DECLARE_FUNC(size_t) ci_headers_pack_to_buffer(ci_headers_list_t *heads, char *buf, size_t size); /** * Get the first line of headers \ingroup HEADERS \param heads is a pointer to the ci_headers_list_t object \return the first line on success, NULL otherwise */ CI_DECLARE_FUNC(const char *) ci_headers_first_line(ci_headers_list_t *heads); /** * Get the first line of headers and its size \ingroup HEADERS \param heads is a pointer to the ci_headers_list_t object \param return_size where to store the size of first line in bytes \return the first line on success, NULL otherwise */ CI_DECLARE_FUNC(const char *) ci_headers_first_line2(ci_headers_list_t *heads, size_t *return_size); /*compatibility macro*/ #define ci_headers_copy_header_bytes ci_headers_pack_to_buffer /*The following headers are only used internally */ CI_DECLARE_FUNC(void) ci_headers_pack(ci_headers_list_t *heads); CI_DECLARE_FUNC(int) ci_headers_unpack(ci_headers_list_t *heads); CI_DECLARE_FUNC(int) sizeofheader(ci_headers_list_t *heads); CI_DECLARE_FUNC(ci_encaps_entity_t) *mk_encaps_entity(int type,int val); CI_DECLARE_FUNC(void) destroy_encaps_entity(ci_encaps_entity_t *e); CI_DECLARE_FUNC(int) get_encaps_type(const char *buf,int *val,char **endpoint); CI_DECLARE_FUNC(int) sizeofencaps(ci_encaps_entity_t *e); #ifdef __CI_COMPAT #define ci_headers_make ci_header_create #endif #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/port.h0000664000175000017500000000327413371253152012453 00000000000000/* * Copyright (C) 2016 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __C_ICAP_PORT_H #define __C_ICAP_PORT_H #include "c-icap.h" #include "net_io.h" #ifdef USE_OPENSSL #include #endif /** * Basic configurations for a listening port \ingroup CONFIG */ typedef struct ci_port { int port; int protocol_family; char *address; int secs_to_linger; #ifdef USE_OPENSSL int tls_enabled; char *tls_server_cert; char *tls_server_key; char *tls_client_ca_certs; char *tls_cafile; char *tls_capath; char *tls_method; char *tls_ciphers; long tls_options; #endif int configured; ci_socket_t fd; #ifdef USE_OPENSSL SSL_CTX *tls_context; BIO* bio; #endif } ci_port_t; /*For internal c-icap use*/ struct ci_vector; void ci_port_handle_reconfigure(struct ci_vector *new_ports, struct ci_vector *old_ports); void ci_port_close(ci_port_t *port); void ci_port_list_release(struct ci_vector *ports); #endif c_icap-0.5.6/include/c-icap-conf.h0000664000175000017500000000445613570504073013553 00000000000000/*This is autogenerated file*/ #ifndef __C_ICAP_CONF_H #define __C_ICAP_CONF_H /*C_ICAP VERSION*/ #define C_ICAP_HEX_VERSION 0x000000050006 /* Define USE_IPV6 if we are supporting ipv6 */ #if 0 #define USE_IPV6 #endif #if 1 #define USE_OPENSSL #endif #if 1 #define USE_SYSV_IPC #endif #if 1 #define USE_POSIX_MAPPED_FILES #endif #if 1 #define USE_POSIX_SHARED_MEM #endif #if 1 # define USE_SYSV_IPC_MUTEX #endif #if 1 # define USE_POSIX_FILE_LOCK #endif #if 1 # define USE_POSIX_SEMAPHORES #endif #if 1 #define USE_PTHREADS_RWLOCK #endif #if 1 #define USE_REGEX #endif #if 1 #define __CI_COMPAT #endif #if 1 #define USE_POLL #endif /*The following maybe should used...*/ #if 1 #define __SYS_TYPES_H_EXISTS #endif #if 1 #define __INTTYPES_H_EXISTS #endif /* The 64 bit data models as described by wikipedia are: Data model short int long long long pointers/size_t LLP64 16 32 32 64 64 LP64 16 32 64 64 64 ILP64 16 64 64 64 64 SILP64 64 64 64 64 64 On most 32bit and 64bit unix machines, 'short' is always 16bit, 'int' is 32bit long is 32bit or 64bit respectively and long long is always 64bit. We are going to define: off_t as long on 32bit machines and long long on 64bit (sizeof(void*)==8) size_t as long on 32bit machines and long long on 64bit The c-icap should not use int32_t/uint32_t/int16_t/uint16_t types */ #define CI_SIZEOF_VOID_P 8 /* typedef off_t if does not define. */ #if 0 #if CI_SIZEOF_VOID_P == 8 typedef long long off_t; #define CI_SIZEOF_OFF_T 8 #elif CI_SIZEOF_VOID_P == 4 typedef long off_t; #define CI_SIZEOF_OFF_T 4 #else #error "Unhandled size of void *" #endif #else /*if 0*/ #define CI_SIZEOF_OFF_T 8 #endif /* typedef size_t if does not define. */ #if 0 #if SIZEOF_VOID_P == 8 typedef unsigned long long size_t; #elif SIZEOF_VOID_P == 4 typedef unsigned int size_t; #else #error "Unhandled size of void *" #endif #endif #if 0 typedef unsigned char uint8_t; #endif #if 0 typedef char int8_t; #endif #if 0 typedef unsigned long long uint64_t; #endif #if 0 typedef long long int64_t; #endif #if 1 #define USE_VISIBILITY_ATTRIBUTE #endif #endif c_icap-0.5.6/include/shared_mem.h0000664000175000017500000000441113371253152013565 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef _SHARED_MEM_H #define _SHARED_MEM_H #include "c-icap.h" #if defined (_WIN32) #include #endif #ifdef __cplusplus extern "C" { #endif typedef struct ci_shared_mem_id ci_shared_mem_id_t; typedef struct ci_shared_mem_scheme { void *(*shared_mem_create)(ci_shared_mem_id_t *id, const char *name, int size); void *(*shared_mem_attach)(ci_shared_mem_id_t *id); int (*shared_mem_detach)(ci_shared_mem_id_t *id); int (*shared_mem_destroy)(ci_shared_mem_id_t *id); int (*shared_mem_print_info)(ci_shared_mem_id_t *id, char *buf, size_t buf_size); const char *name; } ci_shared_mem_scheme_t; #define CI_SHARED_MEM_NAME_SIZE 64 struct ci_shared_mem_id { char name[CI_SHARED_MEM_NAME_SIZE]; void *mem; size_t size; #if defined (_WIN32) HANDLE id; #else const ci_shared_mem_scheme_t *scheme; union { #if defined (USE_POSIX_SHARED_MEM) struct posix { int fd; } posix; #endif #if defined (USE_SYSV_IPC) struct sysv { int id; } sysv; #endif int id_; }; #endif }; CI_DECLARE_FUNC(void) *ci_shared_mem_create(ci_shared_mem_id_t *id, const char *name, int size); CI_DECLARE_FUNC(void) *ci_shared_mem_attach(ci_shared_mem_id_t *id); CI_DECLARE_FUNC(int) ci_shared_mem_detach(ci_shared_mem_id_t *id); CI_DECLARE_FUNC(int) ci_shared_mem_destroy(ci_shared_mem_id_t *id); CI_DECLARE_FUNC(int) ci_shared_mem_set_scheme(const char *name); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/array.h0000664000175000017500000006415013371253152012605 00000000000000/* * Copyright (C) 2011 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __ARRAY_H #define __ARRAY_H #include "c-icap.h" #include "mem.h" #ifdef __cplusplus extern "C" { #endif /** \defgroup ARRAYS Arrays, stacks, queues and vectors related API \ingroup API * Arrays, stacks, queues and vectors related API. */ typedef struct ci_array_item { char *name; void *value; } ci_array_item_t; /** \defgroup SIMPLE_ARRAYS Simple arrays related API \ingroup ARRAYS * Arrays which store name/value pair items */ /** \typedef ci_array_t \ingroup SIMPLE_ARRAYS * The ci_array_t objects can store a list of name/value pairs. Currently * can grow up to a fixed size. */ typedef struct ci_array { ci_array_item_t *items; char *mem; size_t max_size; unsigned int count; ci_mem_allocator_t *alloc; } ci_array_t; /** \def ci_array_value(array, pos) \ingroup SIMPLE_ARRAYS * Return the value of item on position 'pos' */ #define ci_array_value(array, pos) (pos < (array)->count ? (array)->items[pos].value : NULL) /** \def ci_array_name(array, pos) \ingroup SIMPLE_ARRAYS * Return the name of item on position 'pos' */ #define ci_array_name(array, pos) (pos < (array)->count ? (array)->items[pos].name : NULL) /** \def ci_array_size(array) \ingroup SIMPLE_ARRAYS * Return the size of array 'array' */ #define ci_array_size(array) ((array)->count) /** * Allocate the required memory and initialize an ci_array_t object \ingroup SIMPLE_ARRAYS \param max_mem_size the maximum memory to use \return the allocated object on success, or NULL on failure * */ CI_DECLARE_FUNC(ci_array_t *) ci_array_new(size_t max_mem_size); /** * Create and initialize an ci_array_t object for the given number of items \ingroup SIMPLE_ARRAYS \param items the maximum aray items \param item_size the items size \return the allocated object on success, or NULL on failure */ CI_DECLARE_FUNC(ci_array_t *) ci_array_new2(size_t items, size_t item_size); /** * Destroy an ci_array_t object \ingroup SIMPLE_ARRAYS \param array a pointer to ci_array_t object to be destroyed * */ CI_DECLARE_FUNC(void) ci_array_destroy(ci_array_t *array); /** * Add an name/value pair item to the array. \ingroup SIMPLE_ARRAYS \param array a pointer to the ci_array_t object \param name the name part of the name/value pair item to add \param value the value part of the name/value pair item to add \param size the size of the value part of the new item. \return a pointer to the new array item on success, NULL otherwise */ CI_DECLARE_FUNC(const ci_array_item_t *) ci_array_add(ci_array_t *array, const char *name, const void *value, size_t size); /** * Delete the last element of the array. \ingroup SIMPLE_ARRAYS \param array a pointer to the ci_array_t object \return a pointer to the popped array item on success, NULL otherwise */ CI_DECLARE_FUNC(const ci_array_item_t *)ci_array_pop(ci_array_t *array); /** * Search in an array for an item with the given name \ingroup SIMPLE_ARRAYS \param array a pointer to the ci_array_t object \param name the item to be search for. \return pointer to the value pair of the array item if found, NULL otherwise */ CI_DECLARE_FUNC(const void *) ci_array_search(ci_array_t *array, const char *name); /** * Run the given function for each array item \ingroup SIMPLE_ARRAYS \param array a pointer to the ci_array_t object \param data a pointer to data which will be passed on fn function \param fn a pointer to the function which will be run for each array item. The iteration will stop if the fn function return non zero value */ CI_DECLARE_FUNC(void) ci_array_iterate(const ci_array_t *array, void *data, int (*fn)(void *data, const char *name, const void *)); /** * Get an item of the array. \ingroup SIMPLE_ARRAYS \param array a pointer to the ci_array_t object \param pos The position of the item in array \return a pointer to the array item on success, NULL otherwise */ CI_DECLARE_FUNC(const ci_array_item_t *) ci_array_get_item(ci_array_t *array, int pos); /** \defgroup STR_ARRAYS Arrays of strings related API \ingroup SIMPLE_ARRAYS * Arrays which store name/value pair items */ /** \typedef ci_str_array_t \ingroup STR_ARRAYS * An alias to the ci_array_t object. It is used to store items with string * values to an array. * The ci_str_array_new, ci_str_array_destroy, ci_str_array_add, * ci_str_array_search and ci_str_array_iterate defines are similar to * the equivalent ci_array_* functions with the required typecasting to * work with strings. */ typedef ci_array_t ci_str_array_t; #define ci_str_array_new ci_array_new #define ci_str_array_destroy ci_array_destroy #define ci_str_array_add(array, name, value) ci_array_add((ci_array_t *)(array), name, value, (strlen(value)+1)) #define ci_str_array_pop(array) ci_array_pop((ci_array_t *)(array)) #define ci_str_array_get_item(array, pos) ci_array_get_item((ci_array_t *)(array), pos) #define ci_str_array_search(array, name) (const char *)ci_array_search((ci_array_t *)(array), name) #define ci_str_array_iterate ci_array_iterate #define ci_str_array_value(array, pos) ci_array_value((ci_array_t *)(array), pos) #define ci_str_array_name(array, pos) ci_array_name((ci_array_t *)(array), pos) #define ci_str_array_size(array) ci_array_size((ci_array_t *)(array)) /** \defgroup PTR_ARRAYS Arrays of pointers \ingroup SIMPLE_ARRAYS * Arrays of name/pointers to objects pairs */ /** \typedef ci_ptr_array_t \ingroup PTR_ARRAYS * The ci_ptr_array_t objects can store a list of name and pointer to object * pairs. It is similar to the ci_array_t object but does not store the value * but a pointer to the value. */ typedef ci_array_t ci_ptr_array_t; /** \def ci_ptr_array_value(ptr_array, pos) \ingroup PTR_ARRAYS * Return the value of item at position 'pos' */ #define ci_ptr_array_value(array, pos) ci_array_value((ci_array_t *)(array), pos) /** \def ci_ptr_array_value(ptr_array, pos) \ingroup PTR_ARRAYS * Return the name of item at position 'pos' */ #define ci_ptr_array_name(array, pos) ci_array_name((ci_array_t *)(array), pos) /** \def ci_ptr_array_value(ptr_array) \ingroup PTR_ARRAYS * Return the size of ptr_array */ #define ci_ptr_array_size(array) ci_array_size((ci_array_t *)(array)) /** \def ci_ptr_array_new() \ingroup PTR_ARRAYS * Create a new ci_ptr_array_t object. Similar to the ci_array_new() function. */ #define ci_ptr_array_new ci_array_new /** * Create and initialize an ci_ptr_array_t object for the given number of items \ingroup PTR_ARRAYS \param items the maximum aray items \return the allocated object on success, or NULL on failure */ CI_DECLARE_FUNC(ci_ptr_array_t *) ci_ptr_array_new2(size_t items); /** \def ci_ptr_array_destroy(ptr_array) \ingroup PTR_ARRAYS * Destroy a ci_ptr_array_t object. Similar to the ci_array_destroy function */ #define ci_ptr_array_destroy(ptr_array) ci_array_destroy((ci_array_t *)(ptr_array)) /** * Search in an array for an item with the given name \ingroup PTR_ARRAYS \param array a pointer to the ci_ptr_array_t object \param name the item to be search for. \return pointer to the value pair of the array item if found, NULL otherwise */ CI_DECLARE_FUNC(void *) ci_ptr_array_search(ci_ptr_array_t *array, const char *name); /** \def ci_ptr_array_iterate(ptr_array, data, fn) \ingroup PTR_ARRAYS * Run the function fn for each item of the ci_ptr_array_t object. Similar to * the ci_array_iterate function */ #define ci_ptr_array_iterate(ptr_array, data, fn) ci_array_iterate((ci_array_t *)(ptr_array), data, fn) /** * Add an name/value pair item to the ci_ptr_array_t object. \ingroup PTR_ARRAYS \param ptr_array a pointer to the ci_ptr_array_t object \param name the name part of the name/value pair item to be added \param value a pointer to the value part of the name/value pair item to be * added \return a pointer to the new array item on success, NULL otherwise * */ CI_DECLARE_FUNC(const ci_array_item_t *) ci_ptr_array_add(ci_ptr_array_t *ptr_array, const char *name, void *value); /** * Pop and delete the last item of a ci_ptr_array_t object. \ingroup PTR_ARRAYS \param ptr_array a pointer to the ci_ptr_array_t object \return a pointer to the popped array item */ CI_DECLARE_FUNC(const ci_array_item_t *) ci_ptr_array_pop(ci_ptr_array_t *ptr_array); /** * Pop and delete the last item of a ci_ptr_array_t object. \ingroup PTR_ARRAYS \param ptr_array a pointer to the ci_ptr_array_t object \param name a pointer to a buffer where the name of the poped item will be * store, or NULL \param name_size the size of name buffer \return a pointer to the value of the popped item */ CI_DECLARE_FUNC(void *) ci_ptr_array_pop_value(ci_ptr_array_t *ptr_array, char *name, size_t name_size); /** \def ci_ptr_array_get_item() \ingroup PTR_ARRAYS * Get an array item. Wrapper to the ci_array_get_item() function. */ #define ci_ptr_array_get_item(array, pos) ci_array_get_item((ci_array_t *)(array), pos) /** \defgroup DYNAMIC_ARRAYS Dynamic arrays related API \ingroup ARRAYS * Arrays which store name/value pair items, and can grow unlimited. * */ /** \typedef ci_dyn_array_t \ingroup DYNAMIC_ARRAYS * The ci_dyn_array_t objects can store a list of name/value pairs. * The memory RAM space of dynamic array items can not be released * before the ci_dyn_array destroyed. */ typedef struct ci_dyn_array { ci_array_item_t **items; int count; int max_items; ci_mem_allocator_t *alloc; } ci_dyn_array_t; /** \def ci_dyn_array_get_item(array, pos) \ingroup DYNAMIC_ARRAYS * Return the ci_array_item_t item on position 'pos' */ #define ci_dyn_array_get_item(array, pos) (pos < (array)->count ? (array)->items[pos] : NULL) /** \def ci_dyn_array_value(array, pos) \ingroup DYNAMIC_ARRAYS * Return the value of item on position 'pos' */ #define ci_dyn_array_value(array, pos) ((pos < (array)->count && (array)->items[pos] != NULL) ? (array)->items[pos]->value : NULL) /** \def ci_dyn_array_name(array, pos) \ingroup DYNAMIC_ARRAYS * Return the name of item on position 'pos' */ #define ci_dyn_array_name(array, pos) ((pos < (array)->count && (array)->items[pos] != NULL) ? (array)->items[pos]->name : NULL) /** \def ci_dyn_array_size(array) \ingroup DYNAMIC_ARRAYS * Return the size of array 'array' */ #define ci_dyn_array_size(array) ((array)->count) /** * Allocate the required memory and initialize an ci_dyn_array_t object \ingroup DYNAMIC_ARRAYS \param mem_size the initial size to use for dyn_array \return the allocated object on success, or NULL on failure * */ CI_DECLARE_FUNC(ci_dyn_array_t *) ci_dyn_array_new(size_t mem_size); /** * Create and initialize an ci_dyn_array_t object for the given number of items \ingroup DYNAMIC_ARRAYS \param items the maximum aray items \param item_size the items size \return the allocated object on success, or NULL on failure */ CI_DECLARE_FUNC(ci_dyn_array_t *) ci_dyn_array_new2(size_t items, size_t item_size); /** * Destroy an ci_dyn_array_t object \ingroup DYNAMIC_ARRAYS \param array a pointer to ci_dyn_array_t object to be destroyed */ CI_DECLARE_FUNC(void) ci_dyn_array_destroy(ci_dyn_array_t *array); /** * Add an name/value pair item to a dynamic array. \ingroup DYNAMIC_ARRAYS \param array a pointer to the ci_dyn_array_t object \param name the name part of the name/value pair item to be added \param value the value part of the name/value pair item to be added \param size the size of the value part of the new item. \return a pointer to the new array item on success, NULL otherwise */ CI_DECLARE_FUNC(const ci_array_item_t *) ci_dyn_array_add(ci_dyn_array_t *array, const char *name, const void *value, size_t size); /** * Search in an dynamic array for an item with the given name \ingroup DYNAMIC_ARRAYS \param array a pointer to the ci_dyn_array_t object \param name the item to be search for. \return pointer to the value pair of the array item if found, NULL otherwise */ CI_DECLARE_FUNC(const void *) ci_dyn_array_search(ci_dyn_array_t *array, const char *name); /** * Run the given function for each dynamic array item \ingroup DYNAMIC_ARRAYS \param array a pointer to the ci_dyn_array_t object \param data a pointer to data which will be passed on fn function \param fn a pointer to the function which will be run for each array item. * The iteration will stop if the fn function return non zero value. */ CI_DECLARE_FUNC(void) ci_dyn_array_iterate(const ci_dyn_array_t *array, void *data, int (*fn)(void *data, const char *name, const void *)); /** \defgroup PTR_DYNAMIC_ARRAYS Dynamic arrays of pointers related API \ingroup DYNAMIC_ARRAYS * Arrays which store name/value pair items */ /** \typedef ci_ptr_dyn_array_t \ingroup PTR_DYNAMIC_ARRAYS * An alias to the ci_dyn_array_t object. It is used to store pointers * to an array. * The ci_ptr_dyn_array_new, ci_ptr_dyn_array_destroy, ci_ptr_dyn_array_search * and ci_ptr_dyn_array_iterate defines are equivalent to the ci_dyn_array_* * functions with the required typecasting. */ typedef ci_dyn_array_t ci_ptr_dyn_array_t; #define ci_ptr_dyn_array_new(size) ci_dyn_array_new(size) #define ci_ptr_dyn_array_new2(items, item_size) ci_dyn_array_new2(items, item_size) #define ci_ptr_dyn_array_destroy(ptr_array) ci_dyn_array_destroy((ci_dyn_array_t *)(ptr_array)) #define ci_ptr_dyn_array_search(ptr_array, name) ci_dyn_array_search((ci_dyn_array_t *)(ptr_array), name) #define ci_ptr_dyn_array_iterate(ptr_array, data, fn) ci_dyn_array_iterate((ci_dyn_array_t *)(ptr_array), data, fn) #define ci_ptr_dyn_array_get_item(ptr_array, pos) ci_dyn_array_get_item((ci_dyn_array_t *)(ptr_array), pos) #define ci_ptr_dyn_array_value(ptr_array, pos) ci_dyn_array_value((ci_dyn_array_t *)(ptr_array), pos) #define ci_ptr_dyn_array_name(ptr_array, pos) ci_dyn_array_name((ci_dyn_array_t *)(ptr_array), pos) #define ci_ptr_dyn_array_size(ptr_array) ci_dyn_array_size((ci_dyn_array_t *)(ptr_array)) /** * Add an name/value pair item to the array. \ingroup PTR_DYNAMIC_ARRAYS \param ptr_array a pointer to the ci_ptr_dyn_array_t object \param name the name part of the name/pointer pair item to be added \param pointer the pointer part of the name/value pair item to be added \return a pointer to the new array item on success, NULL otherwise */ CI_DECLARE_FUNC(const ci_array_item_t *) ci_ptr_dyn_array_add(ci_ptr_dyn_array_t *ptr_array, const char *name, void *pointer); /** \defgroup VECTORS Simple vectors related API \ingroup ARRAYS * Structure which can store lists of objects */ /** \typedef ci_vector_t \ingroup VECTORS * The ci_vector_t objects can store a list of objects. Currently can grow up * to a fixed size. */ typedef struct ci_vector { void **items; void **last; char *mem; size_t max_size; int count; ci_mem_allocator_t *alloc; } ci_vector_t; /** * Allocate the required memory and initialize a ci_vector_t object \ingroup VECTORS \param max_size the maximum memory to use \return the allocated object on success, or NULL on failure */ CI_DECLARE_FUNC(ci_vector_t *) ci_vector_create(size_t max_size); /** * Destroy an ci_vector_t object \ingroup VECTORS \param vector a pointer to ci_vector_t object to be destroyed */ CI_DECLARE_FUNC(void) ci_vector_destroy(ci_vector_t *vector); /** * Add an item to the vector. \ingroup VECTORS \param vector a pointer to the ci_vector_t object \param obj pointer to the object to add in vector \param size the size of the new item. \return a pointer to the new item on success, NULL otherwise */ CI_DECLARE_FUNC(void *) ci_vector_add(ci_vector_t *vector, const void *obj, size_t size); /** * Run the given function for each vector item \ingroup VECTORS \param vector a pointer to the ci_vector_t object \param data a pointer to data which will be passed to the fn function \param fn a pointer to the function which will be run for each vector item. * The iteration will stop if the fn function return non zero value. */ CI_DECLARE_FUNC(void) ci_vector_iterate(const ci_vector_t *vector, void *data, int (*fn)(void *data, const void *)); /** * Delete the last element of a vector. \ingroup VECTORS \param vector a pointer to the ci_vector_t object \return a pointer to the popped vector item on success, NULL otherwise */ CI_DECLARE_FUNC(void *) ci_vector_pop(ci_vector_t *vector); /** \def ci_vector_get(vector, i) \ingroup VECTORS * Return a pointer to the i item of the vector */ #define ci_vector_get(vector, i) (i < vector->count ? (const void *)vector->items[i]: (const void *)NULL) CI_DECLARE_FUNC(const void **) ci_vector_cast_to_voidvoid(ci_vector_t *vector); CI_DECLARE_FUNC(ci_vector_t *)ci_vector_cast_from_voidvoid(const void **p); /** \defgroup STR_VECTORS Vectors of strings \ingroup VECTORS * */ /** \typedef ci_str_vector_t \ingroup STR_VECTORS * The ci_str_vector is used to implement string vectors. * The ci_str_vector_create, ci_str_vector_destroy, ci_str_vector_add, * and ci_str_vector_pop defines are similar and equivalent to the ci_vector_* * functions. */ typedef ci_vector_t ci_str_vector_t; #define ci_str_vector_create ci_vector_create #define ci_str_vector_destroy ci_vector_destroy #define ci_str_vector_add(vect, string) ((const char *)ci_vector_add((ci_vector_t *)(vect), string, (strlen(string)+1))) #define ci_str_vector_get(vector, i) (i < vector->count ? (const char *)vector->items[i]: (const char *)NULL) #define ci_str_vector_pop(vect) ((const char *)ci_vector_pop((ci_vector_t *)(vect))) #define ci_str_vector_cast_to_charchar(vector) ((const char **)ci_vector_cast_to_voidvoid((ci_vector_t *)(vector))) #define ci_str_vector_cast_from_charchar(p) ((ci_str_vector_t *)ci_vector_cast_from_voidvoid((const void **)p)) /** * Run the given function for each string vector item \ingroup STR_VECTORS \param vector a pointer to the ci_vector_t object \param data a pointer to data which will be passed to the fn function \param fn a pointer to the function which will be run for each string vector * item. The iteration will stop if the fn function return non zero value. */ CI_DECLARE_FUNC(void) ci_str_vector_iterate(const ci_str_vector_t *vector, void *data, int (*fn)(void *data, const char *)); /** * Search for a string in a string vector. \ingroup STR_VECTORS \param vector a pointer to the ci_vector_t object \param str the string to search for \return a pointer to the new item on success, NULL otherwise */ CI_DECLARE_FUNC(const char *) ci_str_vector_search(ci_str_vector_t *vector, const char *str); /** \defgroup PTR_VECTORS Vectors of pointers \ingroup VECTORS */ /** \typedef ci_ptr_vector_t \ingroup PTR_VECTORS * The ci_ptr_vector is used to implement vectors storing pointers. * The ci_ptr_vector_create, ci_ptr_vector_destroy, ci_ptr_vector_iterate, * and ci_ptr_vector_get defines are similar and equivalent to the ci_vector_* functions. */ typedef ci_vector_t ci_ptr_vector_t; #define ci_ptr_vector_create ci_vector_create #define ci_ptr_vector_destroy ci_vector_destroy #define ci_ptr_vector_iterate ci_vector_iterate #define ci_ptr_vector_get ci_vector_get /** * Add an item to the vector. \ingroup PTR_VECTORS \param vector a pointer to the ci_vector_t object \param pointer the pointer to store in vector \return a pointer to the new item on success, NULL otherwise */ CI_DECLARE_FUNC(void *) ci_ptr_vector_add(ci_vector_t *vector, void *pointer); /** \defgroup LISTS Lists API \ingroup ARRAYS * Lists for storing items, and can grow unlimited. * */ typedef struct ci_list_item { void *item; struct ci_list_item *next; } ci_list_item_t; /** \typedef ci_list_t \ingroup LISTS * The ci_list_t objects can store a list of objects, with a predefined size. * The list items can be removed. * The memory RAM space of list can not be decreased before the * ci_list destroyed. However the memory of removed items reused. */ typedef struct ci_list { ci_list_item_t *items; ci_list_item_t *last; ci_list_item_t *trash; ci_list_item_t *cursor; ci_list_item_t *tmp; size_t obj_size; ci_mem_allocator_t *alloc; int (*cmp_func)(const void *obj, const void *user_data, size_t user_data_size); int (*copy_func)(void *newObj, const void *oldObj); void (*free_func)(void *obj); } ci_list_t; /** * Allocate the required memory and initialize a ci_list_t object \ingroup LISTS \param init_size the initial memory size to use \param obj_size the size of stored objects. If it is 0 then stores pointers * to objects. \return the allocated object on success, or NULL on failure */ CI_DECLARE_FUNC(ci_list_t *) ci_list_create(size_t init_size, size_t obj_size); /** \def ci_list_first(ci_list_t *list) * Gets the first item of the list and updates the list cursor to the next item. * WARNING: do not mix this macro with ci_list_iterate. Use the ci_list_head * and ci_list_tail macros instead \ingroup LISTS \param list a pointer to the ci_list_t object \return The first item if exist, NULL otherwise */ #define ci_list_first(list) (list && (list)->items && (((list)->cursor = (list)->items->next) != NULL || 1) ? (list)->items->item : NULL) /** \def ci_list_next() * Return the next item of the list and updates the list cursor to the next * item. * WARNING: It does not check for valid list object. * WARNING: do not mix this macro with ci_list_iterate! \ingroup LISTS \param list a pointer to the ci_list_t object \return The next item if exist, NULL otherwise */ #define ci_list_next(list) (((list)->tmp = (list)->cursor) != NULL && (((list)->cursor = (list)->cursor->next) != NULL || 1) ? (list)->tmp->item : NULL) /** \def ci_list_head(list) \ingroup LISTS * Return the head of the list */ #define ci_list_head(list) (list && list->items != NULL ? list->items->item : NULL) /** \def ci_list_tail(list) \ingroup LISTS * Return last item of the list. */ #define ci_list_tail(list) (list && list->last != NULL ? list->last->item : NULL) /** * Destroy an ci_list_t object \ingroup LISTS \param list a pointer to ci_list_t object to be destroyed */ CI_DECLARE_FUNC(void) ci_list_destroy(ci_list_t *list); /** * Run the given function for each list item \ingroup LISTS \param list a pointer to the ci_list_t object \param data a pointer to data which will be passed to the fn function \param fn a pointer to the function which will be run for each vector item. * The iteration will stop if the fn function return non zero value. */ CI_DECLARE_FUNC(void) ci_list_iterate(ci_list_t *list, void *data, int (*fn)(void *data, const void *obj)); /** * Add an item to the head of list. \ingroup LISTS \param list a pointer to the ci_list_t object \param obj pointer to the object to add in vector \return a pointer to the new item on success, NULL otherwise */ CI_DECLARE_FUNC(const void *) ci_list_push(ci_list_t *list, const void *obj); /** * Add an item to the tail of list. \ingroup LISTS \param list a pointer to the ci_list_t object \param obj pointer to the object to add in vector \return a pointer to the new item on success, NULL otherwise */ CI_DECLARE_FUNC(const void *) ci_list_push_back(ci_list_t *list, const void *data); /** * Remove the first item of the list. \ingroup LISTS \param list a pointer to the ci_list_t object \param obj pointer to an object to store removed item \return a pointer to the obj on success, NULL otherwise */ CI_DECLARE_FUNC(void *) ci_list_pop(ci_list_t *list, void *obj); /** * Remove the last item of the list. \ingroup LISTS \param list a pointer to the ci_list_t object \param obj pointer to an object to store removed item \return a pointer to the obj on success, NULL otherwise */ CI_DECLARE_FUNC(void *) ci_list_pop_back(ci_list_t *list, void *obj); /** * Remove the first found item equal to the obj. \ingroup LISTS \param list a pointer to the ci_list_t object \param obj pointer to an object to remove \return not 0 on success, 0 otherwise */ CI_DECLARE_FUNC(int) ci_list_remove(ci_list_t *list, const void *obj); /** * Return the first found item equal to the obj. \ingroup LISTS \param list a pointer to the ci_list_t object \param obj pointer to an object to remove \return the found item on success, NULL otherwise */ CI_DECLARE_FUNC(const void *) ci_list_search(ci_list_t *list, const void *data); /** * Return the first found item equal to the obj, using the cmp_func as * comparison function. \ingroup LISTS \param list a pointer to the ci_list_t object \param obj pointer to an object to remove \param cmp_func the comparison function to use \return the found item on success, NULL otherwise */ CI_DECLARE_FUNC(const void *) ci_list_search2(ci_list_t *list, const void *data, int (*cmp_func)(const void *obj, const void *user_data, size_t user_data_size)); /** * Sorts the list using as compare function the default. \ingroup LISTS \param list a pointer to the ci_list_t object */ CI_DECLARE_FUNC(void) ci_list_sort(ci_list_t *list); /** * Sorts the list using as compare function the cmp_func. \ingroup LISTS \param list a pointer to the ci_list_t object \param cmp_func the compare function to use */ CI_DECLARE_FUNC(void) ci_list_sort2(ci_list_t *list, int (*cmp_func)(const void *obj1, const void *obj2, size_t obj_size)); /* The following three functions are undocumented. Probably will be removed or replaced by others. */ CI_DECLARE_FUNC(void) ci_list_cmp_handler(ci_list_t *list, int (*cmp_func)(const void *obj, const void *user_data, size_t user_data_size)); CI_DECLARE_FUNC(void) ci_list_copy_handler(ci_list_t *list, int (*copy_func)(void *newObj, const void *oldObj)); CI_DECLARE_FUNC(void) ci_list_free_handler(ci_list_t *list, void (*free_func)(void *obj)); #ifdef __cplusplus } #endif #endif /*__ARRAY_H*/ c_icap-0.5.6/include/util.h0000664000175000017500000000402313371253152012435 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __UTIL_H #define __UTIL_H #include "array.h" #ifdef __cplusplus extern "C" { #endif #define STR_TIME_SIZE 64 CI_DECLARE_FUNC(void) ci_strtime(char *buf); CI_DECLARE_FUNC(void) ci_strtime_rfc822(char *buf); CI_DECLARE_FUNC(int) ci_mktemp_file(char*dir,char *name_template,char *filename); CI_DECLARE_FUNC(int) ci_usleep(unsigned long usec); #ifdef _WIN32 CI_DECLARE_FUNC(int) mkstemp(char *filename); CI_DECLARE_FUNC(struct tm*) localtime_r(const time_t *t, struct tm *tm); CI_DECLARE_FUNC(struct tm*) gmtime_r(const time_t *t, struct tm *tm); #endif CI_DECLARE_FUNC(const char *) ci_strnstr(const char *s, const char *find, size_t slen); CI_DECLARE_FUNC(const char *) ci_strncasestr(const char *s, const char *find, size_t slen); CI_DECLARE_FUNC(const char *) ci_strcasestr(const char *str, const char *find); /*Handle M/m/k/K suffixes and try to detect errors*/ CI_DECLARE_FUNC(long int) ci_atol_ext(const char *str, const char **error); CI_DECLARE_FUNC(void) ci_str_trim(char *str); CI_DECLARE_FUNC(char *) ci_str_trim2(char *s); CI_DECLARE_FUNC(char *) ci_strerror(int error, char *buf, size_t buflen); CI_DECLARE_FUNC(ci_dyn_array_t *) ci_parse_key_value_list(const char *str, char sep); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/filetype.h0000664000175000017500000001434413541160325013306 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __FILETYPE_H #define __FILETYPE_H #include "c-icap.h" #include "request.h" #ifdef __cplusplus extern "C" { #endif /** \defgroup DATATYPE Data type recogintion api \ingroup API * Macros, functions and structures used for data type recognition */ #define MAGIC_SIZE 50 #define NAME_SIZE 15 #define DESCR_SIZE 50 #define MAX_GROUPS 64 /*Maximum number of groups of a single data type*/ struct ci_data_type { char name[NAME_SIZE+1]; char descr[DESCR_SIZE+1]; int groups[MAX_GROUPS]; }; struct ci_data_group { char name[NAME_SIZE+1]; char descr[DESCR_SIZE+1]; }; typedef struct ci_magic { int offset; unsigned char magic[MAGIC_SIZE+1]; size_t len; unsigned int type; } ci_magic_t; #define DECLARE_ARRAY(array,type) type *array;int array##_num;int array##_size; struct ci_magics_db { DECLARE_ARRAY(types,struct ci_data_type) DECLARE_ARRAY(groups,struct ci_data_group) DECLARE_ARRAY(magics,struct ci_magic) }; #define ci_magic_types_num(db) (db != NULL?db->types_num:0) #define ci_magic_groups_num(db)(db != NULL?db->groups_num:0) #define ci_data_type_name(db,i)(db != NULL?db->types[i].name:NULL) #define ci_data_type_groups(db,i)(db != NULL && i < db->types_num && i >= 0?db->types[i].groups:NULL) #define ci_data_type_descr(db,i)(db != NULL && i < db->types_num && i >= 0?db->types[i].descr:NULL) #define ci_data_group_name(db,i)(db != NULL && i < db->groups_num && i >= 0?db->groups[i].name:NULL) enum {CI_ASCII_DATA,CI_ISO8859_DATA,CI_XASCII_DATA,CI_UTF_DATA,CI_HTML_DATA,CI_BIN_DATA}; enum {CI_TEXT_DATA,CI_OCTET_DATA}; /*low level functions should not used by users*/ CI_DECLARE_FUNC(struct ci_magics_db) *ci_magics_db_build(const char *filename); CI_DECLARE_FUNC(int) ci_magics_db_file_add(struct ci_magics_db *db,const char *filename); CI_DECLARE_FUNC(void) ci_magics_db_release(struct ci_magics_db *db); CI_DECLARE_FUNC(int) ci_get_data_type_id(struct ci_magics_db *db,const char *name); CI_DECLARE_FUNC(int) ci_get_data_group_id(struct ci_magics_db *db,const char *group); CI_DECLARE_FUNC(int) ci_belongs_to_group(struct ci_magics_db *db, int type, int group); CI_DECLARE_FUNC(int) ci_filetype(struct ci_magics_db *db,const char *buf, int buflen); CI_DECLARE_FUNC(int) ci_extend_filetype(struct ci_magics_db *db, ci_request_t *req, const char *buf,int len,int *iscompressed); /*And the c-icap Library functions*/ /** * Read the magics db from a file and create a ci_magics_db object. * \ingroup DATATYPE * * The user normaly does not need to call this function inside c-icap server. * It is not a thread safe function, should called only during icap library * initialization before threads started. \param filename is the name of the file contains the db \return a pointer to a ci_magics_db object */ CI_DECLARE_FUNC(struct ci_magics_db) *ci_magic_db_load(const char *filename); CI_DECLARE_FUNC(void) ci_magic_db_free(); /** * Return the type of data of an c-icap request object. * \ingroup DATATYPE * * This function checks the preview data of the request. * If the data are encoded this function try to uncompress them before * data type recognition * \param req the c-icap request (ci_request_t) data \param isencoded set to CI_ENCODE_GZIP, CI_ENCODE_DEFLATE or * CI_ENCODE_UNKNOWN if the data are encoded with an unknown method \return the data type or -1 if the data type recognition fails for a reason * (eg no preview data, of library not initialized) */ CI_DECLARE_FUNC(int) ci_magic_req_data_type(ci_request_t *req, int *isencoded); CI_DECLARE_FUNC(int) ci_magic_data_type(const char *buf, int buflen); CI_DECLARE_FUNC(int) ci_magic_data_type_ext(ci_headers_list_t *headers, const char *buf,int len,int *iscompressed); /** * Finds the type id from type name. * \ingroup DATATYPE * \param name is the name of the magic type \return the type id */ CI_DECLARE_FUNC(int) ci_magic_type_id(const char *name); /** * Finds the group id from group name. * \ingroup DATATYPE * \param group is the name of the group \return the group id */ CI_DECLARE_FUNC(int) ci_magic_group_id(const char *group); /** * Checks if a magic type belongs to a magic types group. * \ingroup DATATYPE * \param type is the type id to check \param group is the group id \return non zero if the type belongs to group, zero otherwise */ CI_DECLARE_FUNC(int) ci_magic_group_check(int type, int group); /** * The number of types stored in internal magic db. * \ingroup DATATYPE * \return the number of stored magic types */ CI_DECLARE_FUNC(int) ci_magic_types_count(); /** * The number of groups stored in internal magic db. * \ingroup DATATYPE * \return the number of stored magic groups */ CI_DECLARE_FUNC(int) ci_magic_groups_count(); /** * Retrieve the name of a magic type. * \ingroup DATATYPE * \param type the type id \return the name of the type or NULL if the type does not exists */ CI_DECLARE_FUNC(char *) ci_magic_type_name(int type); /** * Retrieve the short description of a magic type. * \ingroup DATATYPE * \param type the type id \return the short description if the type or NULL if the type does not exists */ CI_DECLARE_FUNC(char *) ci_magic_type_descr(int type); /** * Retrieve the name of a magic types group. * \ingroup DATATYPE * \param group the group id \return the name of the group or NULL if the group does not exists */ CI_DECLARE_FUNC(char *) ci_magic_group_name(int group); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/request.h0000664000175000017500000002274613570502422013162 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ /** \defgroup ICAPCLIENT ICAP client request API \ingroup API * API for implementing ICAP clients */ #ifndef _REQUEST_H #define _REQUEST_H #include "header.h" #include "service.h" #include "net_io.h" #include "array.h" #ifdef __cplusplus extern "C" { #endif /** \defgroup REQUEST ICAP request API \ingroup API * ICAP request related API. */ /** \defgroup ICAPCLIENT ICAP client request API \ingroup API * API for implementing ICAP clients */ //enum REQUEST_STATUS { WAIT,SERVED }; enum GETDATA_STATUS {GET_NOTHING = 0,GET_HEADERS,GET_PREVIEW,GET_BODY,GET_EOF}; enum SENDDATA_STATUS {SEND_NOTHING = 0, SEND_RESPHEAD, SEND_HEAD1, SEND_HEAD2, SEND_HEAD3, SEND_BODY, SEND_EOF }; /*enum BODY_RESPONCE_STATUS{ CHUNK_DEF = 1,CHUNK_BODY,CHUNK_END};*/ enum CLIENT_STATUS { CLIENT_INIT = 0, CLIENT_SEND_HEADERS, CLIENT_SEND_HEADERS_WRITE_NOTHING = CLIENT_SEND_HEADERS, CLIENT_SEND_HEADERS_WRITE_ICAP_HEADERS, CLIENT_SEND_HEADERS_WRITE_REQ_HEADERS, CLIENT_SEND_HEADERS_WRITE_RES_HEADERS, CLIENT_SEND_HEADERS_WRITE_PREVIEW_INFO, CLIENT_SEND_HEADERS_WRITE_PREVIEW, CLIENT_SEND_HEADERS_WRITE_EOF_INFO, CLIENT_SEND_HEADERS_FINISHED, CLIENT_READ_PREVIEW_RESPONSE, CLIENT_PROCESS_DATA, CLIENT_PROCESS_DATA_GET_NOTHING = CLIENT_PROCESS_DATA, CLIENT_PROCESS_DATA_GET_HEADERS, CLIENT_PROCESS_DATA_HEADERS_FINISHED, CLIENT_PROCESS_DATA_GET_BODY, CLIENT_PROCESS_DATA_GET_EOF }; #define NEEDS_TO_READ_FROM_ICAP 0x1 #define NEEDS_TO_WRITE_TO_ICAP 0x2 #define NEEDS_TO_READ_USER_DATA 0x4 #define NEEDS_TO_WRITE_USER_DATA 0x8 #define CI_NO_STATUS 0 #define CI_OK 1 #define CI_NEEDS_MORE 2 #define CI_ERROR -1 #define CI_EOF -2 #define EXTRA_CHUNK_SIZE 30 #define MAX_CHUNK_SIZE 4064 /*4096 -EXTRA_CHUNK_SIZE-2*/ #define MAX_USERNAME_LEN 255 typedef struct ci_buf { char *buf; int size; int used; } ci_buf_t; struct ci_service_module; struct ci_ring_buf; /** \typedef ci_request_t \ingroup REQUEST * This is the struct which holds all the data which represent an ICAP * request. The developers should not access directly the fields of * this struct but better use the documented macros and functions */ typedef struct ci_request { ci_connection_t *connection; int packed; int type; char req_server[CI_MAXHOSTNAMELEN+1]; int access_type; char user[MAX_USERNAME_LEN+1]; char service[MAX_SERVICE_NAME+1]; char args[MAX_SERVICE_ARGS + 1]; int preview; int keepalive; int allow204; int hasbody; int responce_hasbody; struct ci_buf preview_data; struct ci_service_module *current_service_mod; ci_headers_list_t *request_header; ci_headers_list_t *response_header; ci_encaps_entity_t *entities[5];//At most 3 and 1 for termination..... ci_encaps_entity_t *trash_entities[7]; ci_headers_list_t *xheaders; void *service_data; char rbuf[BUFSIZE]; char wbuf[MAX_CHUNK_SIZE+EXTRA_CHUNK_SIZE+2]; int eof_received; int eof_sent; int data_locked; char *pstrblock_read; int pstrblock_read_len; unsigned int current_chunk_len; unsigned int chunk_bytes_read; unsigned int write_to_module_pending; int status; int return_code; char *pstrblock_responce; int remain_send_block_bytes; /*Used to echo data back to a client which does not support preview in the case of 204 outside preview.*/ struct ci_ring_buf *echo_body; /*Caching values for various subsystems*/ int preview_data_type; int auth_required; /*log string*/ char *log_str; ci_str_array_t *attributes; /* statistics */ uint64_t bytes_in; /*May include bytes from next pipelined request*/ uint64_t bytes_out; uint64_t request_bytes_in; /*Current request input bytes*/ uint64_t http_bytes_in; uint64_t http_bytes_out; uint64_t body_bytes_in; uint64_t body_bytes_out; /* added flags/variables*/ int allow206; int64_t i206_use_original_body; ci_ip_t xclient_ip; } ci_request_t; #define lock_data(req) (req->data_locked = 1) #define unlock_data(req) (req->data_locked = 0) /*This functions needed in server (mpmt_server.c ) */ ci_request_t *newrequest(ci_connection_t *connection); int recycle_request(ci_request_t *req,ci_connection_t *connection); int keepalive_request(ci_request_t *req); int process_request(ci_request_t *); /*Functions used in both server and icap-client library*/ CI_DECLARE_FUNC(int) parse_chunk_data(ci_request_t *req, char **wdata); CI_DECLARE_FUNC(int) net_data_read(ci_request_t *req); CI_DECLARE_FUNC(int) process_encapsulated(ci_request_t *req, const char *buf); /*********************************************/ /*Buffer functions (I do not know if they must included in ci library....) */ CI_DECLARE_FUNC(void) ci_buf_init(struct ci_buf *buf); CI_DECLARE_FUNC(void) ci_buf_reset(struct ci_buf *buf); CI_DECLARE_FUNC(int) ci_buf_mem_alloc(struct ci_buf *buf,int size); CI_DECLARE_FUNC(void) ci_buf_mem_free(struct ci_buf *buf); CI_DECLARE_FUNC(int) ci_buf_write(struct ci_buf *buf,char *data,int len); CI_DECLARE_FUNC(int) ci_buf_reset_size(struct ci_buf *buf,int req_size); /***************/ /*API defines */ #define ci_service_data(req) ((req)->service_data) #define ci_allow204(req) ((req)->allow204) #define ci_allow206(req) ((req)->allow206) /*API functions ......*/ CI_DECLARE_FUNC(ci_request_t *) ci_request_alloc(ci_connection_t *connection); CI_DECLARE_FUNC(void) ci_request_reset(ci_request_t *req); CI_DECLARE_FUNC(void) ci_request_destroy(ci_request_t *req); CI_DECLARE_FUNC(void) ci_request_pack(ci_request_t *req); CI_DECLARE_FUNC(void) ci_response_pack(ci_request_t *req); CI_DECLARE_FUNC(ci_encaps_entity_t *) ci_request_alloc_entity(ci_request_t *req,int type,int val); CI_DECLARE_FUNC(int) ci_request_release_entity(ci_request_t *req,int pos); CI_DECLARE_FUNC(char *) ci_request_set_log_str(ci_request_t *req, char *logstr); CI_DECLARE_FUNC(int) ci_request_set_str_attribute(ci_request_t *req, const char *name, const char *value); CI_DECLARE_FUNC(int) ci_request_206_origin_body(ci_request_t *req, uint64_t offset); /*ICAP client api*/ CI_DECLARE_FUNC(ci_request_t *) ci_client_request(ci_connection_t *conn,const char *server,const char *service); CI_DECLARE_FUNC(void) ci_client_request_reuse(ci_request_t *req); CI_DECLARE_FUNC(int) ci_client_get_server_options(ci_request_t *req,int timeout); CI_DECLARE_FUNC(int) ci_client_get_server_options_nonblocking(ci_request_t *req); CI_DECLARE_FUNC(int) ci_client_icapfilter(ci_request_t *req, int timeout, ci_headers_list_t *req_headers, ci_headers_list_t *resp_headers, void *data_source, int (*source_read)(void *,char *,int), void *data_dest, int (*dest_write) (void *,char *,int)); /** \ingroup ICAPCLIENT * Function to send HTTP objects to an ICAP server for processing. It sends * the HTTP request headers, and the HTTP response from HTTP server (headers * plus body data), and receives modified HTTP response headers and body data. \param req The ci_request_t object. \param io_action is a combination set of ci_wait_for_read and * ci_wait_for_write flags. It has the meaning that the * ci_client_icapfilter_nonblocking can read from or write to ICAP server. \param req_headers The HTTP request headers to use. \param resp_headers The HTTP response headers to use. \param data_source User data to use with source_read callback function. \param source_read Callback function to use for reading HTTP object body data. \param data_dest User data to use with dest_write callback function. \param dest_write Callback function to use for storing modified body data. \return combination of the following flags: NEEDS_TO_READ_FROM_ICAP, * NEEDS_TO_WRITE_TO_ICAP, NEEDS_TO_READ_USER_DATA and * NEEDS_TO_WRITE_USER_DATA. */ CI_DECLARE_FUNC(int) ci_client_icapfilter_nonblocking(ci_request_t * req, int io_action, ci_headers_list_t * req_headers, ci_headers_list_t * resp_headers, void *data_source, int (*source_read) (void *, char *, int), void *data_dest, int (*dest_write) (void *, char *, int)); CI_DECLARE_FUNC(int) ci_client_http_headers_completed(ci_request_t * req); CI_DECLARE_FUNC(void) ci_client_set_user_agent(const char *agent); CI_DECLARE_FUNC(void) ci_client_library_init(); CI_DECLARE_FUNC(void) ci_client_library_release(); /** Deprecated. Use ci_connect_to declared in net_io.h instead. */ CI_DECLARE_FUNC(ci_connection_t *) ci_client_connect_to(char *servername,int port,int proto); #ifdef __CI_COMPAT #define request_t ci_request_t #endif #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/hash.h0000664000175000017500000000341213371253152012404 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __HASH_H #define __HASH_H #include "c-icap.h" #include "lookup_table.h" #include "mem.h" #ifdef __cplusplus extern "C" { #endif struct ci_hash_entry { unsigned int hash; const void *key; const void *val; struct ci_hash_entry *hnext; }; struct ci_hash_table { struct ci_hash_entry **hash_table; unsigned int hash_table_size; const ci_type_ops_t *ops; ci_mem_allocator_t *allocator; }; CI_DECLARE_FUNC(unsigned int) ci_hash_compute(unsigned long hash_max_value, const void *key, int len); CI_DECLARE_FUNC(struct ci_hash_table *) ci_hash_build(unsigned int hash_size, const ci_type_ops_t *ops, ci_mem_allocator_t *allocator); CI_DECLARE_FUNC(void) ci_hash_destroy(struct ci_hash_table *htable); CI_DECLARE_FUNC(const void *) ci_hash_search(struct ci_hash_table *htable,const void *key); CI_DECLARE_FUNC(void *) ci_hash_add(struct ci_hash_table *htable, const void *key, const void *val); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/txt_format.h0000664000175000017500000000457513371253152013663 00000000000000/* * Copyright (C) 2004-2009 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __TXT_FORMAT_H #define __TXT_FORMAT_H #include "request.h" #ifdef __cplusplus extern "C" { #endif /** * \defgroup FORMATING Text formating api * \ingroup API * Functions and structures used for text formating */ /** * \brief This structure used to implement text formating directives * \ingroup FORMATING */ struct ci_fmt_entry { /** * \brief The formating directive (eg "%a") */ const char *directive; /** * \brief A short description */ const char *description; /** * \brief Pointer to the function which implements the text formating for this directive * \param req_data Pointer to the current request structure * \param buf The output buffer * \param len The length of the buffer * \param param Parameter of the directive * \return Non zero on success, zero on error */ int (*format)(ci_request_t *req_data, char *buf, int len, const char *param); }; /** * \brief Produces formated text based on template text. * \ingroup FORMATING * \param req_data The current request * \param fmt The format string * \param buffer The output buffer * \param len The length of the output buffer * \param user_table An array of user defined directives * \return Non zero on success, zero on error * * This function uses the internal formating directives table. Also the user can define his own table. */ CI_DECLARE_FUNC(int) ci_format_text(ci_request_t *req_data, const char *fmt, char *buffer, int len, struct ci_fmt_entry *user_table); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/mem.h0000664000175000017500000000623713371253152012247 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __MEM_H #define __MEM_H #include "c-icap.h" #ifdef __cplusplus extern "C" { #endif enum allocator_types {OS_ALLOC, SERIAL_ALLOC, POOL_ALLOC, PACK_ALLOC}; typedef struct ci_mem_allocator { void *(*alloc)(struct ci_mem_allocator *,size_t size); void (*free)(struct ci_mem_allocator *,void *); void (*reset)(struct ci_mem_allocator *); void (*destroy)(struct ci_mem_allocator *); void *data; char *name; int type; int must_free; } ci_mem_allocator_t; CI_DECLARE_DATA extern ci_mem_allocator_t *default_allocator; CI_DECLARE_FUNC(void) ci_mem_allocator_destroy(ci_mem_allocator_t *allocator); CI_DECLARE_FUNC(ci_mem_allocator_t *) ci_create_os_allocator(); CI_DECLARE_FUNC(ci_mem_allocator_t *) ci_create_serial_allocator(int size); /*pack_allocator related functions ....*/ CI_DECLARE_FUNC(ci_mem_allocator_t *) ci_create_pack_allocator(char *memblock, size_t size); CI_DECLARE_FUNC(int) ci_pack_allocator_data_size(ci_mem_allocator_t *allocator); CI_DECLARE_FUNC(void *) ci_pack_allocator_alloc(ci_mem_allocator_t *allocator,size_t size); CI_DECLARE_FUNC(void) ci_pack_allocator_free(ci_mem_allocator_t *allocator,void *p); /*The following six functions are only for c-icap internal use....*/ CI_DECLARE_FUNC(ci_mem_allocator_t *)ci_create_pack_allocator_on_memblock(char *memblock, size_t size); CI_DECLARE_FUNC(size_t) ci_pack_allocator_required_size(); CI_DECLARE_FUNC(void *) ci_pack_allocator_alloc_unaligned(ci_mem_allocator_t *allocator, size_t size); CI_DECLARE_FUNC(void *) ci_pack_allocator_alloc_from_rear(ci_mem_allocator_t *allocator, int size); CI_DECLARE_FUNC(void) ci_pack_allocator_set_start_pos(ci_mem_allocator_t *allocator, void *p); CI_DECLARE_FUNC(void) ci_pack_allocator_set_end_pos(ci_mem_allocator_t *allocator, void *p); CI_DECLARE_FUNC(int) ci_buffers_init(); CI_DECLARE_FUNC(void) ci_buffers_destroy(); CI_DECLARE_FUNC(void *) ci_buffer_alloc(int block_size); CI_DECLARE_FUNC(void *) ci_buffer_realloc(void *data, int block_size); CI_DECLARE_FUNC(void) ci_buffer_free(void *data); CI_DECLARE_FUNC(size_t) ci_buffer_blocksize(const void *data); CI_DECLARE_FUNC(int) ci_object_pool_register(const char *name, int size); CI_DECLARE_FUNC(void) ci_object_pool_unregister(int id); CI_DECLARE_FUNC(void *) ci_object_pool_alloc(int id); CI_DECLARE_FUNC(void) ci_object_pool_free(void *ptr); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/net_io_ssl.h0000664000175000017500000001424513371253152013625 00000000000000#ifndef __C_ICAP_NET_IO_SSL_H #define __C_ICAP_NET_IO_SSL_H #include "c-icap.h" #include "net_io.h" #ifdef USE_OPENSSL #include #ifdef __cplusplus extern "C" { #endif /** \defgroup TLS TLS/SSL related API \ingroup API * TLS/SSL related API. */ /** \ingroup TLS \brief Stores basic parameters for connecting to the remote TLS server. */ typedef struct ci_tls_client_options { /** \brief The TLS method to use. * Can be set to one of TLSv1_2, TLSv1_1, TLSv1, SSLv23, SSLv3 */ const char *method; /** \brief The path to a file stores the certificate */ const char *cert; /** \brief The path to a file stores the certificate key */ const char *key; /** \brief The ciphers list separated by ':'. * Read OpenSSL manuals for complete list of ciphers. */ const char *ciphers; /** \brief Path to a file stores the CA certificates */ const char *cafile; /** \brief Path to a directory where the CA certificates are stored */ const char *capath; /** \brief Set to 1 if server certificate verification is required 0 otherwise. */ int verify; /** \brief Please read SSL_CTX_set_options man page for available options */ unsigned long options; } ci_tls_client_options_t; /*API functions for implementing TLS icap client*/ /** \ingroup TLS \brief Initializes c-icap tls subsystem. Normally called on programs startup. */ CI_DECLARE_FUNC(void) ci_tls_init(); /** \ingroup TLS \brief Deinitializes c-icap tls subsystem. Normally called on shutdown to * clean-up. */ CI_DECLARE_FUNC(void) ci_tls_cleanup(); /** \ingroup TLS \brief Create a context based on given opts * * A context can be used to open more than one connections to a TLS server. */ CI_DECLARE_FUNC(SSL_CTX *) ci_tls_create_context(ci_tls_client_options_t *opts); /** \ingroup TLS \brief Initializes and establishes a connection to a server. \param servername The ip or dns name of the server \param p The port number to use \param proto One of AF_INET, AF_INET6 \param ctx The context object to use \return NULL on failures the ci_connection_t object which can be used * with various ci_connection_* api functions on success. */ CI_DECLARE_FUNC(ci_connection_t*) ci_tls_connect(const char *servername, int port, int proto, SSL_CTX *ctx, int timeout); /** \ingroup TLS \brief The non-blocking version of ci_tls_connect function \return -1 on error, 1 when connection is established or 0 if should be * called again. * * To establish a connection required more than one calls to * ci_tls_connect_nonblock. The user should monitor the connection->fd * file descriptor for events in order to call again ci_tls_connect_nonblock. * If it is used with a custom monitor of file descriptors event, it should * be used with ci_connection_should_read_tls/ci_connection_should_write_tls * functions. In this case it should be used as follows: \code ci_connection_t *connection = ci_connection_create(); int ret = ci_tls_connect_nonblock(connection, servername, port, proto, use_ctx); while (ret == 0) { int wants_read = ci_connection_should_read_tls(connection); int wants_write = ci_connection_should_write_tls(connection); if (wants_read == 0 && wants_write == 0) wants_write = 1; int mresult = monitor_fd(connection->fd, (wants_read > 0 ? MONITOR_FD_FOR_READ : 0), (wants_write > 0 ? MONITOR_FD_FOR_WRITE : 0) ); if (mresult == error) { return error; } ret = ci_tls_connect_nonblock(connection, servername, port, proto, use_ctx); } if (ret < 0) return error; \endcode */ CI_DECLARE_FUNC(int) ci_tls_connect_nonblock(ci_connection_t *connection, const char *servername, int port, int proto, SSL_CTX *ctx); /** \ingroup TLS \brief The TLS subsystem wants to read data from the connection \return -1 on non TLS connection or error, 1 if wants to read data, 0 otherwise */ CI_DECLARE_FUNC(int) ci_connection_should_read_tls(ci_connection_t *connection); /** \ingroup TLS \brief The TLS subsystem wants to write data to the connection \return -1 on non TLS connection or error, 1 if wants to write data, * 0 otherwise */ CI_DECLARE_FUNC(int) ci_connection_should_write_tls(ci_connection_t *connection); /** \ingroup TLS \brief There are pending bytes to read from TLS connection \return The number of pending bytes or 0 */ CI_DECLARE_FUNC(int) ci_connection_read_pending_tls(ci_connection_t *conn); /** \ingroup TLS \brief There are pending bytes to write to TLS connection \return The number of pending bytes or 0 */ CI_DECLARE_FUNC(int) ci_connection_write_pending_tls(ci_connection_t *conn); /* Functions needed to create an SSL server. Used by c-icap server. */ struct ci_port; CI_DECLARE_FUNC(int) icap_init_server_tls(struct ci_port *port); CI_DECLARE_FUNC(void) icap_close_server_tls(struct ci_port *port); CI_DECLARE_FUNC(int) icap_port_tls_option(const char *opt, struct ci_port *conf, const char *config_dir); CI_DECLARE_FUNC(int) icap_accept_tls_connection(struct ci_port *port, ci_connection_t *client_conn); CI_DECLARE_FUNC(int) ci_port_reconfigure_tls(struct ci_port *port); CI_DECLARE_FUNC(void) ci_tls_set_passphrase_script(const char *script); /* Low level functions which not exported, but used internally by libicapapi.so library. */ int ci_connection_wait_tls(ci_connection_t *conn, int secs, int what_wait); int ci_connection_read_tls(ci_connection_t *conn, void *buf, size_t count, int timeout); int ci_connection_write_tls(ci_connection_t *conn, const void *buf, size_t count, int timeout); int ci_connection_read_nonblock_tls(ci_connection_t *conn, void *buf, size_t count); int ci_connection_write_nonblock_tls(ci_connection_t *conn, const void *buf, size_t count); int ci_connection_linger_close_tls(ci_connection_t *conn, int timeout); int ci_connection_hard_close_tls(ci_connection_t *conn); #ifdef __cplusplus } #endif #endif #endif /* NET_IO_SSL_H */ c_icap-0.5.6/include/c-icap-conf.h.in0000664000175000017500000000516613371253152014155 00000000000000/*This is autogenerated file*/ #ifndef __C_ICAP_CONF_H #define __C_ICAP_CONF_H /*C_ICAP VERSION*/ #define C_ICAP_HEX_VERSION @C_ICAP_HEX_VERSION@ /* Define USE_IPV6 if we are supporting ipv6 */ #if @USE_IPV6@ #define USE_IPV6 #endif #if @USE_OPENSSL@ #define USE_OPENSSL #endif #if @SYSV_IPC@ #define USE_SYSV_IPC #endif #if @POSIX_MAPPED_FILES@ #define USE_POSIX_MAPPED_FILES #endif #if @POSIX_SHARED_MEM@ #define USE_POSIX_SHARED_MEM #endif #if @SYSV_IPC@ # define USE_SYSV_IPC_MUTEX #endif #if @POSIX_FILE_LOCK@ # define USE_POSIX_FILE_LOCK #endif #if @POSIX_SEMAPHORES@ # define USE_POSIX_SEMAPHORES #endif #if @PTHREADS_RWLOCK@ #define USE_PTHREADS_RWLOCK #endif #if @USE_REGEX@ #define USE_REGEX #endif #if @USE_COMPAT@ #define __CI_COMPAT #endif #if @USE_POLL@ #define USE_POLL #endif /*The following maybe should used...*/ #if @SYS_TYPES_H@ #define __SYS_TYPES_H_EXISTS #endif #if @INTTYPES_H@ #define __INTTYPES_H_EXISTS #endif /* The 64 bit data models as described by wikipedia are: Data model short int long long long pointers/size_t LLP64 16 32 32 64 64 LP64 16 32 64 64 64 ILP64 16 64 64 64 64 SILP64 64 64 64 64 64 On most 32bit and 64bit unix machines, 'short' is always 16bit, 'int' is 32bit long is 32bit or 64bit respectively and long long is always 64bit. We are going to define: off_t as long on 32bit machines and long long on 64bit (sizeof(void*)==8) size_t as long on 32bit machines and long long on 64bit The c-icap should not use int32_t/uint32_t/int16_t/uint16_t types */ #define CI_SIZEOF_VOID_P @DEFINE_SIZE_VOID_P@ /* typedef off_t if does not define. */ #if @DEFINE_OFF_T@ #if CI_SIZEOF_VOID_P == 8 typedef long long off_t; #define CI_SIZEOF_OFF_T 8 #elif CI_SIZEOF_VOID_P == 4 typedef long off_t; #define CI_SIZEOF_OFF_T 4 #else #error "Unhandled size of void *" #endif #else /*if @DEFINE_OFF_T@*/ #define CI_SIZEOF_OFF_T @DEFINE_SIZE_OFF_T@ #endif /* typedef size_t if does not define. */ #if @DEFINE_SIZE_T@ #if SIZEOF_VOID_P == 8 typedef unsigned long long size_t; #elif SIZEOF_VOID_P == 4 typedef unsigned int size_t; #else #error "Unhandled size of void *" #endif #endif #if @DEFINE_UINT8@ typedef unsigned char uint8_t; #endif #if @DEFINE_INT8@ typedef char int8_t; #endif #if @DEFINE_UINT64@ typedef unsigned long long uint64_t; #endif #if @DEFINE_INT64@ typedef long long int64_t; #endif #if @VISIBILITY_ATTR@ #define USE_VISIBILITY_ATTRIBUTE #endif #endif c_icap-0.5.6/include/commands.h0000664000175000017500000000531213371253152013263 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __COMMANDS_H #define __COMMANDS_H #include "c-icap.h" #ifdef __cplusplus extern "C" { #endif #define COMMANDS_BUFFER_SIZE 128 #define NULL_CMD 0 #define MONITOR_PROC_CMD 1 #define CHILDS_PROC_CMD 2 #define MONITOR_PROC_POST_CMD 4 #define ALL_PROC_CMD 7 #define CHILD_START_CMD 8 #define CHILD_STOP_CMD 16 #define ONDEMAND_CMD 32 #define CMD_NM_SIZE 128 typedef struct ci_command { char name[CMD_NM_SIZE]; int type; void *data; union { void (*command_action)(const char *name, int type,const char **argv); void (*command_action_extend)(const char *name, int type, void *data); }; } ci_command_t; /* Backward compatible function for ci_command_register_ctl */ CI_DECLARE_FUNC(void) register_command(const char *name, int type, void (*command_action)(const char *name,int type, const char **argv)); /* backward compatible function for ci_command_register_action */ CI_DECLARE_FUNC(void) register_command_extend(const char *name, int type, void *data, void (*command_action) (const char *name, int type, void *data)); CI_DECLARE_FUNC(void) ci_command_register_ctl_cmd(const char *name, int type, void (*command_action)(const char *name,int type, const char **argv)); CI_DECLARE_FUNC(void) ci_command_register_action(const char *name, int type, void *data, void (*command_action) (const char *name, int type, void *data)); CI_DECLARE_FUNC(void) ci_command_schedule_on(const char *name, void *data, time_t time); CI_DECLARE_FUNC(void) ci_command_schedule(const char *name, void *data, time_t afterSecs); void commands_init(); void commands_reset(); int execute_command(ci_command_t *command, char *cmdline, int exec_type); ci_command_t *find_command(const char *cmd_line); int commands_execute_start_child(); int commands_execute_stop_child(); void commands_exec_scheduled(); #ifdef __cplusplus } #endif #endif /*__COMMANDS_H*/ c_icap-0.5.6/include/types_ops.h0000664000175000017500000000370513371253152013513 00000000000000/* * Copyright (C) 2004-2010 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __TYPES_OPS_H #define __TYPES_OPS_H #include "c-icap.h" #include "mem.h" #ifdef __cplusplus extern "C" { #endif typedef struct ci_type_ops { void *(*dup)(const char *, ci_mem_allocator_t *); void (*free)(void *key, ci_mem_allocator_t *); int (*compare)(const void *ref_key,const void *check_key); size_t (*size)(const void *key); int (*equal)(const void *ref_key,const void *check_key); } ci_type_ops_t; CI_DECLARE_DATA extern const ci_type_ops_t ci_str_ops; CI_DECLARE_DATA extern const ci_type_ops_t ci_str_ext_ops; CI_DECLARE_DATA extern const ci_type_ops_t ci_int32_ops; CI_DECLARE_DATA extern const ci_type_ops_t ci_uint64_ops; CI_DECLARE_DATA extern const ci_type_ops_t ci_ip_ops; CI_DECLARE_DATA extern const ci_type_ops_t ci_ip_sockaddr_ops; CI_DECLARE_DATA extern const ci_type_ops_t ci_datatype_ops; #ifdef USE_REGEX CI_DECLARE_DATA extern const ci_type_ops_t ci_regex_ops; #define ci_type_ops_is_string(tops) ((tops) == &ci_str_ops || (tops) == &ci_str_ext_ops || (tops) == &ci_regex_ops) #else #define ci_type_ops_is_string(tops) ((tops) == &ci_str_ops || (tops) == &ci_str_ext_ops) #endif #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/txtTemplate.h0000664000175000017500000000371713371253152014004 00000000000000/* * Copyright (C) 2007,2010 Trever L. Adams * * 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 of the License, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ // Additionally, you may use this file under LGPL 2 or (at your option) later #ifndef __TXTTEMPLATE_H #define __TXTTEMPLATE_H #include #include "request.h" #include "txt_format.h" #include "body.h" #ifdef __cplusplus extern "C" { #endif CI_DECLARE_FUNC (ci_membuf_t *) ci_txt_template_build_content(const ci_request_t *req, const char *SERVICE_NAME, const char *TEMPLATE_NAME, struct ci_fmt_entry *user_table); CI_DECLARE_FUNC (void) ci_txt_template_reset(void); CI_DECLARE_FUNC (int) ci_txt_template_init(void); CI_DECLARE_FUNC (void) ci_txt_template_close(void); CI_DECLARE_FUNC (void) ci_txt_template_set_dir(const char *dir); CI_DECLARE_FUNC (void) ci_txt_template_set_default_lang(const char *lang); CI_DECLARE_DATA extern const char *TEMPLATE_DIR; CI_DECLARE_DATA extern const char *TEMPLATE_DEF_LANG; CI_DECLARE_DATA extern int TEMPLATE_RELOAD_TIME; // Default time is one hour, this variable is in seconds CI_DECLARE_DATA extern int TEMPLATE_CACHE_SIZE; // How many templates can be cached CI_DECLARE_DATA extern int TEMPLATE_MEMBUF_SIZE; // Max memory for txtTemplate to expand template into txt #ifdef __cplusplus } #endif #endif /*__TXTTEMPLATE_H*/ c_icap-0.5.6/include/net_io.h0000664000175000017500000001562213371253152012744 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __NET_IO_H #define __NET_IO_H #include "c-icap.h" #ifndef _WIN32 #include #include #include #include #include #include #include #else #include #endif #ifdef USE_OPENSSL #include #endif #ifdef __cplusplus extern "C" { #endif #ifndef _WIN32 #define ci_socket int #define CI_SOCKET_ERROR -1 #else #define ci_socket SOCKET #define CI_SOCKET_ERROR INVALID_SOCKET #endif typedef ci_socket ci_socket_t; typedef struct ci_sockaddr { #ifdef USE_IPV6 struct sockaddr_storage sockaddr; #else struct sockaddr_in sockaddr; #endif int ci_sin_family;/* #define ci_sin_family sockaddr.sin_family */ int ci_sin_port; /* #define ci_sin_port sockaddr.sin_port */ void *ci_sin_addr; int ci_inaddr_len; } ci_sockaddr_t; #define CI_MAXHOSTNAMELEN 256 #ifdef USE_IPV6 typedef union ci_inaddr { struct in_addr ipv4_addr; struct in6_addr ipv6_addr; } ci_in_addr_t; #define ci_inaddr_zero(addr) (memset(&(addr),0,sizeof(ci_in_addr_t))) #define ci_inaddr_copy(dest,src) (memcpy(&(dest),&(src),sizeof(ci_in_addr_t))) #define ci_ipv4_inaddr_hostnetmask(addr)((addr).ipv4_addr.s_addr = htonl(0xFFFFFFFF)) #define ci_in6_addr_u32(addr) ((uint32_t *)&((addr).ipv6_addr)) #define ci_ipv6_inaddr_hostnetmask(addr)(ci_in6_addr_u32(addr)[0] = htonl(0xFFFFFFFF),\ ci_in6_addr_u32(addr)[1] = htonl(0xFFFFFFFF), \ ci_in6_addr_u32(addr)[2] = htonl(0xFFFFFFFF), \ ci_in6_addr_u32(addr)[3] = htonl(0xFFFFFFFF)) #define CI_IPLEN 46 #define CI_SOCKADDR_SIZE sizeof(struct sockaddr_storage) #else /*IPV4 only*/ typedef struct in_addr ci_in_addr_t; #define ci_inaddr_zero(addr) ((addr).s_addr = 0) #define ci_inaddr_copy(dest,src) ((dest) = (src)) #define ci_ipv4_inaddr_hostnetmask(addr)((addr).s_addr = htonl(0xFFFFFFFF)) #define CI_IPLEN 16 #define CI_SOCKADDR_SIZE sizeof(struct sockaddr_in) #endif #define wait_for_read 0x1 #define wait_for_write 0x2 #define wait_for_readwrite 0x3 #define ci_wait_for_read 0x1 #define ci_wait_for_write 0x2 #define ci_wait_for_readwrite 0x3 #define ci_wait_should_retry 0x4 typedef struct ci_ip { ci_in_addr_t address; ci_in_addr_t netmask; int family; } ci_ip_t; /*Flags for ci_connection_t object*/ #define CI_CONNECTION_CONNECTED 0x1 typedef struct ci_connection { ci_socket fd; ci_sockaddr_t claddr; ci_sockaddr_t srvaddr; #ifdef USE_OPENSSL BIO* bio; #endif int32_t flags; } ci_connection_t ; struct ci_port; CI_DECLARE_FUNC(ci_connection_t *) ci_connection_create(); CI_DECLARE_FUNC(void) ci_connection_destroy(ci_connection_t *connection); CI_DECLARE_FUNC(void) ci_fill_sockaddr(ci_sockaddr_t *addr); CI_DECLARE_FUNC(void) ci_fill_ip_t(ci_ip_t *ip, ci_sockaddr_t *addr); CI_DECLARE_FUNC(void) ci_copy_sockaddr(ci_sockaddr_t *dest, ci_sockaddr_t *src); CI_DECLARE_FUNC(int) ci_inet_aton(int af,const char *cp, void *inp); CI_DECLARE_FUNC(const char *) ci_inet_ntoa(int af,const void *src, char *dst,int cnt); CI_DECLARE_FUNC(const char *) ci_sockaddr_t_to_ip(ci_sockaddr_t *addr, char *ip,int ip_strlen); #define ci_conn_remote_ip(conn,ip) ci_sockaddr_t_to_ip(&(conn->claddr),ip,CI_IPLEN) #define ci_conn_local_ip(conn,ip) ci_sockaddr_t_to_ip(&(conn->srvaddr),ip,CI_IPLEN) #ifdef USE_IPV6 CI_DECLARE_FUNC(void) ci_sockaddr_set_port(ci_sockaddr_t *addr, int port); #define ci_sockaddr_set_family(addr,family) ((addr).sockaddr.ss_family=family) #else CI_DECLARE_FUNC(void) ci_sockaddr_set_port(ci_sockaddr_t *addr, int port); #define ci_sockaddr_set_family(addr,family) ((addr).sockaddr.sin_family=family/*,(addr).ci_sin_family=family*/) #endif CI_DECLARE_FUNC(const char *) ci_sockaddr_t_to_host(ci_sockaddr_t *addr, char *hname, int maxhostlen); CI_DECLARE_FUNC(int) ci_host_to_sockaddr_t(const char *servername, ci_sockaddr_t * addr, int proto); CI_DECLARE_FUNC(void) ci_copy_connection(ci_connection_t *dest, ci_connection_t *src); CI_DECLARE_FUNC(void) ci_connection_reset(ci_connection_t *conn); CI_DECLARE_FUNC(int) icap_socket_opts(ci_socket fd, int secs_to_linger); CI_DECLARE_FUNC(ci_socket) icap_init_server(struct ci_port *port); CI_DECLARE_FUNC(int) icap_accept_raw_connection(struct ci_port *port, ci_connection_t *conn); CI_DECLARE_FUNC(int) ci_wait_for_data(ci_socket fd,int secs,int what_wait); #define ci_wait_for_incomming_data(fd,timeout) ci_wait_for_data(fd,timeout,wait_for_read) #define ci_wait_for_outgoing_data(fd,timeout) ci_wait_for_data(fd,timeout,wait_for_write) CI_DECLARE_FUNC(int) ci_connection_set_nonblock(ci_connection_t *conn); typedef enum {ci_connection_server_side, ci_connection_client_side} ci_connection_type_t; CI_DECLARE_FUNC(int) ci_connection_init(ci_connection_t *conn, ci_connection_type_t type); CI_DECLARE_FUNC(int) ci_read(ci_socket fd,void *buf,size_t count,int timeout); CI_DECLARE_FUNC(int) ci_write(ci_socket fd, const void *buf,size_t count,int timeout); CI_DECLARE_FUNC(int) ci_read_nonblock(ci_socket fd, void *buf,size_t count); CI_DECLARE_FUNC(int) ci_write_nonblock(ci_socket fd, const void *buf,size_t count); CI_DECLARE_FUNC(int) ci_linger_close(ci_socket fd,int secs_to_linger); CI_DECLARE_FUNC(int) ci_hard_close(ci_socket fd); CI_DECLARE_FUNC(ci_connection_t *) ci_connect_to(const char *servername, int port, int proto, int timeout); CI_DECLARE_FUNC(int) ci_connect_to_nonblock(ci_connection_t *connection, const char *servername, int port, int proto); CI_DECLARE_FUNC(int) ci_connection_wait(ci_connection_t *conn, int secs, int what_wait); CI_DECLARE_FUNC(int) ci_connection_read(ci_connection_t *conn, void *buf, size_t count, int timeout); CI_DECLARE_FUNC(int) ci_connection_write(ci_connection_t *conn, void *buf, size_t count, int timeout); CI_DECLARE_FUNC(int) ci_connection_read_nonblock(ci_connection_t *conn, void *buf, size_t count); CI_DECLARE_FUNC(int) ci_connection_write_nonblock(ci_connection_t *conn, void *buf, size_t count); CI_DECLARE_FUNC(int) ci_connection_linger_close(ci_connection_t *conn, int timeout); CI_DECLARE_FUNC(int) ci_connection_hard_close(ci_connection_t *conn); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/proc_mutex.h0000664000175000017500000000505113371253152013647 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __PROC_MUTEX_H #define __PROC_MUTEX_H #include "c-icap.h" #if defined (USE_SYSV_IPC_MUTEX) #include #include #endif #if defined (USE_POSIX_SEMAPHORES) #include #endif #if defined (USE_POSIX_FILE_LOCK) #include #endif #if defined (_WIN32) #include #endif #ifdef __cplusplus extern "C" { #endif typedef struct ci_proc_mutex ci_proc_mutex_t; typedef struct ci_proc_mutex_scheme { int (*proc_mutex_init)(ci_proc_mutex_t *mutex, const char *name); int (*proc_mutex_destroy)(ci_proc_mutex_t *mutex); int (*proc_mutex_lock)(ci_proc_mutex_t *mutex); int (*proc_mutex_unlock)(ci_proc_mutex_t *mutex); int (*proc_mutex_print_info)(ci_proc_mutex_t *mutex, char *buf, size_t buf_size); const char *name; } ci_proc_mutex_scheme_t; #define CI_PROC_MUTEX_NAME_SIZE 64 struct ci_proc_mutex { char name[CI_PROC_MUTEX_NAME_SIZE]; #if defined(_WIN32) HANDLE id; #else const ci_proc_mutex_scheme_t *scheme; union { #if defined(USE_SYSV_IPC_MUTEX) struct { int id; } sysv; #endif #if defined(USE_POSIX_SEMAPHORES) struct { sem_t *sem; } posix; #endif #if defined(USE_POSIX_FILE_LOCK) struct { int fd; } file; #endif }; #endif }; CI_DECLARE_FUNC(int) ci_proc_mutex_init(ci_proc_mutex_t *mutex, const char *name); CI_DECLARE_FUNC(int) ci_proc_mutex_lock(ci_proc_mutex_t *mutex); CI_DECLARE_FUNC(int) ci_proc_mutex_unlock(ci_proc_mutex_t *mutex); CI_DECLARE_FUNC(int) ci_proc_mutex_destroy(ci_proc_mutex_t *mutex); CI_DECLARE_FUNC(int) ci_proc_mutex_set_scheme(const char *scheme); CI_DECLARE_FUNC(const ci_proc_mutex_scheme_t *) ci_proc_mutex_default_scheme(); #ifdef __cplusplus } #endif #endif c_icap-0.5.6/include/debug.h0000664000175000017500000000300213371253152012542 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #ifndef __DEBUG_H #define __DEBUG_H #include "c-icap.h" #include #include #ifdef __cplusplus extern "C" { #endif CI_DECLARE_DATA extern int CI_DEBUG_LEVEL; CI_DECLARE_DATA extern int CI_DEBUG_STDOUT; #ifdef _MSC_VER CI_DECLARE_DATA extern void (*__vlog_error)(void *req, const char *format, va_list ap); CI_DECLARE_FUNC(void) __ldebug_printf(int i,const char *format, ...); #define ci_debug_printf __ldebug_printf #else CI_DECLARE_DATA extern void (*__log_error)(void *req, const char *format,... ); #define ci_debug_printf(i, args...) if(i<=CI_DEBUG_LEVEL){ if(__log_error) (*__log_error)(NULL,args); if(CI_DEBUG_STDOUT) printf(args);} #endif #ifdef __cplusplus } #endif #endif /*__DEBUG_H*/ c_icap-0.5.6/filetype.c0000664000175000017500000005514213541161032011653 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include #include #include #ifdef HAVE_ZLIB #include #endif #ifdef HAVE_BZLIB #include #endif #include "simple_api.h" #include "debug.h" #include "request.h" #include "mem.h" #include "filetype.h" static struct ci_magics_db *_MAGIC_DB = NULL; struct ci_data_type predefined_types[] = { {"ASCII", "ASCII text file", {CI_TEXT_DATA, -1}}, {"ISO-8859", "ISO-8859 text file", {CI_TEXT_DATA, -1}}, {"EXT-ASCII", "Extended ASCII (Mac,IBM PC etc.)", {CI_TEXT_DATA, -1}}, {"UTF", "Unicode text file ", {CI_TEXT_DATA, -1}}, {"HTML", "HTML text", {CI_TEXT_DATA, -1}}, {"BINARY", "Unknown data", {CI_OCTET_DATA, -1}}, {"", "", {-1}} }; struct ci_data_group predefined_groups[] = { {"TEXT", "All texts"}, {"DATA", "Undefined data type"}, {"", ""} }; struct ci_magic_record { int offset; unsigned char magic[MAGIC_SIZE + 1]; size_t len; char type[NAME_SIZE + 1]; char *groups[MAX_GROUPS + 1]; char descr[DESCR_SIZE + 1]; }; #define DECLARE_ARRAY_FUNCTIONS(structure,array,type,size) int array##_init(structure *db){ \ if((db->array=malloc(size*sizeof(type)))==NULL) \ return 0; \ db->array##_num=0; \ db->array##_size=size;\ return 1; \ } #define CHECK_SIZE(db,array,type,size) if(db->array##_num >= db->array##_size){\ if((newdata=realloc(db->array,(db->array##_size+size)*sizeof(type)))==NULL)\ return -1;\ db->array##_size +=size; \ db->array =newdata;\ } DECLARE_ARRAY_FUNCTIONS(struct ci_magics_db, types, struct ci_data_type, 50) DECLARE_ARRAY_FUNCTIONS(struct ci_magics_db, groups, struct ci_data_group, 15) DECLARE_ARRAY_FUNCTIONS(struct ci_magics_db, magics, struct ci_magic, 50) int types_add(struct ci_magics_db *db, const char *name, const char *descr, int *groups) { struct ci_data_type *newdata; int indx, i; CHECK_SIZE(db, types, struct ci_data_type, 50); indx = db->types_num; db->types_num++; strcpy(db->types[indx].name, name); strcpy(db->types[indx].descr, descr); i = 0; while (groups[i] >= 0 && i < MAX_GROUPS) { db->types[indx].groups[i] = groups[i]; i++; } db->types[indx].groups[i] = -1; return indx; } int groups_add(struct ci_magics_db *db, const char *name, const char *descr) { struct ci_data_group *newdata; int indx; CHECK_SIZE(db, groups, struct ci_data_group, 15); indx = db->groups_num; db->groups_num++; strcpy(db->groups[indx].name, name); strcpy(db->groups[indx].descr, descr); return indx; } int magics_add(struct ci_magics_db *db, int offset, unsigned char *magic, size_t len, int type) { struct ci_magic *newdata; int indx; CHECK_SIZE(db, magics, struct ci_magic, 50) indx = db->magics_num; db->magics_num++; db->magics[indx].type = type; db->magics[indx].offset = offset; db->magics[indx].len = len; memcpy(db->magics[indx].magic, magic, len); return indx; } int ci_get_data_type_id(struct ci_magics_db *db, const char *name) { int i = 0; for (i = 0; i < db->types_num; i++) { if (strcasecmp(name, db->types[i].name) == 0) return i; } return -1; } int ci_get_data_group_id(struct ci_magics_db *db, const char *group) { int i = 0; for (i = 0; i < db->groups_num; i++) { if (strcasecmp(group, db->groups[i].name) == 0) return i; } return -1; } int ci_belongs_to_group(struct ci_magics_db *db, int type, int group) { int i; if (db->types_num < type) return 0; i = 0; while (db->types[type].groups[i] >= 0 && i < MAX_GROUPS) { if (db->types[type].groups[i] == group) return 1; i++; } return 0; } void free_records_group(struct ci_magic_record *record) { int i; i = 0; while (record->groups[i] != NULL) { free(record->groups[i]); record->groups[i] = NULL; i++; } } #define RECORD_LINE 32768 static int parse_record(char *line, struct ci_magic_record *record) { char *s, *end, num[4]; int len, c, i; if ((len = strlen(line)) < 4) /*must have at least 4 ':' */ return 0; if (line[0] == '#') /*Comment ....... */ return 0; line[--len] = '\0'; /*the \n at the end of */ s = line; errno = 0; record->offset = strtol(s, &end, 10); if (*end != ':' || errno != 0) return 0; s = end + 1; i = 0; end = line + len; while (*s != ':' && s < end && i < MAGIC_SIZE) { if (*s == '\\') { s++; if (*s == 'x') { s++; num[0] = *(s++); num[1] = *(s++); num[2] = '\0'; c = strtol(num, NULL, 16); } else { num[0] = *(s++); num[1] = *(s++); num[2] = *(s++); num[3] = '\0'; c = strtol(num, NULL, 8); } if (c > 256 || c < 0) { return -2; } record->magic[i++] = c; } else { record->magic[i++] = *s; s++; } } record->len = i; if (s >= end || *s != ':') { /*End of the line..... parse error */ return -2; } s++; if ((end = strchr(s, ':')) == NULL) { return -2; /*Parse error */ } *end = '\0'; strncpy(record->type, s, NAME_SIZE); record->type[NAME_SIZE] = '\0'; s = end + 1; if ((end = strchr(s, ':')) == NULL) { return -2; /*Parse error */ } *end = '\0'; strncpy(record->descr, s, DESCR_SIZE); record->descr[DESCR_SIZE] = '\0'; s = end + 1; i = 0; while ((end = strchr(s, ':')) != NULL) { *end = '\0'; record->groups[i] = malloc(NAME_SIZE + 1); strncpy(record->groups[i], s, NAME_SIZE); record->groups[i][NAME_SIZE] = '\0'; i++; if (i >= MAX_GROUPS - 1) break; s = end + 1; } record->groups[i] = malloc(NAME_SIZE + 1); strncpy(record->groups[i], s, NAME_SIZE); record->groups[i][NAME_SIZE] = '\0'; i++; record->groups[i] = NULL; return 1; } struct ci_magics_db *ci_magics_db_init() { struct ci_magics_db *db; int i, ret; db = malloc(sizeof(struct ci_magics_db)); if (!db) return NULL; memset(db, 0, sizeof(struct ci_magics_db)); ret = types_init(db) && groups_init(db) && magics_init(db); if (!ret) { ci_magics_db_release(db); return NULL; } i = 0; /*Copy predefined types */ while (predefined_types[i].name[0] != '\0') { ret = types_add(db, predefined_types[i].name, predefined_types[i].descr, predefined_types[i].groups); if (ret < 0) { /*memory allocation ?*/ ci_magics_db_release(db); return NULL; } i++; } i = 0; /*Copy predefined groups */ while (predefined_groups[i].name[0] != '\0') { ret = groups_add(db, predefined_groups[i].name, predefined_groups[i].descr); if (ret < 0) { /*memory allocation ?*/ ci_magics_db_release(db); return NULL; } i++; } return db; } void ci_magics_db_release(struct ci_magics_db *db) { if (db->types) free(db->types); if (db->groups) free(db->groups); if (db->magics) free(db->magics); free(db); } int ci_magics_db_file_add(struct ci_magics_db *db, const char *filename) { int type; int ret, error, group, i, lineNum; int groups[MAX_GROUPS + 1]; char line[RECORD_LINE]; struct ci_magic_record record; FILE *f; if ((f = fopen(filename, "r")) == NULL) { ci_debug_printf(1, "Error opening magic file: %s\n", filename); return 0; } lineNum = 0; error = 0; while (!error && fgets(line, RECORD_LINE, f) != NULL) { lineNum ++; ret = parse_record(line, &record); if (!ret) continue; if (ret < 0) { error = 1; break; } if ((type = ci_get_data_type_id(db, record.type)) < 0) { for (i=0; record.groups[i] != NULL && !error && i < MAX_GROUPS; ++i) { if ((group = ci_get_data_group_id(db, record.groups[i])) < 0) { group = groups_add(db, record.groups[i], ""); } groups[i] = group; if (group < 0) error = 1; } if (!error) { groups[i] = -1; type = types_add(db, record.type, record.descr, groups); if (type < 0) error = 1; } } if (magics_add(db, record.offset, record.magic, record.len, (unsigned int) type) < 0) error = 1; free_records_group(&record); } fclose(f); if (error) { /*An error occured ..... */ ci_debug_printf(1, "Error reading magic file (%d), line number: %d\nBuggy line: %s\n", ret, lineNum, line); return 0; } ci_debug_printf(3, "In database: magic: %d, types: %d, groups: %d\n", db->magics_num, db->types_num, db->groups_num); return 1; } struct ci_magics_db *ci_magics_db_build(const char *filename) { struct ci_magics_db *db; if ((db = ci_magics_db_init()) != NULL) ci_magics_db_file_add(db, filename); return db; } int check_magics(struct ci_magics_db *db, const char *buf, int buflen) { int i; for (i = 0; i < db->magics_num; i++) { if (buflen >= db->magics[i].offset + db->magics[i].len) { if (memcmp (buf + db->magics[i].offset, db->magics[i].magic, db->magics[i].len) == 0) { return db->magics[i].type; } } } return -1; } /*The folowing table taking from the file project........*/ /*0 are the characters which never appears in text */ #define T 1 /* character appears in plain ASCII text */ #define I 2 /* character appears in ISO-8859 text */ #define X 4 /* character appears in non-ISO extended ASCII (Mac, IBM PC) */ static const char text_chars[256] = { /* BEL BS HT LF FF CR */ 0, 0, 0, 0, 0, 0, 0, T, T, T, T, 0, T, T, 0, 0, /* 0x0X */ /* ESC */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, T, 0, 0, 0, 0, /* 0x1X */ T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x2X */ T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x3X */ T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x4X */ T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x5X */ T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x6X */ T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, 0, /* 0x7X */ /* NEL */ X, X, X, X, X, T, X, X, X, X, X, X, X, X, X, X, /* 0x8X */ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, /* 0x9X */ I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xaX */ I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xbX */ I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xcX */ I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xdX */ I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xeX */ I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I /* 0xfX */ }; /* ASCII if res <= 1 ISO if res <= 3 EXTEND if res <= 7 */ int check_ascii(unsigned char *buf, int buflen) { unsigned int i, res = 0, type; for (i = 0; i < buflen; i++) { /*May be only a small number (30-50 bytes) of the first data must be checked */ if ((type = text_chars[buf[i]]) == 0) return -1; res = res | type; } if (res <= 1) return CI_ASCII_DATA; if (res <= 3) return CI_ISO8859_DATA; return CI_XASCII_DATA; /*Extend ascii for web pages? */ } static unsigned int utf_boundaries[] = { 0x0, 0x0, 0x07F, 0x7FF, 0xFFFF, 0x1FFFFF, 0x3FFFFFF }; int isUTF8(unsigned char *c, int size) { int i, r_size = 0; unsigned int ucs_c = 0; if (text_chars[(int) *c] == T) return 1; if ((*c & 0xE0) == 0xC0) { /*2 byte unicode char ... */ ucs_c = (*c) & 0x1F; r_size = 2; } else if ((*c & 0xF0) == 0xE0) { /*3 byte unicode char */ ucs_c = (*c) & 0x0F; r_size = 3; } else if ((*c & 0xF8) == 0xF0) { /*4 byte unicode char */ ucs_c = (*c) & 0x07; r_size = 4; } else if ((*c & 0xFC) == 0xF8) { /*5 byte unicode char */ ucs_c = (*c) & 0x03; r_size = 5; } else if ((*c & 0xFE) == 0xFC) { /*6 byte unicode char */ ucs_c = (*c) & 0x01; r_size = 6; } if (!r_size /*|| r_size >4 */ ) /*In practice there are not yet 5 and 6 sized utf characters */ return 0; for (i = 1; i < r_size && i < size; i++) { if ((*(c + i) & 0xC0) != 0x80) return 0; ucs_c = (ucs_c << 6) | (*(c + i) & 0x3F); } if (i < r_size) { /*Not enough length ... */ return -1; } if (ucs_c <= utf_boundaries[r_size]) { /*Over long character .... */ return 0; } /* check UTF-16 surrogates? ........ */ if ((ucs_c >= 0xd800 && ucs_c <= 0xdfff) || ucs_c == 0xfffe || ucs_c == 0xffff) { return 0; } return r_size; } int check_unicode(unsigned char *buf, int buflen) { int i, ret = 0; int endian = 0; /*check for utf8 ........ */ for (i = 0; i < buflen; i += ret) { if ((ret = isUTF8(buf + i, buflen - i)) <= 0) break; } if (ret < 0 && i == 0) ret = 0; /*Not enough data to check */ if (ret) /*Even if the last char is unknown ret != 0 mean is utf */ return CI_UTF_DATA; /*... but what about if buflen is about 2 or 3 bytes long ? */ /*check for utf16 .... */ if (buflen < 2) return -1; /*I read somewhere that only Microsoft uses the first 2 bytes to identify utf16 documents */ if (buf[0] == 0xff && buf[1] == 0xfe) /*Litle endian utf16 */ endian = 0; else if (buf[0] == 0xfe && buf[1] == 0xff) /*big endian utf16 .... */ endian = 1; else return -1; /*The only check we can do is for the ascii characters ...... */ for (i = 2; i < buflen; i += 2) { if (endian) { if (buf[i] == 0 && buf[i + 1] < 128 && text_chars[buf[i + 1]] != T) return -1; } else { if (buf[i + 1] == 0 && buf[i] < 128 && text_chars[buf[i]] != T) return -1; } } /*utf32 ????? who are using it? */ return CI_UTF_DATA; } int ci_filetype(struct ci_magics_db *db, const char *buf, int buflen) { int ret; if ((ret = check_magics(db, buf, buflen)) >= 0) return ret; /*At the feature the check_ascii and check_unicode must be merged ....*/ if ((ret = check_ascii((unsigned char *) buf, buflen)) >= 0) return ret; if ((ret = check_unicode((unsigned char *) buf, buflen)) >= 0) { return CI_UTF_DATA; } return CI_BIN_DATA; /*binary data */ } int extend_object_type(struct ci_magics_db *db, ci_headers_list_t *headers, const char *buf, int len, int *iscompressed) { int file_type; int unzipped_buf_len = 0; char *unzipped_buf = NULL; const char *checkbuf = buf; const char *content_type = NULL; const char *content_encoding = NULL; *iscompressed = CI_ENCODE_NONE; if (len <= 0) return CI_BIN_DATA; if (headers) { content_encoding = ci_headers_value(headers, "Content-Encoding"); if (content_encoding) { ci_debug_printf(8, "Content-Encoding: %s\n", content_encoding); *iscompressed = ci_encoding_method(content_encoding); /* Bzip2 comressed data are not usefull on preview data, because ci_uncompress_preview in most cases will not be able to decompress preview data window, because requires large blocks of data to start decompression. */ if (*iscompressed == CI_ENCODE_GZIP #if 0 || *iscompressed == CI_ENCODE_BZIP2 #endif || *iscompressed == CI_ENCODE_DEFLATE || *iscompressed == CI_ENCODE_BROTLI) { unzipped_buf = ci_buffer_alloc(len); /*Will I implement memory pools? when????? */ unzipped_buf_len = len; if (ci_uncompress_preview (*iscompressed, buf, len, unzipped_buf, &unzipped_buf_len) != CI_ERROR) { /* 1) unzip and 2) checkbuf eq to unziped data 3) len eq to unzipped data len */ checkbuf = unzipped_buf; len = unzipped_buf_len; } else { ci_debug_printf(3, "Error uncompressing encoded object\n"); ci_buffer_free(unzipped_buf); unzipped_buf = NULL; /* The checkbuf points to raw buf, type will be zipped data*/ } } } } file_type = ci_filetype(db, checkbuf, len); ci_debug_printf(7, "File type returned: %s,%s\n", ci_data_type_name(db, file_type), ci_data_type_descr(db, file_type)); /*The following until we have an internal html recognizer ..... */ if (ci_belongs_to_group(db, file_type, CI_TEXT_DATA) && headers && (content_type = ci_headers_value(headers, "Content-Type")) != NULL) { if (strcasestr(content_type, "text/html") || strcasestr(content_type, "text/css") || strcasestr(content_type, "text/javascript")) file_type = CI_HTML_DATA; } #ifndef HAVE_ZLIB /*if we do not have a zlib try to get file info from headers....... */ else if (file_type == ci_get_data_type_id(db, "GZip") && content_encoding != NULL) { if (content_type && (strcasestr(content_type, "text/html") || strcasestr(content_type, "text/css") || strcasestr(content_type, "text/javascript"))) file_type = CI_HTML_DATA; } #endif ci_debug_printf(7, "The file type now is: %s,%s\n", ci_data_type_name(db, file_type), ci_data_type_descr(db, file_type)); #ifdef HAVE_ZLIB if (unzipped_buf) ci_buffer_free(unzipped_buf); #endif return file_type; } int ci_extend_filetype(struct ci_magics_db *db, ci_request_t *req, const char *buf, int len, int *iscompressed) { ci_headers_list_t *heads; if (ci_req_type(req) == ICAP_RESPMOD) heads = ci_http_response_headers(req); else heads = NULL; return extend_object_type(db, heads, buf, len, iscompressed); } struct ci_magics_db *ci_magic_db_load(const char *filename) { if (!_MAGIC_DB) return (_MAGIC_DB = ci_magics_db_build(filename)); if (ci_magics_db_file_add(_MAGIC_DB, filename)) return _MAGIC_DB; else return NULL; } void ci_magic_db_free() { if (_MAGIC_DB) ci_magics_db_release(_MAGIC_DB); _MAGIC_DB = NULL; } int ci_magic_req_data_type(ci_request_t *req, int *isencoded) { if (!_MAGIC_DB) return -1; if (!req->preview_data.used) return -1; if (req->preview_data_type <0 ) /*if there is not a cached value compute it*/ req->preview_data_type = ci_extend_filetype(_MAGIC_DB, req, req->preview_data.buf, req->preview_data.used, isencoded); return req->preview_data_type; } int ci_magic_data_type(const char *buf, int len) { if (!_MAGIC_DB) return -1; return ci_filetype(_MAGIC_DB, buf, len); } int ci_magic_data_type_ext(ci_headers_list_t *headers, const char *buf, int len, int *iscompressed) { if (!_MAGIC_DB) return -1; return extend_object_type(_MAGIC_DB, headers, buf, len, iscompressed); } int ci_magic_type_id(const char *name) { if (!_MAGIC_DB) return -1; return ci_get_data_type_id(_MAGIC_DB, name); } int ci_magic_group_id(const char *group) { if (!_MAGIC_DB) return -1; return ci_get_data_group_id(_MAGIC_DB, group); } int ci_magic_group_check(int type, int group) { if (!_MAGIC_DB) return 0; return ci_belongs_to_group(_MAGIC_DB, type, group); } int ci_magic_types_count() { return ci_magic_types_num(_MAGIC_DB); } int ci_magic_groups_count() { return ci_magic_groups_num(_MAGIC_DB); } char * ci_magic_type_name(int type) { if (!_MAGIC_DB || type <= 0 || type >= ci_magic_types_num(_MAGIC_DB)) return NULL; return ci_data_type_name(_MAGIC_DB, type); } char * ci_magic_type_descr(int type) { if (!_MAGIC_DB || type <= 0 || type >= ci_magic_types_num(_MAGIC_DB)) return NULL; return ci_data_type_descr(_MAGIC_DB, type); } char * ci_magic_group_name(int group) { if (!_MAGIC_DB || group <= 0 || group >= ci_magic_groups_num(_MAGIC_DB)) return NULL; return ci_data_group_name(_MAGIC_DB, group); } c_icap-0.5.6/registry.c0000664000175000017500000001150113371253152011677 00000000000000/* * Copyright (C) 2013 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "array.h" #include "debug.h" #include "registry.h" static ci_ptr_array_t *REGISTRIES = NULL; static int32_t REG_ITEMS_COUNT = 0; int ci_registry_create(const char *name) { /* Build space for 1024 different registries. It should be enough. */ if (!REGISTRIES) REGISTRIES = ci_ptr_array_new2(1024); else if (ci_ptr_array_search(REGISTRIES, name)) { ci_debug_printf(1, "Registry '%s' already exist!\n", name); return -1; } ci_ptr_dyn_array_t *registry = ci_ptr_dyn_array_new(1024); ci_ptr_array_add(REGISTRIES, name, registry); ci_debug_printf(4, "Registry '%s' added and is ready to store new registry entries\n", name); return (REGISTRIES->count - 1); /*Return the pos in the REGISTRIES array*/ } void ci_registry_clean() { ci_ptr_dyn_array_t *registry = NULL; char buf[1024]; if (!REGISTRIES) return; while ((registry = (ci_ptr_dyn_array_t *)ci_ptr_array_pop_value(REGISTRIES, buf, sizeof(buf))) != NULL) { ci_debug_printf(4, "Registry %s removed\n", buf); ci_ptr_dyn_array_destroy(registry); } ci_ptr_array_destroy(REGISTRIES); REGISTRIES = NULL; } int ci_registry_iterate(const char *name, void *data, int (*fn)(void *data, const char *label, const void *)) { const ci_ptr_dyn_array_t *registry = NULL; if (!REGISTRIES || (registry = ci_ptr_array_search(REGISTRIES, name)) == NULL) { ci_debug_printf(1, "Registry '%s' does not exist!\n", name); return 0; } ci_ptr_dyn_array_iterate(registry, data, fn); return 1; } int ci_registry_add_item(const char *name, const char *label, const void *obj) { ci_ptr_dyn_array_t *registry = NULL; if (!REGISTRIES || (registry = ci_ptr_array_search(REGISTRIES, name)) == NULL) { ci_debug_printf(3, "Registry '%s' does not exist create it\n", name); if (ci_registry_create(name) < 0) return 0; registry = ci_ptr_array_search(REGISTRIES, name); } if (ci_ptr_dyn_array_add(registry, label, (void *)obj)) return ++REG_ITEMS_COUNT; return 0; } const void * ci_registry_get_item(const char *name, const char *label) { ci_ptr_dyn_array_t *registry = NULL; if (!REGISTRIES || (registry = ci_ptr_array_search(REGISTRIES, name)) == NULL) { ci_debug_printf(1, "Registry '%s' does not exist!\n", name); return NULL; } return ci_ptr_dyn_array_search(registry, label); } struct check_reg_data { const char *name; int found; int count; }; static int check_reg(void *data, const char *name, const void *val) { struct check_reg_data *rdata = (struct check_reg_data *) data; rdata->count++; if (strcmp(rdata->name, name) == 0) { rdata->found = 1; return 1; /*Found the registry, return !=0 to stop iteration*/ } return 0; } int ci_registry_get_id(const char *name) { struct check_reg_data rdata; rdata.name = name; rdata.found = 0; rdata.count = 0; if (REGISTRIES) ci_ptr_array_iterate(REGISTRIES, &rdata, check_reg); if (rdata.found) return (rdata.count - 1); else return -1; } int ci_registry_id_iterate(int reg_id, void *data, int (*fn)(void *data, const char *label, const void *)) { const ci_ptr_dyn_array_t *registry = NULL; const ci_array_item_t *ai; if (!REGISTRIES || (ai = ci_ptr_array_get_item(REGISTRIES, reg_id)) == NULL || (registry = ai->value) == NULL) { ci_debug_printf(1, "Registry with id='%d' does not exist!\n", reg_id); return 0; } ci_ptr_dyn_array_iterate(registry, data, fn); return 1; } const void * ci_registry_id_get_item(int reg_id, const char *label) { const ci_ptr_dyn_array_t *registry = NULL; const ci_array_item_t *ai; if (!REGISTRIES || (ai = ci_ptr_array_get_item(REGISTRIES, reg_id)) == NULL || (registry = ai->value) == NULL) { ci_debug_printf(1, "Registry with id='%d' does not exist!\n", reg_id); return 0; } return ci_ptr_dyn_array_search(registry, label); } c_icap-0.5.6/config.guess0000755000175000017500000012637313570504056012222 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-24' # This file 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 3 of the License, 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval "$set_cc_for_build" cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval "$set_cc_for_build" SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ [ "$TARGET_BINARY_INTERFACE"x = x ] then echo m88k-dg-dgux"$UNAME_RELEASE" else echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "$HP_ARCH" = "" ]; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ "$HP_ARCH" = hppa2.0w ] then eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) if objdump -f /bin/sh | grep -q elf32-x86-64; then echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 else echo "$UNAME_MACHINE"-pc-linux-"$LIBC" fi exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: c_icap-0.5.6/services/0000775000175000017500000000000013570504160011567 500000000000000c_icap-0.5.6/services/Makefile.in0000664000175000017500000005023013570504057013561 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ #SUBDIRS = url_check echo clamav #SUBDIRS = @BUILD_SERVICES@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = services ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/autoconf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BDB_ADD_FLAG = @BDB_ADD_FLAG@ BDB_ADD_LDADD = @BDB_ADD_LDADD@ BDB_LNDIR_LDADD = @BDB_LNDIR_LDADD@ BROTLI_ADD_FLAG = @BROTLI_ADD_FLAG@ BROTLI_ADD_LDADD = @BROTLI_ADD_LDADD@ BROTLI_LNDIR_LDADD = @BROTLI_LNDIR_LDADD@ BZLIB_ADD_FLAG = @BZLIB_ADD_FLAG@ BZLIB_ADD_LDADD = @BZLIB_ADD_LDADD@ BZLIB_LNDIR_LDADD = @BZLIB_LNDIR_LDADD@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CICAPLIB_VERSION = @CICAPLIB_VERSION@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ C_ICAP_HEX_VERSION = @C_ICAP_HEX_VERSION@ DEFINE_INT64 = @DEFINE_INT64@ DEFINE_INT8 = @DEFINE_INT8@ DEFINE_OFF_T = @DEFINE_OFF_T@ DEFINE_SIZE_OFF_T = @DEFINE_SIZE_OFF_T@ DEFINE_SIZE_T = @DEFINE_SIZE_T@ DEFINE_SIZE_VOID_P = @DEFINE_SIZE_VOID_P@ DEFINE_UINT64 = @DEFINE_UINT64@ DEFINE_UINT8 = @DEFINE_UINT8@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_ADD_FLAG = @DL_ADD_FLAG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTTYPES_H = @INTTYPES_H@ INVISIBILITY_CFLAG = @INVISIBILITY_CFLAG@ LD = @LD@ LDAP_ADD_FLAG = @LDAP_ADD_FLAG@ LDAP_ADD_LDADD = @LDAP_ADD_LDADD@ LDAP_LNDIR_LDADD = @LDAP_LNDIR_LDADD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEMCACHED_ADD_FLAG = @MEMCACHED_ADD_FLAG@ MEMCACHED_ADD_LDADD = @MEMCACHED_ADD_LDADD@ MEMCACHED_LNDIR_LDADD = @MEMCACHED_LNDIR_LDADD@ MKDIR_P = @MKDIR_P@ MODULES_CFLAGS = @MODULES_CFLAGS@ MODULES_LIBADD = @MODULES_LIBADD@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_ADD_FLAG = @OPENSSL_ADD_FLAG@ OPENSSL_ADD_LDADD = @OPENSSL_ADD_LDADD@ OPENSSL_LNDIR_LDADD = @OPENSSL_LNDIR_LDADD@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_ADD_FLAG = @PCRE_ADD_FLAG@ PCRE_ADD_LDADD = @PCRE_ADD_LDADD@ PCRE_LNDIR_LDADD = @PCRE_LNDIR_LDADD@ POSIX_FILE_LOCK = @POSIX_FILE_LOCK@ POSIX_MAPPED_FILES = @POSIX_MAPPED_FILES@ POSIX_SEMAPHORES = @POSIX_SEMAPHORES@ POSIX_SHARED_MEM = @POSIX_SHARED_MEM@ PTHREADS_RWLOCK = @PTHREADS_RWLOCK@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSV_IPC = @SYSV_IPC@ SYS_TYPES_H = @SYS_TYPES_H@ THREADS_LDADD = @THREADS_LDADD@ THREADS_LDFLAGS = @THREADS_LDFLAGS@ USE_COMPAT = @USE_COMPAT@ USE_IPV6 = @USE_IPV6@ USE_OPENSSL = @USE_OPENSSL@ USE_POLL = @USE_POLL@ USE_REGEX = @USE_REGEX@ VERSION = @VERSION@ VISIBILITY_ATTR = @VISIBILITY_ATTR@ ZLIB_ADD_FLAG = @ZLIB_ADD_FLAG@ ZLIB_ADD_LDADD = @ZLIB_ADD_LDADD@ ZLIB_LNDIR_LDADD = @ZLIB_LNDIR_LDADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen_bin = @doxygen_bin@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ has_doxygen = @has_doxygen@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perlccflags = @perlccflags@ perlcore = @perlcore@ perlldflags = @perlldflags@ perllib = @perllib@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = echo ex-206 all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu services/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu services/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile #SUBDIRS += url_check #if USECLAMAV #SUBDIRS += clamav #endif #if USEPERL #SUBDIRS += a_perl #endif # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: c_icap-0.5.6/services/Makefile.am0000664000175000017500000000027513371253152013550 00000000000000 #SUBDIRS = url_check echo clamav #SUBDIRS = @BUILD_SERVICES@ SUBDIRS = echo ex-206 #SUBDIRS += url_check #if USECLAMAV #SUBDIRS += clamav #endif #if USEPERL #SUBDIRS += a_perl #endif c_icap-0.5.6/services/ex-206/0000775000175000017500000000000013570504160012510 500000000000000c_icap-0.5.6/services/ex-206/Makefile.in0000664000175000017500000005642513570504057014516 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = services/ex-206 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/autoconf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) srv_ex206_la_DEPENDENCIES = am_srv_ex206_la_OBJECTS = srv_ex206_la-srv_ex206.lo srv_ex206_la_OBJECTS = $(am_srv_ex206_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = srv_ex206_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(srv_ex206_la_CFLAGS) \ $(CFLAGS) $(srv_ex206_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(srv_ex206_la_SOURCES) DIST_SOURCES = $(srv_ex206_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BDB_ADD_FLAG = @BDB_ADD_FLAG@ BDB_ADD_LDADD = @BDB_ADD_LDADD@ BDB_LNDIR_LDADD = @BDB_LNDIR_LDADD@ BROTLI_ADD_FLAG = @BROTLI_ADD_FLAG@ BROTLI_ADD_LDADD = @BROTLI_ADD_LDADD@ BROTLI_LNDIR_LDADD = @BROTLI_LNDIR_LDADD@ BZLIB_ADD_FLAG = @BZLIB_ADD_FLAG@ BZLIB_ADD_LDADD = @BZLIB_ADD_LDADD@ BZLIB_LNDIR_LDADD = @BZLIB_LNDIR_LDADD@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CICAPLIB_VERSION = @CICAPLIB_VERSION@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ C_ICAP_HEX_VERSION = @C_ICAP_HEX_VERSION@ DEFINE_INT64 = @DEFINE_INT64@ DEFINE_INT8 = @DEFINE_INT8@ DEFINE_OFF_T = @DEFINE_OFF_T@ DEFINE_SIZE_OFF_T = @DEFINE_SIZE_OFF_T@ DEFINE_SIZE_T = @DEFINE_SIZE_T@ DEFINE_SIZE_VOID_P = @DEFINE_SIZE_VOID_P@ DEFINE_UINT64 = @DEFINE_UINT64@ DEFINE_UINT8 = @DEFINE_UINT8@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_ADD_FLAG = @DL_ADD_FLAG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTTYPES_H = @INTTYPES_H@ INVISIBILITY_CFLAG = @INVISIBILITY_CFLAG@ LD = @LD@ LDAP_ADD_FLAG = @LDAP_ADD_FLAG@ LDAP_ADD_LDADD = @LDAP_ADD_LDADD@ LDAP_LNDIR_LDADD = @LDAP_LNDIR_LDADD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEMCACHED_ADD_FLAG = @MEMCACHED_ADD_FLAG@ MEMCACHED_ADD_LDADD = @MEMCACHED_ADD_LDADD@ MEMCACHED_LNDIR_LDADD = @MEMCACHED_LNDIR_LDADD@ MKDIR_P = @MKDIR_P@ MODULES_CFLAGS = @MODULES_CFLAGS@ MODULES_LIBADD = @MODULES_LIBADD@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_ADD_FLAG = @OPENSSL_ADD_FLAG@ OPENSSL_ADD_LDADD = @OPENSSL_ADD_LDADD@ OPENSSL_LNDIR_LDADD = @OPENSSL_LNDIR_LDADD@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_ADD_FLAG = @PCRE_ADD_FLAG@ PCRE_ADD_LDADD = @PCRE_ADD_LDADD@ PCRE_LNDIR_LDADD = @PCRE_LNDIR_LDADD@ POSIX_FILE_LOCK = @POSIX_FILE_LOCK@ POSIX_MAPPED_FILES = @POSIX_MAPPED_FILES@ POSIX_SEMAPHORES = @POSIX_SEMAPHORES@ POSIX_SHARED_MEM = @POSIX_SHARED_MEM@ PTHREADS_RWLOCK = @PTHREADS_RWLOCK@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSV_IPC = @SYSV_IPC@ SYS_TYPES_H = @SYS_TYPES_H@ THREADS_LDADD = @THREADS_LDADD@ THREADS_LDFLAGS = @THREADS_LDFLAGS@ USE_COMPAT = @USE_COMPAT@ USE_IPV6 = @USE_IPV6@ USE_OPENSSL = @USE_OPENSSL@ USE_POLL = @USE_POLL@ USE_REGEX = @USE_REGEX@ VERSION = @VERSION@ VISIBILITY_ATTR = @VISIBILITY_ATTR@ ZLIB_ADD_FLAG = @ZLIB_ADD_FLAG@ ZLIB_ADD_LDADD = @ZLIB_ADD_LDADD@ ZLIB_LNDIR_LDADD = @ZLIB_LNDIR_LDADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen_bin = @doxygen_bin@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ has_doxygen = @has_doxygen@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perlccflags = @perlccflags@ perlcore = @perlcore@ perlldflags = @perlldflags@ perllib = @perllib@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkglib_LTLIBRARIES = srv_ex206.la AM_CPPFLAGS = -I$(top_srcdir)/ -I$(top_srcdir)/include/ -I$(top_builddir)/include/ srv_ex206_la_LIBADD = @MODULES_LIBADD@ srv_ex206_la_CFLAGS = @MODULES_CFLAGS@ @OPENSSL_ADD_FLAG@ srv_ex206_la_LDFLAGS = -module -avoid-version srv_ex206_la_SOURCES = srv_ex206.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu services/ex-206/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu services/ex-206/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } srv_ex206.la: $(srv_ex206_la_OBJECTS) $(srv_ex206_la_DEPENDENCIES) $(EXTRA_srv_ex206_la_DEPENDENCIES) $(AM_V_CCLD)$(srv_ex206_la_LINK) -rpath $(pkglibdir) $(srv_ex206_la_OBJECTS) $(srv_ex206_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srv_ex206_la-srv_ex206.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< srv_ex206_la-srv_ex206.lo: srv_ex206.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srv_ex206_la_CFLAGS) $(CFLAGS) -MT srv_ex206_la-srv_ex206.lo -MD -MP -MF $(DEPDIR)/srv_ex206_la-srv_ex206.Tpo -c -o srv_ex206_la-srv_ex206.lo `test -f 'srv_ex206.c' || echo '$(srcdir)/'`srv_ex206.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/srv_ex206_la-srv_ex206.Tpo $(DEPDIR)/srv_ex206_la-srv_ex206.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srv_ex206.c' object='srv_ex206_la-srv_ex206.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srv_ex206_la_CFLAGS) $(CFLAGS) -c -o srv_ex206_la-srv_ex206.lo `test -f 'srv_ex206.c' || echo '$(srcdir)/'`srv_ex206.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-pkglibLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: c_icap-0.5.6/services/ex-206/Makefile.am0000664000175000017500000000044613371253152014471 00000000000000 pkglib_LTLIBRARIES=srv_ex206.la AM_CPPFLAGS=-I$(top_srcdir)/ -I$(top_srcdir)/include/ -I$(top_builddir)/include/ srv_ex206_la_LIBADD = @MODULES_LIBADD@ srv_ex206_la_CFLAGS= @MODULES_CFLAGS@ @OPENSSL_ADD_FLAG@ srv_ex206_la_LDFLAGS= -module -avoid-version srv_ex206_la_SOURCES = srv_ex206.c c_icap-0.5.6/services/ex-206/srv_ex206.c0000664000175000017500000001724313371253152014342 00000000000000/* * Copyright (C) 2011 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "service.h" #include "header.h" #include "body.h" #include "simple_api.h" #include "debug.h" int ex206_init_service(ci_service_xdata_t * srv_xdata, struct ci_server_conf *server_conf); int ex206_check_preview_handler(char *preview_data, int preview_data_len, ci_request_t *); int ex206_end_of_data_handler(ci_request_t * req); void *ex206_init_request_data(ci_request_t * req); void ex206_close_service(); void ex206_release_request_data(void *data); int ex206_io(char *wbuf, int *wlen, char *rbuf, int *rlen, int iseof, ci_request_t * req); CI_DECLARE_MOD_DATA ci_service_module_t service = { "ex206", /* mod_name, The module name */ "Ex206 demo service", /* mod_short_descr, Module short description */ ICAP_RESPMOD | ICAP_REQMOD, /* mod_type, The service type is responce or request modification */ ex206_init_service, /* mod_init_service. Service initialization */ NULL, /* post_init_service. Service initialization after c-icap configured. Not used here */ ex206_close_service, /* mod_close_service. Called when service shutdowns. */ ex206_init_request_data, /* mod_init_request_data */ ex206_release_request_data, /* mod_release_request_data */ ex206_check_preview_handler, /* mod_check_preview_handler */ ex206_end_of_data_handler, /* mod_end_of_data_handler */ ex206_io, /* mod_service_io */ NULL, NULL }; /* The ex206_req_data structure will store the data required to serve an ICAP request. */ struct ex206_req_data { ci_membuf_t *body; int script_size; }; /* This function will be called when the service loaded */ int ex206_init_service(ci_service_xdata_t * srv_xdata, struct ci_server_conf *server_conf) { ci_debug_printf(5, "Initialization of ex206 module......\n"); /*Tell to the icap clients that we can support up to 1024 size of preview data*/ ci_service_set_preview(srv_xdata, 1024); /*Tell to the icap clients that we support 204 responses*/ ci_service_enable_204(srv_xdata); /*Tell to the icap clients that we support 206 responses*/ ci_service_enable_206(srv_xdata); /*Tell to the icap clients to send preview data for all files*/ ci_service_set_transfer_preview(srv_xdata, "*"); return CI_OK; } /* This function will be called when the service shutdown */ void ex206_close_service() { ci_debug_printf(5,"Service shutdown!\n"); /*Nothing to do*/ } /*This function will be executed when a new request for ex206 service arrives. This function will initialize the required structures and data to serve the request. */ void *ex206_init_request_data(ci_request_t * req) { struct ex206_req_data *ex206_data; /*Allocate memory fot the ex206_data*/ ex206_data = malloc(sizeof(struct ex206_req_data)); ex206_data->body = NULL; ex206_data->script_size = 0; /*Return to the c-icap server the allocated data*/ return ex206_data; } /*This function will be executed after the request served to release allocated data*/ void ex206_release_request_data(void *data) { /*The data points to the ex206_req_data struct we allocated in function ex206_init_service */ struct ex206_req_data *ex206_data = (struct ex206_req_data *)data; free(ex206_data); } int ex206_check_preview_handler(char *preview_data, int preview_data_len, ci_request_t * req) { ci_off_t content_len; const char *script = "\n\n\n"; const char *p, *e; char buf[256]; int use_origin = 0; int body_altered = 0; /*Get the ex206_req_data we allocated using the ex206_init_service function*/ struct ex206_req_data *ex206_data = ci_service_data(req); content_len = ci_http_content_length(req); ci_debug_printf(9, "We expect to read :%" PRINTF_OFF_T " body data\n", (CAST_OFF_T) content_len); if (!ci_req_allow206(req)) /*The client does not support allow 206, return allow204*/ return CI_MOD_ALLOW204; ci_debug_printf(8, "Ex206 service will process the request\n"); if (preview_data_len) { if ((p=strncasestr(preview_data, "", preview_data_len - (p-preview_data))) != NULL) { if ((ex206_data->body = ci_membuf_new()) == NULL) return CI_ERROR; /* Copy body data untill the tag*/ ci_membuf_write(ex206_data->body, preview_data, (e - preview_data+1), 0); /* Copy the script */ ci_membuf_write(ex206_data->body, script, strlen(script), 1); ex206_data->script_size = strlen(script); /*Use only the original body after the tag */ use_origin = e - preview_data + 1; ci_request_206_origin_body(req, use_origin); if (content_len > 0) { // The content length increased because the script was added. content_len += ex206_data->script_size; ci_http_response_remove_header(req, "Content-Length"); char head[512]; snprintf(head, 512, "Content-Length: %" PRINTF_OFF_T, (CAST_OFF_T) content_len); ci_http_response_add_header(req, head); } } else //Else no HTML tag use all of the original body data ci_request_206_origin_body(req, 0); } else //Use all of the original body data ci_request_206_origin_body(req, 0); sprintf(buf, "X-Ex206-Service: %s", (body_altered ? "Modified" : "Unmodified")); if (req->type == ICAP_REQMOD) ci_http_request_add_header(req, buf); else if (req->type == ICAP_RESPMOD) ci_http_response_add_header(req, buf); return CI_MOD_ALLOW206; } /* This function will called if we returned CI_MOD_CONTINUE in ex206_check_preview_handler function, after we read all the data from the ICAP client*/ int ex206_end_of_data_handler(ci_request_t * req) { /*struct ex206_req_data *ex206_data = ci_service_data(req);*/ return CI_MOD_DONE; } int ex206_io(char *wbuf, int *wlen, char *rbuf, int *rlen, int iseof, ci_request_t * req) { int ret; struct ex206_req_data *ex206_data = ci_service_data(req); ret = CI_OK; /*write the data read from icap_client to the ex206_data->body*/ if (rlen && rbuf) { /*Client should not send more data here. Just ignore for now*/ } if (!ex206_data->body) { *wlen = CI_EOF; } else if (wbuf && wlen) { /*read some data from the ex206_data->body and put them to the write buffer to be send to the ICAP client*/ *wlen = ci_membuf_read(ex206_data->body, wbuf, *wlen); } return ret; } c_icap-0.5.6/services/echo/0000775000175000017500000000000013570504160012505 500000000000000c_icap-0.5.6/services/echo/srv_echo.c0000664000175000017500000002121313541163124014377 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "service.h" #include "header.h" #include "body.h" #include "simple_api.h" #include "debug.h" int echo_init_service(ci_service_xdata_t * srv_xdata, struct ci_server_conf *server_conf); int echo_check_preview_handler(char *preview_data, int preview_data_len, ci_request_t *); int echo_end_of_data_handler(ci_request_t * req); void *echo_init_request_data(ci_request_t * req); void echo_close_service(); void echo_release_request_data(void *data); int echo_io(char *wbuf, int *wlen, char *rbuf, int *rlen, int iseof, ci_request_t * req); CI_DECLARE_MOD_DATA ci_service_module_t service = { "echo", /* mod_name, The module name */ "Echo demo service", /* mod_short_descr, Module short description */ ICAP_RESPMOD | ICAP_REQMOD, /* mod_type, The service type is responce or request modification */ echo_init_service, /* mod_init_service. Service initialization */ NULL, /* post_init_service. Service initialization after c-icap configured. Not used here */ echo_close_service, /* mod_close_service. Called when service shutdowns. */ echo_init_request_data, /* mod_init_request_data */ echo_release_request_data, /* mod_release_request_data */ echo_check_preview_handler, /* mod_check_preview_handler */ echo_end_of_data_handler, /* mod_end_of_data_handler */ echo_io, /* mod_service_io */ NULL, NULL }; /* The echo_req_data structure will store the data required to serve an ICAP request. */ struct echo_req_data { /*the body data*/ ci_ring_buf_t *body; /*flag for marking the eof*/ int eof; }; /* This function will be called when the service loaded */ int echo_init_service(ci_service_xdata_t * srv_xdata, struct ci_server_conf *server_conf) { ci_debug_printf(5, "Initialization of echo module......\n"); /*Tell to the icap clients that we can support up to 1024 size of preview data*/ ci_service_set_preview(srv_xdata, 1024); /*Tell to the icap clients that we support 204 responses*/ ci_service_enable_204(srv_xdata); /*Tell to the icap clients to send preview data for all files*/ ci_service_set_transfer_preview(srv_xdata, "*"); /*Tell to the icap clients that we want the X-Authenticated-User and X-Authenticated-Groups headers which contains the username and the groups in which belongs. */ ci_service_set_xopts(srv_xdata, CI_XAUTHENTICATEDUSER|CI_XAUTHENTICATEDGROUPS); return CI_OK; } /* This function will be called when the service shutdown */ void echo_close_service() { ci_debug_printf(5,"Service shutdown!\n"); /*Nothing to do*/ } /*This function will be executed when a new request for echo service arrives. This function will initialize the required structures and data to serve the request. */ void *echo_init_request_data(ci_request_t * req) { struct echo_req_data *echo_data; /*Allocate memory fot the echo_data*/ echo_data = malloc(sizeof(struct echo_req_data)); if (!echo_data) { ci_debug_printf(1, "Memory allocation failed inside echo_init_request_data!\n"); return NULL; } /*If the ICAP request encuspulates a HTTP objects which contains body data and not only headers allocate a ci_cached_file_t object to store the body data. */ if (ci_req_hasbody(req)) echo_data->body = ci_ring_buf_new(4096); else echo_data->body = NULL; echo_data->eof = 0; /*Return to the c-icap server the allocated data*/ return echo_data; } /*This function will be executed after the request served to release allocated data*/ void echo_release_request_data(void *data) { /*The data points to the echo_req_data struct we allocated in function echo_init_service */ struct echo_req_data *echo_data = (struct echo_req_data *)data; /*if we had body data, release the related allocated data*/ if (echo_data->body) ci_ring_buf_destroy(echo_data->body); free(echo_data); } static int whattodo = 0; int echo_check_preview_handler(char *preview_data, int preview_data_len, ci_request_t * req) { ci_off_t content_len; /*Get the echo_req_data we allocated using the echo_init_service function*/ struct echo_req_data *echo_data = ci_service_data(req); /*If there are is a Content-Length header in encupsulated Http object read it and display a debug message (used here only for debuging purposes)*/ content_len = ci_http_content_length(req); ci_debug_printf(9, "We expect to read :%" PRINTF_OFF_T " body data\n", (CAST_OFF_T) content_len); /*If there are not body data in HTTP encapsulated object but only headers respond with Allow204 (no modification required) and terminate here the ICAP transaction */ if (!ci_req_hasbody(req)) return CI_MOD_ALLOW204; /*Unlock the request body data so the c-icap server can send data before all body data has received */ ci_req_unlock_data(req); /*If there are not preview data tell to the client to continue sending data (http object modification required). */ if (!preview_data_len) return CI_MOD_CONTINUE; /* In most real world services we should decide here if we must modify/process or not the encupsulated HTTP object and return CI_MOD_CONTINUE or CI_MOD_ALLOW204 respectively. The decision can be taken examining the http object headers or/and the preview_data buffer. In this example service we just use the whattodo static variable to decide if we want to process or not the HTTP object. */ if (whattodo == 0) { whattodo = 1; ci_debug_printf(8, "Echo service will process the request\n"); /*if we have preview data and we want to proceed with the request processing we should store the preview data. There are cases where all the body data of the encapsulated HTTP object included in preview data. Someone can use the ci_req_hasalldata macro to identify these cases*/ if (preview_data_len) { ci_ring_buf_write(echo_data->body, preview_data, preview_data_len); echo_data->eof = ci_req_hasalldata(req); } return CI_MOD_CONTINUE; } else { whattodo = 0; /*Nothing to do just return an allow204 (No modification) to terminate here the ICAP transaction */ ci_debug_printf(8, "Allow 204...\n"); return CI_MOD_ALLOW204; } } /* This function will called if we returned CI_MOD_CONTINUE in echo_check_preview_handler function, after we read all the data from the ICAP client*/ int echo_end_of_data_handler(ci_request_t * req) { struct echo_req_data *echo_data = ci_service_data(req); /*mark the eof*/ echo_data->eof = 1; /*and return CI_MOD_DONE */ return CI_MOD_DONE; } /* This function will called if we returned CI_MOD_CONTINUE in echo_check_preview_handler function, when new data arrived from the ICAP client and when the ICAP client is ready to get data. */ int echo_io(char *wbuf, int *wlen, char *rbuf, int *rlen, int iseof, ci_request_t * req) { int ret; struct echo_req_data *echo_data = ci_service_data(req); ret = CI_OK; /*write the data read from icap_client to the echo_data->body*/ if (rlen && rbuf) { *rlen = ci_ring_buf_write(echo_data->body, rbuf, *rlen); if (*rlen < 0) ret = CI_ERROR; } /*read some data from the echo_data->body and put them to the write buffer to be send to the ICAP client*/ if (wbuf && wlen) { *wlen = ci_ring_buf_read(echo_data->body, wbuf, *wlen); if (*wlen == 0 && echo_data->eof == 1) *wlen = CI_EOF; } return ret; } c_icap-0.5.6/services/echo/Makefile.in0000664000175000017500000005640413570504057014510 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = services/echo ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/autoconf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) srv_echo_la_DEPENDENCIES = am_srv_echo_la_OBJECTS = srv_echo_la-srv_echo.lo srv_echo_la_OBJECTS = $(am_srv_echo_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = srv_echo_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(srv_echo_la_CFLAGS) \ $(CFLAGS) $(srv_echo_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(srv_echo_la_SOURCES) DIST_SOURCES = $(srv_echo_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BDB_ADD_FLAG = @BDB_ADD_FLAG@ BDB_ADD_LDADD = @BDB_ADD_LDADD@ BDB_LNDIR_LDADD = @BDB_LNDIR_LDADD@ BROTLI_ADD_FLAG = @BROTLI_ADD_FLAG@ BROTLI_ADD_LDADD = @BROTLI_ADD_LDADD@ BROTLI_LNDIR_LDADD = @BROTLI_LNDIR_LDADD@ BZLIB_ADD_FLAG = @BZLIB_ADD_FLAG@ BZLIB_ADD_LDADD = @BZLIB_ADD_LDADD@ BZLIB_LNDIR_LDADD = @BZLIB_LNDIR_LDADD@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CICAPLIB_VERSION = @CICAPLIB_VERSION@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ C_ICAP_HEX_VERSION = @C_ICAP_HEX_VERSION@ DEFINE_INT64 = @DEFINE_INT64@ DEFINE_INT8 = @DEFINE_INT8@ DEFINE_OFF_T = @DEFINE_OFF_T@ DEFINE_SIZE_OFF_T = @DEFINE_SIZE_OFF_T@ DEFINE_SIZE_T = @DEFINE_SIZE_T@ DEFINE_SIZE_VOID_P = @DEFINE_SIZE_VOID_P@ DEFINE_UINT64 = @DEFINE_UINT64@ DEFINE_UINT8 = @DEFINE_UINT8@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_ADD_FLAG = @DL_ADD_FLAG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTTYPES_H = @INTTYPES_H@ INVISIBILITY_CFLAG = @INVISIBILITY_CFLAG@ LD = @LD@ LDAP_ADD_FLAG = @LDAP_ADD_FLAG@ LDAP_ADD_LDADD = @LDAP_ADD_LDADD@ LDAP_LNDIR_LDADD = @LDAP_LNDIR_LDADD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEMCACHED_ADD_FLAG = @MEMCACHED_ADD_FLAG@ MEMCACHED_ADD_LDADD = @MEMCACHED_ADD_LDADD@ MEMCACHED_LNDIR_LDADD = @MEMCACHED_LNDIR_LDADD@ MKDIR_P = @MKDIR_P@ MODULES_CFLAGS = @MODULES_CFLAGS@ MODULES_LIBADD = @MODULES_LIBADD@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_ADD_FLAG = @OPENSSL_ADD_FLAG@ OPENSSL_ADD_LDADD = @OPENSSL_ADD_LDADD@ OPENSSL_LNDIR_LDADD = @OPENSSL_LNDIR_LDADD@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_ADD_FLAG = @PCRE_ADD_FLAG@ PCRE_ADD_LDADD = @PCRE_ADD_LDADD@ PCRE_LNDIR_LDADD = @PCRE_LNDIR_LDADD@ POSIX_FILE_LOCK = @POSIX_FILE_LOCK@ POSIX_MAPPED_FILES = @POSIX_MAPPED_FILES@ POSIX_SEMAPHORES = @POSIX_SEMAPHORES@ POSIX_SHARED_MEM = @POSIX_SHARED_MEM@ PTHREADS_RWLOCK = @PTHREADS_RWLOCK@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSV_IPC = @SYSV_IPC@ SYS_TYPES_H = @SYS_TYPES_H@ THREADS_LDADD = @THREADS_LDADD@ THREADS_LDFLAGS = @THREADS_LDFLAGS@ USE_COMPAT = @USE_COMPAT@ USE_IPV6 = @USE_IPV6@ USE_OPENSSL = @USE_OPENSSL@ USE_POLL = @USE_POLL@ USE_REGEX = @USE_REGEX@ VERSION = @VERSION@ VISIBILITY_ATTR = @VISIBILITY_ATTR@ ZLIB_ADD_FLAG = @ZLIB_ADD_FLAG@ ZLIB_ADD_LDADD = @ZLIB_ADD_LDADD@ ZLIB_LNDIR_LDADD = @ZLIB_LNDIR_LDADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen_bin = @doxygen_bin@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ has_doxygen = @has_doxygen@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perlccflags = @perlccflags@ perlcore = @perlcore@ perlldflags = @perlldflags@ perllib = @perllib@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkglib_LTLIBRARIES = srv_echo.la AM_CPPFLAGS = -I$(top_srcdir)/ -I$(top_srcdir)/include/ -I$(top_builddir)/include/ srv_echo_la_LIBADD = @MODULES_LIBADD@ srv_echo_la_CFLAGS = @MODULES_CFLAGS@ @OPENSSL_ADD_FLAG@ srv_echo_la_LDFLAGS = -module -avoid-version srv_echo_la_SOURCES = srv_echo.c EXTRA_DIST = makefile.w32 srv_echo.def all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu services/echo/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu services/echo/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } srv_echo.la: $(srv_echo_la_OBJECTS) $(srv_echo_la_DEPENDENCIES) $(EXTRA_srv_echo_la_DEPENDENCIES) $(AM_V_CCLD)$(srv_echo_la_LINK) -rpath $(pkglibdir) $(srv_echo_la_OBJECTS) $(srv_echo_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srv_echo_la-srv_echo.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< srv_echo_la-srv_echo.lo: srv_echo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srv_echo_la_CFLAGS) $(CFLAGS) -MT srv_echo_la-srv_echo.lo -MD -MP -MF $(DEPDIR)/srv_echo_la-srv_echo.Tpo -c -o srv_echo_la-srv_echo.lo `test -f 'srv_echo.c' || echo '$(srcdir)/'`srv_echo.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/srv_echo_la-srv_echo.Tpo $(DEPDIR)/srv_echo_la-srv_echo.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srv_echo.c' object='srv_echo_la-srv_echo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srv_echo_la_CFLAGS) $(CFLAGS) -c -o srv_echo_la-srv_echo.lo `test -f 'srv_echo.c' || echo '$(srcdir)/'`srv_echo.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-pkglibLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: c_icap-0.5.6/services/echo/Makefile.am0000664000175000017500000000050713371253152014464 00000000000000 pkglib_LTLIBRARIES=srv_echo.la AM_CPPFLAGS=-I$(top_srcdir)/ -I$(top_srcdir)/include/ -I$(top_builddir)/include/ srv_echo_la_LIBADD = @MODULES_LIBADD@ srv_echo_la_CFLAGS= @MODULES_CFLAGS@ @OPENSSL_ADD_FLAG@ srv_echo_la_LDFLAGS= -module -avoid-version srv_echo_la_SOURCES = srv_echo.c EXTRA_DIST= makefile.w32 srv_echo.def c_icap-0.5.6/services/echo/makefile.w320000664000175000017500000000051613371253152014542 00000000000000!include all: srv_echo.Dll .c.obj: $(cc) /I..\..\include /I..\..\ $(cdebug) $(cflags) $(cvarsdll) -I. -DCI_BUILD_MODULE -DUNICODE $*.c srv_echo.Dll: srv_echo.obj $(link) $(linkdebug) $(dlllflags) /LIBPATH:..\..\ c_icap.lib -def:srv_echo.def -out:$*.Dll $** $(DLL_ENTRY) $(EXTRA_LIBS) clean: del *.obj *.exe *.lib c_icap-0.5.6/services/echo/srv_echo.def0000664000175000017500000000000113371253152014705 00000000000000 c_icap-0.5.6/debug.c0000664000175000017500000000514613371253152011125 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include #include "debug.h" int CI_DEBUG_LEVEL = 1; int CI_DEBUG_STDOUT = 0; #ifndef _WIN32 void (*__log_error) (void *req, const char *format, ...) = NULL; #else void (*__vlog_error) (void *req, const char *format, va_list ap) = NULL; void __ldebug_printf(int i, const char *format, ...) { va_list ap; if (i <= CI_DEBUG_LEVEL) { va_start(ap, format); if (__vlog_error) { (*__vlog_error) (NULL, format, ap); } if (CI_DEBUG_STDOUT) vprintf(format, ap); va_end(ap); } } #endif /* void debug_print_request(ci_request_t *req){ int i,j; ci_debug_printf(1,"Request Type :\n"); if(req->type>=0){ ci_debug_printf(1," Requested: %s\n Server: %s\n Service: %s\n", ci_method_string(req->type), req->req_server, req->service); if(req->args){ ci_debug_printf(1," Args: %s\n",req->args); } else{ ci_debug_printf(1,"\n"); } } else{ ci_debug_printf(1," No Method\n"); } ci_debug_printf(1,"\n\nHEADERS : \n"); for(i = 0; i < req->head->used; i++){ ci_debug_printf(1," %s\n",req->head->headers[i]); } ci_debug_printf(1,"\n\nEncapsulated Entities: \n"); i = 0; while(req->entities[i] != NULL){ ci_debug_printf(1,"\t %s header at %d\n", ci_encaps_entity_string(req->entities[i]->type),req->entities[i]->start); if(req->entities[i]->typeentities[i]->entity; ci_debug_printf(1,"\t\t HEADERS : \n"); for(j=0;jused;j++){ ci_debug_printf(1,"\t\t\t%d. %s\n",j,h->headers[j]); } } i++; } } */ c_icap-0.5.6/Makefile.in0000664000175000017500000034530213570504057011745 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = c-icap$(EXEEXT) @USE_OPENSSL_TRUE@am__append_1 = openssl/net_io_ssl.c @USE_REGEX_TRUE@am__append_2 = regex.c @USE_RPATH_TRUE@am__append_3 = -rpath @libdir@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(pkginclude_HEADERS) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = autoconf.h CONFIG_CLEAN_FILES = include/c-icap-conf.h CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libicapapi_la_DEPENDENCIES = am__libicapapi_la_SOURCES_DIST = header.c body.c decode.c encode.c \ simple_api.c request_common.c filetype.c debug.c cfg_lib.c \ mem.c service_lib.c cache.c lookup_table.c lookup_file_table.c \ hash.c txt_format.c stats.c types_ops.c acl.c txtTemplate.c \ array.c registry.c md5.c net_io.c util.c os/unix/net_io.c \ os/unix/proc_mutex.c os/unix/shared_mem.c os/unix/threads.c \ os/unix/utilfunc.c os/unix/dlib.c openssl/net_io_ssl.c regex.c am__dirstamp = $(am__leading_dot)dirstamp @USE_OPENSSL_TRUE@am__objects_1 = openssl/libicapapi_la-net_io_ssl.lo @USE_REGEX_TRUE@am__objects_2 = libicapapi_la-regex.lo am__objects_3 = libicapapi_la-net_io.lo libicapapi_la-util.lo \ os/unix/libicapapi_la-net_io.lo \ os/unix/libicapapi_la-proc_mutex.lo \ os/unix/libicapapi_la-shared_mem.lo \ os/unix/libicapapi_la-threads.lo \ os/unix/libicapapi_la-utilfunc.lo \ os/unix/libicapapi_la-dlib.lo $(am__objects_1) \ $(am__objects_2) am_libicapapi_la_OBJECTS = libicapapi_la-header.lo \ libicapapi_la-body.lo libicapapi_la-decode.lo \ libicapapi_la-encode.lo libicapapi_la-simple_api.lo \ libicapapi_la-request_common.lo libicapapi_la-filetype.lo \ libicapapi_la-debug.lo libicapapi_la-cfg_lib.lo \ libicapapi_la-mem.lo libicapapi_la-service_lib.lo \ libicapapi_la-cache.lo libicapapi_la-lookup_table.lo \ libicapapi_la-lookup_file_table.lo libicapapi_la-hash.lo \ libicapapi_la-txt_format.lo libicapapi_la-stats.lo \ libicapapi_la-types_ops.lo libicapapi_la-acl.lo \ libicapapi_la-txtTemplate.lo libicapapi_la-array.lo \ libicapapi_la-registry.lo libicapapi_la-md5.lo \ $(am__objects_3) libicapapi_la_OBJECTS = $(am_libicapapi_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libicapapi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libicapapi_la_CFLAGS) \ $(CFLAGS) $(libicapapi_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) am__objects_4 = os/unix/c_icap-proc_utils.$(OBJEXT) am_c_icap_OBJECTS = c_icap-aserver.$(OBJEXT) c_icap-request.$(OBJEXT) \ c_icap-cfg_param.$(OBJEXT) \ c_icap-proc_threads_queues.$(OBJEXT) \ c_icap-http_auth.$(OBJEXT) c_icap-access.$(OBJEXT) \ c_icap-log.$(OBJEXT) c_icap-service.$(OBJEXT) \ c_icap-module.$(OBJEXT) c_icap-commands.$(OBJEXT) \ c_icap-mpmt_server.$(OBJEXT) c_icap-dlib.$(OBJEXT) \ c_icap-info.$(OBJEXT) c_icap-default_acl.$(OBJEXT) \ c_icap-port.$(OBJEXT) $(am__objects_4) c_icap_OBJECTS = $(am_c_icap_OBJECTS) c_icap_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(c_icap_CFLAGS) $(CFLAGS) \ $(c_icap_LDFLAGS) $(LDFLAGS) -o $@ SCRIPTS = $(bin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libicapapi_la_SOURCES) $(c_icap_SOURCES) DIST_SOURCES = $(am__libicapapi_la_SOURCES_DIST) $(c_icap_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(pkginclude_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)autoconf.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/autoconf.h.in \ $(top_srcdir)/include/c-icap-conf.h.in AUTHORS COPYING \ ChangeLog INSTALL NEWS README TODO compile config.guess \ config.sub depcomp install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BDB_ADD_FLAG = @BDB_ADD_FLAG@ BDB_ADD_LDADD = @BDB_ADD_LDADD@ BDB_LNDIR_LDADD = @BDB_LNDIR_LDADD@ BROTLI_ADD_FLAG = @BROTLI_ADD_FLAG@ BROTLI_ADD_LDADD = @BROTLI_ADD_LDADD@ BROTLI_LNDIR_LDADD = @BROTLI_LNDIR_LDADD@ BZLIB_ADD_FLAG = @BZLIB_ADD_FLAG@ BZLIB_ADD_LDADD = @BZLIB_ADD_LDADD@ BZLIB_LNDIR_LDADD = @BZLIB_LNDIR_LDADD@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CICAPLIB_VERSION = @CICAPLIB_VERSION@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ C_ICAP_HEX_VERSION = @C_ICAP_HEX_VERSION@ DEFINE_INT64 = @DEFINE_INT64@ DEFINE_INT8 = @DEFINE_INT8@ DEFINE_OFF_T = @DEFINE_OFF_T@ DEFINE_SIZE_OFF_T = @DEFINE_SIZE_OFF_T@ DEFINE_SIZE_T = @DEFINE_SIZE_T@ DEFINE_SIZE_VOID_P = @DEFINE_SIZE_VOID_P@ DEFINE_UINT64 = @DEFINE_UINT64@ DEFINE_UINT8 = @DEFINE_UINT8@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_ADD_FLAG = @DL_ADD_FLAG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTTYPES_H = @INTTYPES_H@ INVISIBILITY_CFLAG = @INVISIBILITY_CFLAG@ LD = @LD@ LDAP_ADD_FLAG = @LDAP_ADD_FLAG@ LDAP_ADD_LDADD = @LDAP_ADD_LDADD@ LDAP_LNDIR_LDADD = @LDAP_LNDIR_LDADD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEMCACHED_ADD_FLAG = @MEMCACHED_ADD_FLAG@ MEMCACHED_ADD_LDADD = @MEMCACHED_ADD_LDADD@ MEMCACHED_LNDIR_LDADD = @MEMCACHED_LNDIR_LDADD@ MKDIR_P = @MKDIR_P@ MODULES_CFLAGS = @MODULES_CFLAGS@ MODULES_LIBADD = @MODULES_LIBADD@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_ADD_FLAG = @OPENSSL_ADD_FLAG@ OPENSSL_ADD_LDADD = @OPENSSL_ADD_LDADD@ OPENSSL_LNDIR_LDADD = @OPENSSL_LNDIR_LDADD@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_ADD_FLAG = @PCRE_ADD_FLAG@ PCRE_ADD_LDADD = @PCRE_ADD_LDADD@ PCRE_LNDIR_LDADD = @PCRE_LNDIR_LDADD@ POSIX_FILE_LOCK = @POSIX_FILE_LOCK@ POSIX_MAPPED_FILES = @POSIX_MAPPED_FILES@ POSIX_SEMAPHORES = @POSIX_SEMAPHORES@ POSIX_SHARED_MEM = @POSIX_SHARED_MEM@ PTHREADS_RWLOCK = @PTHREADS_RWLOCK@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSV_IPC = @SYSV_IPC@ SYS_TYPES_H = @SYS_TYPES_H@ THREADS_LDADD = @THREADS_LDADD@ THREADS_LDFLAGS = @THREADS_LDFLAGS@ USE_COMPAT = @USE_COMPAT@ USE_IPV6 = @USE_IPV6@ USE_OPENSSL = @USE_OPENSSL@ USE_POLL = @USE_POLL@ USE_REGEX = @USE_REGEX@ VERSION = @VERSION@ VISIBILITY_ATTR = @VISIBILITY_ATTR@ ZLIB_ADD_FLAG = @ZLIB_ADD_FLAG@ ZLIB_ADD_LDADD = @ZLIB_ADD_LDADD@ ZLIB_LNDIR_LDADD = @ZLIB_LNDIR_LDADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen_bin = @doxygen_bin@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ has_doxygen = @has_doxygen@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perlccflags = @perlccflags@ perlcore = @perlcore@ perlldflags = @perlldflags@ perllib = @perllib@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ CONFIGDIR = @sysconfdir@ PKGLIBDIR = @pkglibdir@ MODULESDIR = $(pkglibdir)/ SERVICESDIR = $(pkglibdir)/ #CONFIGDIR=$(sysconfdir)/ DATADIR = $(pkgdatadir)/ LOGDIR = $(localstatedir)/log/ SOCKDIR = /var/run/c-icap DOXYGEN = @doxygen_bin@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = . utils modules services tests docs lib_LTLIBRARIES = libicapapi.la bin_SCRIPTS = c-icap-config c-icap-libicapapi-config UTIL_LIB_SOURCES = net_io.c util.c os/unix/net_io.c \ os/unix/proc_mutex.c os/unix/shared_mem.c os/unix/threads.c \ os/unix/utilfunc.c os/unix/dlib.c $(am__append_1) \ $(am__append_2) UTIL_SOURCES = os/unix/proc_utils.c RPATH_FLAG = $(am__append_3) libicapapi_la_SOURCES = header.c body.c decode.c encode.c simple_api.c request_common.c \ filetype.c debug.c cfg_lib.c mem.c service_lib.c \ cache.c lookup_table.c lookup_file_table.c hash.c \ txt_format.c stats.c types_ops.c acl.c txtTemplate.c \ array.c registry.c md5.c $(UTIL_LIB_SOURCES) c_icap_SOURCES = aserver.c request.c cfg_param.c \ proc_threads_queues.c http_auth.c \ access.c log.c service.c module.c \ commands.c mpmt_server.c dlib.c info.c \ default_acl.c port.c $(UTIL_SOURCES) # libicapapi ...... libicapapi_la_CFLAGS = $(INVISIBILITY_CFLAG) -I$(srcdir)/include/ -Iinclude/ @ZLIB_ADD_FLAG@ @OPENSSL_ADD_FLAG@ @BZLIB_ADD_FLAG@ @BROTLI_ADD_FLAG@ @PCRE_ADD_FLAG@ -DCI_BUILD_LIB libicapapi_la_LIBADD = @ZLIB_ADD_LDADD@ @BZLIB_ADD_LDADD@ @BROTLI_ADD_LDADD@ @PCRE_ADD_LDADD@ @DL_ADD_FLAG@ @THREADS_LDADD@ @OPENSSL_ADD_LDADD@ libicapapi_la_LDFLAGS = -shared -version-info @CICAPLIB_VERSION@ @THREADS_LDFLAGS@ #c_icap the main server c_icap_DEPENDENCIES = libicapapi.la c_icap_CFLAGS = $(INVISIBILITY_CFLAG) -I$(top_srcdir)/include/ -I$(top_builddir)/include/ \ -DCONFDIR=\"$(CONFIGDIR)\" -DMODSDIR=\"$(MODULESDIR)\" \ -DSERVDIR=\"$(SERVICESDIR)\" -DLOGDIR=\"$(LOGDIR)\" \ -DDATADIR=\"$(DATADIR)\" @OPENSSL_ADD_FLAG@ c_icap_LDADD = libicapapi.la @DL_ADD_FLAG@ @THREADS_LDADD@ $(EXT_PROGRAMS_MKLIB) c_icap_LDFLAGS = -rdynamic $(RPATH_FLAG) @THREADS_LDFLAGS@ INCS = access.h body.h cfg_param.h c-icap-conf.h c-icap.h ci_threads.h \ commands.h debug.h dlib.h filetype.h header.h log.h mem.h module.h \ net_io.h proc_mutex.h proc_threads_queues.h request.h service.h \ shared_mem.h simple_api.h util.h lookup_table.h hash.h stats.h acl.h \ cache.h txt_format.h types_ops.h txtTemplate.h array.h registry.h \ md5.h ci_regex.h net_io_ssl.h port.h ALL_INCS = $(INCS:%.h=include/%.h) pkginclude_HEADERS = $(ALL_INCS) do_subst = sed -e 's%[@]SYSCONFDIR[@]%$(CONFIGDIR)%g' \ -e 's%[@]PACKAGE_VERSION[@]%$(PACKAGE_VERSION)%g' \ -e 's%[@]PACKAGE[@]%$(PACKAGE)%g' \ -e 's%[@]prefix[@]%$(prefix)%g' \ -e 's%[@]LIBDIR[@]%$(libdir)%g' \ -e 's%[@]PKGINCLUDEDIR[@]%$(pkgincludedir)%g' \ -e 's%[@]INCLUDEDIR[@]%$(includedir)%g' \ -e 's%[@]PKGLIBDIR[@]%$(pkglibdir)%g' \ -e 's%[@]PKGDATADIR[@]%$(pkgdatadir)%g' \ -e 's%[@]CFLAGS[@]%$(CFLAGS)%g' \ -e 's%[@]MODULES_LIBADD[@]%$(MODULES_LIBADD)%g' \ -e 's%[@]MODULES_CFLAGS[@]%$(MODULES_CFLAGS)%g' \ -e 's%[@]EXT_PROGRAMS_LIBADD[@]%$(EXT_PROGRAMS_MKLIB)%g' \ -e 's%[@]SOCKDIR[@]%$(SOCKDIR)%g' CLEANFILES = c-icap-config c-icap-libicapapi-config EXTRA_DIST = RECONF config-w32.h makefile.w32 \ c_icap_dll.mak c-icap.conf.in c-icap.magic c_icap.mak c_icap.def \ contrib/get_file.pl contrib/convert_old_magic.pl \ winnt_server.c os/win32/dll_entry.c os/win32/makefile.w32 \ os/win32/net_io.c os/win32/proc_mutex.c \ os/win32/shared_mem.c os/win32/threads.c os/win32/utilfunc.c \ common.h \ c-icap-config.in c-icap-libicapapi-config.in c-icap.dox \ build/c_icap_version.awk \ openssl/build_openssl_opts.pl \ openssl/openssl_options.c all: autoconf.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): autoconf.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/autoconf.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status autoconf.h $(srcdir)/autoconf.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f autoconf.h stamp-h1 include/c-icap-conf.h: $(top_builddir)/config.status $(top_srcdir)/include/c-icap-conf.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } os/unix/$(am__dirstamp): @$(MKDIR_P) os/unix @: > os/unix/$(am__dirstamp) os/unix/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) os/unix/$(DEPDIR) @: > os/unix/$(DEPDIR)/$(am__dirstamp) os/unix/libicapapi_la-net_io.lo: os/unix/$(am__dirstamp) \ os/unix/$(DEPDIR)/$(am__dirstamp) os/unix/libicapapi_la-proc_mutex.lo: os/unix/$(am__dirstamp) \ os/unix/$(DEPDIR)/$(am__dirstamp) os/unix/libicapapi_la-shared_mem.lo: os/unix/$(am__dirstamp) \ os/unix/$(DEPDIR)/$(am__dirstamp) os/unix/libicapapi_la-threads.lo: os/unix/$(am__dirstamp) \ os/unix/$(DEPDIR)/$(am__dirstamp) os/unix/libicapapi_la-utilfunc.lo: os/unix/$(am__dirstamp) \ os/unix/$(DEPDIR)/$(am__dirstamp) os/unix/libicapapi_la-dlib.lo: os/unix/$(am__dirstamp) \ os/unix/$(DEPDIR)/$(am__dirstamp) openssl/$(am__dirstamp): @$(MKDIR_P) openssl @: > openssl/$(am__dirstamp) openssl/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) openssl/$(DEPDIR) @: > openssl/$(DEPDIR)/$(am__dirstamp) openssl/libicapapi_la-net_io_ssl.lo: openssl/$(am__dirstamp) \ openssl/$(DEPDIR)/$(am__dirstamp) libicapapi.la: $(libicapapi_la_OBJECTS) $(libicapapi_la_DEPENDENCIES) $(EXTRA_libicapapi_la_DEPENDENCIES) $(AM_V_CCLD)$(libicapapi_la_LINK) -rpath $(libdir) $(libicapapi_la_OBJECTS) $(libicapapi_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list os/unix/c_icap-proc_utils.$(OBJEXT): os/unix/$(am__dirstamp) \ os/unix/$(DEPDIR)/$(am__dirstamp) c-icap$(EXEEXT): $(c_icap_OBJECTS) $(c_icap_DEPENDENCIES) $(EXTRA_c_icap_DEPENDENCIES) @rm -f c-icap$(EXEEXT) $(AM_V_CCLD)$(c_icap_LINK) $(c_icap_OBJECTS) $(c_icap_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f openssl/*.$(OBJEXT) -rm -f openssl/*.lo -rm -f os/unix/*.$(OBJEXT) -rm -f os/unix/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-access.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-aserver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-cfg_param.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-commands.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-default_acl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-dlib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-http_auth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-module.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-mpmt_server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-port.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-proc_threads_queues.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-request.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap-service.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-acl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-array.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-body.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-cache.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-cfg_lib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-decode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-encode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-filetype.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-header.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-lookup_file_table.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-lookup_table.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-md5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-mem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-net_io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-regex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-registry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-request_common.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-service_lib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-simple_api.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-stats.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-txtTemplate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-txt_format.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-types_ops.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libicapapi_la-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@openssl/$(DEPDIR)/libicapapi_la-net_io_ssl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@os/unix/$(DEPDIR)/c_icap-proc_utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@os/unix/$(DEPDIR)/libicapapi_la-dlib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@os/unix/$(DEPDIR)/libicapapi_la-net_io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@os/unix/$(DEPDIR)/libicapapi_la-proc_mutex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@os/unix/$(DEPDIR)/libicapapi_la-shared_mem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@os/unix/$(DEPDIR)/libicapapi_la-threads.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@os/unix/$(DEPDIR)/libicapapi_la-utilfunc.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libicapapi_la-header.lo: header.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-header.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-header.Tpo -c -o libicapapi_la-header.lo `test -f 'header.c' || echo '$(srcdir)/'`header.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-header.Tpo $(DEPDIR)/libicapapi_la-header.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='header.c' object='libicapapi_la-header.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-header.lo `test -f 'header.c' || echo '$(srcdir)/'`header.c libicapapi_la-body.lo: body.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-body.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-body.Tpo -c -o libicapapi_la-body.lo `test -f 'body.c' || echo '$(srcdir)/'`body.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-body.Tpo $(DEPDIR)/libicapapi_la-body.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='body.c' object='libicapapi_la-body.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-body.lo `test -f 'body.c' || echo '$(srcdir)/'`body.c libicapapi_la-decode.lo: decode.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-decode.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-decode.Tpo -c -o libicapapi_la-decode.lo `test -f 'decode.c' || echo '$(srcdir)/'`decode.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-decode.Tpo $(DEPDIR)/libicapapi_la-decode.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='decode.c' object='libicapapi_la-decode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-decode.lo `test -f 'decode.c' || echo '$(srcdir)/'`decode.c libicapapi_la-encode.lo: encode.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-encode.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-encode.Tpo -c -o libicapapi_la-encode.lo `test -f 'encode.c' || echo '$(srcdir)/'`encode.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-encode.Tpo $(DEPDIR)/libicapapi_la-encode.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='encode.c' object='libicapapi_la-encode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-encode.lo `test -f 'encode.c' || echo '$(srcdir)/'`encode.c libicapapi_la-simple_api.lo: simple_api.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-simple_api.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-simple_api.Tpo -c -o libicapapi_la-simple_api.lo `test -f 'simple_api.c' || echo '$(srcdir)/'`simple_api.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-simple_api.Tpo $(DEPDIR)/libicapapi_la-simple_api.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='simple_api.c' object='libicapapi_la-simple_api.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-simple_api.lo `test -f 'simple_api.c' || echo '$(srcdir)/'`simple_api.c libicapapi_la-request_common.lo: request_common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-request_common.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-request_common.Tpo -c -o libicapapi_la-request_common.lo `test -f 'request_common.c' || echo '$(srcdir)/'`request_common.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-request_common.Tpo $(DEPDIR)/libicapapi_la-request_common.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='request_common.c' object='libicapapi_la-request_common.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-request_common.lo `test -f 'request_common.c' || echo '$(srcdir)/'`request_common.c libicapapi_la-filetype.lo: filetype.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-filetype.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-filetype.Tpo -c -o libicapapi_la-filetype.lo `test -f 'filetype.c' || echo '$(srcdir)/'`filetype.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-filetype.Tpo $(DEPDIR)/libicapapi_la-filetype.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='filetype.c' object='libicapapi_la-filetype.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-filetype.lo `test -f 'filetype.c' || echo '$(srcdir)/'`filetype.c libicapapi_la-debug.lo: debug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-debug.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-debug.Tpo -c -o libicapapi_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-debug.Tpo $(DEPDIR)/libicapapi_la-debug.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='debug.c' object='libicapapi_la-debug.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c libicapapi_la-cfg_lib.lo: cfg_lib.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-cfg_lib.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-cfg_lib.Tpo -c -o libicapapi_la-cfg_lib.lo `test -f 'cfg_lib.c' || echo '$(srcdir)/'`cfg_lib.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-cfg_lib.Tpo $(DEPDIR)/libicapapi_la-cfg_lib.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cfg_lib.c' object='libicapapi_la-cfg_lib.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-cfg_lib.lo `test -f 'cfg_lib.c' || echo '$(srcdir)/'`cfg_lib.c libicapapi_la-mem.lo: mem.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-mem.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-mem.Tpo -c -o libicapapi_la-mem.lo `test -f 'mem.c' || echo '$(srcdir)/'`mem.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-mem.Tpo $(DEPDIR)/libicapapi_la-mem.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mem.c' object='libicapapi_la-mem.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-mem.lo `test -f 'mem.c' || echo '$(srcdir)/'`mem.c libicapapi_la-service_lib.lo: service_lib.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-service_lib.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-service_lib.Tpo -c -o libicapapi_la-service_lib.lo `test -f 'service_lib.c' || echo '$(srcdir)/'`service_lib.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-service_lib.Tpo $(DEPDIR)/libicapapi_la-service_lib.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='service_lib.c' object='libicapapi_la-service_lib.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-service_lib.lo `test -f 'service_lib.c' || echo '$(srcdir)/'`service_lib.c libicapapi_la-cache.lo: cache.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-cache.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-cache.Tpo -c -o libicapapi_la-cache.lo `test -f 'cache.c' || echo '$(srcdir)/'`cache.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-cache.Tpo $(DEPDIR)/libicapapi_la-cache.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cache.c' object='libicapapi_la-cache.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-cache.lo `test -f 'cache.c' || echo '$(srcdir)/'`cache.c libicapapi_la-lookup_table.lo: lookup_table.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-lookup_table.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-lookup_table.Tpo -c -o libicapapi_la-lookup_table.lo `test -f 'lookup_table.c' || echo '$(srcdir)/'`lookup_table.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-lookup_table.Tpo $(DEPDIR)/libicapapi_la-lookup_table.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lookup_table.c' object='libicapapi_la-lookup_table.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-lookup_table.lo `test -f 'lookup_table.c' || echo '$(srcdir)/'`lookup_table.c libicapapi_la-lookup_file_table.lo: lookup_file_table.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-lookup_file_table.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-lookup_file_table.Tpo -c -o libicapapi_la-lookup_file_table.lo `test -f 'lookup_file_table.c' || echo '$(srcdir)/'`lookup_file_table.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-lookup_file_table.Tpo $(DEPDIR)/libicapapi_la-lookup_file_table.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lookup_file_table.c' object='libicapapi_la-lookup_file_table.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-lookup_file_table.lo `test -f 'lookup_file_table.c' || echo '$(srcdir)/'`lookup_file_table.c libicapapi_la-hash.lo: hash.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-hash.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-hash.Tpo -c -o libicapapi_la-hash.lo `test -f 'hash.c' || echo '$(srcdir)/'`hash.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-hash.Tpo $(DEPDIR)/libicapapi_la-hash.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash.c' object='libicapapi_la-hash.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-hash.lo `test -f 'hash.c' || echo '$(srcdir)/'`hash.c libicapapi_la-txt_format.lo: txt_format.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-txt_format.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-txt_format.Tpo -c -o libicapapi_la-txt_format.lo `test -f 'txt_format.c' || echo '$(srcdir)/'`txt_format.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-txt_format.Tpo $(DEPDIR)/libicapapi_la-txt_format.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='txt_format.c' object='libicapapi_la-txt_format.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-txt_format.lo `test -f 'txt_format.c' || echo '$(srcdir)/'`txt_format.c libicapapi_la-stats.lo: stats.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-stats.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-stats.Tpo -c -o libicapapi_la-stats.lo `test -f 'stats.c' || echo '$(srcdir)/'`stats.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-stats.Tpo $(DEPDIR)/libicapapi_la-stats.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stats.c' object='libicapapi_la-stats.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-stats.lo `test -f 'stats.c' || echo '$(srcdir)/'`stats.c libicapapi_la-types_ops.lo: types_ops.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-types_ops.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-types_ops.Tpo -c -o libicapapi_la-types_ops.lo `test -f 'types_ops.c' || echo '$(srcdir)/'`types_ops.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-types_ops.Tpo $(DEPDIR)/libicapapi_la-types_ops.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='types_ops.c' object='libicapapi_la-types_ops.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-types_ops.lo `test -f 'types_ops.c' || echo '$(srcdir)/'`types_ops.c libicapapi_la-acl.lo: acl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-acl.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-acl.Tpo -c -o libicapapi_la-acl.lo `test -f 'acl.c' || echo '$(srcdir)/'`acl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-acl.Tpo $(DEPDIR)/libicapapi_la-acl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='acl.c' object='libicapapi_la-acl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-acl.lo `test -f 'acl.c' || echo '$(srcdir)/'`acl.c libicapapi_la-txtTemplate.lo: txtTemplate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-txtTemplate.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-txtTemplate.Tpo -c -o libicapapi_la-txtTemplate.lo `test -f 'txtTemplate.c' || echo '$(srcdir)/'`txtTemplate.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-txtTemplate.Tpo $(DEPDIR)/libicapapi_la-txtTemplate.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='txtTemplate.c' object='libicapapi_la-txtTemplate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-txtTemplate.lo `test -f 'txtTemplate.c' || echo '$(srcdir)/'`txtTemplate.c libicapapi_la-array.lo: array.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-array.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-array.Tpo -c -o libicapapi_la-array.lo `test -f 'array.c' || echo '$(srcdir)/'`array.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-array.Tpo $(DEPDIR)/libicapapi_la-array.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='array.c' object='libicapapi_la-array.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-array.lo `test -f 'array.c' || echo '$(srcdir)/'`array.c libicapapi_la-registry.lo: registry.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-registry.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-registry.Tpo -c -o libicapapi_la-registry.lo `test -f 'registry.c' || echo '$(srcdir)/'`registry.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-registry.Tpo $(DEPDIR)/libicapapi_la-registry.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='registry.c' object='libicapapi_la-registry.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-registry.lo `test -f 'registry.c' || echo '$(srcdir)/'`registry.c libicapapi_la-md5.lo: md5.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-md5.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-md5.Tpo -c -o libicapapi_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-md5.Tpo $(DEPDIR)/libicapapi_la-md5.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='md5.c' object='libicapapi_la-md5.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c libicapapi_la-net_io.lo: net_io.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-net_io.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-net_io.Tpo -c -o libicapapi_la-net_io.lo `test -f 'net_io.c' || echo '$(srcdir)/'`net_io.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-net_io.Tpo $(DEPDIR)/libicapapi_la-net_io.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='net_io.c' object='libicapapi_la-net_io.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-net_io.lo `test -f 'net_io.c' || echo '$(srcdir)/'`net_io.c libicapapi_la-util.lo: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-util.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-util.Tpo -c -o libicapapi_la-util.lo `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-util.Tpo $(DEPDIR)/libicapapi_la-util.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='libicapapi_la-util.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-util.lo `test -f 'util.c' || echo '$(srcdir)/'`util.c os/unix/libicapapi_la-net_io.lo: os/unix/net_io.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT os/unix/libicapapi_la-net_io.lo -MD -MP -MF os/unix/$(DEPDIR)/libicapapi_la-net_io.Tpo -c -o os/unix/libicapapi_la-net_io.lo `test -f 'os/unix/net_io.c' || echo '$(srcdir)/'`os/unix/net_io.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/unix/$(DEPDIR)/libicapapi_la-net_io.Tpo os/unix/$(DEPDIR)/libicapapi_la-net_io.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/unix/net_io.c' object='os/unix/libicapapi_la-net_io.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o os/unix/libicapapi_la-net_io.lo `test -f 'os/unix/net_io.c' || echo '$(srcdir)/'`os/unix/net_io.c os/unix/libicapapi_la-proc_mutex.lo: os/unix/proc_mutex.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT os/unix/libicapapi_la-proc_mutex.lo -MD -MP -MF os/unix/$(DEPDIR)/libicapapi_la-proc_mutex.Tpo -c -o os/unix/libicapapi_la-proc_mutex.lo `test -f 'os/unix/proc_mutex.c' || echo '$(srcdir)/'`os/unix/proc_mutex.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/unix/$(DEPDIR)/libicapapi_la-proc_mutex.Tpo os/unix/$(DEPDIR)/libicapapi_la-proc_mutex.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/unix/proc_mutex.c' object='os/unix/libicapapi_la-proc_mutex.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o os/unix/libicapapi_la-proc_mutex.lo `test -f 'os/unix/proc_mutex.c' || echo '$(srcdir)/'`os/unix/proc_mutex.c os/unix/libicapapi_la-shared_mem.lo: os/unix/shared_mem.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT os/unix/libicapapi_la-shared_mem.lo -MD -MP -MF os/unix/$(DEPDIR)/libicapapi_la-shared_mem.Tpo -c -o os/unix/libicapapi_la-shared_mem.lo `test -f 'os/unix/shared_mem.c' || echo '$(srcdir)/'`os/unix/shared_mem.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/unix/$(DEPDIR)/libicapapi_la-shared_mem.Tpo os/unix/$(DEPDIR)/libicapapi_la-shared_mem.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/unix/shared_mem.c' object='os/unix/libicapapi_la-shared_mem.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o os/unix/libicapapi_la-shared_mem.lo `test -f 'os/unix/shared_mem.c' || echo '$(srcdir)/'`os/unix/shared_mem.c os/unix/libicapapi_la-threads.lo: os/unix/threads.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT os/unix/libicapapi_la-threads.lo -MD -MP -MF os/unix/$(DEPDIR)/libicapapi_la-threads.Tpo -c -o os/unix/libicapapi_la-threads.lo `test -f 'os/unix/threads.c' || echo '$(srcdir)/'`os/unix/threads.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/unix/$(DEPDIR)/libicapapi_la-threads.Tpo os/unix/$(DEPDIR)/libicapapi_la-threads.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/unix/threads.c' object='os/unix/libicapapi_la-threads.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o os/unix/libicapapi_la-threads.lo `test -f 'os/unix/threads.c' || echo '$(srcdir)/'`os/unix/threads.c os/unix/libicapapi_la-utilfunc.lo: os/unix/utilfunc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT os/unix/libicapapi_la-utilfunc.lo -MD -MP -MF os/unix/$(DEPDIR)/libicapapi_la-utilfunc.Tpo -c -o os/unix/libicapapi_la-utilfunc.lo `test -f 'os/unix/utilfunc.c' || echo '$(srcdir)/'`os/unix/utilfunc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/unix/$(DEPDIR)/libicapapi_la-utilfunc.Tpo os/unix/$(DEPDIR)/libicapapi_la-utilfunc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/unix/utilfunc.c' object='os/unix/libicapapi_la-utilfunc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o os/unix/libicapapi_la-utilfunc.lo `test -f 'os/unix/utilfunc.c' || echo '$(srcdir)/'`os/unix/utilfunc.c os/unix/libicapapi_la-dlib.lo: os/unix/dlib.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT os/unix/libicapapi_la-dlib.lo -MD -MP -MF os/unix/$(DEPDIR)/libicapapi_la-dlib.Tpo -c -o os/unix/libicapapi_la-dlib.lo `test -f 'os/unix/dlib.c' || echo '$(srcdir)/'`os/unix/dlib.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/unix/$(DEPDIR)/libicapapi_la-dlib.Tpo os/unix/$(DEPDIR)/libicapapi_la-dlib.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/unix/dlib.c' object='os/unix/libicapapi_la-dlib.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o os/unix/libicapapi_la-dlib.lo `test -f 'os/unix/dlib.c' || echo '$(srcdir)/'`os/unix/dlib.c openssl/libicapapi_la-net_io_ssl.lo: openssl/net_io_ssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT openssl/libicapapi_la-net_io_ssl.lo -MD -MP -MF openssl/$(DEPDIR)/libicapapi_la-net_io_ssl.Tpo -c -o openssl/libicapapi_la-net_io_ssl.lo `test -f 'openssl/net_io_ssl.c' || echo '$(srcdir)/'`openssl/net_io_ssl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openssl/$(DEPDIR)/libicapapi_la-net_io_ssl.Tpo openssl/$(DEPDIR)/libicapapi_la-net_io_ssl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openssl/net_io_ssl.c' object='openssl/libicapapi_la-net_io_ssl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o openssl/libicapapi_la-net_io_ssl.lo `test -f 'openssl/net_io_ssl.c' || echo '$(srcdir)/'`openssl/net_io_ssl.c libicapapi_la-regex.lo: regex.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -MT libicapapi_la-regex.lo -MD -MP -MF $(DEPDIR)/libicapapi_la-regex.Tpo -c -o libicapapi_la-regex.lo `test -f 'regex.c' || echo '$(srcdir)/'`regex.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libicapapi_la-regex.Tpo $(DEPDIR)/libicapapi_la-regex.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regex.c' object='libicapapi_la-regex.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libicapapi_la_CFLAGS) $(CFLAGS) -c -o libicapapi_la-regex.lo `test -f 'regex.c' || echo '$(srcdir)/'`regex.c c_icap-aserver.o: aserver.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-aserver.o -MD -MP -MF $(DEPDIR)/c_icap-aserver.Tpo -c -o c_icap-aserver.o `test -f 'aserver.c' || echo '$(srcdir)/'`aserver.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-aserver.Tpo $(DEPDIR)/c_icap-aserver.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='aserver.c' object='c_icap-aserver.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-aserver.o `test -f 'aserver.c' || echo '$(srcdir)/'`aserver.c c_icap-aserver.obj: aserver.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-aserver.obj -MD -MP -MF $(DEPDIR)/c_icap-aserver.Tpo -c -o c_icap-aserver.obj `if test -f 'aserver.c'; then $(CYGPATH_W) 'aserver.c'; else $(CYGPATH_W) '$(srcdir)/aserver.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-aserver.Tpo $(DEPDIR)/c_icap-aserver.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='aserver.c' object='c_icap-aserver.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-aserver.obj `if test -f 'aserver.c'; then $(CYGPATH_W) 'aserver.c'; else $(CYGPATH_W) '$(srcdir)/aserver.c'; fi` c_icap-request.o: request.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-request.o -MD -MP -MF $(DEPDIR)/c_icap-request.Tpo -c -o c_icap-request.o `test -f 'request.c' || echo '$(srcdir)/'`request.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-request.Tpo $(DEPDIR)/c_icap-request.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='request.c' object='c_icap-request.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-request.o `test -f 'request.c' || echo '$(srcdir)/'`request.c c_icap-request.obj: request.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-request.obj -MD -MP -MF $(DEPDIR)/c_icap-request.Tpo -c -o c_icap-request.obj `if test -f 'request.c'; then $(CYGPATH_W) 'request.c'; else $(CYGPATH_W) '$(srcdir)/request.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-request.Tpo $(DEPDIR)/c_icap-request.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='request.c' object='c_icap-request.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-request.obj `if test -f 'request.c'; then $(CYGPATH_W) 'request.c'; else $(CYGPATH_W) '$(srcdir)/request.c'; fi` c_icap-cfg_param.o: cfg_param.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-cfg_param.o -MD -MP -MF $(DEPDIR)/c_icap-cfg_param.Tpo -c -o c_icap-cfg_param.o `test -f 'cfg_param.c' || echo '$(srcdir)/'`cfg_param.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-cfg_param.Tpo $(DEPDIR)/c_icap-cfg_param.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cfg_param.c' object='c_icap-cfg_param.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-cfg_param.o `test -f 'cfg_param.c' || echo '$(srcdir)/'`cfg_param.c c_icap-cfg_param.obj: cfg_param.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-cfg_param.obj -MD -MP -MF $(DEPDIR)/c_icap-cfg_param.Tpo -c -o c_icap-cfg_param.obj `if test -f 'cfg_param.c'; then $(CYGPATH_W) 'cfg_param.c'; else $(CYGPATH_W) '$(srcdir)/cfg_param.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-cfg_param.Tpo $(DEPDIR)/c_icap-cfg_param.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cfg_param.c' object='c_icap-cfg_param.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-cfg_param.obj `if test -f 'cfg_param.c'; then $(CYGPATH_W) 'cfg_param.c'; else $(CYGPATH_W) '$(srcdir)/cfg_param.c'; fi` c_icap-proc_threads_queues.o: proc_threads_queues.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-proc_threads_queues.o -MD -MP -MF $(DEPDIR)/c_icap-proc_threads_queues.Tpo -c -o c_icap-proc_threads_queues.o `test -f 'proc_threads_queues.c' || echo '$(srcdir)/'`proc_threads_queues.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-proc_threads_queues.Tpo $(DEPDIR)/c_icap-proc_threads_queues.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='proc_threads_queues.c' object='c_icap-proc_threads_queues.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-proc_threads_queues.o `test -f 'proc_threads_queues.c' || echo '$(srcdir)/'`proc_threads_queues.c c_icap-proc_threads_queues.obj: proc_threads_queues.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-proc_threads_queues.obj -MD -MP -MF $(DEPDIR)/c_icap-proc_threads_queues.Tpo -c -o c_icap-proc_threads_queues.obj `if test -f 'proc_threads_queues.c'; then $(CYGPATH_W) 'proc_threads_queues.c'; else $(CYGPATH_W) '$(srcdir)/proc_threads_queues.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-proc_threads_queues.Tpo $(DEPDIR)/c_icap-proc_threads_queues.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='proc_threads_queues.c' object='c_icap-proc_threads_queues.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-proc_threads_queues.obj `if test -f 'proc_threads_queues.c'; then $(CYGPATH_W) 'proc_threads_queues.c'; else $(CYGPATH_W) '$(srcdir)/proc_threads_queues.c'; fi` c_icap-http_auth.o: http_auth.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-http_auth.o -MD -MP -MF $(DEPDIR)/c_icap-http_auth.Tpo -c -o c_icap-http_auth.o `test -f 'http_auth.c' || echo '$(srcdir)/'`http_auth.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-http_auth.Tpo $(DEPDIR)/c_icap-http_auth.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http_auth.c' object='c_icap-http_auth.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-http_auth.o `test -f 'http_auth.c' || echo '$(srcdir)/'`http_auth.c c_icap-http_auth.obj: http_auth.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-http_auth.obj -MD -MP -MF $(DEPDIR)/c_icap-http_auth.Tpo -c -o c_icap-http_auth.obj `if test -f 'http_auth.c'; then $(CYGPATH_W) 'http_auth.c'; else $(CYGPATH_W) '$(srcdir)/http_auth.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-http_auth.Tpo $(DEPDIR)/c_icap-http_auth.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http_auth.c' object='c_icap-http_auth.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-http_auth.obj `if test -f 'http_auth.c'; then $(CYGPATH_W) 'http_auth.c'; else $(CYGPATH_W) '$(srcdir)/http_auth.c'; fi` c_icap-access.o: access.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-access.o -MD -MP -MF $(DEPDIR)/c_icap-access.Tpo -c -o c_icap-access.o `test -f 'access.c' || echo '$(srcdir)/'`access.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-access.Tpo $(DEPDIR)/c_icap-access.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='access.c' object='c_icap-access.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-access.o `test -f 'access.c' || echo '$(srcdir)/'`access.c c_icap-access.obj: access.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-access.obj -MD -MP -MF $(DEPDIR)/c_icap-access.Tpo -c -o c_icap-access.obj `if test -f 'access.c'; then $(CYGPATH_W) 'access.c'; else $(CYGPATH_W) '$(srcdir)/access.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-access.Tpo $(DEPDIR)/c_icap-access.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='access.c' object='c_icap-access.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-access.obj `if test -f 'access.c'; then $(CYGPATH_W) 'access.c'; else $(CYGPATH_W) '$(srcdir)/access.c'; fi` c_icap-log.o: log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-log.o -MD -MP -MF $(DEPDIR)/c_icap-log.Tpo -c -o c_icap-log.o `test -f 'log.c' || echo '$(srcdir)/'`log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-log.Tpo $(DEPDIR)/c_icap-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='c_icap-log.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-log.o `test -f 'log.c' || echo '$(srcdir)/'`log.c c_icap-log.obj: log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-log.obj -MD -MP -MF $(DEPDIR)/c_icap-log.Tpo -c -o c_icap-log.obj `if test -f 'log.c'; then $(CYGPATH_W) 'log.c'; else $(CYGPATH_W) '$(srcdir)/log.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-log.Tpo $(DEPDIR)/c_icap-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='c_icap-log.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-log.obj `if test -f 'log.c'; then $(CYGPATH_W) 'log.c'; else $(CYGPATH_W) '$(srcdir)/log.c'; fi` c_icap-service.o: service.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-service.o -MD -MP -MF $(DEPDIR)/c_icap-service.Tpo -c -o c_icap-service.o `test -f 'service.c' || echo '$(srcdir)/'`service.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-service.Tpo $(DEPDIR)/c_icap-service.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='service.c' object='c_icap-service.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-service.o `test -f 'service.c' || echo '$(srcdir)/'`service.c c_icap-service.obj: service.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-service.obj -MD -MP -MF $(DEPDIR)/c_icap-service.Tpo -c -o c_icap-service.obj `if test -f 'service.c'; then $(CYGPATH_W) 'service.c'; else $(CYGPATH_W) '$(srcdir)/service.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-service.Tpo $(DEPDIR)/c_icap-service.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='service.c' object='c_icap-service.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-service.obj `if test -f 'service.c'; then $(CYGPATH_W) 'service.c'; else $(CYGPATH_W) '$(srcdir)/service.c'; fi` c_icap-module.o: module.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-module.o -MD -MP -MF $(DEPDIR)/c_icap-module.Tpo -c -o c_icap-module.o `test -f 'module.c' || echo '$(srcdir)/'`module.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-module.Tpo $(DEPDIR)/c_icap-module.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='module.c' object='c_icap-module.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-module.o `test -f 'module.c' || echo '$(srcdir)/'`module.c c_icap-module.obj: module.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-module.obj -MD -MP -MF $(DEPDIR)/c_icap-module.Tpo -c -o c_icap-module.obj `if test -f 'module.c'; then $(CYGPATH_W) 'module.c'; else $(CYGPATH_W) '$(srcdir)/module.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-module.Tpo $(DEPDIR)/c_icap-module.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='module.c' object='c_icap-module.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-module.obj `if test -f 'module.c'; then $(CYGPATH_W) 'module.c'; else $(CYGPATH_W) '$(srcdir)/module.c'; fi` c_icap-commands.o: commands.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-commands.o -MD -MP -MF $(DEPDIR)/c_icap-commands.Tpo -c -o c_icap-commands.o `test -f 'commands.c' || echo '$(srcdir)/'`commands.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-commands.Tpo $(DEPDIR)/c_icap-commands.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='commands.c' object='c_icap-commands.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-commands.o `test -f 'commands.c' || echo '$(srcdir)/'`commands.c c_icap-commands.obj: commands.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-commands.obj -MD -MP -MF $(DEPDIR)/c_icap-commands.Tpo -c -o c_icap-commands.obj `if test -f 'commands.c'; then $(CYGPATH_W) 'commands.c'; else $(CYGPATH_W) '$(srcdir)/commands.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-commands.Tpo $(DEPDIR)/c_icap-commands.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='commands.c' object='c_icap-commands.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-commands.obj `if test -f 'commands.c'; then $(CYGPATH_W) 'commands.c'; else $(CYGPATH_W) '$(srcdir)/commands.c'; fi` c_icap-mpmt_server.o: mpmt_server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-mpmt_server.o -MD -MP -MF $(DEPDIR)/c_icap-mpmt_server.Tpo -c -o c_icap-mpmt_server.o `test -f 'mpmt_server.c' || echo '$(srcdir)/'`mpmt_server.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-mpmt_server.Tpo $(DEPDIR)/c_icap-mpmt_server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mpmt_server.c' object='c_icap-mpmt_server.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-mpmt_server.o `test -f 'mpmt_server.c' || echo '$(srcdir)/'`mpmt_server.c c_icap-mpmt_server.obj: mpmt_server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-mpmt_server.obj -MD -MP -MF $(DEPDIR)/c_icap-mpmt_server.Tpo -c -o c_icap-mpmt_server.obj `if test -f 'mpmt_server.c'; then $(CYGPATH_W) 'mpmt_server.c'; else $(CYGPATH_W) '$(srcdir)/mpmt_server.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-mpmt_server.Tpo $(DEPDIR)/c_icap-mpmt_server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mpmt_server.c' object='c_icap-mpmt_server.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-mpmt_server.obj `if test -f 'mpmt_server.c'; then $(CYGPATH_W) 'mpmt_server.c'; else $(CYGPATH_W) '$(srcdir)/mpmt_server.c'; fi` c_icap-dlib.o: dlib.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-dlib.o -MD -MP -MF $(DEPDIR)/c_icap-dlib.Tpo -c -o c_icap-dlib.o `test -f 'dlib.c' || echo '$(srcdir)/'`dlib.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-dlib.Tpo $(DEPDIR)/c_icap-dlib.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dlib.c' object='c_icap-dlib.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-dlib.o `test -f 'dlib.c' || echo '$(srcdir)/'`dlib.c c_icap-dlib.obj: dlib.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-dlib.obj -MD -MP -MF $(DEPDIR)/c_icap-dlib.Tpo -c -o c_icap-dlib.obj `if test -f 'dlib.c'; then $(CYGPATH_W) 'dlib.c'; else $(CYGPATH_W) '$(srcdir)/dlib.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-dlib.Tpo $(DEPDIR)/c_icap-dlib.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dlib.c' object='c_icap-dlib.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-dlib.obj `if test -f 'dlib.c'; then $(CYGPATH_W) 'dlib.c'; else $(CYGPATH_W) '$(srcdir)/dlib.c'; fi` c_icap-info.o: info.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-info.o -MD -MP -MF $(DEPDIR)/c_icap-info.Tpo -c -o c_icap-info.o `test -f 'info.c' || echo '$(srcdir)/'`info.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-info.Tpo $(DEPDIR)/c_icap-info.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='info.c' object='c_icap-info.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-info.o `test -f 'info.c' || echo '$(srcdir)/'`info.c c_icap-info.obj: info.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-info.obj -MD -MP -MF $(DEPDIR)/c_icap-info.Tpo -c -o c_icap-info.obj `if test -f 'info.c'; then $(CYGPATH_W) 'info.c'; else $(CYGPATH_W) '$(srcdir)/info.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-info.Tpo $(DEPDIR)/c_icap-info.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='info.c' object='c_icap-info.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-info.obj `if test -f 'info.c'; then $(CYGPATH_W) 'info.c'; else $(CYGPATH_W) '$(srcdir)/info.c'; fi` c_icap-default_acl.o: default_acl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-default_acl.o -MD -MP -MF $(DEPDIR)/c_icap-default_acl.Tpo -c -o c_icap-default_acl.o `test -f 'default_acl.c' || echo '$(srcdir)/'`default_acl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-default_acl.Tpo $(DEPDIR)/c_icap-default_acl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='default_acl.c' object='c_icap-default_acl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-default_acl.o `test -f 'default_acl.c' || echo '$(srcdir)/'`default_acl.c c_icap-default_acl.obj: default_acl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-default_acl.obj -MD -MP -MF $(DEPDIR)/c_icap-default_acl.Tpo -c -o c_icap-default_acl.obj `if test -f 'default_acl.c'; then $(CYGPATH_W) 'default_acl.c'; else $(CYGPATH_W) '$(srcdir)/default_acl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-default_acl.Tpo $(DEPDIR)/c_icap-default_acl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='default_acl.c' object='c_icap-default_acl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-default_acl.obj `if test -f 'default_acl.c'; then $(CYGPATH_W) 'default_acl.c'; else $(CYGPATH_W) '$(srcdir)/default_acl.c'; fi` c_icap-port.o: port.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-port.o -MD -MP -MF $(DEPDIR)/c_icap-port.Tpo -c -o c_icap-port.o `test -f 'port.c' || echo '$(srcdir)/'`port.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-port.Tpo $(DEPDIR)/c_icap-port.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='port.c' object='c_icap-port.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-port.o `test -f 'port.c' || echo '$(srcdir)/'`port.c c_icap-port.obj: port.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT c_icap-port.obj -MD -MP -MF $(DEPDIR)/c_icap-port.Tpo -c -o c_icap-port.obj `if test -f 'port.c'; then $(CYGPATH_W) 'port.c'; else $(CYGPATH_W) '$(srcdir)/port.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap-port.Tpo $(DEPDIR)/c_icap-port.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='port.c' object='c_icap-port.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o c_icap-port.obj `if test -f 'port.c'; then $(CYGPATH_W) 'port.c'; else $(CYGPATH_W) '$(srcdir)/port.c'; fi` os/unix/c_icap-proc_utils.o: os/unix/proc_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT os/unix/c_icap-proc_utils.o -MD -MP -MF os/unix/$(DEPDIR)/c_icap-proc_utils.Tpo -c -o os/unix/c_icap-proc_utils.o `test -f 'os/unix/proc_utils.c' || echo '$(srcdir)/'`os/unix/proc_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/unix/$(DEPDIR)/c_icap-proc_utils.Tpo os/unix/$(DEPDIR)/c_icap-proc_utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/unix/proc_utils.c' object='os/unix/c_icap-proc_utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o os/unix/c_icap-proc_utils.o `test -f 'os/unix/proc_utils.c' || echo '$(srcdir)/'`os/unix/proc_utils.c os/unix/c_icap-proc_utils.obj: os/unix/proc_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -MT os/unix/c_icap-proc_utils.obj -MD -MP -MF os/unix/$(DEPDIR)/c_icap-proc_utils.Tpo -c -o os/unix/c_icap-proc_utils.obj `if test -f 'os/unix/proc_utils.c'; then $(CYGPATH_W) 'os/unix/proc_utils.c'; else $(CYGPATH_W) '$(srcdir)/os/unix/proc_utils.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/unix/$(DEPDIR)/c_icap-proc_utils.Tpo os/unix/$(DEPDIR)/c_icap-proc_utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/unix/proc_utils.c' object='os/unix/c_icap-proc_utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_CFLAGS) $(CFLAGS) -c -o os/unix/c_icap-proc_utils.obj `if test -f 'os/unix/proc_utils.c'; then $(CYGPATH_W) 'os/unix/proc_utils.c'; else $(CYGPATH_W) '$(srcdir)/os/unix/proc_utils.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf openssl/.libs openssl/_libs -rm -rf os/unix/.libs os/unix/_libs distclean-libtool: -rm -f libtool config.lt install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(HEADERS) \ autoconf.h install-binPROGRAMS: install-libLTLIBRARIES installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f openssl/$(DEPDIR)/$(am__dirstamp) -rm -f openssl/$(am__dirstamp) -rm -f os/unix/$(DEPDIR)/$(am__dirstamp) -rm -f os/unix/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) openssl/$(DEPDIR) os/unix/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-data-local install-pkgincludeHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-binSCRIPTS \ install-libLTLIBRARIES install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) openssl/$(DEPDIR) os/unix/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-binPROGRAMS \ clean-cscope clean-generic clean-libLTLIBRARIES clean-libtool \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-binPROGRAMS \ install-binSCRIPTS install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-pkgincludeHEADERS install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-binSCRIPTS uninstall-libLTLIBRARIES \ uninstall-pkgincludeHEADERS .PRECIOUS: Makefile export EXT_PROGRAMS_MKLIB = @ZLIB_LNDIR_LDADD@ @BZLIB_LNDIR_LDADD@ @BROTLI_LNDIR_LDADD@ @PCRE_LNDIR_LDADD@ @OPENSSL_LNDIR_LDADD@ # The c-icap.conf, c-icap-config, and c-icap-libicapapi-config must rebuild # on every new configure run. The include/c-icap-conf.h is rebuild when # configure runs so it is a good test. c-icap.conf: c-icap.conf.in include/c-icap-conf.h $(do_subst) < $(srcdir)/c-icap.conf.in > $@ c-icap-config: c-icap-config.in include/c-icap-conf.h $(do_subst) < $(srcdir)/c-icap-config.in > $@ chmod 755 $@ c-icap-libicapapi-config: c-icap-libicapapi-config.in include/c-icap-conf.h $(do_subst) < $(srcdir)/c-icap-libicapapi-config.in > $@ chmod 755 $@ doc: $(DOXYGEN) $(srcdir)/c-icap.dox install-data-local: c-icap.conf $(mkinstalldirs) $(DESTDIR)$(CONFIGDIR); $(INSTALL) c-icap.conf $(DESTDIR)$(CONFIGDIR)/c-icap.conf.default $(INSTALL) $(srcdir)/c-icap.magic $(DESTDIR)$(CONFIGDIR)/c-icap.magic.default if test ! -f $(DESTDIR)$(CONFIGDIR)/c-icap.conf; then $(INSTALL) c-icap.conf $(DESTDIR)$(CONFIGDIR)/c-icap.conf; fi if test ! -f $(DESTDIR)$(CONFIGDIR)/c-icap.magic; then $(INSTALL) $(srcdir)/c-icap.magic $(DESTDIR)$(CONFIGDIR)/c-icap.magic; fi $(mkinstalldirs) $(DESTDIR)$(LOGDIR); $(mkinstalldirs) $(DESTDIR)$(SOCKDIR); chgrp nogroup $(DESTDIR)$(LOGDIR) || echo -e "*********\nWARNING! Can not set group for the log dir $(DESTDIR)$(LOGDIR)\n*********\n" chmod 775 $(DESTDIR)$(LOGDIR) chgrp nogroup $(DESTDIR)$(SOCKDIR) || echo -e "*********\nWARNING! Can not set group for the c-icap socket store dir $(DESTDIR)$(SOCKDIR)\n\n*********\n" chmod 775 $(DESTDIR)$(SOCKDIR) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: c_icap-0.5.6/depcomp0000755000175000017500000005601713570504057011255 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2016-01-11.22; # UTC # Copyright (C) 1999-2017 Free Software Foundation, Inc. # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: c_icap-0.5.6/c_icap.mak0000664000175000017500000000032313371253152011573 00000000000000 CONFDIR="c:\\c-icap\\etc" SERVDIR="c:\\c-icap\\lib" MODSDIR="c:\\c-icap\\lib" LOGDIR="c:\\c-icap\\log" CI_DEFS=-DCONFDIR=\"$(CONFDIR)\" -DSERVDIR=\"$(SERVDIR)\" -DMODSDIR=\"$(MODSDIR)\" -DLOGDIR=\"$(LOGDIR)\" c_icap-0.5.6/c_icap.def0000664000175000017500000000000013371253152011551 00000000000000c_icap-0.5.6/txtTemplate.c0000664000175000017500000003422013371253152012345 00000000000000/* * Copyright (C) 2007,2010 Trever L. Adams * * 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 of the License, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ // Additionally, you may use this file under LGPL 2 or (at your option) later #include #include #include #include #include #include #include #include #include #include #include "common.h" #include "body.h" #include "c-icap.h" #include "service.h" #include "header.h" #include "request.h" #include "debug.h" #include "txtTemplate.h" #include "simple_api.h" typedef struct { char *TEMPLATE_NAME; char *SERVICE_NAME; char *LANGUAGE; ci_membuf_t *data; time_t last_used; time_t loaded; time_t modified; int locked; int must_free; int non_cached; } txtTemplate_t; const char *TEMPLATE_DIR = NULL; const char *TEMPLATE_DEF_LANG = "en"; int TEMPLATE_RELOAD_TIME = 360; // Default time is one hour, this variable is in seconds txtTemplate_t *templates = NULL; int txtTemplateInited = 0; int TEMPLATE_CACHE_SIZE = 20; // How many templates can be cached int TEMPLATE_MEMBUF_SIZE = 8192; // Max memory for txtTemplate to expand template into txt static ci_thread_mutex_t templates_mutex; // Caller should free returned pointer static void makeTemplatePathFileName(char *path, int path_len, const char *service_name, const char *page_name, const char *lang) { snprintf(path, path_len, "%s/%s/%s/%s", TEMPLATE_DIR, service_name, lang, page_name); path[path_len-1] = '\0'; } int ci_txt_template_init(void) { int i; templates = malloc(TEMPLATE_CACHE_SIZE * sizeof(txtTemplate_t)); if (templates == NULL) { ci_debug_printf(1, "Unable to allocate memory in in inittxtTemplate for template storage!\n"); return -1; } for (i = 0; i < TEMPLATE_CACHE_SIZE; i++) { // The following three elements are critical to be cleared, // the rest can be left unintialized templates[i].data = NULL; templates[i].loaded = 0; templates[i].locked = 0; templates[i].must_free = 0; templates[i].non_cached = 0; } txtTemplateInited = 1; ci_thread_mutex_init(&templates_mutex); return 1; } void ci_txt_template_set_dir(const char *dir) { TEMPLATE_DIR = dir; } void ci_txt_template_set_default_lang(const char *lang) { TEMPLATE_DEF_LANG = lang; } static int templateExpired(txtTemplate_t *template) { char path[CI_MAX_PATH]; struct stat file; time_t current_time; time(¤t_time); if (current_time - template->loaded >= TEMPLATE_RELOAD_TIME) { makeTemplatePathFileName(path, CI_MAX_PATH, template->SERVICE_NAME, template->TEMPLATE_NAME, template->LANGUAGE); if (stat(path, &file) < 0) { ci_debug_printf(1, "Can not found the text template file %s!", path); return 0; } if (file.st_mtime > template->modified) { ci_debug_printf(4, "templateFind: found: %s, %s, %s updated on disk, expired.\n", template->SERVICE_NAME, template->LANGUAGE, template->TEMPLATE_NAME); return 1; } } return 0; } //templates_mutex should be locked by caller! static void templateFree(txtTemplate_t *template) { assert(template != NULL); if (template->data == NULL) return; if (template->TEMPLATE_NAME) free(template->TEMPLATE_NAME); if (template->SERVICE_NAME) free(template->SERVICE_NAME); if (template->LANGUAGE) free(template->LANGUAGE); template->TEMPLATE_NAME = template->SERVICE_NAME = template->LANGUAGE = NULL; ci_membuf_free(template->data); template->data = NULL; } static void template_release(txtTemplate_t *template) { int must_free = 0; if (!template) return; /*It is not in cached list release allocated memory*/ if (template->non_cached) { templateFree(template); free(template); return; } if (template->must_free || templateExpired(template)) { must_free = 1; } /*It is in templates cache just unlock it*/ ci_thread_mutex_lock(&templates_mutex); template->locked--; if (template->locked < 0) template->locked = 0; if (must_free && template->locked == 0) templateFree(template); else template->must_free = must_free; ci_thread_mutex_unlock(&templates_mutex); } //templates_mutex should not be locked by caller! void ci_txt_template_reset(void) { int i = 0; ci_thread_mutex_lock(&templates_mutex); for (i = 0; i < TEMPLATE_CACHE_SIZE; i++) { templateFree(&templates[i]); } ci_thread_mutex_unlock(&templates_mutex); } /*this function is not thread safe. Will be called only in main threads at shutdown.*/ void ci_txt_template_close(void) { int i; if (!templates) return; for (i = 0; i < TEMPLATE_CACHE_SIZE; i++) { templateFree(&templates[i]); } free(templates); templates = NULL; ci_thread_mutex_destroy(&templates_mutex); } //templates_mutex should be locked by caller! static txtTemplate_t *templateFind(const char *SERVICE_NAME, const char *TEMPLATE_NAME, const char *LANGUAGE) { int i = 0; // We don't lock here as it should be locked elsewhere for (i = 0; i < TEMPLATE_CACHE_SIZE; i++) { if (templates[i].data != NULL && templates[i].must_free == 0) { if (strcmp(templates[i].SERVICE_NAME, SERVICE_NAME) == 0 && strcmp(templates[i].TEMPLATE_NAME, TEMPLATE_NAME) == 0 && strcmp(templates[i].LANGUAGE, LANGUAGE) == 0) { ci_debug_printf(4, "templateFind: found: %s, %s, %s in cache at index %d\n", SERVICE_NAME, LANGUAGE, TEMPLATE_NAME, i); return &templates[i]; } } } return NULL; } //templates_mutex should be locked by caller! static txtTemplate_t *templateFindFree(void) { time_t oldest = 0; txtTemplate_t *useme = NULL; int i = 0; // We don't lock here as it should be locked elsewhere // First we try to find an unused template slot for (i = 0; i < TEMPLATE_CACHE_SIZE; i++) if (templates[i].data == NULL) return &templates[i]; // We didn't find one, so look for most unused for (i = 0; i < TEMPLATE_CACHE_SIZE; i++) { if (templates[i].last_used < oldest && templates[i].locked <= 0) { oldest = templates[i].last_used; useme = &templates[i]; } } if (useme != NULL) if (useme->data != NULL) templateFree(useme); return useme; } static txtTemplate_t *templateTryLoadText(const ci_request_t * req, const char *service_name, const char *page_name, const char *lang) { int fd; char path[CI_MAX_PATH]; char buf[4096]; struct stat file; ssize_t len; ci_membuf_t *textbuff = NULL; txtTemplate_t *tempTemplate = NULL; time_t current_time; time(¤t_time); // Protect the template cache structure ci_thread_mutex_lock(&templates_mutex); tempTemplate = templateFind(service_name, page_name, lang); if (tempTemplate != NULL) { tempTemplate->last_used = current_time; tempTemplate->locked++; ci_thread_mutex_unlock(&templates_mutex); // unlock the templates structure return tempTemplate; } ci_thread_mutex_unlock(&templates_mutex); // We didn't go into the if, release the lock makeTemplatePathFileName(path, CI_MAX_PATH, service_name, page_name, lang); ci_debug_printf(9, "templateTryLoadText: %s\n", path); fd = open(path, O_RDONLY); if (fd < 0) { ci_debug_printf(4, "templateTryLoadText: '%s': %s\n", path, strerror(errno)); return NULL; } fstat(fd, &file); /* TODO: do not allow txttemplates bigger than 64k */ textbuff = ci_membuf_new_sized(file.st_size + 1); if (!textbuff) { ci_debug_printf(1, "templateTryLoadText: membuf allocation failed!\n"); return NULL; } while ((len = read(fd, buf, sizeof(buf))) > 0) { ci_membuf_write(textbuff, buf, len, 0); } close(fd); if (len < 0) { ci_debug_printf(4, "templateTryLoadText: failed to fully read: '%s': %s\n", path, strerror(errno)); ci_membuf_free(textbuff); return NULL; } ci_membuf_write(textbuff, "\0", 1, 1); // terminate the string for safety // Protect the template cache structure ci_thread_mutex_lock(&templates_mutex); // Find free template tempTemplate = templateFindFree(); if (tempTemplate != NULL) { tempTemplate->locked++; tempTemplate->non_cached = 0; } else { ci_debug_printf(4, "templateTryLoadText: Unable to find free template slot.\n"); tempTemplate = malloc(sizeof(txtTemplate_t )); if (!tempTemplate) { ci_debug_printf(1, "templateTryLoadText: memory allocation error!\n"); ci_thread_mutex_unlock(&templates_mutex); ci_membuf_free(textbuff); return NULL; } tempTemplate->non_cached = 1; } tempTemplate->SERVICE_NAME = strdup(service_name); tempTemplate->TEMPLATE_NAME = strdup(page_name); tempTemplate->LANGUAGE = strdup(lang); tempTemplate->data = textbuff; tempTemplate->loaded = current_time; tempTemplate->modified = file.st_mtime; tempTemplate->last_used = current_time; tempTemplate->must_free = 0; // Unlock the template cache structure ci_thread_mutex_unlock(&templates_mutex); return tempTemplate; } static txtTemplate_t *templateLoadText(const ci_request_t * req, const char *service_name, const char *page_name) { const char *acceptLangHeader; const char *s; char preferred[32]; int i; txtTemplate_t *template = NULL; if ((acceptLangHeader = ci_http_request_get_header((ci_request_t *)req, "Accept-Language")) != NULL) { s = acceptLangHeader; ci_debug_printf(4, "templateLoadText: Languages are: '%s'\n", s); while ( *s != '\0') { while (*s != '\0' && isspace(*s)) s++; /* eat spaces*/ for (i = 0; *s != '\0' && *s != ',' && *s != ';' && !isspace(*s) && i < sizeof(preferred) - 1; i++,s++) preferred[i] = *s; /*Copy the language part*/ preferred[i] = '\0'; ci_debug_printf(6, "Try load the error message on language:%s\n", preferred); template = templateTryLoadText(req, service_name, page_name, preferred); if (template != NULL) { return template; } /* This is a bad idea, as currently implemented it allows frequent disk accesses. Symlinks en_GB -> en, en_US->en, etc. are probably the right answer. On thinking about it, these shouldn't trash the cash to badly.*/ /* else { str2 = strchr(preferred, '-'); if(str2) str2[0] = '\0'; ci_debug_printf(4, "templateLoadText: trying base of preferred language: '%s'\n", preferred); template = templateTryLoadText(req, service_name, page_name, preferred); if (template != NULL) { return template; } } */ while (*s != '\0' && *s != ',') s++; /*ignore the qvalue part(at least for now)*/ if (*s == ',') s++; } } ci_debug_printf(4, "templateLoadText: Accept-Language header not found or was empty!\n"); return templateTryLoadText(req, service_name, page_name, TEMPLATE_DEF_LANG); } // Caller should release the returned buffer when they have finished with it. ci_membuf_t *ci_txt_template_build_content(const ci_request_t *req, const char *SERVICE_NAME, const char *TEMPLATE_NAME, struct ci_fmt_entry *user_table) { ci_membuf_t *content; char templpath[CI_MAX_PATH]; txtTemplate_t *template = NULL; content = ci_membuf_new_sized(TEMPLATE_MEMBUF_SIZE); if (!content) { ci_debug_printf(1, "Failed to allocate buffer to load template!"); return NULL; } /*templateLoadText also locks the template*/ template = templateLoadText(req, SERVICE_NAME, TEMPLATE_NAME); if (template) { content->endpos = ci_format_text((ci_request_t *)req, template->data->buf, content->buf, content->bufsize, user_table); ci_membuf_write(content, "\0", 1, 1); // terminate the string for safety (????) if (template->LANGUAGE) ci_membuf_attr_add(content, "lang", template->LANGUAGE, strlen(template->LANGUAGE) + 1); template_release(template); } else { makeTemplatePathFileName(templpath, CI_MAX_PATH, SERVICE_NAME, TEMPLATE_NAME, TEMPLATE_DEF_LANG); content->endpos = snprintf(content->buf, content->bufsize, "ERROR: Unable to find specified template: %s\n", templpath); if (content->endpos > content->bufsize) content->endpos = content->bufsize; ci_membuf_attr_add(content, "lang", TEMPLATE_DEF_LANG, strlen(TEMPLATE_DEF_LANG) + 1); ci_debug_printf(1, "ERROR: Unable to find specified template: %s\n", templpath); } return content; } c_icap-0.5.6/port.c0000664000175000017500000000712713371253152011024 00000000000000/* * Copyright (C) 20016 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "array.h" #include "port.h" #ifdef USE_OPENSSL #include "net_io_ssl.h" #endif #include "debug.h" static int mystrcmp(const char *s1, const char *s2) { if (s1 && !s2) return 1; if (!s1 && s2) return -1; if (!s1 && !s2) return 0; return strcmp(s1, s2); } static int ci_port_compare_config(ci_port_t *src, ci_port_t *dst) { if (dst->port != src->port) return 0; if (mystrcmp(dst->address, src->address)) return 0; /*fd, configured, protocol_family and secs_to_linger are filled by c-icap while port configured*/ #ifdef USE_OPENSSL if (dst->tls_enabled != src->tls_enabled) return 0; #endif return 1; } static void ci_port_move_configured(ci_port_t *dst, ci_port_t *src) { dst->configured = src->configured; dst->fd = src->fd; src->configured = 0; src->fd = -1; #ifdef USE_OPENSSL dst->tls_enabled = src->tls_enabled; dst->tls_context = src->tls_context; dst->bio = src->bio; src->tls_context = NULL; src->bio = NULL; if (src->tls_enabled) ci_port_reconfigure_tls(dst); #endif } void ci_port_handle_reconfigure(ci_vector_t *new_ports, ci_vector_t *old_ports) { int i, k; ci_port_t *find_port, *check_port, *check_old_port; for (i = 0; (check_port = (ci_port_t *)ci_vector_get(new_ports, i)) != NULL; ++i) { for (k = 0, find_port = NULL; (find_port == NULL) && ((check_old_port = (ci_port_t *)ci_vector_get(old_ports, k)) != NULL); ++k ) { if (ci_port_compare_config(check_port, check_old_port)) { find_port = check_port; ci_port_move_configured(check_port, check_old_port); } } if (find_port) ci_debug_printf(1, "Port %d is already configured\n", find_port->port); } } void ci_port_close(ci_port_t *port) { if (port->fd < 0) return; #ifdef USE_OPENSSL if (port->bio) icap_close_server_tls(port); else #endif close(port->fd); port->fd = -1; port->configured = 0; } void ci_port_list_release(ci_vector_t *ports) { int i; ci_port_t *p; for (i = 0; (p = (ci_port_t *)ci_vector_get(ports, i)) != NULL; ++i) { ci_port_close(p); if (p->address) free(p->address); #ifdef USE_OPENSSL if (p->tls_server_cert) free(p->tls_server_cert); if (p->tls_server_key) free(p->tls_server_key); if (p->tls_client_ca_certs) free(p->tls_client_ca_certs); if (p->tls_cafile) free(p->tls_cafile); if (p->tls_capath) free(p->tls_capath); if (p->tls_method) free(p->tls_method); if (p->tls_ciphers) free(p->tls_ciphers); #endif } ci_vector_destroy(ports); } c_icap-0.5.6/modules/0000775000175000017500000000000013570504160011414 500000000000000c_icap-0.5.6/modules/shared_cache.c0000664000175000017500000002744013541163124014077 00000000000000#include "common.h" #include "c-icap.h" #include "commands.h" #include "debug.h" #include "cache.h" #include "module.h" #include "proc_mutex.h" #include "shared_mem.h" #include static int init_shared_cache(struct ci_server_conf *server_conf); static void release_shared_cache(); CI_DECLARE_MOD_DATA common_module_t module = { "shared_cache", init_shared_cache, NULL, release_shared_cache, NULL, }; struct ci_cache_type ci_shared_cache; static int init_shared_cache(struct ci_server_conf *server_conf) { ci_cache_type_register(&ci_shared_cache); return 1; } static void release_shared_cache() { } int ci_shared_cache_init(struct ci_cache *cache, const char *name); const void *ci_shared_cache_search(struct ci_cache *cache, const void *key, void **val, void *data, void *(*dup_from_cache)(const void *stored_val, size_t stored_val_size, void *data)); int ci_shared_cache_update(struct ci_cache *cache, const void *key, const void *val, size_t val_size, void *(*copy_to_cache)(void *buf, const void *val, size_t buf_size)); void ci_shared_cache_destroy(struct ci_cache *cache); struct ci_cache_type ci_shared_cache = { ci_shared_cache_init, ci_shared_cache_search, ci_shared_cache_update, ci_shared_cache_destroy, "shared" }; /*Should be power of 2 and equal or less than 64*/ #define CACHE_PAGES 4 struct shared_cache_stats { int cache_users; struct page_stats { int64_t hits; int64_t searches; int64_t updates; int64_t update_hits; } page[CACHE_PAGES]; }; struct shared_cache_data { void *mem_ptr; void *slots; ci_shared_mem_id_t id; size_t max_hash; size_t entry_size; size_t shared_mem_size; int entries; int pages; int page_size; int page_shift_op; struct shared_cache_stats *stats; ci_proc_mutex_t cache_mutex; ci_proc_mutex_t mutex[CACHE_PAGES]; }; struct shared_cache_slot { unsigned int hash; time_t expires; size_t key_size; size_t value_size; unsigned char bytes[]; }; unsigned int ci_hash_compute2(unsigned long hash_max_value, const void *data, unsigned int len) { const unsigned char *s = (const unsigned char *)(data); unsigned int n = 0; unsigned int j = 0; unsigned int i = 0; while ((s - (const unsigned char *)data) < len) { ++j; n ^= 271 * *s; ++s; } i = n ^ (j * 271); return i % hash_max_value; } const char *ci_shared_mem_print_id(char *buf, size_t size, ci_shared_mem_id_t *id) { if (buf) { if (id->scheme) id->scheme->shared_mem_print_info(id, buf, size); else *buf = '\0'; } return buf; } void command_attach_shared_mem(const char *name, int type, void *data) { char buf[128]; struct shared_cache_data *shared_cache = (struct shared_cache_data *)data; shared_cache->mem_ptr = ci_shared_mem_attach(&shared_cache->id); shared_cache->stats = (struct shared_cache_stats *)shared_cache->mem_ptr; shared_cache->slots = (void *)(shared_cache->mem_ptr + sizeof(struct shared_cache_stats)); ci_debug_printf(3, "Shared cache id:'%s' attached on address %p\n", ci_shared_mem_print_id(buf, sizeof(buf), &shared_cache->id), shared_cache->mem_ptr); ci_proc_mutex_lock(&(shared_cache->cache_mutex)); ++shared_cache->stats->cache_users; ci_proc_mutex_unlock(&(shared_cache->cache_mutex)); } int ci_shared_cache_init(struct ci_cache *cache, const char *name) { unsigned int next_hash = 63; unsigned int final_max_hash = 63; int i; struct shared_cache_data *data; data = (struct shared_cache_data *)malloc(sizeof(struct shared_cache_data)); data->entry_size = _CI_ALIGN(cache->max_object_size > 0 ? cache->max_object_size : 1); data->entries = _CI_ALIGN(cache->mem_size) / data->entry_size; while (next_hash < data->entries) { final_max_hash = next_hash; next_hash++; next_hash = (next_hash << 1) -1; } data->max_hash = final_max_hash; data->entries = final_max_hash + 1; data->shared_mem_size = sizeof(struct shared_cache_stats) + data->entries * data->entry_size; data->mem_ptr = ci_shared_mem_create(&data->id, name, data->shared_mem_size); if (!data->mem_ptr) { free(data); ci_debug_printf(1, "Error allocating shared mem for %s cache\n", name); return 0; } data->stats = (struct shared_cache_stats *)data->mem_ptr; data->slots = data->mem_ptr + sizeof(struct shared_cache_stats); memset(data->stats, 0, sizeof(struct shared_cache_stats)); data->stats->cache_users = 1; /*TODO: check for error*/ for (i = 0; i < CACHE_PAGES; ++i) { ci_proc_mutex_init(&(data->mutex[i]), name); } ci_proc_mutex_init(&(data->cache_mutex), name); data->page_size = data->entries / CACHE_PAGES; /* CACHE_PAGES can not be bigger than 64, the minimum entries value*/ assert(data->entries % data->page_size == 0); data->pages = CACHE_PAGES; /* The pages and page_size should be a power of 2*/ assert((data->pages & (data->pages - 1)) == 0); assert((data->page_size & (data->page_size - 1)) == 0); for (data->page_shift_op = 0; ((data->page_size >> data->page_shift_op) & 0x1) ==0 && data->page_shift_op < 64; ++data->page_shift_op ); assert(data->page_shift_op < 64); ci_debug_printf(1, "Shared mem %s created\nMax shared memory: %u (of the %u requested), max entry size: %u, maximum entries: %u\n", name, (unsigned int)data->shared_mem_size, (unsigned int)cache->mem_size, (unsigned int)data->entry_size, data->entries); cache->cache_data = data; ci_command_register_action("shared_cache_attach_cmd", CHILD_START_CMD, data, command_attach_shared_mem); return 1; } int rw_lock_page(struct shared_cache_data *cache_data, int pos) { ci_proc_mutex_lock(&cache_data->mutex[pos >> cache_data->page_shift_op]); return 1; } int rd_lock_page(struct shared_cache_data *cache_data, int pos) { ci_proc_mutex_lock(&cache_data->mutex[pos >> cache_data->page_shift_op]); return 1; } void unlock_page(struct shared_cache_data *cache_data, int pos) { ci_proc_mutex_unlock(&cache_data->mutex[pos >> cache_data->page_shift_op]); } time_t ci_internal_time() { return time(NULL); } const void *ci_shared_cache_search(struct ci_cache *cache, const void *key, void **val, void *user_data, void *(*dup_from_cache)(const void *stored_val, size_t stored_val_size, void *user_data)) { time_t current_time; const void *cache_key, *cache_val; struct shared_cache_data *cache_data = cache->cache_data; unsigned int hash = ci_hash_compute(cache_data->max_hash, key, cache->key_ops->size(key)); *val = NULL; if (hash >= cache_data->entries) hash = cache_data->entries -1; if (!rd_lock_page(cache_data, hash)) return NULL; unsigned int page = (hash >> cache_data->page_shift_op); ++cache_data->stats->page[page].searches; unsigned int pos; int done; for (pos = hash, done = 0, cache_key = NULL; !cache_key && !done && ((pos >> cache_data->page_shift_op) == page); ++pos) { struct shared_cache_slot *slot = cache_data->slots + (pos * cache_data->entry_size); cache_key = (const void *)slot->bytes; cache_val = (const void *)(&slot->bytes[slot->key_size + 1]); if (slot->hash != hash) { cache_key = NULL; done = 1; } else if (cache->key_ops->compare(cache_key, key) == 0) { current_time = ci_internal_time(); if (slot->expires < current_time) cache_key = NULL; else if (slot->value_size) { if (dup_from_cache) *val = (*dup_from_cache)(cache_val, slot->value_size, user_data); else { if ((*val = ci_buffer_alloc(slot->value_size))) memcpy(*val, cache_val, slot->value_size); } } } else cache_key = NULL; } if (cache_key) ++cache_data->stats->page[page].hits; unlock_page(cache_data, hash); return cache_key; } int ci_shared_cache_update(struct ci_cache *cache, const void *key, const void *val, size_t val_size, void *(*copy_to_cache)(void *buf, const void *val, size_t buf_size)) { time_t expire_time, current_time; void *cache_key, *cache_val; size_t key_size; int ret, can_updated; struct shared_cache_data *cache_data = cache->cache_data; key_size = cache->key_ops->size(key); if ((key_size + val_size + sizeof(struct shared_cache_slot)) > cache_data->entry_size) { /*Does not fit to a cache_data slot.*/ return 0; } unsigned int hash = ci_hash_compute(cache_data->max_hash, key, key_size); if (hash >= cache_data->entries) hash = cache_data->entries -1; current_time = ci_internal_time(); expire_time = current_time + cache->ttl; if (!rw_lock_page(cache_data, hash)) return 0; /*not able to obtain a rw lock*/ unsigned int page = (hash >> cache_data->page_shift_op); ++cache_data->stats->page[page].updates; unsigned int pos; int done; for (pos = hash, ret = 0, done = 0; ret == 0 && !done && ((hash >> cache_data->page_shift_op) == (pos >> cache_data->page_shift_op)); ++pos) { struct shared_cache_slot *slot = cache_data->slots + (pos * cache_data->entry_size); cache_key = (void *)slot->bytes; can_updated = 0; if (slot->hash < hash) { can_updated = 1; } else if (cache->key_ops->compare(cache_key, key) == 0) { /*we are updating key with a new value*/ can_updated = 1; } else if (slot->expires < current_time + cache->ttl) { can_updated = 1; } else if (pos == hash && slot->expires < (current_time + (cache->ttl / 2))) { /*entries on pos == hash which are near to expire*/ can_updated = 1; } else if (pos != hash && slot->hash == pos) { /*entry is not expired, and it is not on a continues block we can use */ done = 1; } if (can_updated) { slot->hash = pos; slot->expires = expire_time; slot->key_size = key_size; slot->value_size = val_size; memcpy(cache_key, key, key_size); cache_val = (void *)(&slot->bytes[slot->key_size + 1]); if (copy_to_cache) copy_to_cache(cache_val, val, slot->value_size); else memcpy(cache_val, val, slot->value_size); ret = 1; ++cache_data->stats->page[page].update_hits; } else ret = 0; } unlock_page(cache_data, hash); return ret; } void ci_shared_cache_destroy(struct ci_cache *cache) { int i, users; uint64_t updates, update_hits, searches, hits; struct shared_cache_data *data = cache->cache_data; ci_proc_mutex_lock(&data->cache_mutex); users = --data->stats->cache_users; ci_proc_mutex_unlock(&data->cache_mutex); if (users == 0) { updates = update_hits = searches = hits = 0; for (i = 0; i < CACHE_PAGES; ++i) { updates += data->stats->page[i].updates; update_hits += data->stats->page[i].update_hits; searches += data->stats->page[i].searches; hits += data->stats->page[i].hits; } ci_debug_printf(3, "Last user, the cache will be destroyed\n"); ci_debug_printf(3, "Cache updates: %" PRIu64 ", update hits:%" PRIu64 ", searches: %" PRIu64 ", hits: %" PRIu64 "\n", updates, update_hits, searches, hits ); ci_shared_mem_destroy(&data->id); ci_proc_mutex_destroy(&data->cache_mutex); for (i = 0; i < CACHE_PAGES; ++i) { ci_proc_mutex_destroy(&data->mutex[i]); } } else ci_shared_mem_detach(&data->id); } c_icap-0.5.6/modules/Makefile.in0000664000175000017500000011013313570504057013405 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # lib_LTLIBRARIES=sys_logger.la perl_handler.la VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @USEPERL_TRUE@am__append_1 = perl_handler.la @USEBDB_TRUE@am__append_2 = bdb_tables.la @USELDAP_TRUE@am__append_3 = ldap_module.la @USEMEMCACHED_TRUE@am__append_4 = memcached_cache.la subdir = modules ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/autoconf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) bdb_tables_la_DEPENDENCIES = am_bdb_tables_la_OBJECTS = bdb_tables_la-bdb_tables.lo bdb_tables_la_OBJECTS = $(am_bdb_tables_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = bdb_tables_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(bdb_tables_la_CFLAGS) \ $(CFLAGS) $(bdb_tables_la_LDFLAGS) $(LDFLAGS) -o $@ @USEBDB_TRUE@am_bdb_tables_la_rpath = -rpath $(pkglibdir) dnsbl_tables_la_DEPENDENCIES = am_dnsbl_tables_la_OBJECTS = dnsbl_tables_la-dnsbl_tables.lo dnsbl_tables_la_OBJECTS = $(am_dnsbl_tables_la_OBJECTS) dnsbl_tables_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(dnsbl_tables_la_CFLAGS) $(CFLAGS) $(dnsbl_tables_la_LDFLAGS) \ $(LDFLAGS) -o $@ ldap_module_la_DEPENDENCIES = $(top_builddir)/libicapapi.la am_ldap_module_la_OBJECTS = ldap_module_la-ldap_module.lo ldap_module_la_OBJECTS = $(am_ldap_module_la_OBJECTS) ldap_module_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(ldap_module_la_CFLAGS) $(CFLAGS) $(ldap_module_la_LDFLAGS) \ $(LDFLAGS) -o $@ @USELDAP_TRUE@am_ldap_module_la_rpath = -rpath $(pkglibdir) memcached_cache_la_DEPENDENCIES = am_memcached_cache_la_OBJECTS = memcached_cache_la-memcached.lo memcached_cache_la_OBJECTS = $(am_memcached_cache_la_OBJECTS) memcached_cache_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(memcached_cache_la_CFLAGS) $(CFLAGS) \ $(memcached_cache_la_LDFLAGS) $(LDFLAGS) -o $@ @USEMEMCACHED_TRUE@am_memcached_cache_la_rpath = -rpath $(pkglibdir) perl_handler_la_DEPENDENCIES = am_perl_handler_la_OBJECTS = perl_handler_la-perl_handler.lo perl_handler_la_OBJECTS = $(am_perl_handler_la_OBJECTS) perl_handler_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(perl_handler_la_CFLAGS) $(CFLAGS) $(perl_handler_la_LDFLAGS) \ $(LDFLAGS) -o $@ @USEPERL_TRUE@am_perl_handler_la_rpath = -rpath $(pkglibdir) shared_cache_la_DEPENDENCIES = am_shared_cache_la_OBJECTS = shared_cache_la-shared_cache.lo shared_cache_la_OBJECTS = $(am_shared_cache_la_OBJECTS) shared_cache_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(shared_cache_la_CFLAGS) $(CFLAGS) $(shared_cache_la_LDFLAGS) \ $(LDFLAGS) -o $@ sys_logger_la_DEPENDENCIES = am_sys_logger_la_OBJECTS = sys_logger_la-sys_logger.lo sys_logger_la_OBJECTS = $(am_sys_logger_la_OBJECTS) sys_logger_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(sys_logger_la_CFLAGS) \ $(CFLAGS) $(sys_logger_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(bdb_tables_la_SOURCES) $(dnsbl_tables_la_SOURCES) \ $(ldap_module_la_SOURCES) $(memcached_cache_la_SOURCES) \ $(perl_handler_la_SOURCES) $(shared_cache_la_SOURCES) \ $(sys_logger_la_SOURCES) DIST_SOURCES = $(bdb_tables_la_SOURCES) $(dnsbl_tables_la_SOURCES) \ $(ldap_module_la_SOURCES) $(memcached_cache_la_SOURCES) \ $(perl_handler_la_SOURCES) $(shared_cache_la_SOURCES) \ $(sys_logger_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BDB_ADD_FLAG = @BDB_ADD_FLAG@ BDB_ADD_LDADD = @BDB_ADD_LDADD@ BDB_LNDIR_LDADD = @BDB_LNDIR_LDADD@ BROTLI_ADD_FLAG = @BROTLI_ADD_FLAG@ BROTLI_ADD_LDADD = @BROTLI_ADD_LDADD@ BROTLI_LNDIR_LDADD = @BROTLI_LNDIR_LDADD@ BZLIB_ADD_FLAG = @BZLIB_ADD_FLAG@ BZLIB_ADD_LDADD = @BZLIB_ADD_LDADD@ BZLIB_LNDIR_LDADD = @BZLIB_LNDIR_LDADD@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CICAPLIB_VERSION = @CICAPLIB_VERSION@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ C_ICAP_HEX_VERSION = @C_ICAP_HEX_VERSION@ DEFINE_INT64 = @DEFINE_INT64@ DEFINE_INT8 = @DEFINE_INT8@ DEFINE_OFF_T = @DEFINE_OFF_T@ DEFINE_SIZE_OFF_T = @DEFINE_SIZE_OFF_T@ DEFINE_SIZE_T = @DEFINE_SIZE_T@ DEFINE_SIZE_VOID_P = @DEFINE_SIZE_VOID_P@ DEFINE_UINT64 = @DEFINE_UINT64@ DEFINE_UINT8 = @DEFINE_UINT8@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_ADD_FLAG = @DL_ADD_FLAG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTTYPES_H = @INTTYPES_H@ INVISIBILITY_CFLAG = @INVISIBILITY_CFLAG@ LD = @LD@ LDAP_ADD_FLAG = @LDAP_ADD_FLAG@ LDAP_ADD_LDADD = @LDAP_ADD_LDADD@ LDAP_LNDIR_LDADD = @LDAP_LNDIR_LDADD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEMCACHED_ADD_FLAG = @MEMCACHED_ADD_FLAG@ MEMCACHED_ADD_LDADD = @MEMCACHED_ADD_LDADD@ MEMCACHED_LNDIR_LDADD = @MEMCACHED_LNDIR_LDADD@ MKDIR_P = @MKDIR_P@ MODULES_CFLAGS = @MODULES_CFLAGS@ MODULES_LIBADD = @MODULES_LIBADD@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_ADD_FLAG = @OPENSSL_ADD_FLAG@ OPENSSL_ADD_LDADD = @OPENSSL_ADD_LDADD@ OPENSSL_LNDIR_LDADD = @OPENSSL_LNDIR_LDADD@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_ADD_FLAG = @PCRE_ADD_FLAG@ PCRE_ADD_LDADD = @PCRE_ADD_LDADD@ PCRE_LNDIR_LDADD = @PCRE_LNDIR_LDADD@ POSIX_FILE_LOCK = @POSIX_FILE_LOCK@ POSIX_MAPPED_FILES = @POSIX_MAPPED_FILES@ POSIX_SEMAPHORES = @POSIX_SEMAPHORES@ POSIX_SHARED_MEM = @POSIX_SHARED_MEM@ PTHREADS_RWLOCK = @PTHREADS_RWLOCK@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSV_IPC = @SYSV_IPC@ SYS_TYPES_H = @SYS_TYPES_H@ THREADS_LDADD = @THREADS_LDADD@ THREADS_LDFLAGS = @THREADS_LDFLAGS@ USE_COMPAT = @USE_COMPAT@ USE_IPV6 = @USE_IPV6@ USE_OPENSSL = @USE_OPENSSL@ USE_POLL = @USE_POLL@ USE_REGEX = @USE_REGEX@ VERSION = @VERSION@ VISIBILITY_ATTR = @VISIBILITY_ATTR@ ZLIB_ADD_FLAG = @ZLIB_ADD_FLAG@ ZLIB_ADD_LDADD = @ZLIB_ADD_LDADD@ ZLIB_LNDIR_LDADD = @ZLIB_LNDIR_LDADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen_bin = @doxygen_bin@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ has_doxygen = @has_doxygen@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perlccflags = @perlccflags@ perlcore = @perlcore@ perlldflags = @perlldflags@ perllib = @perllib@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkglib_LTLIBRARIES = sys_logger.la dnsbl_tables.la shared_cache.la \ $(am__append_1) $(am__append_2) $(am__append_3) \ $(am__append_4) AM_CPPFLAGS = -I$(top_srcdir)/ -I$(top_srcdir)/include/ -I$(top_builddir)/include/ sys_logger_la_LIBADD = @MODULES_LIBADD@ sys_logger_la_CFLAGS = @MODULES_CFLAGS@ @OPENSSL_ADD_FLAG@ sys_logger_la_LDFLAGS = -module -avoid-version sys_logger_la_SOURCES = sys_logger.c dnsbl_tables_la_LIBADD = @MODULES_LIBADD@ dnsbl_tables_la_CFLAGS = @MODULES_CFLAGS@ @OPENSSL_ADD_FLAG@ dnsbl_tables_la_LDFLAGS = -module -avoid-version dnsbl_tables_la_SOURCES = dnsbl_tables.c perl_handler_la_LIBADD = @MODULES_LIBADD@ @perllib@ -L@perlcore@ -lperl perl_handler_la_CFLAGS = @MODULES_CFLAGS@ @perlccflags@ -I@perlcore@ perl_handler_la_LDFLAGS = -module -avoid-version @perlldflags@ perl_handler_la_SOURCES = perl_handler.c bdb_tables_la_LIBADD = @MODULES_LIBADD@ @BDB_ADD_LDADD@ bdb_tables_la_CFLAGS = @MODULES_CFLAGS@ @BDB_ADD_FLAG@ bdb_tables_la_LDFLAGS = -module -avoid-version bdb_tables_la_SOURCES = bdb_tables.c ldap_module_la_LIBADD = @MODULES_LIBADD@ @LDAP_ADD_LDADD@ $(top_builddir)/libicapapi.la ldap_module_la_CFLAGS = @MODULES_CFLAGS@ @LDAP_ADD_FLAG@ ldap_module_la_LDFLAGS = -module -avoid-version ldap_module_la_SOURCES = ldap_module.c memcached_cache_la_LIBADD = @MODULES_LIBADD@ @MEMCACHED_ADD_LDADD@ memcached_cache_la_CFLAGS = @MODULES_CFLAGS@ @MEMCACHED_ADD_FLAG@ memcached_cache_la_LDFLAGS = -module -avoid-version memcached_cache_la_SOURCES = memcached.c shared_cache_la_LIBADD = @MODULES_LIBADD@ shared_cache_la_CFLAGS = @OPENSSL_ADD_FLAG@ shared_cache_la_LDFLAGS = -module -avoid-version shared_cache_la_SOURCES = shared_cache.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu modules/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } bdb_tables.la: $(bdb_tables_la_OBJECTS) $(bdb_tables_la_DEPENDENCIES) $(EXTRA_bdb_tables_la_DEPENDENCIES) $(AM_V_CCLD)$(bdb_tables_la_LINK) $(am_bdb_tables_la_rpath) $(bdb_tables_la_OBJECTS) $(bdb_tables_la_LIBADD) $(LIBS) dnsbl_tables.la: $(dnsbl_tables_la_OBJECTS) $(dnsbl_tables_la_DEPENDENCIES) $(EXTRA_dnsbl_tables_la_DEPENDENCIES) $(AM_V_CCLD)$(dnsbl_tables_la_LINK) -rpath $(pkglibdir) $(dnsbl_tables_la_OBJECTS) $(dnsbl_tables_la_LIBADD) $(LIBS) ldap_module.la: $(ldap_module_la_OBJECTS) $(ldap_module_la_DEPENDENCIES) $(EXTRA_ldap_module_la_DEPENDENCIES) $(AM_V_CCLD)$(ldap_module_la_LINK) $(am_ldap_module_la_rpath) $(ldap_module_la_OBJECTS) $(ldap_module_la_LIBADD) $(LIBS) memcached_cache.la: $(memcached_cache_la_OBJECTS) $(memcached_cache_la_DEPENDENCIES) $(EXTRA_memcached_cache_la_DEPENDENCIES) $(AM_V_CCLD)$(memcached_cache_la_LINK) $(am_memcached_cache_la_rpath) $(memcached_cache_la_OBJECTS) $(memcached_cache_la_LIBADD) $(LIBS) perl_handler.la: $(perl_handler_la_OBJECTS) $(perl_handler_la_DEPENDENCIES) $(EXTRA_perl_handler_la_DEPENDENCIES) $(AM_V_CCLD)$(perl_handler_la_LINK) $(am_perl_handler_la_rpath) $(perl_handler_la_OBJECTS) $(perl_handler_la_LIBADD) $(LIBS) shared_cache.la: $(shared_cache_la_OBJECTS) $(shared_cache_la_DEPENDENCIES) $(EXTRA_shared_cache_la_DEPENDENCIES) $(AM_V_CCLD)$(shared_cache_la_LINK) -rpath $(pkglibdir) $(shared_cache_la_OBJECTS) $(shared_cache_la_LIBADD) $(LIBS) sys_logger.la: $(sys_logger_la_OBJECTS) $(sys_logger_la_DEPENDENCIES) $(EXTRA_sys_logger_la_DEPENDENCIES) $(AM_V_CCLD)$(sys_logger_la_LINK) -rpath $(pkglibdir) $(sys_logger_la_OBJECTS) $(sys_logger_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdb_tables_la-bdb_tables.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsbl_tables_la-dnsbl_tables.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldap_module_la-ldap_module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached_cache_la-memcached.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perl_handler_la-perl_handler.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shared_cache_la-shared_cache.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sys_logger_la-sys_logger.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< bdb_tables_la-bdb_tables.lo: bdb_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bdb_tables_la_CFLAGS) $(CFLAGS) -MT bdb_tables_la-bdb_tables.lo -MD -MP -MF $(DEPDIR)/bdb_tables_la-bdb_tables.Tpo -c -o bdb_tables_la-bdb_tables.lo `test -f 'bdb_tables.c' || echo '$(srcdir)/'`bdb_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bdb_tables_la-bdb_tables.Tpo $(DEPDIR)/bdb_tables_la-bdb_tables.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bdb_tables.c' object='bdb_tables_la-bdb_tables.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bdb_tables_la_CFLAGS) $(CFLAGS) -c -o bdb_tables_la-bdb_tables.lo `test -f 'bdb_tables.c' || echo '$(srcdir)/'`bdb_tables.c dnsbl_tables_la-dnsbl_tables.lo: dnsbl_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dnsbl_tables_la_CFLAGS) $(CFLAGS) -MT dnsbl_tables_la-dnsbl_tables.lo -MD -MP -MF $(DEPDIR)/dnsbl_tables_la-dnsbl_tables.Tpo -c -o dnsbl_tables_la-dnsbl_tables.lo `test -f 'dnsbl_tables.c' || echo '$(srcdir)/'`dnsbl_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dnsbl_tables_la-dnsbl_tables.Tpo $(DEPDIR)/dnsbl_tables_la-dnsbl_tables.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dnsbl_tables.c' object='dnsbl_tables_la-dnsbl_tables.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dnsbl_tables_la_CFLAGS) $(CFLAGS) -c -o dnsbl_tables_la-dnsbl_tables.lo `test -f 'dnsbl_tables.c' || echo '$(srcdir)/'`dnsbl_tables.c ldap_module_la-ldap_module.lo: ldap_module.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ldap_module_la_CFLAGS) $(CFLAGS) -MT ldap_module_la-ldap_module.lo -MD -MP -MF $(DEPDIR)/ldap_module_la-ldap_module.Tpo -c -o ldap_module_la-ldap_module.lo `test -f 'ldap_module.c' || echo '$(srcdir)/'`ldap_module.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ldap_module_la-ldap_module.Tpo $(DEPDIR)/ldap_module_la-ldap_module.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ldap_module.c' object='ldap_module_la-ldap_module.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ldap_module_la_CFLAGS) $(CFLAGS) -c -o ldap_module_la-ldap_module.lo `test -f 'ldap_module.c' || echo '$(srcdir)/'`ldap_module.c memcached_cache_la-memcached.lo: memcached.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(memcached_cache_la_CFLAGS) $(CFLAGS) -MT memcached_cache_la-memcached.lo -MD -MP -MF $(DEPDIR)/memcached_cache_la-memcached.Tpo -c -o memcached_cache_la-memcached.lo `test -f 'memcached.c' || echo '$(srcdir)/'`memcached.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/memcached_cache_la-memcached.Tpo $(DEPDIR)/memcached_cache_la-memcached.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='memcached.c' object='memcached_cache_la-memcached.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(memcached_cache_la_CFLAGS) $(CFLAGS) -c -o memcached_cache_la-memcached.lo `test -f 'memcached.c' || echo '$(srcdir)/'`memcached.c perl_handler_la-perl_handler.lo: perl_handler.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(perl_handler_la_CFLAGS) $(CFLAGS) -MT perl_handler_la-perl_handler.lo -MD -MP -MF $(DEPDIR)/perl_handler_la-perl_handler.Tpo -c -o perl_handler_la-perl_handler.lo `test -f 'perl_handler.c' || echo '$(srcdir)/'`perl_handler.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/perl_handler_la-perl_handler.Tpo $(DEPDIR)/perl_handler_la-perl_handler.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='perl_handler.c' object='perl_handler_la-perl_handler.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(perl_handler_la_CFLAGS) $(CFLAGS) -c -o perl_handler_la-perl_handler.lo `test -f 'perl_handler.c' || echo '$(srcdir)/'`perl_handler.c shared_cache_la-shared_cache.lo: shared_cache.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(shared_cache_la_CFLAGS) $(CFLAGS) -MT shared_cache_la-shared_cache.lo -MD -MP -MF $(DEPDIR)/shared_cache_la-shared_cache.Tpo -c -o shared_cache_la-shared_cache.lo `test -f 'shared_cache.c' || echo '$(srcdir)/'`shared_cache.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/shared_cache_la-shared_cache.Tpo $(DEPDIR)/shared_cache_la-shared_cache.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared_cache.c' object='shared_cache_la-shared_cache.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(shared_cache_la_CFLAGS) $(CFLAGS) -c -o shared_cache_la-shared_cache.lo `test -f 'shared_cache.c' || echo '$(srcdir)/'`shared_cache.c sys_logger_la-sys_logger.lo: sys_logger.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sys_logger_la_CFLAGS) $(CFLAGS) -MT sys_logger_la-sys_logger.lo -MD -MP -MF $(DEPDIR)/sys_logger_la-sys_logger.Tpo -c -o sys_logger_la-sys_logger.lo `test -f 'sys_logger.c' || echo '$(srcdir)/'`sys_logger.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sys_logger_la-sys_logger.Tpo $(DEPDIR)/sys_logger_la-sys_logger.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sys_logger.c' object='sys_logger_la-sys_logger.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sys_logger_la_CFLAGS) $(CFLAGS) -c -o sys_logger_la-sys_logger.lo `test -f 'sys_logger.c' || echo '$(srcdir)/'`sys_logger.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-pkglibLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: c_icap-0.5.6/modules/bdb_tables.c0000664000175000017500000001712113371253152013564 00000000000000#include "common.h" #include "c-icap.h" #include "module.h" #include "lookup_table.h" #include "commands.h" #include "debug.h" #include "util.h" #include BDB_HEADER_PATH(db.h) int init_bdb_tables(struct ci_server_conf *server_conf); void release_bdb_tables(); CI_DECLARE_MOD_DATA common_module_t module = { "bdb_tables", init_bdb_tables, NULL, release_bdb_tables, NULL, }; void *bdb_table_open(struct ci_lookup_table *table); void bdb_table_close(struct ci_lookup_table *table); void *bdb_table_search(struct ci_lookup_table *table, void *key, void ***vals); void bdb_table_release_result(struct ci_lookup_table *table_data,void **val); struct ci_lookup_table_type bdb_table_type = { bdb_table_open, bdb_table_close, bdb_table_search, bdb_table_release_result, NULL, "bdb" }; int init_bdb_tables(struct ci_server_conf *server_conf) { return (ci_lookup_table_type_register(&bdb_table_type) != NULL); } void release_bdb_tables() { ci_lookup_table_type_unregister(&bdb_table_type); } /***********************************************************/ /* bdb_table_type inmplementation */ struct bdb_data { DB_ENV *env_db; DB *db; }; int bdb_table_do_real_open(struct ci_lookup_table *table) { int ret, i; char *s,home[CI_MAX_PATH]; ci_dyn_array_t *args = NULL; ci_array_item_t *arg = NULL; uint32_t cache_size = 0; int caches_num = 0; long int val; struct bdb_data *dbdata = table->data; if (!dbdata) { ci_debug_printf(1, "Db table %s is not initialized?\n", table->path); return 0; } if (dbdata->db || dbdata->env_db) { ci_debug_printf(1, "Db table %s already open?\n", table->path); return 0; } strncpy(home,table->path,CI_MAX_PATH); home[CI_MAX_PATH-1] = '\0'; s=strrchr(home,'/'); if (s) *s = '\0'; else /*no path in filename?*/ home[0] = '\0'; if (table->args) { if ((args = ci_parse_key_value_list(table->args, ','))) { for (i = 0; (arg = ci_dyn_array_get_item(args, i)) != NULL; ++i) { if (strcasecmp(arg->name, "cache-size") == 0) { val = ci_atol_ext((char *)arg->value, NULL); if (val > 0 && val < 1*1024*1024*1024) cache_size = (uint32_t)val; else ci_debug_printf(1, "WARNING: wrong cache-size value: %ld, will not set\n", val); } if (strcasecmp(arg->name, "cache-num") == 0) { val = strtol(arg->value, NULL, 10); if (val > 0 && val < 20) caches_num = (uint32_t)val; else ci_debug_printf(1, "WARNING: wrong cache-num value: %ld, will not set\n", val); } } } } /* * Create an environment and initialize it for additional error * reporting. */ if ((ret = db_env_create(&dbdata->env_db, 0)) != 0) { return 0; } ci_debug_printf(5, "bdb_table_open: Environment created OK.\n"); dbdata->env_db->set_data_dir(dbdata->env_db, home); ci_debug_printf(5, "bdb_table_open: Data dir set to %s.\n", home); /* Open the environment */ if ((ret = dbdata->env_db->open(dbdata->env_db, home, DB_CREATE | DB_INIT_LOCK | DB_INIT_MPOOL|DB_THREAD /*| DB_SYSTEM_MEM*/, 0)) != 0) { ci_debug_printf(1, "bdb_table_open: Environment open failed: %s\n", db_strerror(ret)); dbdata->env_db->close(dbdata->env_db, 0); dbdata->env_db = NULL; return 0; } ci_debug_printf(5, "bdb_table_open: DB environment setup OK.\n"); if ((ret = db_create(&dbdata->db, dbdata->env_db, 0)) != 0) { ci_debug_printf(1, "db_create: %s\n", db_strerror(ret)); dbdata->db = NULL; dbdata->env_db->close(dbdata->env_db, 0); dbdata->env_db = NULL; return 0; } if (cache_size > 0 && (ret = dbdata->db->set_cachesize(dbdata->db, 0, cache_size, caches_num)) != 0) { ci_debug_printf(1, "db_create failed to set cache size: %s\n", db_strerror(ret)); } #if (DB_VERSION_MAJOR > 4) || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1) if ((ret = dbdata->db->open( dbdata->db, NULL, table->path, NULL, DB_BTREE, DB_RDONLY|DB_THREAD, 0)) != 0) { #else if ((ret = dbdata->db->open( dbdata->db, table->path, NULL, DB_BTREE, DB_RDONLY, 0)) != 0) { #endif ci_debug_printf(1, "open db %s: %s\n", table->path, db_strerror(ret)); dbdata->db->close(dbdata->db, 0); dbdata->db = NULL; dbdata->env_db->close(dbdata->env_db, 0); dbdata->env_db = NULL; return 0; } return 1; } void command_real_open_table(const char *name, int type, void *data) { struct ci_lookup_table *table = data; bdb_table_do_real_open(table); } void *bdb_table_open(struct ci_lookup_table *table) { struct bdb_data *dbdata = malloc(sizeof(struct bdb_data)); if (!dbdata) return NULL; dbdata->env_db = NULL; dbdata->db = NULL; table->data = dbdata; /*We can not fork a Berkeley DB table, so we have to open bdb tables for every child, on childs start-up procedure*/ register_command_extend("openBDBtable", CHILD_START_CMD, table, command_real_open_table); return table->data; } void bdb_table_close(struct ci_lookup_table *table) { struct bdb_data *dbdata; dbdata = table->data; if (dbdata && dbdata->db && dbdata->env_db) { dbdata->db->close(dbdata->db,0); dbdata->env_db->close(dbdata->env_db,0); free(table->data); table->data = NULL; } else { ci_debug_printf(3,"table %s is not open?\n", table->path); } } #define DATA_SIZE 32768 #define BDB_MAX_COLS 1024 /*Shound be: BDB_MAX_COLS*sizeof(void *) < DATA_SIZE */ void *bdb_table_search(struct ci_lookup_table *table, void *key, void ***vals) { void *store; void **store_index; void *endstore; DBT db_key, db_data; int ret, i, parse_error = 0; struct bdb_data *dbdata = (struct bdb_data *)table->data; if (!dbdata) { ci_debug_printf(1,"table %s is not initialized?\n", table->path); return NULL; } if (!dbdata->db) { ci_debug_printf(1,"table %s is not open?\n", table->path); return NULL; } *vals = NULL; memset(&db_data, 0, sizeof(db_data)); memset(&db_key, 0, sizeof(db_key)); db_key.data = key; db_key.size = table->key_ops->size(key); db_data.flags = DB_DBT_USERMEM; db_data.data = ci_buffer_alloc(DATA_SIZE); db_data.size = DATA_SIZE; if ((ret = dbdata->db->get(dbdata->db, NULL, &db_key, &db_data, 0)) != 0) { ci_debug_printf(5, "db_entry_exists does not exists: %s\n", db_strerror(ret)); *vals = NULL; return NULL; } if (db_data.size) { store = db_data.data; store_index = store; endstore = store+db_data.size; for (i = 0; store_index[i] != NULL && i < BDB_MAX_COLS && !parse_error; i++) { store_index[i] = store+(unsigned long int)store_index[i]; if (store_index[i] > endstore) parse_error = 1; } if (!parse_error) *vals = store; else { ci_debug_printf(1, "Error while parsing data in bdb_table_search.Is this a c-icap bdb table?\n"); } } return key; } void bdb_table_release_result(struct ci_lookup_table *table,void **val) { ci_buffer_free(val); } c_icap-0.5.6/modules/Makefile.am0000664000175000017500000000352213371253152013373 00000000000000 # lib_LTLIBRARIES=sys_logger.la perl_handler.la pkglib_LTLIBRARIES= sys_logger.la dnsbl_tables.la shared_cache.la if USEPERL pkglib_LTLIBRARIES += perl_handler.la endif if USEBDB pkglib_LTLIBRARIES += bdb_tables.la endif if USELDAP pkglib_LTLIBRARIES += ldap_module.la endif if USEMEMCACHED pkglib_LTLIBRARIES += memcached_cache.la endif AM_CPPFLAGS=-I$(top_srcdir)/ -I$(top_srcdir)/include/ -I$(top_builddir)/include/ sys_logger_la_LIBADD = @MODULES_LIBADD@ sys_logger_la_CFLAGS= @MODULES_CFLAGS@ @OPENSSL_ADD_FLAG@ sys_logger_la_LDFLAGS= -module -avoid-version sys_logger_la_SOURCES = sys_logger.c dnsbl_tables_la_LIBADD = @MODULES_LIBADD@ dnsbl_tables_la_CFLAGS= @MODULES_CFLAGS@ @OPENSSL_ADD_FLAG@ dnsbl_tables_la_LDFLAGS= -module -avoid-version dnsbl_tables_la_SOURCES = dnsbl_tables.c perl_handler_la_LIBADD = @MODULES_LIBADD@ @perllib@ -L@perlcore@ -lperl perl_handler_la_CFLAGS= @MODULES_CFLAGS@ @perlccflags@ -I@perlcore@ perl_handler_la_LDFLAGS= -module -avoid-version @perlldflags@ perl_handler_la_SOURCES = perl_handler.c bdb_tables_la_LIBADD = @MODULES_LIBADD@ @BDB_ADD_LDADD@ bdb_tables_la_CFLAGS= @MODULES_CFLAGS@ @BDB_ADD_FLAG@ bdb_tables_la_LDFLAGS= -module -avoid-version bdb_tables_la_SOURCES = bdb_tables.c ldap_module_la_LIBADD = @MODULES_LIBADD@ @LDAP_ADD_LDADD@ $(top_builddir)/libicapapi.la ldap_module_la_CFLAGS= @MODULES_CFLAGS@ @LDAP_ADD_FLAG@ ldap_module_la_LDFLAGS= -module -avoid-version ldap_module_la_SOURCES = ldap_module.c memcached_cache_la_LIBADD= @MODULES_LIBADD@ @MEMCACHED_ADD_LDADD@ memcached_cache_la_CFLAGS= @MODULES_CFLAGS@ @MEMCACHED_ADD_FLAG@ memcached_cache_la_LDFLAGS= -module -avoid-version memcached_cache_la_SOURCES= memcached.c shared_cache_la_LIBADD= @MODULES_LIBADD@ shared_cache_la_CFLAGS= @OPENSSL_ADD_FLAG@ shared_cache_la_LDFLAGS= -module -avoid-version shared_cache_la_SOURCES= shared_cache.c c_icap-0.5.6/modules/sys_logger.c0000664000175000017500000001605713371253152013667 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include #include #include #include #include "log.h" #include "module.h" #include "cfg_param.h" #include "debug.h" #include "txt_format.h" #include "access.h" #include "acl.h" /************************************************************************/ /* sys_logger implementation. */ /* */ int sys_log_open(); void sys_log_close(); void sys_log_access(ci_request_t *req); void sys_log_server(const char *server, const char *format, va_list ap); char *log_ident = "c-icap: "; static int FACILITY = LOG_DAEMON; static int ACCESS_PRIORITY = LOG_INFO; static int SERVER_PRIORITY = LOG_CRIT; char *syslog_logformat = "%la %a %im %iu %is"; static ci_access_entry_t *syslog_access_list = NULL; int cfg_set_facility(const char *directive, const char **argv, void *setdata); int cfg_set_priority(const char *directive, const char **argv, void *setdata); /*int cfg_set_prefix(const char *directive,const char **argv,void *setdata);*/ int cfg_syslog_logformat(const char *directive, const char **argv, void *setdata); int cfg_syslog_access(const char *directive, const char **argv, void *setdata); /* functions declared in log.c. This file is not included in c-icap library but defined in primary c-icap binary. */ extern char *logformat_fmt(const char *name); /*Configuration Table .....*/ static struct ci_conf_entry conf_variables[] = { {"Facility", NULL, cfg_set_facility, NULL}, {"access_priority", &ACCESS_PRIORITY, cfg_set_priority, NULL}, {"server_priority", &SERVER_PRIORITY, cfg_set_priority, NULL}, {"Prefix", &log_ident, ci_cfg_set_str, NULL}, {"LogFormat", NULL, cfg_syslog_logformat}, {"access", NULL, cfg_syslog_access}, {NULL, NULL, NULL, NULL} }; CI_DECLARE_MOD_DATA logger_module_t module = { "sys_logger", NULL, sys_log_open, sys_log_close, sys_log_access, sys_log_server, conf_variables }; int cfg_set_facility(const char *directive, const char **argv, void *setdata) { if (argv == NULL || argv[0] == NULL) { // ci_debug_printf(1,"Missing arguments in directive\n"); return 0; } if (strcmp(argv[0], "daemon") == 0) FACILITY = LOG_DAEMON; else if (strcmp(argv[0], "user") == 0) FACILITY = LOG_USER; else if (strncmp(argv[0], "local", 5) == 0 && strlen(argv[0]) == 6) { switch (argv[0][5]) { case '0': FACILITY = LOG_LOCAL0; break; case '1': FACILITY = LOG_LOCAL1; break; case '2': FACILITY = LOG_LOCAL2; break; case '3': FACILITY = LOG_LOCAL3; break; case '4': FACILITY = LOG_LOCAL4; break; case '5': FACILITY = LOG_LOCAL5; break; case '6': FACILITY = LOG_LOCAL6; break; case '7': FACILITY = LOG_LOCAL7; break; } } return 1; } int cfg_set_priority(const char *directive, const char **argv, void *setdata) { if (argv == NULL || argv[0] == NULL) { ci_debug_printf(1, "Missing arguments in directive\n"); return 0; } if (!setdata) return 0; if (strcmp(argv[0], "alert") == 0) *((int *) setdata) = LOG_ALERT; else if (strcmp(argv[0], "crit") == 0) *((int *) setdata) = LOG_CRIT; else if (strcmp(argv[0], "debug") == 0) *((int *) setdata) = LOG_DEBUG; else if (strcmp(argv[0], "emerg") == 0) *((int *) setdata) = LOG_EMERG; else if (strcmp(argv[0], "err") == 0) *((int *) setdata) = LOG_ERR; else if (strcmp(argv[0], "info") == 0) *((int *) setdata) = LOG_INFO; else if (strcmp(argv[0], "notice") == 0) *((int *) setdata) = LOG_NOTICE; else if (strcmp(argv[0], "warning") == 0) *((int *) setdata) = LOG_WARNING; return 1; } int cfg_syslog_logformat(const char *directive, const char **argv, void *setdata) { if (argv == NULL || argv[0] == NULL) { ci_debug_printf(1, "Missing arguments in directive\n"); return 0; } /* the folowing return format txt or NULL. It is OK */ syslog_logformat = logformat_fmt(argv[0]); return 1; } int sys_log_open() { openlog(log_ident, 0, FACILITY); return 1; } void sys_log_close() { closelog(); if (syslog_access_list) ci_access_entry_release(syslog_access_list); syslog_access_list = NULL; } void sys_log_access(ci_request_t *req) { char logline[1024]; if (!syslog_logformat) return; if (syslog_access_list && !(ci_access_entry_match_request(syslog_access_list, req) == CI_ACCESS_ALLOW)) { ci_debug_printf(6, "Access list for syslog access does not match\n"); return; } ci_format_text(req, syslog_logformat, logline, 1024, NULL); syslog(ACCESS_PRIORITY, "%s\n", logline); } void sys_log_server(const char *server, const char *format, va_list ap) { char buf[512]; char prefix[150]; snprintf(prefix, 149, "%s, %s ", server, format); prefix[149] = '\0'; vsnprintf(buf, 511, (const char *) prefix, ap); buf[511] = '\0'; syslog(SERVER_PRIORITY, "%s", buf); } int cfg_syslog_access(const char *directive, const char **argv, void *setdata) { int argc, error; const char *acl_spec_name; if (argv[0] == NULL) { ci_debug_printf(1, "Parse error in directive %s \n", directive); return 0; } if (ci_access_entry_new(&syslog_access_list, CI_ACCESS_ALLOW) == NULL) { ci_debug_printf(1, "Error creating access list for syslog logger!\n"); return 0; } ci_debug_printf(1,"Creating new access entry for syslog module with specs:\n"); error = 0; for (argc = 0; argv[argc] != NULL; argc++) { acl_spec_name = argv[argc]; /*TODO: check return type.....*/ if (!ci_access_entry_add_acl_by_name(syslog_access_list, acl_spec_name)) { ci_debug_printf(1,"Error adding acl spec: %s. Probably does not exist!\n", acl_spec_name); error = 1; } else ci_debug_printf(1,"\tAdding acl spec: %s\n", acl_spec_name); } if (error) return 0; return 1; } c_icap-0.5.6/modules/perl_handler.c0000664000175000017500000000751113371253152014144 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "service.h" #include "module.h" #include "header.h" #include "body.h" #include "debug.h" #include "EXTERN.h" #include "perl.h" #include "XSUB.h" struct perl_data { PerlInterpreter *perl; }; int init_perl_handler(struct ci_server_conf *server_conf); ci_service_module_t *load_perl_module(char *service_file); CI_DECLARE_DATA service_handler_module_t module = { "perl_handler", ".pl,.pm,.plx", init_perl_handler, NULL, /*post_init .... */ NULL, /*release handler */ load_perl_module, NULL }; int perl_init_service(ci_service_xdata_t *srv_xdata, struct ci_server_conf *server_conf); void perl_close_service(); void *perl_init_request_data(ci_request_t *); void perl_release_request_data(void *data); int perl_check_preview_handler(char *preview_data, int preview_data_len, ci_request_t *); int perl_end_of_data_handler(ci_request_t *); int perl_service_io(char *rbuf, int *rlen, char *wbuf, int *wlen, int iseof, ci_request_t *req); int init_perl_handler(struct ci_server_conf *server_conf) { return 0; } ci_service_module_t *load_perl_module(char *service_file) { ci_service_module_t *service = NULL; struct perl_data *perl_data; char *argv[2]; argv[0] = NULL; argv[1] = service_file; service = malloc(sizeof(ci_service_module_t)); perl_data = malloc(sizeof(struct perl_data)); perl_data->perl = perl_alloc(); /*Maybe it is better to allocate a perl interpreter per request */ perl_construct(perl_data->perl); perl_parse(perl_data->perl, NULL, 2, argv, NULL); perl_run(perl_data->perl); service->mod_data = perl_data; service->mod_init_service = perl_init_service; service->mod_post_init_service = NULL; service->mod_close_service = perl_close_service; service->mod_init_request_data = perl_init_request_data; service->mod_release_request_data = perl_release_request_data; service->mod_check_preview_handler = perl_check_preview_handler; service->mod_end_of_data_handler = perl_end_of_data_handler; service->mod_service_io = perl_service_io; service->mod_name = strdup("perl_test"); service->mod_type = ICAP_REQMOD | ICAP_RESPMOD; ci_debug_printf(1, "OK service %s loaded\n", service_file); return service; } int perl_init_service(ci_service_xdata_t *srv_xdata, struct ci_server_conf *server_conf) { return 0; } void perl_close_service() { } void *perl_init_request_data(ci_request_t *req) { return NULL; } void perl_release_request_data(void *data) { } int perl_check_preview_handler(char *preview_data, int preview_data_len, ci_request_t *req) { return EC_500; } int perl_end_of_data_handler(ci_request_t *req) { return 0; } int perl_service_io(char *rbuf, int *rlen, char *wbuf, int *wlen, int iseof, ci_request_t *req) { *rlen = 0; *wlen = 0; return CI_OK; } c_icap-0.5.6/modules/ldap_module.c0000664000175000017500000005517513371253152014003 00000000000000#include "common.h" #include #include "c-icap.h" #include "module.h" #include "mem.h" #include "lookup_table.h" #include "cache.h" #include "debug.h" #include "util.h" #include #define MAX_LDAP_FILTER_SIZE 1024 #define MAX_DATA_SIZE 32768 #define MAX_COLS 1024 #define DATA_START (MAX_COLS*sizeof(void *)) #define DATA_SIZE (MAX_DATA_SIZE-DATA_START) static int init_ldap_pools(); static void release_ldap_pools(); int init_ldap_module(struct ci_server_conf *server_conf); void release_ldap_module(); CI_DECLARE_MOD_DATA common_module_t module = { "ldap_module", init_ldap_module, NULL, release_ldap_module, NULL, }; void *ldap_table_open(struct ci_lookup_table *table); void ldap_table_close(struct ci_lookup_table *table); void *ldap_table_search(struct ci_lookup_table *table, void *key, void ***vals); void ldap_table_release_result(struct ci_lookup_table *table_data,void **val); const void *ldap_table_get_row(struct ci_lookup_table *table, const void *key, const char *columns[], void ***vals); struct ci_lookup_table_type ldap_table_type = { ldap_table_open, ldap_table_close, ldap_table_search, ldap_table_release_result, NULL, "ldap" }; struct ci_lookup_table_type ldaps_table_type = { ldap_table_open, ldap_table_close, ldap_table_search, ldap_table_release_result, NULL, "ldaps" }; struct ci_lookup_table_type ldapi_table_type = { ldap_table_open, ldap_table_close, ldap_table_search, ldap_table_release_result, NULL, "ldapi" }; int init_ldap_module(struct ci_server_conf *server_conf) { init_ldap_pools(); if (ci_lookup_table_type_register(&ldap_table_type) == NULL) return 0; if (ci_lookup_table_type_register(&ldaps_table_type) == NULL) return 0; if (ci_lookup_table_type_register(&ldapi_table_type) == NULL) return 0; return 1; } void release_ldap_module() { release_ldap_pools(); ci_lookup_table_type_unregister(&ldap_table_type); ci_lookup_table_type_unregister(&ldaps_table_type); ci_lookup_table_type_unregister(&ldapi_table_type); } /***********************************************************/ /* ldap_connections_pool inmplementation */ struct ldap_connection { LDAP *ldap; int hits; struct ldap_connection *next; }; struct ldap_connections_pool { char ldap_uri[1024]; char server[CI_MAXHOSTNAMELEN+1]; int port; int ldapversion; char user[256]; char password[256]; int connections; #ifdef LDAP_MAX_CONNECTIONS int max_connections; #endif const char *scheme; ci_thread_mutex_t mutex; #ifdef LDAP_MAX_CONNECTIONS ci_thread_cond_t pool_cond; #endif struct ldap_connection *inactive; struct ldap_connection *used; struct ldap_connections_pool *next; }; struct ldap_connections_pool *ldap_pools = NULL; ci_thread_mutex_t ldap_connections_pool_mtx; static void ldap_pool_destroy(struct ldap_connections_pool *pool); static int init_ldap_pools() { ldap_pools = NULL; ci_thread_mutex_init(&ldap_connections_pool_mtx); return 1; } static void release_ldap_pools() { struct ldap_connections_pool *pool; while ((pool = ldap_pools) != NULL) { ldap_pools = ldap_pools->next; ldap_pool_destroy(pool); } ci_thread_mutex_destroy(&ldap_connections_pool_mtx); } /*The folowing two functions are not thread safe! It is only used in ldap_pool_create which locks the required mutexes*/ static void add_ldap_pool(struct ldap_connections_pool *pool) { /*NOT thread safe!*/ struct ldap_connections_pool *p; pool->next = NULL; if (!ldap_pools) { ldap_pools = pool; return; } p = ldap_pools; while (p->next != NULL) p = p->next; p->next = pool; } static struct ldap_connections_pool * search_ldap_pools(char *server, int port, char *user, char *password) { /*NOT thread safe!*/ struct ldap_connections_pool *p; p = ldap_pools; while (p) { if (strcmp(p->server,server) == 0 && p->port == port && strcmp(p->user, user) == 0 && strcmp(p->password, password) == 0 ) return p; p = p->next; } return NULL; } static struct ldap_connections_pool *ldap_pool_create(char *server, int port, char *user, char *password, const char *scheme) { struct ldap_connections_pool *pool; ci_thread_mutex_lock(&ldap_connections_pool_mtx); pool = search_ldap_pools(server, port, (user != NULL? user : ""), (password != NULL? password : "")); if (pool) { ci_thread_mutex_unlock(&ldap_connections_pool_mtx); return pool; } pool = malloc(sizeof(struct ldap_connections_pool)); if (!pool) { ci_thread_mutex_unlock(&ldap_connections_pool_mtx); return NULL; } strncpy(pool->server, server, CI_MAXHOSTNAMELEN); pool->server[CI_MAXHOSTNAMELEN]='\0'; pool->port = port; pool->ldapversion = LDAP_VERSION3; pool->scheme = scheme; pool->next = NULL; if (user) { strncpy(pool->user,user,256); pool->user[255] = '\0'; } else pool->user[0] = '\0'; if (password) { strncpy(pool->password,password,256); pool->password[255] = '\0'; } else pool->password[0] = '\0'; pool->connections = 0; pool->inactive = NULL; pool->used = NULL; if (pool->port > 0) snprintf(pool->ldap_uri, 1024, "%s://%s:%d", pool->scheme, pool->server, pool->port); else snprintf(pool->ldap_uri, 1024, "%s://%s", pool->scheme, pool->server); pool->ldap_uri[1023] = '\0'; ci_thread_mutex_init(&pool->mutex); #ifdef LDAP_MAX_CONNECTIONS pool->max_connections = 0; ci_thread_cond_init(&pool->pool_cond); #endif add_ldap_pool(pool); ci_thread_mutex_unlock(&ldap_connections_pool_mtx); return pool; } /*The following function is not thread safe! Should called only when c-icap shutdown*/ static void ldap_pool_destroy(struct ldap_connections_pool *pool) { struct ldap_connection *conn,*prev; if (pool->used) { ci_debug_printf(1,"Not released ldap connections for pool %s.This is BUG!\n", pool->ldap_uri); } conn = pool->inactive; while (conn) { ldap_unbind_ext_s(conn->ldap, NULL, NULL); prev = conn; conn = conn->next; free(prev); } pool->inactive = NULL; ci_thread_mutex_destroy(&pool->mutex); #ifdef LDAP_MAX_CONNECTIONS ci_thread_cond_destroy(&pool->pool_cond); #endif free(pool); } static LDAP *ldap_connection_open(struct ldap_connections_pool *pool) { struct ldap_connection *conn; struct berval ldap_passwd, *servercred; int ret; char *ldap_user; if (ci_thread_mutex_lock(&pool->mutex) != 0) return NULL; do { if (pool->inactive) { conn = pool->inactive; pool->inactive = pool->inactive->next; conn->next = pool->used; pool->used = conn; conn->hits++; ci_thread_mutex_unlock(&pool->mutex); return conn->ldap; } #ifdef LDAP_MAX_CONNECTIONS if (pool->connections >= pool->max_connections) { /*wait for an ldap connection to be released. The condwait will unlock pool->mutex */ if (ci_thread_cond_wait(&(pool->pool_cond), &(pool->mutex)) != 0) { ci_thread_mutex_unlock(&(pool->mutex)); return NULL; } } } while (pool->connections >= pool->max_connections); #else } while (0); ci_thread_mutex_unlock(&pool->mutex); #endif conn = malloc(sizeof(struct ldap_connection)); if (!conn) { #ifdef LDAP_MAX_CONNECTIONS ci_thread_mutex_unlock(&pool->mutex); #endif return NULL; } conn->hits = 1; ret = ldap_initialize(&conn->ldap, pool->ldap_uri); if (!conn->ldap) { #ifdef LDAP_MAX_CONNECTIONS ci_thread_mutex_unlock(&pool->mutex); #endif ci_debug_printf(1, "Error allocating memory for ldap connection: %s!\n", ldap_err2string(ret)); free(conn); return NULL; } ldap_set_option(conn->ldap, LDAP_OPT_PROTOCOL_VERSION, &(pool->ldapversion)); if (pool->user[0] != '\0') ldap_user = pool->user; else ldap_user = NULL; if (pool->password[0] != '\0') { ldap_passwd.bv_val = pool->password; ldap_passwd.bv_len = strlen(pool->password); } else { ldap_passwd.bv_val = NULL; ldap_passwd.bv_len = 0; } ret = ldap_sasl_bind_s( conn->ldap, ldap_user, LDAP_SASL_SIMPLE, &ldap_passwd, NULL, NULL, &servercred ); if (ret != LDAP_SUCCESS) { ci_debug_printf(1, "Error bind to ldap server: %s!\n",ldap_err2string(ret)); #ifdef LDAP_MAX_CONNECTIONS ci_thread_mutex_unlock(&pool->mutex); #endif ldap_unbind_ext_s(conn->ldap, NULL, NULL); free(conn); return NULL; } if (servercred) { ber_bvfree(servercred); } #ifdef LDAP_MAX_CONNECTIONS /*we are already locked*/ #else if (ci_thread_mutex_lock(&pool->mutex)!= 0) { ci_debug_printf(1, "Error locking mutex while opening ldap connection!\n"); ldap_unbind_ext_s(conn->ldap, NULL, NULL); free(conn); return NULL; } #endif pool->connections++; conn->next = pool->used; pool->used = conn; ci_thread_mutex_unlock(&pool->mutex); return conn->ldap; } static int ldap_connection_release(struct ldap_connections_pool *pool, LDAP *ldap, int close_connection) { struct ldap_connection *cur,*prev; if (ci_thread_mutex_lock(&pool->mutex) != 0) return 0; for (prev = NULL, cur = pool->used; cur != NULL; prev = cur, cur = cur->next) { if (cur->ldap == ldap) { if (cur == pool->used) pool->used = pool->used->next; else prev->next = cur->next; break; } } if (!cur) { ci_debug_printf(0, "Not ldap connection in used list! THIS IS A BUG! please contact authors\n!"); close_connection = 1; } if (close_connection) { pool->connections--; ldap_unbind_ext_s(ldap, NULL, NULL); if (cur) free(cur); } else { cur->next = pool->inactive; pool->inactive = cur; } ci_thread_mutex_unlock(&pool->mutex); return 1; } /******************************************************/ /* ldap table implementation */ struct ldap_table_data { struct ldap_connections_pool *pool; char *str; char *base; char *server; int port; char *user; char *password; char **attrs; char *filter; char *name; const char *scheme; ci_cache_t *cache; }; static int parse_ldap_str(struct ldap_table_data *fields) { char *s, *e, *p; char c; int array_size, i; /*we are expecting a path in the form //[username:password@]ldapserver[:port][/|?]base?attr1,attr2?filter*/ if (!fields->str) return 0; i = 0; s = fields->str; while (*s == '/') { /*Ignore "//" at the beginning*/ s++; i++; } if (i != 2) return 0; /*Extract username/password if exists*/ if ((e = strrchr(s, '@')) != NULL) { fields->user = s; *e = '\0'; s = e + 1; if ((e = strchr(fields->user, ':')) != NULL) { *e = '\0'; fields->password = e + 1; ci_str_trim(fields->password); } ci_str_trim(fields->user); /* here we have parsed the user*/ } fields->server = s; /*The s points to the "server" field now*/ while (*s != ':' && *s != '?' && *s != '/' && *s != '\0') s++; if (*s == '\0') return 0; c = *s; *s = '\0'; ci_str_trim(fields->server); if (c == ':') { /*The s points to the port specification*/ s++; p = s; while (*s != '?' && *s != '/' && *s != '\0') s++; if (*s == '\0') return 0; *s = '\0'; fields->port = strtol(p, NULL, 10); } s++; fields->base = s; /*The s points to the "base" field now*/ while (*s != '?' && *s != '\0') s++; if (*s == '\0') return 0; *s = '\0'; ci_str_trim(fields->base); s++; e = s; /*Count the args*/ array_size = 1; while (*e != '?' && *e != '\0') { if (*e == ',') array_size = array_size+1; e++; } if (*e == '\0') return 0; array_size = array_size+1; fields->attrs = (char **) malloc(array_size*sizeof(char *)); if (fields->attrs == NULL) return 0; fields->attrs[0] = s; i = 1; while (i < array_size-1) { while (*s != ',') s++; *s = '\0'; s++; fields->attrs[i] = s; /*Every pointer of the array points to an "arg", the last points NULL*/ i++; } while (*s != '?') s++; *s = '\0'; fields->attrs[i] = NULL; for (i = 0; fields->attrs[i] != NULL; i++) ci_str_trim(fields->attrs[i]); s++; fields->filter = s; /*The s points to the "filter" field now*/ ci_str_trim(fields->filter); return 1; } static void *ldap_open(struct ci_lookup_table *table, const char *scheme) { int i; char *path; char tname[1024]; struct ldap_table_data *ldapdata; ci_dyn_array_t *args = NULL; ci_array_item_t *arg = NULL; char *use_cache = "local"; int cache_ttl = 60; size_t cache_size = 1*1024*1024; size_t cache_item_size = 2048; long int val; path = strdup(table->path); if (!path) { ci_debug_printf(1, "ldap_table_open: error allocating memory!\n"); return NULL; } ldapdata = malloc(sizeof(struct ldap_table_data)); if (!ldapdata) { free(path); ci_debug_printf(1, "ldap_table_open: error allocating memory (ldapdata)!\n"); return NULL; } ldapdata->str = path; ldapdata->pool = NULL; ldapdata->base = NULL; ldapdata->server = NULL; if (strcasecmp(scheme, "ldap") == 0) ldapdata->port = 389; else if (strcasecmp(scheme, "ldaps") == 0) ldapdata->port = 636; else ldapdata->port = 0; ldapdata->user = NULL; ldapdata->password = NULL; ldapdata->attrs = NULL; ldapdata->filter = NULL; ldapdata->name = NULL; ldapdata->scheme = scheme; if (!parse_ldap_str(ldapdata)) { free(ldapdata->str); free(ldapdata); ci_debug_printf(1, "ldap_table_open: parse path string error!\n"); return NULL; } if (table->args) { if ((args = ci_parse_key_value_list(table->args, ','))) { for (i = 0; (arg = ci_dyn_array_get_item(args, i)) != NULL; ++i) { ci_debug_printf(5, "Table argument %s:%s\n", arg->name, (char *)arg->value); if (strcasecmp(arg->name, "name") == 0) { ldapdata->name = strdup((char *)arg->value); } else if (strcasecmp(arg->name, "cache") == 0) { if (strcasecmp((char *)arg->value, "no") == 0) use_cache = NULL; else use_cache = (char *)arg->value; } else if (strcasecmp(arg->name, "cache-ttl") == 0) { val = strtol((char *)arg->value, NULL, 10); if (val > 0) cache_ttl = val; else ci_debug_printf(1, "WARNING: wrong cache-ttl value: %ld, using default\n", val); } else if (strcasecmp(arg->name, "cache-size") == 0) { val = ci_atol_ext((char *)arg->value, NULL); if (val > 0) cache_size = (size_t)val; else ci_debug_printf(1, "WARNING: wrong cache-size value: %ld, using default\n", val); } else if (strcasecmp(arg->name, "cache-item-size") == 0) { val = ci_atol_ext((char *)arg->value, NULL); if (val > 0) cache_item_size = (size_t)val; else ci_debug_printf(1, "WARNING: wrong cache-item-size value: %ld, using default\n", val); } } } } ldapdata->pool = ldap_pool_create(ldapdata->server, ldapdata->port, ldapdata->user, ldapdata->password, ldapdata->scheme); if (use_cache) { snprintf(tname, sizeof(tname), "ldap:%s", ldapdata->name ? ldapdata->name : ldapdata->str); tname[sizeof(tname) - 1] = '\0'; ldapdata->cache = ci_cache_build(tname, use_cache, cache_size, cache_item_size, cache_ttl, &ci_str_ops); if (!ldapdata->cache) { ci_debug_printf(1, "ldap_table_open: can not create cache! cache is disabled"); } } else ldapdata->cache = NULL; table->data = ldapdata; /*Must released before exit, we have pointes pointing on args array items*/ if (args) ci_dyn_array_destroy(args); return table->data; } void *ldap_table_open(struct ci_lookup_table *table) { return ldap_open(table, table->type); } void ldap_table_close(struct ci_lookup_table *table) { struct ldap_table_data *ldapdata; ldapdata = (struct ldap_table_data *)table->data; table->data = NULL; //release ldapdata if (ldapdata) { free(ldapdata->str); if (ldapdata->name) free(ldapdata->name); if (ldapdata->cache) ci_cache_destroy(ldapdata->cache); free(ldapdata); } } int create_filter(char *filter,int size, char *frmt,char *key) { char *s,*o, *k; int i; s = frmt; o = filter; i = 0; size --; while (i < size && *s != '\0') { if (*s == '%' && *(s+1) == 's') { k = key; while (i < size && *k != '\0' ) { *o = *k; o++; k++; i++; } s+=2; continue; } *o = *s; o++; s++; i++; } filter[i] = '\0'; ci_debug_printf(5,"Table ldap search filterar is \"%s\"\n", filter); return 1; } void *ldap_table_search(struct ci_lookup_table *table, void *key, void ***vals) { struct ldap_table_data *data = (struct ldap_table_data *)table->data; LDAPMessage *msg, *entry; BerElement *aber; LDAP *ld; struct berval **attrs; void *return_value = NULL; char *attrname; int ret = 0, failures, i; ci_str_vector_t *vect = NULL; size_t v_size; char filter[MAX_LDAP_FILTER_SIZE]; char buf[2048]; *vals = NULL; failures = 0; return_value = NULL; if (data->cache && ci_cache_search(data->cache, key, (void **)&vect, NULL, &ci_cache_read_vector_val)) { ci_debug_printf(4, "Retrieving from cache....\n"); if (!vect) /*Negative hit*/ return NULL; *vals = (void **)ci_vector_cast_to_voidvoid(vect); return key; } create_filter(filter, MAX_LDAP_FILTER_SIZE, data->filter,key); while ((ld = ldap_connection_open(data->pool)) && failures < 5) { ret = ldap_search_ext_s(ld, data->base, /*base*/ LDAP_SCOPE_SUBTREE, /*scope*/ filter, /*filter*/ data->attrs, /*attrs*/ 0, /*attrsonly*/ NULL, /*serverctrls*/ NULL, /*clientctrls*/ NULL, /*timeout*/ -1, /*sizelimit*/ &msg /*res*/ ); ci_debug_printf(4, "Contacting LDAP server: %s\n", ldap_err2string(ret)); if (ret == LDAP_SUCCESS) { entry = ldap_first_entry(ld, msg); while (entry != NULL) { aber = NULL; attrname = ldap_first_attribute(ld, entry, &aber); while (attrname != NULL) { if (vect == NULL) { vect = ci_str_vector_create(MAX_DATA_SIZE); if (!vect) return NULL; } ci_debug_printf(8, "Retrieve attribute:%s. Values: ", attrname); attrs = ldap_get_values_len(ld, entry, attrname); for (i = 0; attrs[i] != NULL ; ++i) { //OpenLdap nowhere documents that the result is NULL terminated. // copy to an intermediate buffer and terminate it before store to vector v_size = sizeof(buf) <= attrs[i]->bv_len + 1 ? sizeof(buf) : attrs[i]->bv_len; memcpy(buf, attrs[i]->bv_val, v_size); buf[v_size] = '\0'; (void)ci_str_vector_add(vect, buf); ci_debug_printf(8, "%s,", buf); } ci_debug_printf(8, "\n"); ldap_value_free_len(attrs); attrname = ldap_next_attribute(ld, entry, aber); } if (aber) ber_free(aber, 0); if (!return_value) return_value = key; entry = ldap_next_entry(ld, entry); } ldap_msgfree(msg); ldap_connection_release(data->pool, ld, 0); if (data->cache) { v_size = vect != NULL ? ci_cache_store_vector_size(vect) : 0; ci_debug_printf(4, "adding to cache\n"); if (!ci_cache_update(data->cache, key, vect, v_size, ci_cache_store_vector_val)) ci_debug_printf(4, "adding to cache failed!\n"); } if (!vect) return NULL; *vals = (void **)ci_vector_cast_to_voidvoid(vect); return return_value; } ldap_connection_release(data->pool, ld, 1); if (ret != LDAP_SERVER_DOWN) { ci_debug_printf(1, "Error contacting LDAP server: %s\n", ldap_err2string(ret)); return NULL; } failures++; } ci_debug_printf(1, "Error LDAP server is down: %s\n", ldap_err2string(ret)); return NULL; } void ldap_table_release_result(struct ci_lookup_table *table,void **val) { ci_str_vector_t *v = ci_vector_cast_from_voidvoid((const void **)val); ci_str_vector_destroy(v); } c_icap-0.5.6/modules/memcached.c0000664000175000017500000004072013570502400013404 00000000000000/* * Copyright (C) 2011 Christos Tsantilas * email: christos@chtsanti.net * * 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 of the License, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "common.h" #include "array.h" #include "cache.h" #include "ci_threads.h" #include "debug.h" #include "md5.h" #include "mem.h" #include "module.h" #include /* Set it to 1 if you want to use c-icap memory pools and custom c-icap memory allocators. Currently libmemcached looks that does not handle well foreign mem allocators, so for nos it is disabled. */ #define USE_CI_BUFFERS 0 #if defined(LIBMEMCACHED_VERSION_HEX) #if LIBMEMCACHED_VERSION_HEX > 0x01000000 #include #else #include #endif /* LIBMEMCACHED_VERSION_HEX > 0x01000000*/ #else /* And older version of libmemcached*/ #include #endif #include int USE_MD5_SUM_KEYS = 1; int mc_cfg_servers_set(const char *directive, const char **argv, void *setdata); /*Configuration Table .....*/ static struct ci_conf_entry mc_conf_variables[] = { {"servers", NULL, mc_cfg_servers_set, NULL}, {"use_md5_keys", &USE_MD5_SUM_KEYS, ci_cfg_onoff, NULL}, {NULL, NULL, NULL, NULL} }; static int mc_module_init(struct ci_server_conf *server_conf); static int mc_module_post_init(struct ci_server_conf *server_conf); static void mc_module_release(); CI_DECLARE_MOD_DATA common_module_t module = { "memcached", mc_module_init, mc_module_post_init, mc_module_release, mc_conf_variables, }; #define MC_DOMAINLEN 32 #define MC_MAXKEYLEN 250 #define HOSTNAME_LEN 256 typedef struct mc_server { char hostname[HOSTNAME_LEN]; int port; } mc_server_t; /*Vector of mc_server_t elements*/ static ci_list_t *servers_list = NULL; /*A general mutex used in various configuration steps*/ static ci_thread_mutex_t mc_mtx; struct mc_cache_data { char domain[MC_DOMAINLEN + 1]; }; /*The list of mc caches. Objects of type mc_cache_data.*/ static ci_list_t *mc_caches_list = NULL; static struct ci_cache_type mc_cache; memcached_st *MC = NULL; memcached_pool_st *MC_POOL = NULL; #if USE_CI_BUFFERS #if defined(LIBMEMCACHED_VERSION_HEX) void *mc_mem_malloc(const memcached_st *ptr, const size_t size, void *context); void mc_mem_free(const memcached_st *ptr, void *mem, void *context); void *mc_mem_realloc(const memcached_st *ptr, void *mem, const size_t size, void *context); void *mc_mem_calloc(const memcached_st *ptr, size_t nelem, const size_t elsize, void *context); #else void *mc_mem_malloc(memcached_st *ptr, const size_t size); void mc_mem_free(memcached_st *ptr, void *mem); void *mc_mem_realloc(memcached_st *ptr, void *mem, const size_t size); void *mc_mem_calloc(memcached_st *ptr, size_t nelem, const size_t elsize); #endif #endif static int computekey(char *mckey, const char *key, const char *search_domain); int mc_module_init(struct ci_server_conf *server_conf) { if (ci_thread_mutex_init(&mc_mtx) != 0) { ci_debug_printf(1, "Can not intialize mutex!\n"); return 0; } /*mc_caches_list should store pointers to memcached caches data*/ if ((mc_caches_list = ci_list_create(1024, 0)) == NULL) { ci_debug_printf(1, "Can not allocate memory for list storing mc domains!\n"); return 0; } ci_cache_type_register(&mc_cache); ci_debug_printf(3, "Memcached cache sucessfully initialized!\n"); return 1; } int mc_module_post_init(struct ci_server_conf *server_conf) { #if USE_CI_BUFFERS memcached_return rc; #endif const mc_server_t *srv; const char *default_servers[] = { "127.0.0.1", NULL }; if (servers_list == NULL) { mc_cfg_servers_set("server", default_servers, NULL); if (servers_list == NULL) return 0; } #if USE_CI_BUFFERS MC = (memcached_st *)mc_mem_calloc(NULL, 1, sizeof(memcached_st) #if defined(LIBMEMCACHED_VERSION_HEX) ,(void *)0x1 #endif ); #else MC = calloc(1, sizeof(memcached_st)); #endif MC = memcached_create(MC); if (MC == NULL) { ci_debug_printf(1, "Failed to create memcached instance\n"); return 0; } ci_debug_printf(1, "memcached instance created\n"); #if USE_CI_BUFFERS rc = memcached_set_memory_allocators(MC, mc_mem_malloc, mc_mem_free, mc_mem_realloc, mc_mem_calloc #if defined(LIBMEMCACHED_VERSION_HEX) , (void *)0x1 #endif ); if (rc != MEMCACHED_SUCCESS) { ci_debug_printf(1, "Failed to set ci-icap membuf memory allocators\n"); memcached_free(MC); MC = NULL; return 0; } #endif memcached_behavior_set(MC, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, 1); for (srv = (const mc_server_t *)ci_list_first(servers_list); srv != NULL ; srv = (const mc_server_t *)ci_list_next(servers_list)) { if (srv->hostname[0] == '/') { if (memcached_server_add_unix_socket(MC, srv->hostname) != MEMCACHED_SUCCESS) { ci_debug_printf(1, "Failed to add socket path to the server pool\n"); memcached_free(MC); MC = NULL; return 0; } } else if (memcached_server_add(MC, srv->hostname, srv->port) != MEMCACHED_SUCCESS) { ci_debug_printf(1, "Failed to add localhost to the server pool\n"); memcached_free(MC); MC = NULL; return 0; } } MC_POOL = memcached_pool_create(MC, 5, 500); if (MC_POOL == NULL) { ci_debug_printf(1, "Failed to create connection pool\n"); memcached_free(MC); MC = NULL; return 0; } return 1; } void mc_module_release() { memcached_pool_destroy(MC_POOL); memcached_free(MC); ci_list_destroy(servers_list); ci_list_destroy(mc_caches_list); servers_list = NULL; } /*******************************************/ /* memcached cache implementation */ static int mc_cache_init(struct ci_cache *cache, const char *name); static const void *mc_cache_search(struct ci_cache *cache, const void *key, void **val, void *data, void *(*dup_from_cache)(const void *stored_val, size_t stored_val_size, void *data)); static int mc_cache_update(struct ci_cache *cache, const void *key, const void *val, size_t val_size, void *(*copy_to_cache)(void *buf, const void *val, size_t buf_size)); static void mc_cache_destroy(struct ci_cache *cache); static struct ci_cache_type mc_cache = { mc_cache_init, mc_cache_search, mc_cache_update, mc_cache_destroy, "memcached" }; int mc_cache_cmp(const void *obj, const void *user_data, size_t user_data_size) { struct mc_cache_data *mcObj = (struct mc_cache_data *)obj; const char *domain = (const char *)user_data; return strcmp(mcObj->domain, domain); } int mc_cache_init(struct ci_cache *cache, const char *domain) { int i; char useDomain[MC_DOMAINLEN + 1]; strncpy(useDomain, domain, MC_DOMAINLEN); useDomain[MC_DOMAINLEN] = '\0'; i = 0; ci_thread_mutex_lock(&mc_mtx); while (i < 1000 && ci_list_search2(mc_caches_list, useDomain, mc_cache_cmp)) { snprintf(useDomain, MC_DOMAINLEN, "%.*s~%d", MC_DOMAINLEN - 2 - (i < 10 ? 1 : (i < 100 ? 2 : 3)), domain, i); i++; } ci_thread_mutex_unlock(&mc_mtx); if (i > 999) /*????*/ return 0; struct mc_cache_data *mc_data = malloc(sizeof(struct mc_cache_data)); strncpy(mc_data->domain, useDomain, MC_DOMAINLEN); mc_data->domain[MC_DOMAINLEN] = '\0'; cache->cache_data = mc_data; ci_thread_mutex_lock(&mc_mtx); ci_list_push_back(mc_caches_list, mc_data); ci_thread_mutex_unlock(&mc_mtx); ci_debug_printf(3, "memcached cache for domain: '%s' created\n", useDomain); return 1; } void mc_cache_destroy(struct ci_cache *cache) { ci_thread_mutex_lock(&mc_mtx); ci_list_remove(mc_caches_list, cache->cache_data); ci_thread_mutex_unlock(&mc_mtx); free(cache->cache_data); } const void *mc_cache_search(struct ci_cache *cache, const void *key, void **val, void *data, void *(*dup_from_cache)(const void *stored_val, size_t stored_val_size, void *data)) { memcached_return rc; memcached_st *mlocal; uint32_t flags; char mckey[MC_MAXKEYLEN+1]; int mckeylen = 0; void *value; size_t value_len; int found = 0; struct mc_cache_data *mc_data = (struct mc_cache_data *)cache->cache_data; mckeylen = computekey(mckey, key, mc_data->domain); if (mckeylen == 0) return NULL; mlocal = memcached_pool_pop(MC_POOL, true, &rc); if (!mlocal) { ci_debug_printf(1, "Error getting memcached_st object from pool: %s\n", memcached_strerror(MC, rc)); return NULL; } value = memcached_get(mlocal, mckey, mckeylen, &value_len, &flags, &rc); if ( rc != MEMCACHED_SUCCESS) { ci_debug_printf(5, "Failed to retrieve %s object from cache: %s\n", mckey, memcached_strerror(mlocal, rc)); } else { ci_debug_printf(5, "The %s object retrieved from cache has size %d\n", mckey, (int)value_len); found = 1; } if ((rc = memcached_pool_push(MC_POOL, mlocal)) != MEMCACHED_SUCCESS) { ci_debug_printf(1, "Failed to release memcached_st object (%s)!\n", memcached_strerror(MC, rc)); } if (!found) return NULL; if (dup_from_cache && value) { *val = dup_from_cache(value, value_len, data); ci_buffer_free(value); value = NULL; } else { #if USE_CI_BUFFERS *val = value; #else if (value && value_len) { *val = ci_buffer_alloc(value_len); if (!*val) { free(value); return NULL; } memcpy(*val, value, value_len); free(value); } else *val = NULL; #endif } return key; } int mc_cache_update(struct ci_cache *cache, const void *key, const void *val, size_t val_size, void *(*copy_to_cache)(void *buf, const void *val, size_t buf_size)) { void *value = NULL; memcached_return rc; char mckey[MC_MAXKEYLEN+1]; int mckeylen = 0; struct mc_cache_data *mc_data = (struct mc_cache_data *)cache->cache_data; memcached_st *mlocal; mckeylen = computekey(mckey, key, mc_data->domain); if (mckeylen == 0) return 0; if (copy_to_cache && val_size) { if ((value = ci_buffer_alloc(val_size)) == NULL) return 0; /*debug message?*/ if (!copy_to_cache(value, val, val_size)) return 0; /*debug message?*/ } mlocal = memcached_pool_pop(MC_POOL, true, &rc); if (!mlocal) { ci_debug_printf(1, "Error getting memcached_st object from pool: %s\n", memcached_strerror(MC, rc)); return 0; } rc = memcached_set(mlocal, mckey, mckeylen, value != NULL ? (const char *)value : (const char *)val, val_size, cache->ttl, (uint32_t)0); if (value) ci_buffer_free(value); if (rc != MEMCACHED_SUCCESS) ci_debug_printf(5, "failed to set key: %s in memcached: %s\n", mckey, memcached_strerror(mlocal, rc)); if (memcached_pool_push(MC_POOL, mlocal) != MEMCACHED_SUCCESS) { ci_debug_printf(1, "Failed to release memcached_st object:%s\n", memcached_strerror(MC, rc)); } ci_debug_printf(5, "mc_cache_update: successfully update key '%s'\n", mckey); return 1; } int mc_cache_delete(const char *key, const char *search_domain) { memcached_return rc; memcached_st *mlocal = memcached_pool_pop(MC_POOL, true, &rc); if (!mlocal) { ci_debug_printf(1, "Error getting memcached_st object from pool: %s\n", memcached_strerror(MC, rc)); return 0; } char mckey[MC_MAXKEYLEN+1]; int mckeylen = 0; mckeylen = computekey(mckey,key,search_domain); if (mckeylen == 0) return 0; rc = memcached_delete(mlocal, mckey, mckeylen, (time_t)0); if (rc != MEMCACHED_SUCCESS) ci_debug_printf(5, "failed to set key: %s in memcached: %s\n", mckey, memcached_strerror(mlocal, rc)); return 1; } int mc_cfg_servers_set(const char *directive, const char **argv, void *setdata) { int argc; char *s; mc_server_t srv; if (!servers_list) { servers_list = ci_list_create(4096, sizeof(mc_server_t)); if (!servers_list) { ci_debug_printf(1, "Error allocating memory for mc_servers list!\n"); return 0; } } for (argc = 0; argv[argc] != NULL; argc++) { strncpy(srv.hostname, argv[argc], HOSTNAME_LEN); srv.hostname[HOSTNAME_LEN - 1] = '\0'; if (srv.hostname[0] != '/' && (s = strchr(srv.hostname, ':')) != NULL) { *s = '\0'; s++; srv.port = atoi(s); if (!srv.port) srv.port = 11211; } else srv.port = 11211; ci_debug_printf(2, "Setup memcached server %s:%d\n", srv.hostname, srv.port); } ci_list_push_back(servers_list, &srv); return argc; } #if USE_CI_BUFFERS /*Memory managment functions*/ #if defined(LIBMEMCACHED_VERSION_HEX) void *mc_mem_malloc(const memcached_st *ptr, const size_t size, void *context) #else void *mc_mem_malloc(memcached_st *ptr, const size_t size) #endif { void *p = ci_buffer_alloc(size); ci_debug_printf(5, "mc_mem_malloc: %p of size %u\n", p, (unsigned int)size); return p; } #if defined(LIBMEMCACHED_VERSION_HEX) void mc_mem_free(const memcached_st *ptr, void *mem, void *context) #else void mc_mem_free(memcached_st *ptr, void *mem) #endif { #if defined(LIBMEMCACHED_VERSION_HEX) ci_debug_printf(5, "mc_mem_free: %p/%p\n", mem, context); #else ci_debug_printf(5, "mc_mem_free: %p\n", mem); #endif if (mem) ci_buffer_free(mem); } #if defined(LIBMEMCACHED_VERSION_HEX) void *mc_mem_realloc(const memcached_st *ptr, void *mem, const size_t size, void *context) #else void *mc_mem_realloc(memcached_st *ptr, void *mem, const size_t size) #endif { void *p = ci_buffer_realloc(mem, size); ci_debug_printf(5, "mc_mem_realloc: %p of size %u\n", p, (unsigned int)size); return p; } #if defined(LIBMEMCACHED_VERSION_HEX) void *mc_mem_calloc(const memcached_st *ptr, size_t nelem, const size_t elsize, void *context) #else void *mc_mem_calloc(memcached_st *ptr, size_t nelem, const size_t elsize) #endif { void *p; p = ci_buffer_alloc(nelem*elsize); if (!p) return NULL; memset(p, 0, nelem*elsize); ci_debug_printf(5, "mc_mem_calloc: %p of size %u\n", p, (unsigned int)(nelem*elsize)); return p; } #endif int computekey(char *mckey, const char *key, const char *search_domain) { ci_MD5_CTX md5; unsigned char digest[16]; int mckeylen; /*we need to use keys in the form "search_domain:key" We can not use keys bigger than MC_MAXKEYLEN */ if (strlen(key)+strlen(search_domain)+2 < MC_MAXKEYLEN) { mckeylen = sprintf(mckey, "v%s:%s", search_domain, key); } else if (USE_MD5_SUM_KEYS) { ci_MD5Init(&md5); ci_MD5Update(&md5, (const unsigned char *)key, strlen(key)); ci_MD5Final(digest, &md5); mckeylen = sprintf(mckey, "v%s:%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", search_domain, digest[0], digest[1], digest[2], digest[3], digest[4], digest[5], digest[6], digest[7], digest[8], digest[9], digest[10], digest[11], digest[12], digest[13], digest[14], digest[15]); } else { mckeylen = 0; } return mckeylen; } c_icap-0.5.6/modules/dnsbl_tables.c0000664000175000017500000001522413570503002014132 00000000000000#include "common.h" #include "c-icap.h" #include "module.h" #include "lookup_table.h" #include "net_io.h" #include "cache.h" #include "debug.h" #include "util.h" #include "common.h" int init_dnsbl_tables(struct ci_server_conf *server_conf); void release_dnsbl_tables(); CI_DECLARE_MOD_DATA common_module_t module = { "dnsbl_tables", init_dnsbl_tables, NULL, release_dnsbl_tables, NULL, }; void *dnsbl_table_open(struct ci_lookup_table *table); void dnsbl_table_close(struct ci_lookup_table *table); void *dnsbl_table_search(struct ci_lookup_table *table, void *key, void ***vals); void dnsbl_table_release_result(struct ci_lookup_table *table_data,void **val); struct ci_lookup_table_type dnsbl_table_type = { dnsbl_table_open, dnsbl_table_close, dnsbl_table_search, dnsbl_table_release_result, NULL, "dnsbl" }; int init_dnsbl_tables(struct ci_server_conf *server_conf) { return (ci_lookup_table_type_register(&dnsbl_table_type) != NULL); } void release_dnsbl_tables() { ci_lookup_table_type_unregister(&dnsbl_table_type); } /***********************************************************/ /* bdb_table_type inmplementation */ struct dnsbl_data { char check_domain[CI_MAXHOSTNAMELEN+1]; ci_cache_t *cache; }; void *dnsbl_table_open(struct ci_lookup_table *table) { struct dnsbl_data *dnsbl_data; ci_dyn_array_t *args = NULL; ci_array_item_t *arg = NULL; char *use_cache = "local"; int cache_ttl = 60; size_t cache_size = 1*1024*1024; long int val; int i; if (strlen(table->path) >= CI_MAXHOSTNAMELEN ) { ci_debug_printf(1, "dnsbl_table_open: too long domain name: %s\n", table->path); return NULL; } if (table->key_ops != &ci_str_ops || table->val_ops != &ci_str_ops) { ci_debug_printf(1, "dnsbl_table_open: Only searching with strings and returning strings supported\n"); return NULL; } dnsbl_data = malloc(sizeof(struct dnsbl_data)); if (!dnsbl_data) { ci_debug_printf(1, "dnsbl_table_open: error allocating memory (dnsbl_data)!\n"); return NULL; } strncpy(dnsbl_data->check_domain, table->path, CI_MAXHOSTNAMELEN); dnsbl_data->check_domain[CI_MAXHOSTNAMELEN] = '\0'; if (table->args) { if ((args = ci_parse_key_value_list(table->args, ','))) { for (i = 0; (arg = ci_dyn_array_get_item(args, i)) != NULL; ++i) { ci_debug_printf(5, "Table argument %s:%s\n", arg->name, (char *)arg->value); if (strcasecmp(arg->name, "cache") == 0) { if (strcasecmp(arg->value, "no") == 0) use_cache = NULL; else use_cache = (char *)arg->value; } else if (strcasecmp(arg->name, "cache-ttl") == 0) { val = strtol((char *)arg->value, NULL, 10); if (val > 0) cache_ttl = val; else ci_debug_printf(1, "WARNING: wrong cache-ttl value: %ld, using default\n", val); } else if (strcasecmp(arg->name, "cache-size") == 0) { val = ci_atol_ext((char *)arg->value, NULL); if (val > 0) cache_size = (size_t)val; else ci_debug_printf(1, "WARNING: wrong cache-size value: %ld, using default\n", val); } } } } if (use_cache) { char tname[CI_MAXHOSTNAMELEN + 8]; snprintf(tname, sizeof(tname), "dnsbl:%s", table->path); tname[sizeof(tname) - 1] = '\0'; dnsbl_data->cache = ci_cache_build(tname, use_cache, cache_size, 1024, cache_ttl, &ci_str_ops); } else dnsbl_data->cache = NULL; table->data = dnsbl_data; /*Must released before exit, we have pointes pointing on args array items*/ if (args) ci_dyn_array_destroy(args); return table->data; } void dnsbl_table_close(struct ci_lookup_table *table) { struct dnsbl_data *dnsbl_data = table->data; table->data = NULL; if (dnsbl_data->cache) ci_cache_destroy(dnsbl_data->cache); free(dnsbl_data); } static ci_vector_t *resolv_hostname(char *hostname); void *dnsbl_table_search(struct ci_lookup_table *table, void *key, void ***vals) { char dnsname[CI_MAXHOSTNAMELEN + 8]; char *server; ci_str_vector_t *v; size_t v_size; struct dnsbl_data *dnsbl_data = table->data; if (table->key_ops != &ci_str_ops) { ci_debug_printf(1,"Only keys of type string allowed in this type of table:\n"); return NULL; } server = (char *)key; if (dnsbl_data->cache && ci_cache_search(dnsbl_data->cache, server, (void **)&v, NULL, &ci_cache_read_vector_val)) { ci_debug_printf(6,"dnsbl_table_search: cache hit for %s value %p\n", server, v); if (!v) { *vals = NULL; return NULL; } *vals = (void **)ci_vector_cast_to_voidvoid(v); return key; } snprintf(dnsname, sizeof(dnsname), "%s.%s", server, dnsbl_data->check_domain); dnsname[sizeof(dnsname) - 1] = '\0'; v = resolv_hostname(dnsname); if (dnsbl_data->cache) { v_size = v != NULL ? ci_cache_store_vector_size(v) : 0; ci_cache_update(dnsbl_data->cache, server, v, v_size, ci_cache_store_vector_val); } if (!v) return NULL; *vals = (void **)ci_vector_cast_to_voidvoid(v); return key; } void dnsbl_table_release_result(struct ci_lookup_table *table,void **val) { ci_str_vector_t *v = ci_vector_cast_from_voidvoid((const void **)val); ci_str_vector_destroy(v); } /**************************/ /* Utility functions */ /*Return the list of ip address for a given hostname*/ static ci_vector_t *resolv_hostname(char *hostname) { ci_str_vector_t *vect = NULL; int ret; struct addrinfo hints, *res, *cur; ci_sockaddr_t addr; char buf[256]; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; if ((ret = getaddrinfo(hostname, NULL, &hints, &res)) != 0) { ci_debug_printf(5, "Error geting addrinfo:%s\n", gai_strerror(ret)); return NULL; } if (res) vect = ci_str_vector_create(1024); if (vect) { for (cur = res; cur != NULL; cur = cur->ai_next) { memcpy(&(addr.sockaddr), cur->ai_addr, CI_SOCKADDR_SIZE); ci_fill_sockaddr(&addr); if (ci_sockaddr_t_to_ip(&addr, buf, sizeof(buf))) (void)ci_str_vector_add(vect, buf); } freeaddrinfo(res); } return vect; } c_icap-0.5.6/md5.c0000664000175000017500000002016713371253152010524 00000000000000/* * This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. * * To compute the message digest of a chunk of bytes, declare an * MD5Context structure, pass it to MD5Init, call MD5Update as * needed on buffers full of bytes, and then call MD5Final, which * will fill a supplied 16-byte array with the digest. */ #include "common.h" #include "md5.h" static void MD5Transform(uint32_t buf[4], uint32_t in[16]); #ifdef WORDS_BIGENDIAN #define byteReverse(buf, len) /* Nothing */ #else /* * Note: this code is harmless on little-endian machines. */ static void byteReverse(unsigned char *buf, unsigned longs) { uint32_t t; do { t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 | ((unsigned) buf[1] << 8 | buf[0]); *(uint32_t *) buf = t; buf += 4; } while (--longs); } #endif /* * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious * initialization constants. */ void ci_MD5Init(struct ci_MD5Context *ctx) { ctx->buf[0] = 0x67452301; ctx->buf[1] = 0xefcdab89; ctx->buf[2] = 0x98badcfe; ctx->buf[3] = 0x10325476; ctx->bits[0] = 0; ctx->bits[1] = 0; } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ void ci_MD5Update(struct ci_MD5Context *ctx, const unsigned char *buf, size_t len) { uint32_t t; /* Update bitcount */ t = ctx->bits[0]; if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t) ctx->bits[1]++; /* Carry from low to high */ ctx->bits[1] += len >> 29; t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ /* Handle any leading odd-sized chunks */ if (t) { unsigned char *p = (unsigned char *) ctx->in + t; t = 64 - t; if (len < t) { memcpy(p, buf, len); return; } memcpy(p, buf, t); byteReverse(ctx->in, 16); MD5Transform(ctx->buf, (uint32_t *) ctx->in); buf += t; len -= t; } /* Process data in 64-byte chunks */ while (len >= 64) { memcpy(ctx->in, buf, 64); byteReverse(ctx->in, 16); MD5Transform(ctx->buf, (uint32_t *) ctx->in); buf += 64; len -= 64; } /* Handle any remaining bytes of data. */ memcpy(ctx->in, buf, len); } /* * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ void ci_MD5Final(unsigned char digest[16], struct ci_MD5Context *ctx) { unsigned count; unsigned char *p; uint32_t *uin; /* Compute number of bytes mod 64 */ count = (ctx->bits[0] >> 3) & 0x3F; /* Set the first char of padding to 0x80. This is safe since there is always at least one byte free */ p = ctx->in + count; *p++ = 0x80; /* Bytes of padding needed to make 64 bytes */ count = 64 - 1 - count; /* Pad out to 56 mod 64 */ if (count < 8) { /* Two lots of padding: Pad the first block to 64 bytes */ memset(p, 0, count); byteReverse(ctx->in, 16); MD5Transform(ctx->buf, (uint32_t *) ctx->in); /* Now fill the next block with 56 bytes */ memset(ctx->in, 0, 56); } else { /* Pad block to 56 bytes */ memset(p, 0, count - 8); } byteReverse(ctx->in, 14); /* Append length in bits and transform */ uin = (uint32_t *) ctx->in; uin[14] = ctx->bits[0]; uin[15] = ctx->bits[1]; MD5Transform(ctx->buf, (uint32_t *) ctx->in); byteReverse((unsigned char *) ctx->buf, 4); memcpy(digest, ctx->buf, 16); memset(ctx, 0, sizeof(struct ci_MD5Context)); /* In case it's sensitive */ } /* The four core functions - F1 is optimized somewhat */ /* #define F1(x, y, z) (x & y | ~x & z) */ #define F1(x, y, z) (z ^ (x & (y ^ z))) #define F2(x, y, z) F1(z, x, y) #define F3(x, y, z) (x ^ y ^ z) #define F4(x, y, z) (y ^ (x | ~z)) /* This is the central step in the MD5 algorithm. */ #define MD5STEP(f, w, x, y, z, data, s) \ ( w += f(x, y, z) + data, w = w<>(32-s), w += x ) /* * The core of the MD5 algorithm, this alters an existing MD5 hash to * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine. */ static void MD5Transform(uint32_t buf[4], uint32_t in[16]) { register uint32_t a, b, c, d; a = buf[0]; b = buf[1]; c = buf[2]; d = buf[3]; MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); buf[0] += a; buf[1] += b; buf[2] += c; buf[3] += d; } c_icap-0.5.6/default_acl.c0000664000175000017500000001202413371253152012273 00000000000000/* * Copyright (C) 2004 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "request.h" #include "module.h" #include "cfg_param.h" #include "debug.h" #include "access.h" #include "simple_api.h" #include "acl.h" #include "net_io.h" #include "common.h" /*********************************************************************************************/ /* Default Authenticator definitions */ int default_acl_init(struct ci_server_conf *server_conf); int default_acl_post_init(struct ci_server_conf *server_conf); void default_acl_release(); int default_acl_client_match(ci_request_t *req); int default_acl_request_match(ci_request_t *req); int cfg_default_acl_add(const char *directive, const char **argv, void *setdata); int cfg_default_acl_access(const char *directive, const char **argv, void *setdata); ci_access_entry_t *acl_connection_access_list = NULL; ci_access_entry_t *acl_access_list = NULL; /*Configuration Table .....*/ static struct ci_conf_entry acl_conf_variables[] = { {"acl", NULL, cfg_default_acl_add, NULL}, {"client_access", NULL, cfg_default_acl_access, NULL}, {"icap_access", NULL, cfg_default_acl_access, NULL}, {NULL, NULL, NULL, NULL} }; access_control_module_t default_acl = { "default_acl", default_acl_init, default_acl_post_init, /*post_init */ default_acl_release, default_acl_client_match, default_acl_request_match, acl_conf_variables }; int default_acl_init(struct ci_server_conf *server_conf) { return 1; } int default_acl_post_init(struct ci_server_conf *server_conf) { return 1; } void default_acl_release() { ci_access_entry_release(acl_access_list); ci_access_entry_release(acl_connection_access_list); acl_access_list = NULL; acl_connection_access_list = NULL; } int default_acl_client_match(ci_request_t *req) { return ci_access_entry_match_request(acl_connection_access_list, req); } int default_acl_request_match(ci_request_t *req) { return ci_access_entry_match_request(acl_access_list, req); } int cfg_default_acl_add(const char *directive, const char **argv, void *setdata) { return 1; } int cfg_default_acl_access(const char *directive, const char **argv, void *setdata) { int type, argc, error = 0; int only_connection = 0; const char *acl_spec_name; ci_access_entry_t **tolist,*access_entry; const ci_acl_spec_t *acl_spec; const ci_acl_type_t *spec_type ; if (argv[0] == NULL || argv[1] == NULL) { ci_debug_printf(1, "Parse error in directive %s \n", directive); return 0; } if (strcmp("client_access", directive) == 0) { tolist = &acl_connection_access_list; only_connection = 1; } else if (strcmp("icap_access", directive) == 0) { tolist = &acl_access_list; } else return 0; if (strcmp(argv[0], "allow") == 0) { type = CI_ACCESS_ALLOW; } else if (strcmp(argv[0], "deny") == 0) { type = CI_ACCESS_DENY; } else { ci_debug_printf(1, "Invalid directive :%s. Disabling %s acl rule \n", argv[0], argv[1]); return 0; } if ((access_entry = ci_access_entry_new(tolist, type)) == NULL) { ci_debug_printf(1,"Error creating new access entry as %s access list\n", argv[0]); return 0; } ci_debug_printf(2,"Creating new access entry as %s with specs:\n", argv[0]); for (argc=1; argv[argc] != NULL; argc++) { acl_spec_name = argv[argc]; acl_spec = ci_acl_search(acl_spec_name); if (acl_spec) spec_type = acl_spec->type; else spec_type = NULL; if (only_connection && spec_type && strcmp(spec_type->name,"port") != 0 && strcmp(spec_type->name,"src") != 0 && strcmp(spec_type->name,"srvip") != 0 ) { ci_debug_printf(1, "Only \"port\", \"src\" and \"srvip\" acl types allowed in client_access access list (given :%s)\n", acl_spec_name); error = 1; } else { /*TODO: check return type.....*/ ci_access_entry_add_acl_by_name(access_entry, acl_spec_name); ci_debug_printf(2,"\tAdding acl spec: %s\n", acl_spec_name); } } if (error) return 0; else return 1; } c_icap-0.5.6/tests/0000775000175000017500000000000013570504160011106 500000000000000c_icap-0.5.6/tests/Makefile.in0000664000175000017500000005764613570504057013122 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @USE_RPATH_TRUE@am__append_1 = -rpath @libdir@ noinst_PROGRAMS = test_cache$(EXEEXT) test_tables$(EXEEXT) \ test_headers$(EXEEXT) test_allocators$(EXEEXT) \ test_arrays$(EXEEXT) test_lists$(EXEEXT) test_md5$(EXEEXT) \ test_base64$(EXEEXT) test_body$(EXEEXT) test_ops$(EXEEXT) subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/autoconf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) test_allocators_SOURCES = test_allocators.c test_allocators_OBJECTS = test_allocators.$(OBJEXT) test_allocators_LDADD = $(LDADD) test_allocators_DEPENDENCIES = ../libicapapi.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = test_arrays_SOURCES = test_arrays.c test_arrays_OBJECTS = test_arrays.$(OBJEXT) test_arrays_LDADD = $(LDADD) test_arrays_DEPENDENCIES = ../libicapapi.la test_base64_SOURCES = test_base64.c test_base64_OBJECTS = test_base64.$(OBJEXT) test_base64_LDADD = $(LDADD) test_base64_DEPENDENCIES = ../libicapapi.la test_body_SOURCES = test_body.c test_body_OBJECTS = test_body.$(OBJEXT) test_body_LDADD = $(LDADD) test_body_DEPENDENCIES = ../libicapapi.la test_cache_SOURCES = test_cache.c test_cache_OBJECTS = test_cache.$(OBJEXT) test_cache_LDADD = $(LDADD) test_cache_DEPENDENCIES = ../libicapapi.la test_headers_SOURCES = test_headers.c test_headers_OBJECTS = test_headers.$(OBJEXT) test_headers_LDADD = $(LDADD) test_headers_DEPENDENCIES = ../libicapapi.la test_lists_SOURCES = test_lists.c test_lists_OBJECTS = test_lists.$(OBJEXT) test_lists_LDADD = $(LDADD) test_lists_DEPENDENCIES = ../libicapapi.la test_md5_SOURCES = test_md5.c test_md5_OBJECTS = test_md5.$(OBJEXT) test_md5_LDADD = $(LDADD) test_md5_DEPENDENCIES = ../libicapapi.la test_ops_SOURCES = test_ops.c test_ops_OBJECTS = test_ops.$(OBJEXT) test_ops_LDADD = $(LDADD) test_ops_DEPENDENCIES = ../libicapapi.la test_tables_SOURCES = test_tables.c test_tables_OBJECTS = test_tables.$(OBJEXT) test_tables_LDADD = $(LDADD) test_tables_DEPENDENCIES = ../libicapapi.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = test_allocators.c test_arrays.c test_base64.c test_body.c \ test_cache.c test_headers.c test_lists.c test_md5.c test_ops.c \ test_tables.c DIST_SOURCES = test_allocators.c test_arrays.c test_base64.c \ test_body.c test_cache.c test_headers.c test_lists.c \ test_md5.c test_ops.c test_tables.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BDB_ADD_FLAG = @BDB_ADD_FLAG@ BDB_ADD_LDADD = @BDB_ADD_LDADD@ BDB_LNDIR_LDADD = @BDB_LNDIR_LDADD@ BROTLI_ADD_FLAG = @BROTLI_ADD_FLAG@ BROTLI_ADD_LDADD = @BROTLI_ADD_LDADD@ BROTLI_LNDIR_LDADD = @BROTLI_LNDIR_LDADD@ BZLIB_ADD_FLAG = @BZLIB_ADD_FLAG@ BZLIB_ADD_LDADD = @BZLIB_ADD_LDADD@ BZLIB_LNDIR_LDADD = @BZLIB_LNDIR_LDADD@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CICAPLIB_VERSION = @CICAPLIB_VERSION@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ C_ICAP_HEX_VERSION = @C_ICAP_HEX_VERSION@ DEFINE_INT64 = @DEFINE_INT64@ DEFINE_INT8 = @DEFINE_INT8@ DEFINE_OFF_T = @DEFINE_OFF_T@ DEFINE_SIZE_OFF_T = @DEFINE_SIZE_OFF_T@ DEFINE_SIZE_T = @DEFINE_SIZE_T@ DEFINE_SIZE_VOID_P = @DEFINE_SIZE_VOID_P@ DEFINE_UINT64 = @DEFINE_UINT64@ DEFINE_UINT8 = @DEFINE_UINT8@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_ADD_FLAG = @DL_ADD_FLAG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTTYPES_H = @INTTYPES_H@ INVISIBILITY_CFLAG = @INVISIBILITY_CFLAG@ LD = @LD@ LDAP_ADD_FLAG = @LDAP_ADD_FLAG@ LDAP_ADD_LDADD = @LDAP_ADD_LDADD@ LDAP_LNDIR_LDADD = @LDAP_LNDIR_LDADD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEMCACHED_ADD_FLAG = @MEMCACHED_ADD_FLAG@ MEMCACHED_ADD_LDADD = @MEMCACHED_ADD_LDADD@ MEMCACHED_LNDIR_LDADD = @MEMCACHED_LNDIR_LDADD@ MKDIR_P = @MKDIR_P@ MODULES_CFLAGS = @MODULES_CFLAGS@ MODULES_LIBADD = @MODULES_LIBADD@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_ADD_FLAG = @OPENSSL_ADD_FLAG@ OPENSSL_ADD_LDADD = @OPENSSL_ADD_LDADD@ OPENSSL_LNDIR_LDADD = @OPENSSL_LNDIR_LDADD@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_ADD_FLAG = @PCRE_ADD_FLAG@ PCRE_ADD_LDADD = @PCRE_ADD_LDADD@ PCRE_LNDIR_LDADD = @PCRE_LNDIR_LDADD@ POSIX_FILE_LOCK = @POSIX_FILE_LOCK@ POSIX_MAPPED_FILES = @POSIX_MAPPED_FILES@ POSIX_SEMAPHORES = @POSIX_SEMAPHORES@ POSIX_SHARED_MEM = @POSIX_SHARED_MEM@ PTHREADS_RWLOCK = @PTHREADS_RWLOCK@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSV_IPC = @SYSV_IPC@ SYS_TYPES_H = @SYS_TYPES_H@ THREADS_LDADD = @THREADS_LDADD@ THREADS_LDFLAGS = @THREADS_LDFLAGS@ USE_COMPAT = @USE_COMPAT@ USE_IPV6 = @USE_IPV6@ USE_OPENSSL = @USE_OPENSSL@ USE_POLL = @USE_POLL@ USE_REGEX = @USE_REGEX@ VERSION = @VERSION@ VISIBILITY_ATTR = @VISIBILITY_ATTR@ ZLIB_ADD_FLAG = @ZLIB_ADD_FLAG@ ZLIB_ADD_LDADD = @ZLIB_ADD_LDADD@ ZLIB_LNDIR_LDADD = @ZLIB_LNDIR_LDADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen_bin = @doxygen_bin@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ has_doxygen = @has_doxygen@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perlccflags = @perlccflags@ perlcore = @perlcore@ perlldflags = @perlldflags@ perllib = @perllib@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ CONFIGDIR = @sysconfdir@ PKGLIBDIR = @pkglibdir@ MODULESDIR = $(pkglibdir)/ SERVICESDIR = $(pkglibdir)/ #CONFIGDIR=$(sysconfdir)/ RPATH_FLAG = $(am__append_1) AM_CFLAGS = -I$(top_srcdir)/ -I$(top_srcdir)/include/ -I$(top_builddir)/include/ @OPENSSL_ADD_FLAG@ AM_LDFLAGS = -rdynamic $(RPATH_FLAG) @THREADS_LDFLAGS@ LDADD = ../libicapapi.la @THREADS_LDADD@ @DL_ADD_FLAG@ $(EXT_PROGRAMS_MKLIB) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list test_allocators$(EXEEXT): $(test_allocators_OBJECTS) $(test_allocators_DEPENDENCIES) $(EXTRA_test_allocators_DEPENDENCIES) @rm -f test_allocators$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_allocators_OBJECTS) $(test_allocators_LDADD) $(LIBS) test_arrays$(EXEEXT): $(test_arrays_OBJECTS) $(test_arrays_DEPENDENCIES) $(EXTRA_test_arrays_DEPENDENCIES) @rm -f test_arrays$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_arrays_OBJECTS) $(test_arrays_LDADD) $(LIBS) test_base64$(EXEEXT): $(test_base64_OBJECTS) $(test_base64_DEPENDENCIES) $(EXTRA_test_base64_DEPENDENCIES) @rm -f test_base64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_base64_OBJECTS) $(test_base64_LDADD) $(LIBS) test_body$(EXEEXT): $(test_body_OBJECTS) $(test_body_DEPENDENCIES) $(EXTRA_test_body_DEPENDENCIES) @rm -f test_body$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_body_OBJECTS) $(test_body_LDADD) $(LIBS) test_cache$(EXEEXT): $(test_cache_OBJECTS) $(test_cache_DEPENDENCIES) $(EXTRA_test_cache_DEPENDENCIES) @rm -f test_cache$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_cache_OBJECTS) $(test_cache_LDADD) $(LIBS) test_headers$(EXEEXT): $(test_headers_OBJECTS) $(test_headers_DEPENDENCIES) $(EXTRA_test_headers_DEPENDENCIES) @rm -f test_headers$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_headers_OBJECTS) $(test_headers_LDADD) $(LIBS) test_lists$(EXEEXT): $(test_lists_OBJECTS) $(test_lists_DEPENDENCIES) $(EXTRA_test_lists_DEPENDENCIES) @rm -f test_lists$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_lists_OBJECTS) $(test_lists_LDADD) $(LIBS) test_md5$(EXEEXT): $(test_md5_OBJECTS) $(test_md5_DEPENDENCIES) $(EXTRA_test_md5_DEPENDENCIES) @rm -f test_md5$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_md5_OBJECTS) $(test_md5_LDADD) $(LIBS) test_ops$(EXEEXT): $(test_ops_OBJECTS) $(test_ops_DEPENDENCIES) $(EXTRA_test_ops_DEPENDENCIES) @rm -f test_ops$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_ops_OBJECTS) $(test_ops_LDADD) $(LIBS) test_tables$(EXEEXT): $(test_tables_OBJECTS) $(test_tables_DEPENDENCIES) $(EXTRA_test_tables_DEPENDENCIES) @rm -f test_tables$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_tables_OBJECTS) $(test_tables_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_allocators.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_arrays.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_body.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_cache.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_headers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_lists.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ops.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tables.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: c_icap-0.5.6/tests/test_cache.c0000664000175000017500000001271513541156313013303 00000000000000#include "common.h" #include #include #include #include "c-icap.h" #include "cache.h" #include "dlib.h" #include "mem.h" #include "module.h" #include "lookup_table.h" #include "proc_mutex.h" #include "ci_threads.h" #include "debug.h" #include "cfg_param.h" int load_module(const char *directive,const char **argv,void *setdata) { CI_DLIB_HANDLE lib; common_module_t *module; if (argv == NULL || argv[0] == NULL) return 0; lib = ci_module_load(argv[0],"./"); if (!lib) { printf("Error opening module :%s\n",argv[0]); return 0; } module = ci_module_sym(lib, "module"); if (!module) { printf("Error opening module %s: can not find symbol module\n",argv[0]); return 0; } if (module->init_module) module->init_module(NULL); if (module->post_init_module) module->post_init_module(NULL); return 1; } void log_errors(void *unused, const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } char *CACHE_TYPE = NULL; static struct ci_options_entry options[] = { { "-d", "debug_level", &CI_DEBUG_LEVEL, ci_cfg_set_int, "The debug level" }, { "-m", "module", NULL, load_module, "The path of the table" }, { "-c", "cache", &CACHE_TYPE, ci_cfg_set_str, "The type of cache to use" }, {NULL,NULL,NULL,NULL,NULL} }; int mem_init(); int main(int argc,char *argv[]) { int i; struct ci_cache *cache; char *s; const char *str; size_t v_size; ci_cfg_lib_init(); mem_init(); __log_error = (void (*)(void *, const char *,...)) log_errors; /*set c-icap library log function */ if (!ci_args_apply(argc, argv, options)) { ci_args_usage(argv[0], options); exit(-1); } if (!CACHE_TYPE) CACHE_TYPE = "local"; cache = ci_cache_build("test1", CACHE_TYPE, 65536, /*cache_size*/ 2048, /*max_object_size*/ 0, /*ttl*/ &ci_str_ops /*key_ops*/ ); ci_cache_update(cache, "test1", "A test1 val", strlen("A test1 val") + 1, NULL); ci_cache_update(cache, "test2", "A test2 val", strlen("A test2 val") + 1, NULL); ci_cache_update(cache, "test3", "A test 3 val", strlen("A test 3 val") + 1, NULL); ci_cache_update(cache, "test4", "A test 4 val", strlen("A test 4 val") + 1, NULL); if (ci_cache_search(cache,"test2", (void **)&s, NULL, NULL)) { printf("Found : %s\n", s); ci_buffer_free(s); } if (ci_cache_search(cache,"test21", (void **)&s, NULL, NULL)) { printf("Found : %s (correct is NULL!)\n", s); ci_buffer_free(s); } if (ci_cache_search(cache,"test1", (void **)&s, NULL, NULL)) { printf("Found : %s\n", s); ci_buffer_free(s); } if (ci_cache_search(cache,"test4", (void **)&s, NULL, NULL)) { printf("Found : %s\n", s); ci_buffer_free(s); } ci_cache_destroy(cache); cache = ci_cache_build("test2", CACHE_TYPE, 65536, /*cache_size*/ 2048, /*max_object_size*/ 0, /*ttl*/ &ci_str_ops /*key_ops*/ ); ci_str_vector_t *vect_str = ci_str_vector_create(4096); str = ci_str_vector_add(vect_str, "1_val1"); printf("Add 1_val1: %s\n", str); str = ci_str_vector_add(vect_str, "1_val2"); printf("Add 1_val2: %s\n", str); v_size = ci_cache_store_vector_size(vect_str); ci_cache_update(cache, "vect1", vect_str, v_size, &ci_cache_store_vector_val); ci_str_vector_destroy(vect_str); vect_str = ci_str_vector_create(4096); str = ci_str_vector_add(vect_str, "2_val1"); printf("Add 2_val1: %s\n", str); str = ci_str_vector_add(vect_str, "2_val2"); printf("Add 2_val2: %s\n", str); str = ci_str_vector_add(vect_str, "2_val3"); printf("Add 2_val3: %s\n", str); v_size = ci_cache_store_vector_size(vect_str); ci_cache_update(cache, "vect2", vect_str, v_size, &ci_cache_store_vector_val); ci_str_vector_destroy(vect_str); if (ci_cache_search(cache, "vect1", (void **)&vect_str, NULL, &ci_cache_read_vector_val)) { for (i = 0; vect_str && vect_str->items[i] != NULL; i++) printf("Vector item %d:%s \n", i, (char *)vect_str->items[i]); ci_str_vector_destroy(vect_str); } if (ci_cache_search(cache, "vect2", (void **)&vect_str, NULL, &ci_cache_read_vector_val)) { for (i = 0; vect_str && vect_str->items[i] != NULL; i++) printf("Vector item %d:%s \n", i, (char *)vect_str->items[i]); ci_str_vector_destroy(vect_str); } ci_cache_destroy(cache); cache = ci_cache_build("test3", CACHE_TYPE, 65536, /*cache_size*/ 2048, /*max_object_size*/ 0, /*ttl*/ NULL /*key_ops*/ ); ci_cache_update(cache, "nulkey1", NULL, 0, NULL); ci_cache_update(cache, "nulkey2", NULL, 0, NULL); if (ci_cache_search(cache,"nulkey1", (void **)&s, NULL, NULL)) { printf("Found : %s\n", s); ci_buffer_free(s); } if (ci_cache_search(cache,"nulkey2", (void **)&s, NULL, NULL)) { printf("Found : %s\n", s); ci_buffer_free(s); } ci_cache_destroy(cache); return 0; } c_icap-0.5.6/tests/test_tables.c0000664000175000017500000000624613371253152013514 00000000000000#include "common.h" #include #include #include #include "c-icap.h" #include "dlib.h" #include "module.h" #include "mem.h" #include "lookup_table.h" #include "cache.h" #include "debug.h" void init_internal_lookup_tables(); char *path; char **keys = NULL; void log_errors(void *unused, const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } int load_module(const char *directive,const char **argv,void *setdata) { CI_DLIB_HANDLE lib; common_module_t *module; if (argv == NULL || argv[0] == NULL) return 0; lib = ci_module_load(argv[0],"./"); if (!lib) { printf("Error opening module :%s\n",argv[0]); return 0; } module = ci_module_sym(lib, "module"); if (!module) { printf("Error opening module %s: can not find symbol module\n",argv[0]); return 0; } if (module->init_module) module->init_module(NULL); if (module->post_init_module) module->post_init_module(NULL); return 1; } int cfg_set_str_list(const char *directive, const char **argv, void *setdata) { int i; char ***list = (char ***)setdata; if (setdata == NULL) return 0; if (argv == NULL || argv[0] == NULL) { return 0; } if (!*list) *list = calloc(1024, sizeof(char *)); for (i = 0; i < 1023 && (*list)[i]; ++i); if ((*list)[i] == NULL) (*list)[i] = strdup(argv[0]); ci_debug_printf(2, "Setting parameter: %s=%s\n", directive, argv[0]); return 1; } static struct ci_options_entry options[] = { { "-d", "debug_level", &CI_DEBUG_LEVEL, ci_cfg_set_int, "The debug level" }, { "-m", "module", NULL, load_module, "The path of the table" }, { "-p", "table_path", &path, ci_cfg_set_str, "The path of the table" }, { "-k", "key", &keys, cfg_set_str_list, "The key to search" }, {NULL,NULL,NULL,NULL,NULL} }; int mem_init(); int main(int argc,char *argv[]) { struct ci_lookup_table *table; void *e,*v,**vals; char *key; int i, k; ci_cfg_lib_init(); mem_init(); init_internal_lookup_tables(); __log_error = (void (*)(void *, const char *,...)) log_errors; /*set c-icap library log function */ if (!ci_args_apply(argc, argv, options) || !path || !keys) { ci_args_usage(argv[0], options); exit(-1); } table = ci_lookup_table_create(path); if (!table) { printf("Error creating table\n"); return -1; } if (!table->open(table)) { printf("Error opening table\n"); return -1; } for (k = 0; keys[k] != NULL && k < 1024; ++k) { key = keys[k]; e = table->search(table,key,&vals); if (e) { printf("Result :\n\t%s:",key); if (vals) { for (v = vals[0], i = 0; v != NULL; v = vals[++i]) { printf("%s ",(char *)v); } } printf("\n"); } else { printf("Key '%s' not found\n", key); } } ci_lookup_table_destroy(table); return 0; } c_icap-0.5.6/tests/test_body.c0000664000175000017500000000464313371253152013176 00000000000000#include "common.h" #include #include "c-icap.h" #include "body.h" #include "cfg_param.h" #include "debug.h" #include "md5.h" #include "mem.h" static void MDPrint(const char *label, unsigned char digest[16]) { unsigned int i; printf("%s:", label); for (i = 0; i < 16; i++) printf("%02x", digest[i]); printf("\n"); } void log_errors(void *unused, const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } char *FILENAME = NULL; static struct ci_options_entry options[] = { { "-d", "debug_level", &CI_DEBUG_LEVEL, ci_cfg_set_int, "The debug level" }, { "-f", "file", &FILENAME, ci_cfg_set_str, "The path of the file to load" }, {NULL,NULL,NULL,NULL,NULL} }; int mem_init(); int init_body_system(); int main(int argc,char *argv[]) { ci_membuf_t *mb = NULL; ci_simple_file_t *sf = NULL; ci_cfg_lib_init(); mem_init(); init_body_system(); __log_error = (void (*)(void *, const char *,...)) log_errors; /*set c-icap library log function */ if (!ci_args_apply(argc, argv, options) || !FILENAME) { ci_args_usage(argv[0], options); exit(-1); } FILE *f; char buf[4096]; if ((f = fopen(FILENAME, "r")) == NULL) { ci_debug_printf(1, "Can not open file '%s'!\n", FILENAME); exit(-1); } if (!(sf = ci_simple_file_new(0))) { ci_debug_printf(1, "Error allocating simple body struct!\n"); exit(-1); } ci_MD5_CTX md; unsigned char digest[16]; ci_MD5Init(&md); size_t bytes; while ((bytes = fread(buf, 1, sizeof(buf), f))) { ci_MD5Update(&md, (unsigned char *)buf, bytes); ci_simple_file_write(sf, buf, bytes, 0); } ci_simple_file_write(sf, buf, 0, 1); ci_MD5Final(digest, &md); MDPrint("File md5", digest); mb = ci_simple_file_to_membuf(sf, CI_MEMBUF_CONST); ci_MD5Init(&md); ci_MD5Update(&md, (unsigned char *)mb->buf, mb->endpos); ci_MD5Final(digest, &md); MDPrint("From membuf_t, whole string md5", digest); ci_MD5Init(&md); int len; while ((len = ci_membuf_read(mb, buf, sizeof(buf))) > 0) { ci_MD5Update(&md, (unsigned char *)buf, len); } ci_MD5Final(digest, &md); MDPrint("From membuf_t read blocks md5", digest); if (mb) ci_membuf_free(mb); ci_simple_file_destroy(sf); return 0; } c_icap-0.5.6/tests/Makefile.am0000664000175000017500000000104413371253152013062 00000000000000 CONFIGDIR=@sysconfdir@ PKGLIBDIR=@pkglibdir@ MODULESDIR=$(pkglibdir)/ SERVICESDIR=$(pkglibdir)/ #CONFIGDIR=$(sysconfdir)/ RPATH_FLAG= if USE_RPATH RPATH_FLAG+=-rpath @libdir@ endif AM_CFLAGS=-I$(top_srcdir)/ -I$(top_srcdir)/include/ -I$(top_builddir)/include/ @OPENSSL_ADD_FLAG@ AM_LDFLAGS = -rdynamic $(RPATH_FLAG) @THREADS_LDFLAGS@ LDADD = ../libicapapi.la @THREADS_LDADD@ @DL_ADD_FLAG@ $(EXT_PROGRAMS_MKLIB) noinst_PROGRAMS = test_cache test_tables test_headers test_allocators test_arrays test_lists test_md5 test_base64 test_body test_ops c_icap-0.5.6/tests/test_lists.c0000664000175000017500000001554513371253152013402 00000000000000#include "common.h" #include #include #include #include "c-icap.h" #include "cfg_param.h" #include "mem.h" #include "array.h" #include "debug.h" void log_errors(void *unused, const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } static struct ci_options_entry options[] = { { "-d", "debug_level", &CI_DEBUG_LEVEL, ci_cfg_set_int, "The debug level" }, {NULL,NULL,NULL,NULL,NULL} }; int print_str(void *data, const char *name, const void *value) { const char *v = (const char *)value; ci_debug_printf(2, "\t%s: %s\n", name, v); return 0; } int mem_init(); struct obj { char c; char buf[64]; }; void fill_obj(struct obj *o, char c) { o->c = c; memset(o->buf, c, 64); o->buf[63] = '\0'; } int check_obj(void *data, const void *obj) { int i; struct obj *o = (struct obj *)obj; int *k = (int *)data; (*k)++; if (!o) { ci_debug_printf(1, "Empty data stored in list?\n"); return -1; } for (i = 0; i < 62; i++) { if (o->c != o->buf[i]) { ci_debug_printf(1, "Not valid data stored in list?\n"); return -1; } } return 0; } struct cb_rm_data { ci_list_t *list; char item; }; int cb_remove_anobj(void *data, const void *obj) { struct obj *o = (struct obj *)obj; struct cb_rm_data *rd = (struct cb_rm_data *)data; if (o->c == rd->item) { ci_list_remove(rd->list, o); } ci_debug_printf(5, "item->%c %s\n", o->c, (o->c == rd->item ? "rm" : "")); return 0; } int main(int argc,char *argv[]) { ci_list_t *list; struct obj o; struct obj *pO; int i, k, l; char c; ci_cfg_lib_init(); mem_init(); __log_error = (void (*)(void *, const char *,...)) log_errors; /*set c-icap library log function */ if (!ci_args_apply(argc, argv, options)) { ci_args_usage(argv[0], options); exit(-1); } list = ci_list_create(4096, sizeof(struct obj)); if (!list) { ci_debug_printf(1, "Error creating list\n"); exit(-1); } for (l = 0; l < 2; l++) { for (i = 0, k =0; i < 1024; i++) { for (c = 'a'; c < 'z'; c++) { fill_obj(&o, c); if (c % 2) ci_list_push(list, &o); else ci_list_push_back(list, &o); k++; } } ci_debug_printf(1, "OK added %d items\n", k); k = 0; ci_debug_printf(1, "Check list...\n"); ci_list_iterate(list, (void *)&k, check_obj); ci_debug_printf(1, "Counted %d valid items\n", k); ci_debug_printf(1, "Remove all 's' objects...\n"); k = 0; fill_obj(&o, 's'); while (ci_list_remove(list, &o)) { k++; } fill_obj(&o, 'k'); while (ci_list_remove(list, &o)) { k++; } ci_debug_printf(1, "Removed %d objects\n", k); ci_debug_printf(1, "Check obj removal on iterate\n"); struct cb_rm_data rd; rd.list = list; rd.item = 'l'; ci_list_iterate(list, (void *)&rd, cb_remove_anobj); ci_debug_printf(1, "done\n"); k = 0; ci_debug_printf(1, "Check list...\n"); ci_list_iterate(list, (void *)&k, check_obj); ci_debug_printf(1, "Counted %d valid items\n", k); ci_debug_printf(1, "Add back the removed objects\n"); k = 0; fill_obj(&o, 's'); for (i = 0; i < 1024; i++) { ci_list_push(list, &o); k++; } fill_obj(&o, 'k'); for (i = 0; i < 1024; i++) { ci_list_push_back(list, &o); k++; } ci_debug_printf(1, "Add %d objects\n", k); k = 0; ci_debug_printf(1, "Check list...\n"); ci_list_iterate(list, (void *)&k, check_obj); ci_debug_printf(1, "Counted %d valid items\n", k); ci_debug_printf(1, "Remove 1024 from the head and 1024 from the tail\n"); for (i = 0; i < 1024; i++) { if (!ci_list_pop(list, &o)) ci_debug_printf(1, "Not enough objects in list!\n"); } for (i = 0; i < 1024; i++) { if (!ci_list_pop_back(list, &o)) ci_debug_printf(1, "Not enough objects in list!\n"); k++; } k = 0; ci_debug_printf(1, "Check list...\n"); ci_list_iterate(list, (void *)&k, check_obj); ci_debug_printf(1, "Counted %d valid items\n", k); fill_obj(&o, 'l'); ci_debug_printf(1, "Find one object of '%c'\n", 'l'); if (!ci_list_search(list, &o)) { ci_debug_printf(1, "\t Not Found (correct)\n"); } else { ci_debug_printf(1, "\t Found! (wrong!)\n"); } fill_obj(&o, 's'); ci_debug_printf(1, "Find one object of '%c'\n", 's'); if (!ci_list_search(list, &o)) { ci_debug_printf(1, "\t Not Found (correct)\n"); } else { ci_debug_printf(1, "\t Found! (wrong!)\n"); } fill_obj(&o, 'k'); ci_debug_printf(1, "Find one object of '%c'\n", 'k'); if (!ci_list_search(list, &o)) { ci_debug_printf(1, "\t Not Found (correct)\n"); } else { ci_debug_printf(1, "\t Found!(wrong!)\n"); } fill_obj(&o, 'd'); ci_debug_printf(1, "Find one object of '%c'\n", 'd'); if (!ci_list_search(list, &o)) { ci_debug_printf(1, "\t Not Found (wrong)\n"); } else { ci_debug_printf(1, "\t Found! (correct)\n"); } for (pO = ci_list_first(list), i = 0; pO != NULL; pO = ci_list_next(list)) { if (pO->c == 'v') { ci_list_remove(list, pO); i++; ci_debug_printf(5, "%d, an item->%c removed\n", i, pO->c); } } ci_debug_printf(1, "removed %d 'v' items (list should have %d items)\n", i, k - i); k = 0; while (ci_list_pop(list, &o)) k++; ci_debug_printf(1, "Removed %d items\n", k); } /* Check removing items in list*/ for (k = 0, c = 'a'; c <= 'c'; c++) { for (i = 0; i < 3; i++) { fill_obj(&o, c); ci_list_push_back(list, &o); k++; } } ci_debug_printf(1, "OK added %d items\n", k); for (pO = ci_list_first(list), i = 0; pO != NULL; pO = ci_list_next(list)) { if (pO->c == 'c') { ci_list_remove(list, pO); i++; ci_debug_printf(5, "%d, an item->%c removed\n", i, pO->c); } } ci_debug_printf(1, "removed %d 'c' items (list should have %d items)\n", i, k - i); k = 0; while (ci_list_pop(list, &o)) k++; ci_debug_printf(1, "Removed %d items\n", k); ci_list_destroy(list); ci_debug_printf(1, "Test finished!\n"); return 0; } c_icap-0.5.6/tests/test_base64.c0000664000175000017500000000106413541154147013322 00000000000000#include "common.h" #include "simple_api.h" int main(int argc, char *argv[]) { char encoded[1024]; char decoded[1024]; int l; const char *str; if (argc > 1) { str = argv[1]; } else str = "Good morning"; ci_base64_encode((unsigned char *)str, (size_t)strlen(str), encoded, 1024); l = ci_base64_decode(encoded, decoded, 1024); decoded[l] = '\0'; printf("Input string: \'%s\'\n", str); printf("Base64 encoded string: \'%s\'\n", encoded); printf("Decoded string: \'%s\'\n", decoded); return 0; } c_icap-0.5.6/tests/test_ops.c0000664000175000017500000000451013371253152013033 00000000000000#include "common.h" #include #include #include #include "c-icap.h" #include "cfg_param.h" #include "debug.h" #include "types_ops.h" #include "mem.h" #include "net_io.h" char *str_ip(ci_ip_t *ip) { char ip_buf[512]; char mask_buf[512]; static char buf[1024]; sprintf(buf, "%s/%s", ci_inet_ntoa(ip->family, &ip->address, ip_buf, sizeof(ip_buf)), ci_inet_ntoa(ip->family, &ip->netmask, mask_buf, sizeof(mask_buf))); return buf; } int check_ip_ops() { int i, ret = 1; char ip_buf[128]; ci_ip_t *ip1 = ci_ip_ops.dup("192.168.1.1/255.255.255.248", default_allocator); for (i = 1; i < 8 && ret; ++i) { snprintf(ip_buf, sizeof(ip_buf), "192.168.1.%d", i); ci_ip_t *ip2 = ci_ip_ops.dup(ip_buf, default_allocator); printf("IP network address: %s\n", str_ip(ip1)); printf("IP check address: %s\n", str_ip(ip2)); ret = ci_ip_ops.equal(ip1, ip2); printf("Check result: %d\n\n", ret); ci_ip_ops.free(ip2, default_allocator); } for (i = 8; i < 16 && ret; ++i) { snprintf(ip_buf, sizeof(ip_buf), "192.168.1.%d", i); ci_ip_t *ip2 = ci_ip_ops.dup(ip_buf, default_allocator); printf("IP network address: %s\n", str_ip(ip1)); printf("IP check address: %s\n", str_ip(ip2)); ret = ci_ip_ops.equal(ip1, ip2); printf("Check result: %d\n\n", ret); ret = !ret; ci_ip_ops.free(ip2, default_allocator); } ci_ip_ops.free(ip1, default_allocator); return ret; } void log_errors(void *unused, const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } static struct ci_options_entry options[] = { { "-d", "debug_level", &CI_DEBUG_LEVEL, ci_cfg_set_int, "The debug level" }, {NULL,NULL,NULL,NULL,NULL} }; int mem_init(); int main(int argc,char *argv[]) { int ret = 0; ci_cfg_lib_init(); __log_error = (void (*)(void *, const char *,...)) log_errors; /*set c-icap library log function */ if (!ci_args_apply(argc, argv, options)) { ci_args_usage(argv[0], options); exit(-1); } ci_cfg_lib_init(); mem_init(); if (!check_ip_ops()) { ci_debug_printf(1, "ip_ops check failed!\n"); ret = -1; } return ret; } c_icap-0.5.6/tests/test_md5.c0000664000175000017500000000204313371253152012716 00000000000000#include "common.h" #include #include #include #include "md5.h" static void MDPrint(unsigned char digest[16]); static void MDString(char *string); static void MDString(char *string) { ci_MD5_CTX context; unsigned char digest[16]; unsigned int len = strlen(string); ci_MD5Init(&context); ci_MD5Update(&context, (unsigned char *)string, len); ci_MD5Final(digest, &context); printf("MD5 (\"%s\") = ", string); MDPrint(digest); printf("\n"); } static void MDPrint(unsigned char digest[16]) { unsigned int i; for (i = 0; i < 16; i++) printf("%02x", digest[i]); } int main(int argc, char *argv[]) { printf("MD5 test suite:\n"); MDString(""); MDString("a"); MDString("abc"); MDString("message digest"); MDString("abcdefghijklmnopqrstuvwxyz"); MDString("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); MDString("1234567890123456789012345678901234567890" "1234567890123456789012345678901234567890"); return 0; } c_icap-0.5.6/tests/test_headers.c0000664000175000017500000000626313371253152013654 00000000000000#include "common.h" #include #include #include #include #include #include #include #include "simple_api.h" #include "header.h" #include "debug.h" int main(int argc, char *argv[]) { int i; ci_headers_list_t *headers; const char *s; size_t valsize; char buf[128]; headers = ci_headers_create(); ci_headers_add(headers,"HTTP/1.1 200 OK"); ci_headers_add(headers,"Date: Fri, 23 Jul 2004 16:31:39 GMT"); ci_headers_add(headers,"Server: Apache/1.3.28 (Linux/SuSE) PHP/4.3.3 mod_perl/1.28"); ci_headers_add(headers,"Content-Location: index.html.en"); ci_headers_add(headers,"Vary: negotiate,accept-language,accept-charset"); ci_headers_add(headers,"Last-Modified: Wed, 16 Jul 2003 20:40:02 GMT"); ci_headers_add(headers,"ETag: \"760-2485-3f15b822;403fc6e0\""); ci_headers_add(headers,"Accept-Ranges: bytes"); ci_headers_add(headers,"Content-Length: 9349"); ci_headers_add(headers,"Keep-Alive: timeout=15, max=96"); ci_headers_add(headers,"Connection: Keep-Alive"); ci_headers_add(headers,"Content-Type: text/html"); ci_headers_add(headers,"Content-Language: en"); for (i=0; iused; i++) { printf(" %d. %s\n", i, headers->headers[i]); } ci_headers_remove(headers,"Content-Language"); ci_headers_remove(headers,"Content-Type"); ci_headers_remove(headers,"Accept-Ranges"); ci_headers_add(headers,"X-Test-Header: a-test-value by me"); printf("\n\nPrint headers 2\n"); for (i=0; iused; i++) { printf(" %d. %s\n", i, headers->headers[i]); } printf("\nSearch functions tests:\n"); printf(" First Line: '%s'\n", ci_headers_first_line(headers)); printf(" Search for vary header: %s\n", ci_headers_search(headers, "Vary")); printf(" Search for 'Connection' header value: %s\n", ci_headers_value(headers, "Connection")); printf(" Search for the last 'X-Test-Header' header value: %s\n", ci_headers_value(headers, "X-Test-Header")); printf(" Search for 'Connection' header value and copy to buf: %s\n", ci_headers_copy_value(headers, "Connection", buf, sizeof(buf))); printf(" Search for the last 'X-Test-Header' header value and copy to buf: %s\n", ci_headers_copy_value(headers, "X-Test-Header", buf, sizeof(buf))); s = ci_headers_search2(headers, "Connection", &valsize); printf(" Search for 'Connection' header and get size: '%s' of size :%d\n", s, (int)valsize); s = ci_headers_value2(headers, "X-Test-Header", &valsize); printf(" Search for the last 'X-Test-Header' header value and get size: '%s' of size %d\n", s, (int)valsize); ci_headers_pack(headers); printf("\n\nThe Packed headers are:\n%.*s\n",headers->bufused, headers->headers[0]); s = ci_headers_first_line2(headers, &valsize); printf(" First Line: '%.*s'\n", (int)valsize, s); s = ci_headers_search2(headers, "Connection", &valsize); printf(" Search for 'Connection' header in packed: '%.*s'\n", (int)valsize, s); s = ci_headers_value2(headers, "X-Test-Header", &valsize); printf(" Search for the last 'X-Test-Header' header value in packed: '%.*s'\n", (int)valsize, s); return 0; } c_icap-0.5.6/tests/test_arrays.c0000664000175000017500000001333213371253152013535 00000000000000#include "common.h" #include #include #include #include "c-icap.h" #include "cfg_param.h" #include "mem.h" #include "array.h" #include "debug.h" void log_errors(void *unused, const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } static struct ci_options_entry options[] = { { "-d", "debug_level", &CI_DEBUG_LEVEL, ci_cfg_set_int, "The debug level" }, {NULL,NULL,NULL,NULL,NULL} }; int print_str(void *data, const char *name, const void *value) { const char *v = (const char *)value; ci_debug_printf(2, "\t%s: %s\n", name, v); return 0; } int mem_init(); int main(int argc,char *argv[]) { ci_str_array_t *arr_str; ci_ptr_array_t *arr_ptr; ci_vector_t *vect_str; ci_dyn_array_t *dyn_arr; const ci_array_item_t *item; int i, j; char name[128]; char value[128]; void *data; const char *strdata; ci_cfg_lib_init(); mem_init(); __log_error = (void (*)(void *, const char *,...)) log_errors; /*set c-icap library log function */ if (!ci_args_apply(argc, argv, options)) { ci_args_usage(argv[0], options); exit(-1); } ci_debug_printf(1, "Creating array of strings ... "); arr_str = ci_str_array_new(32768); for (i = 1; i< 128; i++) { sprintf(name, "name%d", i); sprintf(value, "value%d", i); ci_str_array_add(arr_str, name, value); } ci_debug_printf(1, "done ... test it ... "); ci_debug_printf(2, "\n\nArray of strings:\n"); ci_str_array_iterate(arr_str, NULL, print_str); ci_debug_printf(2, "\nTest random access:\n"); for (i = 0; i< 128; i++) { item = ci_str_array_get_item(arr_str, i); if (item) { ci_debug_printf(2, "\t%s:%s\n", item->name, (char *)item->value); } } ci_debug_printf(1, "done\n"); ci_debug_printf(1, "Test pop1: \n"); for (i = 0; i < 64; i++) ci_str_array_pop(arr_str); for (i = 64; i < 128; i++) { sprintf(name, "name%d", i); sprintf(value, "value%d", i); ci_str_array_add(arr_str, name, value); } ci_debug_printf(2, "Result: \n"); ci_str_array_iterate(arr_str, NULL, print_str); ci_debug_printf(1, "Test pop 2: \n"); while ((item = ci_str_array_pop(arr_str)) != NULL) { ci_debug_printf(2, " popped : %s %s \n", item->name, (char *)item->value); } ci_str_array_destroy(arr_str); ci_debug_printf(1, "done \n"); ci_debug_printf(1, "Creating array of pointers ... "); arr_ptr = ci_ptr_array_new(32768); for (i = 1; i< 128; i++) { sprintf(name, "name%d", i); sprintf(value, "dynvalue%d", i); data = strdup(value); ci_ptr_array_add(arr_ptr, name, data); } ci_debug_printf(1, "done ... test it ... "); ci_debug_printf(2, "Array of pointers:\n"); ci_ptr_array_iterate(arr_ptr, NULL, print_str); ci_debug_printf(1, "done\n"); char buf[1024]; ci_debug_printf(1, "Test pop on array of pointers..."); while ((data = ci_ptr_array_pop_value(arr_ptr, buf, sizeof(buf))) != NULL) { ci_debug_printf(3, "Deleting : %s: %s\n", buf, (char *)data); free(data); } ci_debug_printf(1, "done\n"); ci_ptr_array_destroy(arr_ptr); vect_str = ci_str_vector_create(4096); for (j = 1; j < 3; j++) { for (i = 1; i< 128; i++) { sprintf(value, "value: %d", i); strdata = ci_str_vector_add(vect_str, value); if (!strdata) ci_debug_printf(2, "Can not add: %s\n", value); } /*Check if casting works*/ ci_debug_printf(1, "Test casting for vectors:"); const char **p = ci_str_vector_cast_to_charchar(vect_str); const char **s; for (s = p; *s != NULL; s++) { ci_debug_printf(2, "from charchar value: %s\n", *s); } ci_str_vector_t *v = ci_str_vector_cast_from_charchar(p); ci_debug_printf(1, "Returned vector max size: %d, itmes %d\n", (int)v->max_size, v->count); while ((strdata = ci_str_vector_pop(vect_str)) != NULL) { ci_debug_printf(2, "Popped value: %s\n", strdata); } } ci_str_vector_destroy(vect_str); ci_debug_printf(1, "\nTest for dynamic arrays\n"); dyn_arr = ci_dyn_array_new(1024); for (i = 0, j = 0; i < 1024; ++i) { sprintf(name, "name%d", i); sprintf(value, "value%d", i); if (ci_dyn_array_add(dyn_arr, name, value, strlen(value) + 1) == NULL) { ci_debug_printf(1, "Failed to add : %s/%s!\n", name, value); } else j += strlen(name) + strlen(value) + 2; } ci_debug_printf(1, "Size of dynamic array: %d, of key/value pairs size: %d\n", ci_dyn_array_size(dyn_arr), j); for (i = 0, j = 0; i < ci_dyn_array_size(dyn_arr); ++i) { char *v = ci_dyn_array_value(dyn_arr, i); char *n = ci_dyn_array_name(dyn_arr, i); j += strlen(n) + strlen(v) + 2; ci_debug_printf(5, "%i = %p:%s/%s\n", i, ci_dyn_array_get_item(dyn_arr, i), ci_dyn_array_name(dyn_arr, i), (char *)ci_dyn_array_value(dyn_arr, i)); } ci_debug_printf(1, "%d computed key/value pairs of summary size: %d\n", i, j); ci_debug_printf(1, "Search for %s: %s\n", "name123", (char *)ci_dyn_array_search(dyn_arr, "name123")); ci_debug_printf(1, "Search for %s: %s\n", "name1023", (char *)ci_dyn_array_search(dyn_arr, "name1023")); ci_debug_printf(1, "Search for %s: %s\n", "name0", (char *)ci_dyn_array_search(dyn_arr, "name0")); ci_debug_printf(1, "Search for %s: %s\n", "nameNotExist", (char *)ci_dyn_array_search(dyn_arr, "nameNotExist")); ci_dyn_array_destroy(dyn_arr); ci_debug_printf(1, "\nEnd of dynamic arrays test\n"); return 0; } c_icap-0.5.6/tests/test_allocators.c0000664000175000017500000000426513541163124014402 00000000000000#include "common.h" #include #include #include #include #include #include #include #include "cfg_param.h" #include "ci_threads.h" #include "mem.h" #include "debug.h" int run_allocs() { int l, i, k; void *v; for (l = 1; l< 50; l++) { for (k = 1; k < 133; k++) { for ( i = k; i < 32768; i = i*2) { ci_debug_printf(5, "Alloc buffer for %d bytes\n", i); v = ci_buffer_alloc(i); memset(v, 0x1, i); ci_buffer_free(v); } } for (k = 11; k < 73; k++) { ci_debug_printf(5, "Alloc buffer for realloc for %d bytes\n", k); v = ci_buffer_alloc(k); for ( i = 17; i < 32768; i = i*2) { ci_debug_printf(5, "ReAlloc buffer for %d bytes\n", i); v = ci_buffer_realloc(v, i); memset(v, 0x1, i); } ci_buffer_free(v); } } return 1; } int threadsnum = 100; static struct ci_options_entry options[] = { { "-d", "debug_level", &CI_DEBUG_LEVEL, ci_cfg_set_int, "The debug level" }, { "-t", "threads", &threadsnum, ci_cfg_set_int, "The numbers of threads to use" }, {NULL,NULL,NULL,NULL,NULL} }; int mem_init(); int main(int argc, char *argv[]) { int i; ci_thread_t *threads; CI_DEBUG_STDOUT = 1; ci_cfg_lib_init(); mem_init(); if (!ci_args_apply(argc, argv, options)) { ci_args_usage(argv[0], options); exit(-1); } /* Simple one thread test */ run_allocs(); /* Run multithread test */ threads = malloc(sizeof(ci_thread_t) * threadsnum); for (i = 0; i < threadsnum; i++) threads[i] = 0; for (i = 0; i < threadsnum; i++) { ci_debug_printf(8, "Thread %d started\n", i); ci_thread_create(&(threads[i]), (void *(*)(void *)) run_allocs, (void *) NULL /*data*/); } for (i = 0; i < threadsnum; i++) { ci_thread_join(threads[i]); ci_debug_printf(6, "Thread %d exited\n", i); } free(threads); return 0; } c_icap-0.5.6/module.c0000664000175000017500000005315013541156313011322 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "module.h" #include "header.h" #include "body.h" #include "debug.h" #ifdef _WIN32 #include #endif #include "dlib.h" #include "cfg_param.h" struct modules_list { void **modules; int modules_num; int list_size; }; /* ci_service_module_t **module_list=NULL; int module_list_size; int modules_num=0; */ #define STEP 20 static struct modules_list service_handlers; service_handler_module_t *default_service_handler; static struct modules_list loggers = {NULL, 0, 0}; static struct modules_list access_controllers = {NULL, 0, 0}; static struct modules_list auth_methods = {NULL, 0, 0}; static struct modules_list authenticators = {NULL, 0, 0}; static struct modules_list common_modules = {NULL, 0, 0}; static struct modules_list *modules_lists_table[] = { /*Must follows the 'enum module_type' enumeration */ NULL, &service_handlers, &loggers, &access_controllers, &auth_methods, &authenticators, &common_modules }; void *load_module(const char *module_file, const char *argv[]) { void *module = NULL; CI_DLIB_HANDLE module_handle; int forceUnload = 1; while (*argv != NULL) { if (strcasecmp(*argv, "forceUnload=off") == 0) forceUnload = 0; argv++; } module_handle = ci_module_load(module_file, CI_CONF.MODULES_DIR); if (!module_handle) return NULL; module = ci_module_sym(module_handle, "module"); if (!module) { ci_debug_printf(1, "Symbol \"module\" not found in library; unload it\n"); ci_module_unload(module_handle, module_file); return NULL; } if (ci_module_sym(module_handle, CI_MOD_DISABLE_FORCE_UNLOAD_STR)) forceUnload = 0; ci_dlib_entry("module", module_file, module_handle, forceUnload); return module; } /* Must called only in initialization procedure. It is not thread-safe! */ void *add_to_modules_list(struct modules_list *mod_list, void *module) { if (mod_list->modules == NULL) { mod_list->list_size = STEP; mod_list->modules = malloc(mod_list->list_size * sizeof(void *)); } else if (mod_list->modules_num == mod_list->list_size) { mod_list->list_size += STEP; mod_list->modules = realloc(mod_list->modules, mod_list->list_size * sizeof(void *)); } if (mod_list->modules == NULL) { //log an error......and... exit(-1); } mod_list->modules[mod_list->modules_num++] = module; return module; } static int module_type(const char *type) { if (strcmp(type, "service_handler") == 0) { return SERVICE_HANDLER; } else if (strcmp(type, "logger") == 0) { return LOGGER; } else if (strcmp(type, "access_controller") == 0) { return ACCESS_CONTROLLER; } else if (strcmp(type, "auth_method") == 0) { return AUTH_METHOD; } else if (strcmp(type, "authenticator") == 0) { return AUTHENTICATOR; } else if (strcmp(type, "common") == 0) { return COMMON; } ci_debug_printf(1, "Uknown type of module:%s\n", type); return UNKNOWN; } static int init_module(void *module, enum module_type type) { int ret = 0; switch (type) { case SERVICE_HANDLER: if (((service_handler_module_t *) module)->init_service_handler) ret = ((service_handler_module_t *) module)-> init_service_handler(&CI_CONF); if (((service_handler_module_t *) module)->conf_table) register_conf_table(((service_handler_module_t *) module)->name, ((service_handler_module_t *) module)-> conf_table, MAIN_TABLE); break; case LOGGER: if (((logger_module_t *) module)->init_logger) ret = ((logger_module_t *) module)->init_logger(&CI_CONF); if (((logger_module_t *) module)->conf_table) register_conf_table(((logger_module_t *) module)->name, ((logger_module_t *) module)->conf_table, MAIN_TABLE); break; case ACCESS_CONTROLLER: if (((access_control_module_t *) module)->init_access_controller) ret = ((access_control_module_t *) module)-> init_access_controller(&CI_CONF); if (((access_control_module_t *) module)->conf_table) register_conf_table(((access_control_module_t *) module)->name, ((access_control_module_t *) module)-> conf_table, MAIN_TABLE); break; case AUTH_METHOD: if (((http_auth_method_t *) module)->init_auth_method) ret = ((http_auth_method_t *) module)->init_auth_method(&CI_CONF); if (((http_auth_method_t *) module)->conf_table) register_conf_table(((http_auth_method_t *) module)->name, ((http_auth_method_t *) module)->conf_table, MAIN_TABLE); break; case AUTHENTICATOR: if (((authenticator_module_t *) module)->init_authenticator) ret = ((authenticator_module_t *) module)-> init_authenticator(&CI_CONF); if (((authenticator_module_t *) module)->conf_table) register_conf_table(((authenticator_module_t *) module)->name, ((authenticator_module_t *) module)-> conf_table, MAIN_TABLE); break; case COMMON: if (((common_module_t *) module)->init_module) ret = ((common_module_t *) module)->init_module(&CI_CONF); if (((common_module_t *) module)->conf_table) register_conf_table(((common_module_t *) module)->name, ((common_module_t *) module)->conf_table, MAIN_TABLE); break; default: return 0; } return ret; } logger_module_t *find_logger(const char *name) { logger_module_t *sh; int i; for (i = 0; i < loggers.modules_num; i++) { sh = (logger_module_t *) loggers.modules[i]; if (sh->name && strcmp(sh->name, name) == 0) return sh; } return NULL; } access_control_module_t *find_access_controller(const char *name) { access_control_module_t *sh; int i; for (i = 0; i < access_controllers.modules_num; i++) { sh = (access_control_module_t *) access_controllers.modules[i]; if (sh->name && strcmp(sh->name, name) == 0) return sh; } return NULL; } common_module_t *find_common(const char *name) { common_module_t *m; int i; for (i = 0; i < common_modules.modules_num; i++) { m = (common_module_t *) common_modules.modules[i]; if (m->name && strcmp(m->name, name) == 0) return m; } return NULL; } /******************************************************************/ http_auth_method_t *find_auth_method(const char *method) { int i; for (i = 0; i < auth_methods.modules_num; i++) { if (strcmp (method, ((http_auth_method_t *) auth_methods.modules[i])->name) == 0) return (http_auth_method_t *) auth_methods.modules[i]; } return NULL; } /* The following function is a hacked version of find_auth_method function. Also return an integer (method_id) which corresponds to a hash key points to an array with authenticators which can handle the authentication method. */ http_auth_method_t *find_auth_method_id(const char *method, int *method_id) { int i; *method_id = 0; for (i = 0; i < auth_methods.modules_num; i++) { if (strcasecmp (method, ((http_auth_method_t *) auth_methods.modules[i])->name) == 0) { *method_id = i; return (http_auth_method_t *) auth_methods.modules[i]; } } return NULL; } authenticator_module_t *find_authenticator(const char *name) { int i; for (i = 0; i < authenticators.modules_num; i++) { if (strcmp (name, ((authenticator_module_t *) authenticators.modules[i])->name) == 0) { return (authenticator_module_t *) authenticators.modules[i]; } } return NULL; } service_handler_module_t *find_servicehandler(const char *name) { service_handler_module_t *sh; int i; for (i = 0; i < service_handlers.modules_num; i++) { sh = (service_handler_module_t *) service_handlers.modules[i]; if (sh->name && strcmp(sh->name, name) == 0) return sh; } return NULL; } void *find_module(const char *name, int *type) { void *mod; if ((mod = find_logger(name)) != NULL) { *type = LOGGER; return mod; } if ((mod = find_servicehandler(name)) != NULL) { *type = SERVICE_HANDLER; return mod; } if ((mod = find_access_controller(name)) != NULL) { *type = ACCESS_CONTROLLER; return mod; } if ((mod = find_auth_method(name)) != NULL) { *type = AUTH_METHOD; return mod; } if ((mod = find_authenticator(name)) != NULL) { *type = AUTHENTICATOR; return mod; } if ((mod = find_common(name)) != NULL) { *type = COMMON; return mod; } *type = UNKNOWN; return NULL; } /*All struct modules as first field have the name.*/ struct module_tmp_struct { char *name; void *other_data; }; void *register_module(const char *module_file, const char *type, const char *argv[]) { void *module = NULL; int mod_type; struct modules_list *l = NULL; struct module_tmp_struct *check_mod; int check_mod_type; l = modules_lists_table[mod_type = module_type(type)]; if (l == NULL) return NULL; module = load_module(module_file, argv); if (!module) { ci_debug_printf(3, "Error while loading module %s\n", module_file); return NULL; } check_mod = (struct module_tmp_struct *)module; if (find_module(check_mod->name, &check_mod_type) != NULL) { ci_debug_printf(1, "Error, the module %s is already loaded\n", check_mod->name); return NULL; } init_module(module, mod_type); add_to_modules_list(l, module); return module; } service_handler_module_t *find_servicehandler_by_ext(const char *extension) { service_handler_module_t *sh; const char *s; int i, len_extension, len_s = 0, found = 0; len_extension = strlen(extension); for (i = 0; i < service_handlers.modules_num; i++) { sh = (service_handler_module_t *) service_handlers.modules[i]; s = sh->extensions; do { if ((s = strstr(s, extension)) != NULL) { len_s = strlen(s); if (len_s >= len_extension && (strchr(",. \t", s[len_extension]) || s[len_extension] == '\0')) { found = 1; } } if (!s || len_extension >= len_s) /*There is no any more extensions....... */ break; s += len_extension; } while (s && !found); if (found) { ci_debug_printf(3, "Found handler %s for service with extension: %s\n", sh->name, extension); return sh; } } ci_debug_printf(1, "No handler for extension %s. Using default ...\n", extension); return default_service_handler; } /*************************************************************************************/ #define MAX_HASH_SIZE 256 /*Maybe, better a value of 10 or 20 */ struct auth_hash { authenticator_module_t ***hash; /*A 2-d array which contains pointers to authenticator_module_t */ int usedsize; int hash_size; }; struct auth_hash authenticators_hash; int init_auth_hash(struct auth_hash *hash) { hash->usedsize = 0; if (NULL == (hash->hash = malloc(STEP * sizeof(authenticator_module_t **)))) { hash->hash_size = STEP; return 0; } hash->hash_size = STEP; memset(hash->hash, 0, hash->hash_size); return 1; } void release_auth_hash(struct auth_hash *hash) { int i; for (i = 0; i < hash->hash_size; i++) { if (hash->hash[i] != NULL) { free(hash->hash[i]); } } free(hash->hash); hash->hash = NULL; } authenticator_module_t **get_authenticators_list(struct auth_hash *hash, int method_id) { if (method_id > hash->hash_size) return NULL; return hash->hash[method_id]; } int check_to_add_method_id(struct auth_hash *hash, int method_id) { authenticator_module_t ***new_mem; if (method_id > MAX_HASH_SIZE || method_id < 0) { ci_debug_printf(1, "Method id is %d. Possible bug, please report it to developers!!!!!!\n", method_id); return 0; } while (hash->hash_size < method_id) { new_mem = realloc(hash->hash, hash->hash_size + STEP); if (!new_mem) { ci_debug_printf(1, "Error allocating memory for authenticator hash!!!!!!\n"); return 0; } memset(hash->hash + hash->hash_size, 0, STEP); /*Reset the newly allocated memory */ hash->hash = new_mem; hash->hash_size += STEP; } return 1; } int methods_authenticators(struct auth_hash *hash, const char *method_name, int method_id, const char **argv) { int i, k, auths_num; authenticator_module_t **new_mem, *auth_mod; if (!check_to_add_method_id(hash, method_id)) return 0; for (auths_num = 0; argv[auths_num] != NULL; auths_num++); if (NULL == (new_mem = malloc((auths_num + 1) * sizeof(authenticator_module_t *)))) { ci_debug_printf(1, "Error allocating memory!!!!!!\n"); return 0; } memset(new_mem, 0, auths_num + 1); if (hash->hash[method_id] != NULL) free(hash->hash[method_id]); hash->hash[method_id] = new_mem; k = 0; for (i = 0; i < auths_num; i++) { ci_debug_printf(3, "Authenticator %s......\n", argv[i]); if ((auth_mod = find_authenticator(argv[i])) == NULL) { ci_debug_printf(1, "Authenticator %s does not exist!!!!!\n", argv[i]); continue; } if (strcasecmp(auth_mod->method, method_name) != 0) { ci_debug_printf(1, "Authenticator %s does not provide authentication method %s!!!!\n", auth_mod->name, method_name); continue; } new_mem[k++] = auth_mod; } new_mem[k] = NULL; return 1; } int set_method_authenticators(const char *method_name, const char **argv) { int method_id; http_auth_method_t *method_mod; if (!(method_mod = find_auth_method_id(method_name, &method_id))) { ci_debug_printf(1, "Authentication method \"%s\" not supported\n", method_name); return 0; } return methods_authenticators(&authenticators_hash, method_name, method_id, argv); } http_auth_method_t *get_authentication_schema(const char *method_name, authenticator_module_t *** authenticators) { int method_id; http_auth_method_t *method_mod; if (!(method_mod = find_auth_method_id(method_name, &method_id))) { *authenticators = NULL; return NULL; } *authenticators = get_authenticators_list(&authenticators_hash, method_id); return method_mod; } /*************************************************************************************/ extern service_handler_module_t c_service_handler; extern logger_module_t file_logger; extern logger_module_t *default_logger; extern access_control_module_t default_acl; extern http_auth_method_t basic_auth; extern authenticator_module_t basic_simple_db; int init_modules() { /*first initialize authenticators hash...... */ init_auth_hash(&authenticators_hash); default_service_handler = &c_service_handler; add_to_modules_list(&service_handlers, default_service_handler); default_logger = &file_logger; /* init_module(default_logger,LOGGER); Must be called, if default module has conf table or init_service_handler. */ add_to_modules_list(&loggers, default_logger); init_module(&default_acl, ACCESS_CONTROLLER); add_to_modules_list(&access_controllers, &default_acl); init_module(&basic_auth, AUTH_METHOD); add_to_modules_list(&auth_methods, &basic_auth); init_module(&basic_simple_db, AUTHENTICATOR); add_to_modules_list(&authenticators, &basic_simple_db); return 1; } int post_init_modules() { int i; /* common modules */ for (i = 0; i < common_modules.modules_num ; i++) { if (((common_module_t *) common_modules.modules[i])-> post_init_module != NULL) ((common_module_t *) common_modules.modules[i])-> post_init_module(&CI_CONF); } /* service_handlers */ for (i = 0; i < service_handlers.modules_num; i++) { if (((service_handler_module_t *) service_handlers.modules[i])-> post_init_service_handler != NULL) ((service_handler_module_t *) service_handlers.modules[i])-> post_init_service_handler(&CI_CONF); } /* loggers? loggers do not have post init handlers .... */ /* access_controllers */ for (i = 0; i < access_controllers.modules_num; i++) { if (((access_control_module_t *) access_controllers.modules[i])-> post_init_access_controller != NULL) ((access_control_module_t *) access_controllers.modules[i])-> post_init_access_controller(&CI_CONF); } /* auth_methods */ for (i = 0; i < auth_methods.modules_num; i++) { if (((http_auth_method_t *) auth_methods.modules[i])-> post_init_auth_method != NULL) ((http_auth_method_t *) auth_methods.modules[i])-> post_init_auth_method(&CI_CONF); } /* authenticators */ for (i = 0; i < authenticators.modules_num; i++) { if (((authenticator_module_t *) authenticators.modules[i])-> post_init_authenticator != NULL) ((authenticator_module_t *) authenticators.modules[i])-> post_init_authenticator(&CI_CONF); } return 1; } int access_reset(); void log_reset(); #define RELEASE_MOD_LIST(mod) \ free(mod.modules); mod.modules = NULL; mod.list_size = 0; mod.modules_num=0; int release_modules() { int i; log_reset(); /*resetting logs- we are going to release loggers ... */ access_reset(); /* service_handlers */ for (i = 0; i < service_handlers.modules_num; i++) { if (((service_handler_module_t *) service_handlers.modules[i])-> release_service_handler != NULL) ((service_handler_module_t *) service_handlers.modules[i])-> release_service_handler(); } RELEASE_MOD_LIST(service_handlers); /* loggers? loggers do not have post init handlers .... */ for (i = 0; i < loggers.modules_num; i++) { if (((logger_module_t *) loggers.modules[i])->log_close != NULL) ((logger_module_t *) loggers.modules[i])->log_close(); } RELEASE_MOD_LIST(loggers); /* access_controllers */ for (i = 0; i < access_controllers.modules_num; i++) { if (((access_control_module_t *) access_controllers.modules[i])-> release_access_controller != NULL) ((access_control_module_t *) access_controllers.modules[i])-> release_access_controller(&CI_CONF); } RELEASE_MOD_LIST(access_controllers); /* auth_methods */ for (i = 0; i < auth_methods.modules_num; i++) { if (((http_auth_method_t *) auth_methods.modules[i])-> close_auth_method != NULL) ((http_auth_method_t *) auth_methods.modules[i])-> close_auth_method(&CI_CONF); } RELEASE_MOD_LIST(auth_methods); /* authenticators */ for (i = 0; i < authenticators.modules_num; i++) { if (((authenticator_module_t *) authenticators.modules[i])-> close_authenticator != NULL) ((authenticator_module_t *) authenticators.modules[i])-> close_authenticator(&CI_CONF); } RELEASE_MOD_LIST(authenticators); /* common modules */ for (i = common_modules.modules_num-1; i >= 0 ; i--) { if (((common_module_t *) common_modules.modules[i])-> close_module != NULL) ((common_module_t *) common_modules.modules[i])-> close_module(&CI_CONF); } RELEASE_MOD_LIST(common_modules); return 1; } c_icap-0.5.6/config.sub0000755000175000017500000010645013570504056011657 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-22' # This file 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 3 of the License, 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo "$1" | sed 's/-[^-]*$//'` if [ "$basic_machine" != "$1" ] then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2*) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsv-tandem) basic_machine=nsv-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh5el) basic_machine=sh5le-unknown ;; simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; x64) basic_machine=x86_64-pc ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases that might get confused # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) -es1800*) os=-ose ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -xray | -os68k* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4*) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) os=-eabi ;; *) os=-elf ;; esac ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; pru-*) os=-elf ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac echo "$basic_machine$os" exit # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: c_icap-0.5.6/config-w32.h0000664000175000017500000000213013371253152011710 00000000000000 /* Config.h file for win32 using MSVC compiler */ #include /*For struct tm declaration ....*/ #define HAVE_MALLOC_H 1 #define HAVE_MEMORY_H 1 #define HAVE_STDLIB_H 1 #define HAVE_STRING_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_SYS_TYPES_H 1 /*Some functions definitions */ #define snprintf _snprintf #define strtoll strtol /* Name of package */ #define PACKAGE "c_icap" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ #define PACKAGE_NAME "" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "" /* Define to the version of this package. */ #define PACKAGE_VERSION "" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ #define VERSION "1.0" /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `unsigned' if does not define. */ /* #undef size_t */ c_icap-0.5.6/request.c0000664000175000017500000016576013541163402011535 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include #include #include #include #ifdef _NOTUSED #include #endif #include "debug.h" #include "request.h" #include "service.h" #include "access.h" #include "util.h" #include "simple_api.h" #include "cfg_param.h" #include "stats.h" #include "body.h" extern int TIMEOUT; extern int KEEPALIVE_TIMEOUT; extern const char *DEFAULT_SERVICE; extern int PIPELINING; extern int CHECK_FOR_BUGGY_CLIENT; extern int ALLOW204_AS_200OK_ZERO_ENCAPS; extern int FAKE_ALLOW204; /*This variable defined in mpm_server.c and become 1 when the child must halt imediatelly:*/ extern int CHILD_HALT; #define FORBITTEN_STR "ICAP/1.0 403 Forbidden\r\n\r\n" /*#define ISTAG "\"5BDEEEA9-12E4-2\""*/ static int STAT_REQUESTS = -1; static int STAT_FAILED_REQUESTS = -1; static int STAT_BYTES_IN = -1; static int STAT_BYTES_OUT = -1; static int STAT_HTTP_BYTES_IN = -1; static int STAT_HTTP_BYTES_OUT = -1; static int STAT_BODY_BYTES_IN = -1; static int STAT_BODY_BYTES_OUT = -1; static int STAT_REQMODS = -1; static int STAT_RESPMODS = -1; static int STAT_OPTIONS = -1; static int STAT_ALLOW204 = -1; void request_stats_init() { STAT_REQUESTS = ci_stat_entry_register("REQUESTS", STAT_INT64_T, "General"); STAT_REQMODS = ci_stat_entry_register("REQMODS", STAT_INT64_T, "General"); STAT_RESPMODS = ci_stat_entry_register("RESPMODS", STAT_INT64_T, "General"); STAT_OPTIONS = ci_stat_entry_register("OPTIONS", STAT_INT64_T, "General"); STAT_FAILED_REQUESTS = ci_stat_entry_register("FAILED REQUESTS", STAT_INT64_T, "General"); STAT_ALLOW204 = ci_stat_entry_register("ALLOW 204", STAT_INT64_T, "General"); STAT_BYTES_IN = ci_stat_entry_register("BYTES IN", STAT_KBS_T, "General"); STAT_BYTES_OUT = ci_stat_entry_register("BYTES OUT", STAT_KBS_T, "General"); STAT_HTTP_BYTES_IN = ci_stat_entry_register("HTTP BYTES IN", STAT_KBS_T, "General"); STAT_HTTP_BYTES_OUT = ci_stat_entry_register("HTTP BYTES OUT", STAT_KBS_T, "General"); STAT_BODY_BYTES_IN = ci_stat_entry_register("BODY BYTES IN", STAT_KBS_T, "General"); STAT_BODY_BYTES_OUT = ci_stat_entry_register("BODY BYTES OUT", STAT_KBS_T, "General"); } static int wait_for_data(ci_connection_t *conn, int secs, int what_wait) { int wait_status; /*if we are going down do not wait....*/ if (CHILD_HALT) return -1; do { wait_status = ci_connection_wait(conn, secs, what_wait); if (wait_status < 0) return -1; if (wait_status == 0 && CHILD_HALT) /*abort*/ return -1; } while (wait_status & ci_wait_should_retry); if (wait_status == 0) /* timeout */ return -1; return wait_status; } ci_request_t *newrequest(ci_connection_t * connection) { ci_request_t *req; int access; int len; ci_connection_t *conn; conn = (ci_connection_t *) malloc(sizeof(ci_connection_t)); assert(conn); ci_copy_connection(conn, connection); req = ci_request_alloc(conn); if ((access = access_check_client(req)) == CI_ACCESS_DENY) { /*Check for client access */ len = strlen(FORBITTEN_STR); ci_connection_write(connection, FORBITTEN_STR, len, TIMEOUT); ci_request_destroy(req); return NULL; /*Or something that means authentication error */ } req->access_type = access; return req; } int recycle_request(ci_request_t * req, ci_connection_t * connection) { int access; int len; ci_request_reset(req); ci_copy_connection(req->connection, connection); if ((access = access_check_client(req)) == CI_ACCESS_DENY) { /*Check for client access */ len = strlen(FORBITTEN_STR); ci_connection_write(connection, FORBITTEN_STR, len, TIMEOUT); return 0; /*Or something that means authentication error */ } req->access_type = access; return 1; } int keepalive_request(ci_request_t *req) { /* Preserve extra read bytes*/ char *pstrblock = req->pstrblock_read; int pstrblock_len = req->pstrblock_read_len; // Just reset without change or free memory ci_request_reset(req); if (PIPELINING) { req->pstrblock_read = pstrblock; req->pstrblock_read_len = pstrblock_len; } if (req->pstrblock_read && req->pstrblock_read_len > 0) return 1; return wait_for_data(req->connection, KEEPALIVE_TIMEOUT, ci_wait_for_read); } /*Here we want to read in small blocks icap header becouse in most cases it will not bigger than 512-1024 bytes. So we are going to do small reads and small increments in icap headers size, to save some space and keep small the number of over-read bytes */ #define ICAP_HEADER_READSIZE 512 /*this function check if there is enough space in buffer buf ....*/ static int icap_header_check_realloc(char **buf, int *size, int used, int mustadded) { char *newbuf; int len; if (*size - used < mustadded) { len = *size + ICAP_HEADER_READSIZE; newbuf = realloc(*buf, len); if (!newbuf) { return EC_500; } *buf = newbuf; *size = *size + ICAP_HEADER_READSIZE; } return EC_100; } static int ci_read_icap_header(ci_request_t * req, ci_headers_list_t * h, int timeout) { int bytes, request_status = EC_100, i, eoh = 0, startsearch = 0, readed = 0; int wait_status = 0; char *buf_end; int dataPrefetch = 0; buf_end = h->buf; readed = 0; bytes = 0; if (PIPELINING && req->pstrblock_read && req->pstrblock_read_len > 0) { if ((request_status = icap_header_check_realloc(&(h->buf), &(h->bufsize), req->pstrblock_read_len, ICAP_HEADER_READSIZE)) != EC_100) return request_status; memmove(h->buf, req->pstrblock_read, req->pstrblock_read_len); readed = req->pstrblock_read_len; buf_end = h->buf; bytes = readed; dataPrefetch = 1; req->pstrblock_read = NULL; req->pstrblock_read_len = 0; ci_debug_printf(5, "Get data from previous request read.\n"); } do { if (!dataPrefetch) { if ((wait_status = wait_for_data(req->connection, timeout, ci_wait_for_read)) < 0) return EC_408; bytes = ci_connection_read_nonblock(req->connection, buf_end, ICAP_HEADER_READSIZE); if (bytes < 0) return EC_408; if (bytes == 0) /*NOP? should retry?*/ continue; readed += bytes; req->bytes_in += bytes; } else dataPrefetch = 0; for (i = startsearch; i < bytes - 3; i++) { /*search for end of header.... */ if (strncmp(buf_end + i, "\r\n\r\n", 4) == 0) { buf_end = buf_end + i + 2; eoh = 1; break; } } if (eoh) break; if ((request_status = icap_header_check_realloc(&(h->buf), &(h->bufsize), readed, ICAP_HEADER_READSIZE)) != EC_100) break; buf_end = h->buf + readed; if (startsearch > -3) startsearch = (readed > 3 ? -3 : -readed); /*Including the last 3 char ellements ....... */ } while (1); h->bufused = buf_end - h->buf; /* -1 ; */ req->pstrblock_read = buf_end + 2; /*after the \r\n\r\n. We keep the first \r\n and the other dropped.... */ req->pstrblock_read_len = readed - h->bufused - 2; /*the 2 of the 4 characters \r\n\r\n and the '\0' character */ req->request_bytes_in = h->bufused + 2; /*This is include the "\r\n\r\n" sequence*/ return request_status; } static int read_encaps_header(ci_request_t * req, ci_headers_list_t * h, int size) { int bytes = 0, remains, readed = 0; char *buf_end = NULL; if (!ci_headers_setsize(h, size + (CHECK_FOR_BUGGY_CLIENT != 0 ? 2 : 0))) return EC_500; buf_end = h->buf; if (req->pstrblock_read_len > 0) { readed = (size > req->pstrblock_read_len ? req->pstrblock_read_len : size); memcpy(h->buf, req->pstrblock_read, readed); buf_end = h->buf + readed; if (size <= req->pstrblock_read_len) { /*We have readed all this header....... */ req->pstrblock_read = (req->pstrblock_read) + readed; req->pstrblock_read_len = (req->pstrblock_read_len) - readed; } else { req->pstrblock_read = NULL; req->pstrblock_read_len = 0; } } remains = size - readed; while (remains > 0) { if (wait_for_data(req->connection, TIMEOUT, ci_wait_for_read) < 0) return CI_ERROR; if ((bytes = ci_connection_read_nonblock(req->connection, buf_end, remains)) < 0) return CI_ERROR; remains -= bytes; buf_end += bytes; req->bytes_in += bytes; } h->bufused = buf_end - h->buf; // -1 ; if (strncmp(buf_end - 4, "\r\n\r\n", 4) == 0) { h->bufused -= 2; /*eat the last 2 bytes of "\r\n\r\n" */ } else if (CHECK_FOR_BUGGY_CLIENT && strncmp(buf_end - 2, "\r\n", 2) != 0) { // Some icap clients missing the "\r\n\r\n" after end of headers // when null-body is present. *buf_end = '\r'; *(buf_end + 1) = '\n'; h->bufused += 2; } /*Currently we are counting only successfull http headers read.*/ req->http_bytes_in += size; req->request_bytes_in += size; return EC_100; } static int get_method(char *buf, char **end) { if (!strncmp(buf, "OPTIONS", 7)) { *end = buf + 7; return ICAP_OPTIONS; } else if (!strncmp(buf, "REQMOD", 6)) { *end = buf + 6; return ICAP_REQMOD; } else if (!strncmp(buf, "RESPMOD", 7)) { *end = buf + 7; return ICAP_RESPMOD; } else { *end = buf; return -1; } } static int parse_request(ci_request_t * req, char *buf) { char *start, *end; int servnamelen, len, args_len; int vmajor, vminor; ci_service_module_t *service = NULL; service_alias_t *salias = NULL; if ((req->type = get_method(buf, &end)) < 0) return EC_400; while (*end == ' ') end++; start = end; if (strncasecmp(start, "icap://", 7) == 0) start = start + 7; else if (strncasecmp(start, "icaps://", 8) == 0) start = start + 8; else return EC_400; len = strcspn(start, "/ "); end = start + len; servnamelen = (CI_MAXHOSTNAMELEN > len ? len : CI_MAXHOSTNAMELEN); memcpy(req->req_server, start, servnamelen); req->req_server[servnamelen] = '\0'; if (*end == '/') { /*we are expecting service name*/ start = ++end; while (*end && *end != ' ' && *end != '?') end++; len = end - start; len = (len < MAX_SERVICE_NAME ? len : MAX_SERVICE_NAME); if (len) { strncpy(req->service, start, len); req->service[len] = '\0'; } if (*end == '?') { /*args */ start = ++end; if ((end = strchr(start, ' ')) != NULL) { args_len = strlen(req->args); len = end - start; if (args_len && len) { req->args[args_len] = '&'; args_len++; } len = (len < (MAX_SERVICE_ARGS - args_len) ? len : (MAX_SERVICE_ARGS - args_len)); strncpy(req->args + args_len, start, len); req->args[args_len + len] = '\0'; } else return EC_400; } /*end of parsing args */ } while (*end == ' ') end++; start = end; vminor = vmajor = -1; if (strncmp(start, "ICAP/", 5) == 0) { start += 5; vmajor = strtol(start, &end, 10); if (vmajor > 0 && *end == '.') { start = end + 1; vminor = strtol(start, &end, 10); if (end == start) /*no chars parsed*/ vminor = -1; } } if (vminor == -1 || vmajor < 1) return EC_400; if (req->service[0] == '\0' && DEFAULT_SERVICE) { /*No service name defined*/ strncpy(req->service, DEFAULT_SERVICE, MAX_SERVICE_NAME); } if (req->service[0] != '\0') { if (!(service = find_service(req->service))) { /*else search for an alias */ if ((salias = find_service_alias(req->service))) { service = salias->service; if (salias->args[0] != '\0') strcpy(req->args, salias->args); } } } req->current_service_mod = service; if (!req->current_service_mod) return EC_404; /*Service not found*/ if (!ci_method_support (req->current_service_mod->mod_type, req->type) && req->type != ICAP_OPTIONS) { return EC_405; /* Method not allowed for service. */ } return EC_100; } static int check_request(ci_request_t *req) { /*Check encapsulated header*/ if (req->entities[0] == NULL && req->type != ICAP_OPTIONS) /*No encapsulated header*/ return EC_400; ci_debug_printf(6, "\n type:%d Entities: %d %d %d %d \n", req->type, req->entities[0] ? req->entities[0]->type : -1, req->entities[1] ? req->entities[1]->type : -1, req->entities[2] ? req->entities[2]->type : -1, req->entities[3] ? req->entities[3]->type : -1 ); if (req->type == ICAP_REQMOD) { if (req->entities[2] != NULL) return EC_400; else if (req->entities[1] != NULL) { if (req->entities[0]->type != ICAP_REQ_HDR) return EC_400; if (req->entities[1]->type != ICAP_REQ_BODY && req->entities[1]->type != ICAP_NULL_BODY) return EC_400; } else { /*If it has only one encapsulated object it must be body data*/ if (req->entities[0]->type != ICAP_REQ_BODY) return EC_400; } } else if (req->type == ICAP_RESPMOD) { if (req->entities[3] != NULL) return EC_400; else if (req->entities[2] != NULL) { assert(req->entities[0]); assert(req->entities[1]); if (req->entities[0]->type != ICAP_REQ_HDR) return EC_400; if (req->entities[1]->type != ICAP_RES_HDR) return EC_400; if (req->entities[2]->type != ICAP_RES_BODY && req->entities[2]->type != ICAP_NULL_BODY) return EC_400; } else if (req->entities[1] != NULL) { if (req->entities[0]->type != ICAP_RES_HDR && req->entities[0]->type != ICAP_REQ_HDR) return EC_400; if (req->entities[1]->type != ICAP_RES_BODY && req->entities[1]->type != ICAP_NULL_BODY) return EC_400; } else { /*If it has only one encapsulated object it must be body data*/ if (req->entities[0]->type != ICAP_RES_BODY) return EC_400; } } return EC_100; } static int parse_header(ci_request_t * req) { int i, request_status = EC_100, result; ci_headers_list_t *h; char *val; h = req->request_header; if ((request_status = ci_read_icap_header(req, h, TIMEOUT)) != EC_100) return request_status; if ((request_status = ci_headers_unpack(h)) != EC_100) return request_status; if ((request_status = parse_request(req, h->headers[0])) != EC_100) return request_status; for (i = 1; i < h->used && request_status == EC_100; i++) { if (strncasecmp("Preview:", h->headers[i], 8) == 0) { val = h->headers[i] + 8; for (; isspace(*val) && *val != '\0'; ++val); errno = 0; result = strtol(val, NULL, 10); if (errno != EINVAL && errno != ERANGE) { req->preview = result; if (result >= 0) ci_buf_reset_size(&(req->preview_data), result + 64); } } else if (strncasecmp("Encapsulated:", h->headers[i], 13) == 0) request_status = process_encapsulated(req, h->headers[i]); else if (strncasecmp("Connection:", h->headers[i], 11) == 0) { val = h->headers[i] + 11; for (; isspace(*val) && *val != '\0'; ++val); /* if(strncasecmp(val,"keep-alive",10)==0)*/ if (strncasecmp(val, "close", 5) == 0) req->keepalive = 0; /*else the default behaviour of keepalive ..... */ } else if (strncasecmp("Allow:", h->headers[i], 6) == 0) { if (strstr(h->headers[i]+6, "204")) req->allow204 = 1; if (strstr(h->headers[i]+6, "206")) req->allow206 = 1; } } if (request_status != EC_100) return request_status; return check_request(req); } static int parse_encaps_headers(ci_request_t * req) { int size, i, request_status = 0; ci_encaps_entity_t *e = NULL; for (i = 0; (e = req->entities[i]) != NULL; i++) { if (e->type > ICAP_RES_HDR) //res_body,req_body or opt_body so the end of the headers.....process_encapsulated return EC_100; if (req->entities[i + 1] == NULL) return EC_400; size = req->entities[i + 1]->start - e->start; if ((request_status = read_encaps_header(req, (ci_headers_list_t *) e->entity, size)) != EC_100) return request_status; if ((request_status = ci_headers_unpack((ci_headers_list_t *) e->entity)) != EC_100) return request_status; } return EC_100; } /* In read_preview_data I must check if readed data are more than those client said in preview header */ static int read_preview_data(ci_request_t * req) { int ret; char *wdata; req->current_chunk_len = 0; req->chunk_bytes_read = 0; req->write_to_module_pending = 0; if (req->pstrblock_read_len == 0) { if (wait_for_data(req->connection, TIMEOUT, ci_wait_for_read) < 0) return CI_ERROR; if (net_data_read(req) == CI_ERROR) return CI_ERROR; } do { do { if ((ret = parse_chunk_data(req, &wdata)) == CI_ERROR) { ci_debug_printf(1, "Error parsing chunks, current chunk len: %d readed:%d, str:%s\n", req->current_chunk_len, req->chunk_bytes_read, req->pstrblock_read); return CI_ERROR; } if (ci_buf_write (&(req->preview_data), wdata, req->write_to_module_pending) < 0) return CI_ERROR; req->write_to_module_pending = 0; if (ret == CI_EOF) { req->pstrblock_read = NULL; req->pstrblock_read_len = 0; if (req->eof_received) return CI_EOF; return CI_OK; } } while (ret != CI_NEEDS_MORE); if (wait_for_data(req->connection, TIMEOUT, ci_wait_for_read) < 0) return CI_ERROR; if (net_data_read(req) == CI_ERROR) return CI_ERROR; } while (1); return CI_ERROR; } static void ec_responce_simple(ci_request_t * req, int ec) { char buf[256]; int len; snprintf(buf, 256, "ICAP/1.0 %d %s\r\n\r\n", ci_error_code(ec), ci_error_code_string(ec)); buf[255] = '\0'; len = strlen(buf); ci_connection_write(req->connection, buf, len, TIMEOUT); req->bytes_out += len; req->return_code = ec; } static int ec_responce(ci_request_t * req, int ec) { char buf[256]; ci_service_xdata_t *srv_xdata = NULL; int len, allow204to200OK = 0; if (req->current_service_mod) srv_xdata = service_data(req->current_service_mod); ci_headers_reset(req->response_header); if (ec == EC_204 && ALLOW204_AS_200OK_ZERO_ENCAPS) { allow204to200OK = 1; ec = EC_200; } snprintf(buf, 256, "ICAP/1.0 %d %s", ci_error_code(ec), ci_error_code_string(ec)); ci_headers_add(req->response_header, buf); ci_headers_add(req->response_header, "Server: C-ICAP/" VERSION); if (req->keepalive) ci_headers_add(req->response_header, "Connection: keep-alive"); else ci_headers_add(req->response_header, "Connection: close"); if (srv_xdata) { ci_service_data_read_lock(srv_xdata); ci_headers_add(req->response_header, srv_xdata->ISTag); ci_service_data_read_unlock(srv_xdata); } if (!ci_headers_is_empty(req->xheaders)) { ci_headers_addheaders(req->response_header, req->xheaders); } if (allow204to200OK) { if (req->type == ICAP_REQMOD) ci_headers_add(req->response_header, "Encapsulated: req-hdr=0, null-body=0"); else ci_headers_add(req->response_header, "Encapsulated: res-hdr=0, null-body=0"); } /* TODO: Release req->entities (ci_request_release_entity()) */ ci_headers_pack(req->response_header); req->return_code = ec; len = ci_connection_write(req->connection, req->response_header->buf, req->response_header->bufused, TIMEOUT); /*We are finishing sending*/ req->status = SEND_EOF; if (len < 0) return -1; req->bytes_out += len; return len; } extern char MY_HOSTNAME[]; static int mk_responce_header(ci_request_t * req) { ci_headers_list_t *head; ci_encaps_entity_t **e_list; ci_service_xdata_t *srv_xdata; char buf[512]; srv_xdata = service_data(req->current_service_mod); ci_headers_reset(req->response_header); head = req->response_header; assert(req->return_code >= EC_100 && req->return_code < EC_MAX); snprintf(buf, 512, "ICAP/1.0 %d %s", ci_error_code(req->return_code), ci_error_code_string(req->return_code)); ci_headers_add(head, buf); ci_headers_add(head, "Server: C-ICAP/" VERSION); if (req->keepalive) ci_headers_add(head, "Connection: keep-alive"); else ci_headers_add(head, "Connection: close"); ci_service_data_read_lock(srv_xdata); ci_headers_add(head, srv_xdata->ISTag); ci_service_data_read_unlock(srv_xdata); if (!ci_headers_is_empty(req->xheaders)) { ci_headers_addheaders(head, req->xheaders); } e_list = req->entities; if (req->type == ICAP_RESPMOD) { if (e_list[0]->type == ICAP_REQ_HDR) { ci_request_release_entity(req, 0); e_list[0] = e_list[1]; e_list[1] = e_list[2]; e_list[2] = NULL; } } snprintf(buf, 512, "Via: ICAP/1.0 %s (C-ICAP/" VERSION " %s )", MY_HOSTNAME, (req->current_service_mod->mod_short_descr ? req-> current_service_mod->mod_short_descr : req->current_service_mod-> mod_name)); buf[511] = '\0'; /*Here we must append it to an existsing Via header not just add a new header */ if (req->type == ICAP_RESPMOD) { ci_http_response_add_header(req, buf); } else if (req->type == ICAP_REQMOD) { ci_http_request_add_header(req, buf); } ci_response_pack(req); return 1; } /****************************************************************/ /* New functions to send responce */ const char *eol_str = "\r\n"; const char *eof_str = "0\r\n\r\n"; static int send_current_block_data(ci_request_t * req) { int bytes; if (req->remain_send_block_bytes == 0) return 0; if ((bytes = ci_connection_write_nonblock(req->connection, req->pstrblock_responce, req->remain_send_block_bytes)) < 0) { ci_debug_printf(5, "Error writing to socket (errno:%d, bytes:%d. string:\"%s\")", errno, req->remain_send_block_bytes, req->pstrblock_responce); return CI_ERROR; } /* if (bytes == 0) { ci_debug_printf(5, "Can not write to the client. Is the connection closed?"); return CI_ERROR; } */ req->pstrblock_responce += bytes; req->remain_send_block_bytes -= bytes; req->bytes_out += bytes; if (req->status >= SEND_HEAD1 && req->status <= SEND_HEAD3) req->http_bytes_out +=bytes; return req->remain_send_block_bytes; } static int format_body_chunk(ci_request_t * req) { int def_bytes; char *wbuf = NULL; char tmpbuf[EXTRA_CHUNK_SIZE]; if (!req->responce_hasbody) return CI_EOF; if (req->remain_send_block_bytes > 0) { assert(req->remain_send_block_bytes <= MAX_CHUNK_SIZE); /*The data are not written yet but I hope there is not any problem. It is difficult to compute data sent */ req->http_bytes_out += req->remain_send_block_bytes; req->body_bytes_out += req->remain_send_block_bytes; wbuf = req->wbuf + EXTRA_CHUNK_SIZE + req->remain_send_block_bytes; /*Put the "\r\n" sequence at the end of chunk */ *(wbuf++) = '\r'; *wbuf = '\n'; def_bytes = snprintf(tmpbuf, EXTRA_CHUNK_SIZE, "%x\r\n", req->remain_send_block_bytes); wbuf = req->wbuf + EXTRA_CHUNK_SIZE - def_bytes; /*Copy the chunk define in the beggining of chunk ..... */ memcpy(wbuf, tmpbuf, def_bytes); req->pstrblock_responce = wbuf; req->remain_send_block_bytes += def_bytes + 2; } else if (req->remain_send_block_bytes == CI_EOF) { if (req->return_code == EC_206 && req->i206_use_original_body >= 0) { def_bytes = sprintf(req->wbuf, "0; use-original-body=%" PRId64 "\r\n\r\n", req->i206_use_original_body ); req->pstrblock_responce = req->wbuf; req->remain_send_block_bytes = def_bytes; } else { strcpy(req->wbuf, "0\r\n\r\n"); req->pstrblock_responce = req->wbuf; req->remain_send_block_bytes = 5; } return CI_EOF; } return CI_OK; } static int resp_check_body(ci_request_t * req) { int i; ci_encaps_entity_t **e = req->entities; for (i = 0; e[i] != NULL; i++) if (e[i]->type == ICAP_NULL_BODY) return 0; return 1; } /* The if((ret=send_current_block_data(req))!=0) return ret; must called after this function.... */ static int update_send_status(ci_request_t * req) { int i, status; ci_encaps_entity_t *e; if (req->status == SEND_NOTHING) { //If nothing has send start sending.... if (!mk_responce_header(req)) { ci_debug_printf(1, "Error constructing the responce headers!\n"); return CI_ERROR; } req->responce_hasbody = resp_check_body(req); req->pstrblock_responce = req->response_header->buf; req->remain_send_block_bytes = req->response_header->bufused; req->status = SEND_RESPHEAD; ci_debug_printf(9, "Going to send response headers\n"); return CI_OK; } if (req->status == SEND_EOF) { ci_debug_printf(9, "The req->status is EOF (remain to send bytes:%d)\n", req->remain_send_block_bytes); if (req->remain_send_block_bytes == 0) return CI_EOF; else return CI_OK; } if (req->status == SEND_BODY) { ci_debug_printf(9, "Send status is SEND_BODY return\n"); return CI_OK; } if ((status = req->status) < SEND_HEAD3) { status++; } if (status > SEND_RESPHEAD && status < SEND_BODY) { /*status is SEND_HEAD1 SEND_HEAD2 or SEND_HEAD3 */ i = status - SEND_HEAD1; /*We have to send next headers block .... */ if ((e = req->entities[i]) != NULL && (e->type == ICAP_REQ_HDR || e->type == ICAP_RES_HDR)) { req->pstrblock_responce = ((ci_headers_list_t *) e->entity)->buf; req->remain_send_block_bytes = ((ci_headers_list_t *) e->entity)->bufused; req->status = status; ci_debug_printf(9, "Going to send http headers on entity :%d\n", i); return CI_OK; } else if (req->responce_hasbody) { /*end of headers, going to send body now.A body always follows the res_hdr or req_hdr..... */ req->status = SEND_BODY; return CI_OK; } else { req->status = SEND_EOF; req->pstrblock_responce = (char *) NULL; req->remain_send_block_bytes = 0; return CI_EOF; } } return CI_ERROR; /*Can not be reached (I thing)...... */ } static int mod_null_io(char *rbuf, int *rlen, char *wbuf, int *wlen, int iseof, ci_request_t *req) { if (iseof) *rlen = CI_EOF; else *rlen = 0; return CI_OK; } static int mod_echo_io(char *wbuf, int *wlen, char *rbuf, int *rlen, int iseof, ci_request_t *req) { if (!req->echo_body) return CI_ERROR; if (rlen && rbuf) { *rlen = ci_ring_buf_write(req->echo_body, rbuf, *rlen); if (*rlen < 0) return CI_ERROR; } if (wbuf && wlen) { *wlen = ci_ring_buf_read(req->echo_body, wbuf, *wlen); if (*wlen == 0 && req->eof_received) *wlen = CI_EOF; } return CI_OK; } static int get_send_body(ci_request_t * req, int parse_only) { char *wchunkdata = NULL, *rchunkdata = NULL; int ret, parse_chunk_ret, has_formated_data = 0; int (*service_io) (char *rbuf, int *rlen, char *wbuf, int *wlen, int iseof, ci_request_t *); int action = 0, rchunkisfull = 0, service_eof = 0, wbytes, rbytes; int lock_status; int no_io; if (parse_only) service_io = mod_null_io; else if (req->echo_body) service_io = mod_echo_io; else service_io = req->current_service_mod->mod_service_io; if (!service_io) return CI_ERROR; req->status = SEND_NOTHING; /*in the case we did not have preview data and body is small maybe the c-icap already read the body with the headers so do not read if there are unparsed bytes in pstrblock buffer */ if (req->pstrblock_read_len == 0) action = ci_wait_for_read; do { if (action) { ci_debug_printf(9, "Going to %s/%s data\n", (action & ci_wait_for_read ? "Read" : "-"), (action & ci_wait_for_write ? "Write" : "-") ); if ((ret = wait_for_data(req->connection, TIMEOUT, action)) < 0) break; if (ret & ci_wait_for_read) { if (net_data_read(req) == CI_ERROR) return CI_ERROR; } if (ret & ci_wait_for_write) { if (!req->data_locked && req->status == SEND_NOTHING) { update_send_status(req); } if (send_current_block_data(req) == CI_ERROR) return CI_ERROR; } ci_debug_printf(9, "OK done reading/writing going to process\n"); } if (!req->data_locked && req->remain_send_block_bytes == 0) { if (update_send_status(req) == CI_ERROR) return CI_ERROR; // if(update_send_status == CI_EOF)/*earlier responce from icap server???...*/ } /*Store lock status. If it is changed during module io, we need to update send status.*/ lock_status = req->data_locked; /*In the following loop, parses the chunks from readed data and try to write data to the service. At the same time reads the data from module and try to fill the req->wbuf */ if (req->remain_send_block_bytes) has_formated_data = 1; else has_formated_data = 0; parse_chunk_ret = 0; do { if (req->pstrblock_read_len != 0 && req->write_to_module_pending == 0) { if ((parse_chunk_ret = parse_chunk_data(req, &wchunkdata)) == CI_ERROR) { ci_debug_printf(1, "Error parsing chunks!\n"); return CI_ERROR; } if (parse_chunk_ret == CI_EOF) req->eof_received = 1; } if (wchunkdata && req->write_to_module_pending) wbytes = req->write_to_module_pending; else wbytes = 0; if (req->status == SEND_BODY && !service_eof) { if (req->remain_send_block_bytes == 0) { /*Leave space for chunk spec.. */ rchunkdata = req->wbuf + EXTRA_CHUNK_SIZE; req->pstrblock_responce = rchunkdata; /*does not needed! */ rchunkisfull = 0; } if ((MAX_CHUNK_SIZE - req->remain_send_block_bytes) > 0 && has_formated_data == 0) { rbytes = MAX_CHUNK_SIZE - req->remain_send_block_bytes; } else { rchunkisfull = 1; rbytes = 0; } } else rbytes = 0; ci_debug_printf(9, "get send body: going to write/read: %d/%d bytes\n", wbytes, rbytes); if ((*service_io) (rchunkdata, &rbytes, wchunkdata, &wbytes, req->eof_received, req) == CI_ERROR) return CI_ERROR; ci_debug_printf(9, "get send body: written/read: %d/%d bytes (eof: %d)\n", wbytes, rbytes, req->eof_received); no_io = (rbytes==0 && wbytes==0); if (wbytes) { wchunkdata += wbytes; req->write_to_module_pending -= wbytes; } if (rbytes > 0) { rchunkdata += rbytes; req->remain_send_block_bytes += rbytes; } else if (rbytes == CI_EOF) service_eof = 1; } while (no_io == 0 && req->pstrblock_read_len != 0 && parse_chunk_ret != CI_NEEDS_MORE && parse_chunk_ret != CI_EOF && !rchunkisfull); action = 0; if (!req->write_to_module_pending) { action = ci_wait_for_read; wchunkdata = NULL; } if (req->status == SEND_BODY) { if (req->remain_send_block_bytes == 0 && service_eof == 1) req->remain_send_block_bytes = CI_EOF; if (has_formated_data == 0) { if (format_body_chunk(req) == CI_EOF) req->status = SEND_EOF; } } if (req->remain_send_block_bytes) { action = action | ci_wait_for_write; } } while ((!req->eof_received || (req->eof_received && req->write_to_module_pending)) && (action || lock_status != req->data_locked)); if (req->eof_received) return CI_OK; if (!action) { ci_debug_printf(1, "Bug in the service '%s'. " "Please report to the service author!!!!\n" "request status: %d\n" "request data locked?: %d\n" "Write to module pending: %d\n" "Remain send block bytes: %d\n" "Read block len: %d\n", req->service, req->status, req->data_locked, req->write_to_module_pending, req->remain_send_block_bytes, req->pstrblock_read_len ); } else { ci_debug_printf(5, "Error reading from network......\n"); } return CI_ERROR; } /*Return CI_ERROR on error or CI_OK on success*/ static int send_remaining_response(ci_request_t * req) { int ret = 0; int (*service_io) (char *rbuf, int *rlen, char *wbuf, int *wlen, int iseof, ci_request_t *); if (req->echo_body) service_io = mod_echo_io; else service_io = req->current_service_mod->mod_service_io; if (!service_io) return CI_ERROR; if (req->status == SEND_EOF && req->remain_send_block_bytes == 0) { ci_debug_printf(5, "OK sending all data\n"); return CI_OK; } do { while (req->remain_send_block_bytes > 0) { if ((ret = wait_for_data(req->connection, TIMEOUT, ci_wait_for_write)) < 0) { ci_debug_printf(3, "Timeout sending data. Ending .......\n"); return CI_ERROR; } if (send_current_block_data(req) == CI_ERROR) return CI_ERROR; } if (req->status == SEND_BODY && req->remain_send_block_bytes == 0) { req->pstrblock_responce = req->wbuf + EXTRA_CHUNK_SIZE; /*Leave space for chunk spec.. */ req->remain_send_block_bytes = MAX_CHUNK_SIZE; ci_debug_printf(9, "rest response: going to read: %d bytes\n", req->remain_send_block_bytes); service_io(req->pstrblock_responce, &(req->remain_send_block_bytes), NULL, NULL, 1, req); ci_debug_printf(9, "rest response: read: %d bytes\n", req->remain_send_block_bytes); if (req->remain_send_block_bytes == CI_ERROR) /*CI_EOF of CI_ERROR, stop sending.... */ return CI_ERROR; if (req->remain_send_block_bytes == 0) break; if ((ret = format_body_chunk(req)) == CI_EOF) { req->status = SEND_EOF; } } } while ((ret = update_send_status(req)) >= 0); /*CI_EOF is < 0 */ if (ret == CI_ERROR) return ret; return CI_OK; } static void options_responce(ci_request_t * req) { char buf[MAX_HEADER_SIZE + 1]; const char *str; ci_headers_list_t *head; ci_service_xdata_t *srv_xdata; unsigned int xopts; int preview, allow204, allow206, max_conns, xlen; int hastransfer = 0; int ttl; req->return_code = EC_200; head = req->response_header; srv_xdata = service_data(req->current_service_mod); ci_headers_reset(head); if (run_services_option_handlers(srv_xdata, req) != CI_OK) ci_headers_add(head, "ICAP/1.0 500 Server Error"); else ci_headers_add(head, "ICAP/1.0 200 OK"); strcpy(buf, "Methods: "); if (ci_method_support(req->current_service_mod->mod_type, ICAP_RESPMOD)) { strcat(buf, "RESPMOD"); if (ci_method_support (req->current_service_mod->mod_type, ICAP_REQMOD)) { strcat(buf, ", REQMOD"); } } else { /*At least one method must supported. A check for error must exists here..... */ strcat(buf, "REQMOD"); } ci_headers_add(head, buf); snprintf(buf, MAX_HEADER_SIZE, "Service: C-ICAP/" VERSION " server - %s", ((str = req->current_service_mod->mod_short_descr) ? str : req-> current_service_mod->mod_name)); buf[MAX_HEADER_SIZE] = '\0'; ci_headers_add(head, buf); ci_service_data_read_lock(srv_xdata); ci_headers_add(head, srv_xdata->ISTag); if (srv_xdata->TransferPreview[0] != '\0' && srv_xdata->preview_size >= 0) { ci_headers_add(head, srv_xdata->TransferPreview); hastransfer++; } if (srv_xdata->TransferIgnore[0] != '\0') { ci_headers_add(head, srv_xdata->TransferIgnore); hastransfer++; } if (srv_xdata->TransferComplete[0] != '\0') { ci_headers_add(head, srv_xdata->TransferComplete); hastransfer++; } /*If none of the Transfer-* headers configured but preview configured send all requests*/ if (!hastransfer && srv_xdata->preview_size >= 0) ci_headers_add(head, "Transfer-Preview: *"); /*Get service options before close the lock.... */ xopts = srv_xdata->xopts; preview = srv_xdata->preview_size; allow204 = srv_xdata->allow_204; allow206 = srv_xdata->allow_206; max_conns = srv_xdata->max_connections; ttl = srv_xdata->options_ttl; ci_service_data_read_unlock(srv_xdata); ci_debug_printf(5, "Options response: \n" " Preview: %d\n" " Allow 204: %s\n" " Allow 206: %s\n" " TransferPreview: \"%s\"\n" " TransferIgnore: %s\n" " TransferComplete: %s\n" " Max-Connections: %d\n", preview,(allow204?"yes":"no"), (allow206?"yes":"no"), srv_xdata->TransferPreview, srv_xdata->TransferIgnore, srv_xdata->TransferComplete, max_conns ); /* ci_headers_add(head, "Max-Connections: 20"); */ if (ttl > 0) { sprintf(buf, "Options-TTL: %d", ttl); ci_headers_add(head, buf); } else ci_headers_add(head, "Options-TTL: 3600"); strcpy(buf, "Date: "); ci_strtime_rfc822(buf + strlen(buf)); ci_headers_add(head, buf); if (preview >= 0) { sprintf(buf, "Preview: %d", srv_xdata->preview_size); ci_headers_add(head, buf); } if (max_conns >= 0) { sprintf(buf, "Max-Connections: %d", max_conns); ci_headers_add(head, buf); } if (allow204 && allow206) { ci_headers_add(head, "Allow: 204, 206"); } else if (allow204) { ci_headers_add(head, "Allow: 204"); } if (xopts) { strcpy(buf, "X-Include: "); xlen = 11; /*sizeof("X-Include: ") */ if ((xopts & CI_XCLIENTIP)) { strcat(buf, "X-Client-IP"); xlen += sizeof("X-Client-IP"); } if ((xopts & CI_XSERVERIP)) { if (xlen > 11) { strcat(buf, ", "); xlen += 2; } strcat(buf, "X-Server-IP"); xlen += sizeof("X-Server-IP"); } if ((xopts & CI_XSUBSCRIBERID)) { if (xlen > 11) { strcat(buf, ", "); xlen += 2; } strcat(buf, "X-Subscriber-ID"); xlen += sizeof("X-Subscriber-ID"); } if ((xopts & CI_XAUTHENTICATEDUSER)) { if (xlen > 11) { strcat(buf, ", "); xlen += 2; } strcat(buf, "X-Authenticated-User"); xlen += sizeof("X-Authenticated-User"); } if ((xopts & CI_XAUTHENTICATEDGROUPS)) { if (xlen > 11) { strcat(buf, ", "); xlen += 2; } strcat(buf, "X-Authenticated-Groups"); xlen += sizeof("X-Authenticated-Groups"); } if (xlen > 11) ci_headers_add(head, buf); } if (!ci_headers_is_empty(req->xheaders)) { ci_headers_addheaders(head, req->xheaders); } ci_response_pack(req); req->pstrblock_responce = head->buf; req->remain_send_block_bytes = head->bufused; do { if ((wait_for_data(req->connection, TIMEOUT, ci_wait_for_write)) < 0) { ci_debug_printf(3, "Timeout sending data. Ending .......\n"); return; } if (send_current_block_data(req) == CI_ERROR) { ci_debug_printf(3, "Error sending data. Ending .....\n"); return; } } while (req->remain_send_block_bytes > 0); // if(responce_body) // send_body_responce(req,responce_body); } /*Read preview data, call preview handler and respond with error, "204" or "100 Continue" if required. Returns: - CI_OK on success and 100 Continue, - CI_EOF on ieof chunk response (means all body data received, inside preview, no need to read more data from the client) - CI_ERROR on error */ static int do_request_preview(ci_request_t *req) { int preview_read_status; int res; ci_debug_printf(8,"Read preview data if there are and process request\n"); /*read_preview_data returns CI_OK, CI_EOF or CI_ERROR */ if (!req->hasbody) preview_read_status = CI_EOF; else if ((preview_read_status = read_preview_data(req)) == CI_ERROR) { ci_debug_printf(5, "An error occured while reading preview data (propably timeout)\n"); req->keepalive = 0; ec_responce(req, EC_408); return CI_ERROR; } if (!req->current_service_mod->mod_check_preview_handler) { /*We have not a preview data handler. We are responding with "100 Continue" assuming that the service needs to process all data. The preview data are stored in req->preview_data.buf, if the service needs them. */ ci_debug_printf(3, "Preview request but no preview data handler. Respond with \"100 Continue\"\n"); res = CI_MOD_CONTINUE; } else { /*We have a preview handler and we are going to call it*/ res = req->current_service_mod->mod_check_preview_handler( req->preview_data.buf, req->preview_data.used, req); } if (res == CI_MOD_ALLOW204) { if (ec_responce(req, EC_204) < 0) { req->keepalive = 0; /*close the connection*/ return CI_ERROR; } ci_debug_printf(5,"Preview handler return allow 204 response\n"); /*we are finishing here*/ return CI_OK; } if (res == CI_MOD_ALLOW206 && req->allow206) { req->return_code = EC_206; ci_debug_printf(5,"Preview handler return 206 response\n"); return CI_OK; } /*The CI_MOD_CONTINUE is the only remaining valid answer */ if (res != CI_MOD_CONTINUE) { ci_debug_printf(5, "An error occured in preview handler!" " return code: %d , req->allow204=%d, req->allow206=%d\n", res, req->allow204, req->allow206); req->keepalive = 0; ec_responce(req, EC_500); return CI_ERROR; } if (preview_read_status != CI_EOF) { ec_responce_simple(req, EC_100); /*if 100 Continue and not "0;ieof"*/ } /* else 100 Continue and "0;ieof" received. Do not send "100 Continue"*/ ci_debug_printf(5,"Preview handler %s\n", (preview_read_status == CI_EOF ? "receives all body data" : "continue reading more body data")); return preview_read_status; } /* Call the preview handler in the case there is not preview request. */ static int do_fake_preview(ci_request_t * req) { int res; /*We are outside preview. The preview handler will be called but it needs special handle. Currently the preview data handler called with no preview data.In the future we should add code to read data from client and pass them to the service. Also in the future the service should not need to know if preview supported by the client or not */ if (!req->current_service_mod->mod_check_preview_handler) { req->return_code = req->hasbody ? EC_100 : EC_200; return CI_OK; /*do nothing*/ } ci_debug_printf(8,"Preview does not supported. Call the preview handler with no preview data.\n"); res = req->current_service_mod->mod_check_preview_handler(NULL, 0, req); /*We are outside preview. The client should support allow204 outside preview to support it. */ if (res == CI_MOD_ALLOW204 && req->allow204) { ci_debug_printf(5,"Preview handler return allow 204 response, and allow204 outside preview supported\n"); if (ec_responce(req, EC_204) < 0) { req->keepalive = 0; /*close the connection*/ return CI_ERROR; } /*And now parse body data we have read and data the client going to send us, but do not pass them to the service (second argument of the get_send_body)*/ if (req->hasbody) { res = get_send_body(req, 1); if (res == CI_ERROR) return res; } req->return_code = EC_204; return CI_OK; } if (res == CI_MOD_ALLOW204) { if (req->hasbody) { ci_debug_printf(5,"Preview handler return allow 204 response, allow204 outside preview does NOT supported, and body data\n"); if (FAKE_ALLOW204) { ci_debug_printf(5,"Fake allow204 supported, echo data back\n"); req->echo_body = ci_ring_buf_new(32768); req->return_code = EC_100; return CI_OK; } } else { ci_debug_printf(5,"Preview handler return allow 204 response, allow204 outside preview does NOT supported, but no body data\n"); /*Just copy http headers to icap response*/ req->return_code = EC_200; return CI_OK; } } if (res == CI_MOD_ALLOW206 && req->allow204 && req->allow206) { ci_debug_printf(5,"Preview handler return allow 204 response, allow204 outside preview and allow206 supported by t"); req->return_code = EC_206; return CI_OK; } if (res == CI_MOD_CONTINUE) { req->return_code = req->hasbody ? EC_100 : EC_200; return CI_OK; } ci_debug_printf(1, "An error occured in preview handler (outside preview)!" " return code: %d, req->allow204=%d, req->allow206=%d\n", res, req->allow204, req->allow206); req->keepalive = 0; ec_responce(req, EC_500); return CI_ERROR; } /* Return CI_ERROR or CI_OK */ static int do_end_of_data(ci_request_t * req) { int res; if (!req->current_service_mod->mod_end_of_data_handler) return CI_OK; /*Nothing to do*/ res = req->current_service_mod->mod_end_of_data_handler(req); /* while( req->current_service_mod->mod_end_of_data_handler(req)== CI_MOD_NOT_READY){ //can send some data here ......... } */ if (res == CI_MOD_ALLOW204 && req->allow204 && !ci_req_sent_data(req)) { if (ec_responce(req, EC_204) < 0) { ci_debug_printf(5, "An error occured while sending allow 204 response\n"); return CI_ERROR; } return CI_OK; } if (res == CI_MOD_ALLOW206 && req->allow204 && req->allow206 && !ci_req_sent_data(req)) { req->return_code = EC_206; return CI_OK; } if (res != CI_MOD_DONE) { ci_debug_printf(1, "An error occured in end-of-data handler !" "return code : %d, req->allow204=%d, req->allow206=%d\n", res, req->allow204, req->allow206); if (!ci_req_sent_data(req)) { req->keepalive = 0; ec_responce(req, EC_500); } return CI_ERROR; } return CI_OK; } static int do_request(ci_request_t * req) { ci_service_xdata_t *srv_xdata = NULL; int res, preview_status = 0, auth_status; int ret_status = CI_OK; /*By default ret_status is CI_OK, on error must set to CI_ERROR*/ res = parse_header(req); if (res != EC_100) { /*if read some data, bad request or Service not found or Server error or what else, else connection timeout, or client closes the connection*/ req->return_code = res; req->keepalive = 0; // Error occured, close the connection ...... if (res > EC_100 && req->request_header->bufused > 0) ec_responce(req, res); ci_debug_printf((req->request_header->bufused ? 5 : 11), "Error %d while parsing headers :(%d)\n", res, req->request_header->bufused); return CI_ERROR; } assert(req->current_service_mod); srv_xdata = service_data(req->current_service_mod); if (!srv_xdata || srv_xdata->status != CI_SERVICE_OK) { ci_debug_printf(2, "Service %s not initialized\n", req->current_service_mod->mod_name); req->keepalive = 0; ec_responce(req, EC_500); return CI_ERROR; } if ((auth_status = access_check_request(req)) == CI_ACCESS_DENY) { req->keepalive = 0; if (req->auth_required) { ec_responce(req, EC_407); /*Responce with authentication required */ } else { ec_responce(req, EC_403); /*Forbitten*/ } ci_debug_printf(3, "Request not authenticated, status: %d\n", auth_status); return CI_ERROR; /*Or something that means authentication error */ } if (res == EC_100) { res = parse_encaps_headers(req); if (res != EC_100) { req->keepalive = 0; ec_responce(req, EC_400); return CI_ERROR; } } if (req->current_service_mod->mod_init_request_data) req->service_data = req->current_service_mod->mod_init_request_data(req); else req->service_data = NULL; ci_debug_printf(8, "Requested service: %s\n", req->current_service_mod->mod_name); switch (req->type) { case ICAP_OPTIONS: options_responce(req); ret_status = CI_OK; break; case ICAP_REQMOD: case ICAP_RESPMOD: if (req->preview >= 0) /*we are inside preview*/ preview_status = do_request_preview(req); else { /* do_fake_preview return CI_OK or CI_ERROR. */ preview_status = do_fake_preview(req); } if (preview_status == CI_ERROR) { ret_status = CI_ERROR; break; } else if (preview_status == CI_EOF) req->return_code = EC_200; /*Equivalent to "100 Continue"*/ if (req->return_code == EC_204) /*Allow 204, Stop processing here*/ break; /*else 100 continue or 206 response or Internal error*/ else if (req->return_code != EC_100 && req->return_code != EC_200 && req->return_code != EC_206) { ec_responce(req, EC_500); ret_status = CI_ERROR; break; } if (req->return_code == EC_100 && req->hasbody && preview_status != CI_EOF) { req->return_code = EC_200; /*We have to repsond with "200 OK"*/ ci_debug_printf(9, "Going to get/send body data.....\n"); ret_status = get_send_body(req, 0); if (ret_status == CI_ERROR) { req->keepalive = 0; /*close the connection*/ ci_debug_printf(5, "An error occured. Parse error or the client closed the connection (res:%d, preview status:%d)\n", ret_status, preview_status); break; } } /*We have received all data from the client. Call the end-of-data service handler and process*/ ret_status = do_end_of_data(req); if (ret_status == CI_ERROR) { req->keepalive = 0; /*close the connection*/ break; } if (req->return_code == EC_204) break; /* Nothing to be done, stop here*/ /*else we have to send response to the client*/ unlock_data(req); /*unlock data if locked so that it can be send to the client*/ ret_status = send_remaining_response(req); if (ret_status == CI_ERROR) { req->keepalive = 0; /*close the connection*/ ci_debug_printf(5, "Error while sending rest responce or client closed the connection\n"); } /*We are finished here*/ break; default: req->keepalive = 0; /*close the connection*/ ret_status = CI_ERROR; break; } if (req->current_service_mod->mod_release_request_data && req->service_data) req->current_service_mod->mod_release_request_data(req->service_data); // debug_print_request(req); return ret_status; } int process_request(ci_request_t * req) { int res; ci_service_xdata_t *srv_xdata; res = do_request(req); if (req->pstrblock_read_len) { ci_debug_printf(5, "There are unparsed data od size %d: \"%.*s\"\n. Move to connection buffer\n", req->pstrblock_read_len, (req->pstrblock_read_len < 64 ? req->pstrblock_read_len : 64), req->pstrblock_read); } if (res<0 && req->request_header->bufused == 0) /*Did not read anything*/ return CI_NO_STATUS; if (STATS) { if (req->return_code != EC_404 && req->current_service_mod) srv_xdata = service_data(req->current_service_mod); else srv_xdata = NULL; STATS_LOCK(); if (STAT_REQUESTS >= 0) STATS_INT64_INC(STAT_REQUESTS,1); if (req->type == ICAP_REQMOD) { STATS_INT64_INC(STAT_REQMODS, 1); if (srv_xdata) STATS_INT64_INC(srv_xdata->stat_reqmods, 1); } else if (req->type == ICAP_RESPMOD) { STATS_INT64_INC(STAT_RESPMODS, 1); if (srv_xdata) STATS_INT64_INC(srv_xdata->stat_respmods, 1); } else if (req->type == ICAP_OPTIONS) { STATS_INT64_INC(STAT_OPTIONS, 1); if (srv_xdata) STATS_INT64_INC(srv_xdata->stat_options, 1); } if (res <0 && STAT_FAILED_REQUESTS >= 0) STATS_INT64_INC(STAT_FAILED_REQUESTS,1); else if (req->return_code == EC_204) { STATS_INT64_INC(STAT_ALLOW204, 1); if (srv_xdata) STATS_INT64_INC(srv_xdata->stat_allow204, 1); } if (STAT_BYTES_IN >= 0) STATS_KBS_INC(STAT_BYTES_IN, req->bytes_in); if (STAT_BYTES_OUT >= 0) STATS_KBS_INC(STAT_BYTES_OUT, req->bytes_out); if (STAT_HTTP_BYTES_IN >= 0) STATS_KBS_INC(STAT_HTTP_BYTES_IN, req->http_bytes_in); if (STAT_HTTP_BYTES_OUT >= 0) STATS_KBS_INC(STAT_HTTP_BYTES_OUT, req->http_bytes_out); if (STAT_BODY_BYTES_IN >= 0) STATS_KBS_INC(STAT_BODY_BYTES_IN, req->body_bytes_in); if (STAT_BODY_BYTES_OUT >= 0) STATS_KBS_INC(STAT_BODY_BYTES_OUT, req->body_bytes_out); if (srv_xdata) { if (srv_xdata->stat_bytes_in >= 0) STATS_KBS_INC(srv_xdata->stat_bytes_in, req->bytes_in); if (srv_xdata->stat_bytes_out >= 0) STATS_KBS_INC(srv_xdata->stat_bytes_out, req->bytes_out); if (srv_xdata->stat_http_bytes_in >= 0) STATS_KBS_INC(srv_xdata->stat_http_bytes_in, req->http_bytes_in); if (srv_xdata->stat_http_bytes_out >= 0) STATS_KBS_INC(srv_xdata->stat_http_bytes_out, req->http_bytes_out); if (srv_xdata->stat_body_bytes_in >= 0) STATS_KBS_INC(srv_xdata->stat_body_bytes_in, req->body_bytes_in); if (srv_xdata->stat_body_bytes_out >= 0) STATS_KBS_INC(srv_xdata->stat_body_bytes_out, req->body_bytes_out); } STATS_UNLOCK(); } return res; /*Allow to log even the failed requests*/ } c_icap-0.5.6/utils/0000775000175000017500000000000013570504160011104 500000000000000c_icap-0.5.6/utils/Makefile.in0000664000175000017500000007470213570504057013110 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @USE_RPATH_TRUE@am__append_1 = -rpath @libdir@ bin_PROGRAMS = c-icap-client$(EXEEXT) c-icap-stretch$(EXEEXT) \ $(am__EXEEXT_1) @USEBDB_TRUE@am__append_2 = c-icap-mkbdb subdir = utils ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/autoconf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @USEBDB_TRUE@am__EXEEXT_1 = c-icap-mkbdb$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_c_icap_client_OBJECTS = c_icap_client-c-icap-client.$(OBJEXT) c_icap_client_OBJECTS = $(am_c_icap_client_OBJECTS) am__DEPENDENCIES_1 = c_icap_client_DEPENDENCIES = $(top_builddir)/libicapapi.la \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = c_icap_client_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(c_icap_client_CFLAGS) \ $(CFLAGS) $(c_icap_client_LDFLAGS) $(LDFLAGS) -o $@ am_c_icap_mkbdb_OBJECTS = c_icap_mkbdb-c-icap-mkbdb.$(OBJEXT) c_icap_mkbdb_OBJECTS = $(am_c_icap_mkbdb_OBJECTS) c_icap_mkbdb_DEPENDENCIES = $(top_builddir)/libicapapi.la \ $(am__DEPENDENCIES_1) c_icap_mkbdb_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(c_icap_mkbdb_CFLAGS) \ $(CFLAGS) $(c_icap_mkbdb_LDFLAGS) $(LDFLAGS) -o $@ am_c_icap_stretch_OBJECTS = c_icap_stretch-c-icap-stretch.$(OBJEXT) c_icap_stretch_OBJECTS = $(am_c_icap_stretch_OBJECTS) c_icap_stretch_DEPENDENCIES = $(top_builddir)/libicapapi.la \ $(am__DEPENDENCIES_1) c_icap_stretch_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(c_icap_stretch_CFLAGS) $(CFLAGS) $(c_icap_stretch_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(c_icap_client_SOURCES) $(c_icap_mkbdb_SOURCES) \ $(c_icap_stretch_SOURCES) DIST_SOURCES = $(c_icap_client_SOURCES) $(c_icap_mkbdb_SOURCES) \ $(c_icap_stretch_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BDB_ADD_FLAG = @BDB_ADD_FLAG@ BDB_ADD_LDADD = @BDB_ADD_LDADD@ BDB_LNDIR_LDADD = @BDB_LNDIR_LDADD@ BROTLI_ADD_FLAG = @BROTLI_ADD_FLAG@ BROTLI_ADD_LDADD = @BROTLI_ADD_LDADD@ BROTLI_LNDIR_LDADD = @BROTLI_LNDIR_LDADD@ BZLIB_ADD_FLAG = @BZLIB_ADD_FLAG@ BZLIB_ADD_LDADD = @BZLIB_ADD_LDADD@ BZLIB_LNDIR_LDADD = @BZLIB_LNDIR_LDADD@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CICAPLIB_VERSION = @CICAPLIB_VERSION@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ C_ICAP_HEX_VERSION = @C_ICAP_HEX_VERSION@ DEFINE_INT64 = @DEFINE_INT64@ DEFINE_INT8 = @DEFINE_INT8@ DEFINE_OFF_T = @DEFINE_OFF_T@ DEFINE_SIZE_OFF_T = @DEFINE_SIZE_OFF_T@ DEFINE_SIZE_T = @DEFINE_SIZE_T@ DEFINE_SIZE_VOID_P = @DEFINE_SIZE_VOID_P@ DEFINE_UINT64 = @DEFINE_UINT64@ DEFINE_UINT8 = @DEFINE_UINT8@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_ADD_FLAG = @DL_ADD_FLAG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTTYPES_H = @INTTYPES_H@ INVISIBILITY_CFLAG = @INVISIBILITY_CFLAG@ LD = @LD@ LDAP_ADD_FLAG = @LDAP_ADD_FLAG@ LDAP_ADD_LDADD = @LDAP_ADD_LDADD@ LDAP_LNDIR_LDADD = @LDAP_LNDIR_LDADD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEMCACHED_ADD_FLAG = @MEMCACHED_ADD_FLAG@ MEMCACHED_ADD_LDADD = @MEMCACHED_ADD_LDADD@ MEMCACHED_LNDIR_LDADD = @MEMCACHED_LNDIR_LDADD@ MKDIR_P = @MKDIR_P@ MODULES_CFLAGS = @MODULES_CFLAGS@ MODULES_LIBADD = @MODULES_LIBADD@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_ADD_FLAG = @OPENSSL_ADD_FLAG@ OPENSSL_ADD_LDADD = @OPENSSL_ADD_LDADD@ OPENSSL_LNDIR_LDADD = @OPENSSL_LNDIR_LDADD@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_ADD_FLAG = @PCRE_ADD_FLAG@ PCRE_ADD_LDADD = @PCRE_ADD_LDADD@ PCRE_LNDIR_LDADD = @PCRE_LNDIR_LDADD@ POSIX_FILE_LOCK = @POSIX_FILE_LOCK@ POSIX_MAPPED_FILES = @POSIX_MAPPED_FILES@ POSIX_SEMAPHORES = @POSIX_SEMAPHORES@ POSIX_SHARED_MEM = @POSIX_SHARED_MEM@ PTHREADS_RWLOCK = @PTHREADS_RWLOCK@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSV_IPC = @SYSV_IPC@ SYS_TYPES_H = @SYS_TYPES_H@ THREADS_LDADD = @THREADS_LDADD@ THREADS_LDFLAGS = @THREADS_LDFLAGS@ USE_COMPAT = @USE_COMPAT@ USE_IPV6 = @USE_IPV6@ USE_OPENSSL = @USE_OPENSSL@ USE_POLL = @USE_POLL@ USE_REGEX = @USE_REGEX@ VERSION = @VERSION@ VISIBILITY_ATTR = @VISIBILITY_ATTR@ ZLIB_ADD_FLAG = @ZLIB_ADD_FLAG@ ZLIB_ADD_LDADD = @ZLIB_ADD_LDADD@ ZLIB_LNDIR_LDADD = @ZLIB_LNDIR_LDADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen_bin = @doxygen_bin@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ has_doxygen = @has_doxygen@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perlccflags = @perlccflags@ perlcore = @perlcore@ perlldflags = @perlldflags@ perllib = @perllib@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ CONFIGDIR = @sysconfdir@ PKGLIBDIR = @pkglibdir@ MODULESDIR = $(pkglibdir)/ SERVICESDIR = $(pkglibdir)/ #CONFIGDIR=$(sysconfdir)/ LOGDIR = $(localstatedir)/log/ SOCKDIR = /var/run/c-icap RPATH_FLAG = $(am__append_1) #UTILS_LDADD = @THREADS_LDADD@ @DL_ADD_FLAG@ @ZLIB_LNDIR_LDADD@ @BZLIB_LNDIR_LDADD@ @BROTLI_LNDIR_LDADD@ @PCRE_LNDIR_LDADD@ @OPENSSL_LNDIR_LDADD@ UTILS_LDADD = @THREADS_LDADD@ @DL_ADD_FLAG@ $(EXT_PROGRAMS_MKLIB) #other ..... c_icap_client_SOURCES = c-icap-client.c c_icap_client_CFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/ -I$(top_builddir)/include/ @OPENSSL_ADD_FLAG@ c_icap_client_LDADD = $(top_builddir)/libicapapi.la $(UTILS_LDADD) c_icap_client_LDFLAGS = -rdynamic $(RPATH_FLAG) @THREADS_LDFLAGS@ c_icap_mkbdb_SOURCES = c-icap-mkbdb.c c_icap_mkbdb_CFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/ -I$(top_builddir)/include/ @BDB_ADD_FLAG@ c_icap_mkbdb_LDADD = $(top_builddir)/libicapapi.la $(UTILS_LDADD) @BDB_ADD_LDADD@ c_icap_mkbdb_LDFLAGS = -rdynamic $(RPATH_FLAG) @THREADS_LDFLAGS@ c_icap_stretch_SOURCES = c-icap-stretch.c c_icap_stretch_CFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/ -I$(top_builddir)/include/ @OPENSSL_ADD_FLAG@ c_icap_stretch_LDADD = $(top_builddir)/libicapapi.la $(UTILS_LDADD) c_icap_stretch_LDFLAGS = -rdynamic $(RPATH_FLAG) @THREADS_LDFLAGS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu utils/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list c-icap-client$(EXEEXT): $(c_icap_client_OBJECTS) $(c_icap_client_DEPENDENCIES) $(EXTRA_c_icap_client_DEPENDENCIES) @rm -f c-icap-client$(EXEEXT) $(AM_V_CCLD)$(c_icap_client_LINK) $(c_icap_client_OBJECTS) $(c_icap_client_LDADD) $(LIBS) c-icap-mkbdb$(EXEEXT): $(c_icap_mkbdb_OBJECTS) $(c_icap_mkbdb_DEPENDENCIES) $(EXTRA_c_icap_mkbdb_DEPENDENCIES) @rm -f c-icap-mkbdb$(EXEEXT) $(AM_V_CCLD)$(c_icap_mkbdb_LINK) $(c_icap_mkbdb_OBJECTS) $(c_icap_mkbdb_LDADD) $(LIBS) c-icap-stretch$(EXEEXT): $(c_icap_stretch_OBJECTS) $(c_icap_stretch_DEPENDENCIES) $(EXTRA_c_icap_stretch_DEPENDENCIES) @rm -f c-icap-stretch$(EXEEXT) $(AM_V_CCLD)$(c_icap_stretch_LINK) $(c_icap_stretch_OBJECTS) $(c_icap_stretch_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap_client-c-icap-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap_mkbdb-c-icap-mkbdb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_icap_stretch-c-icap-stretch.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< c_icap_client-c-icap-client.o: c-icap-client.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_client_CFLAGS) $(CFLAGS) -MT c_icap_client-c-icap-client.o -MD -MP -MF $(DEPDIR)/c_icap_client-c-icap-client.Tpo -c -o c_icap_client-c-icap-client.o `test -f 'c-icap-client.c' || echo '$(srcdir)/'`c-icap-client.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap_client-c-icap-client.Tpo $(DEPDIR)/c_icap_client-c-icap-client.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='c-icap-client.c' object='c_icap_client-c-icap-client.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_client_CFLAGS) $(CFLAGS) -c -o c_icap_client-c-icap-client.o `test -f 'c-icap-client.c' || echo '$(srcdir)/'`c-icap-client.c c_icap_client-c-icap-client.obj: c-icap-client.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_client_CFLAGS) $(CFLAGS) -MT c_icap_client-c-icap-client.obj -MD -MP -MF $(DEPDIR)/c_icap_client-c-icap-client.Tpo -c -o c_icap_client-c-icap-client.obj `if test -f 'c-icap-client.c'; then $(CYGPATH_W) 'c-icap-client.c'; else $(CYGPATH_W) '$(srcdir)/c-icap-client.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap_client-c-icap-client.Tpo $(DEPDIR)/c_icap_client-c-icap-client.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='c-icap-client.c' object='c_icap_client-c-icap-client.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_client_CFLAGS) $(CFLAGS) -c -o c_icap_client-c-icap-client.obj `if test -f 'c-icap-client.c'; then $(CYGPATH_W) 'c-icap-client.c'; else $(CYGPATH_W) '$(srcdir)/c-icap-client.c'; fi` c_icap_mkbdb-c-icap-mkbdb.o: c-icap-mkbdb.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_mkbdb_CFLAGS) $(CFLAGS) -MT c_icap_mkbdb-c-icap-mkbdb.o -MD -MP -MF $(DEPDIR)/c_icap_mkbdb-c-icap-mkbdb.Tpo -c -o c_icap_mkbdb-c-icap-mkbdb.o `test -f 'c-icap-mkbdb.c' || echo '$(srcdir)/'`c-icap-mkbdb.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap_mkbdb-c-icap-mkbdb.Tpo $(DEPDIR)/c_icap_mkbdb-c-icap-mkbdb.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='c-icap-mkbdb.c' object='c_icap_mkbdb-c-icap-mkbdb.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_mkbdb_CFLAGS) $(CFLAGS) -c -o c_icap_mkbdb-c-icap-mkbdb.o `test -f 'c-icap-mkbdb.c' || echo '$(srcdir)/'`c-icap-mkbdb.c c_icap_mkbdb-c-icap-mkbdb.obj: c-icap-mkbdb.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_mkbdb_CFLAGS) $(CFLAGS) -MT c_icap_mkbdb-c-icap-mkbdb.obj -MD -MP -MF $(DEPDIR)/c_icap_mkbdb-c-icap-mkbdb.Tpo -c -o c_icap_mkbdb-c-icap-mkbdb.obj `if test -f 'c-icap-mkbdb.c'; then $(CYGPATH_W) 'c-icap-mkbdb.c'; else $(CYGPATH_W) '$(srcdir)/c-icap-mkbdb.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap_mkbdb-c-icap-mkbdb.Tpo $(DEPDIR)/c_icap_mkbdb-c-icap-mkbdb.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='c-icap-mkbdb.c' object='c_icap_mkbdb-c-icap-mkbdb.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_mkbdb_CFLAGS) $(CFLAGS) -c -o c_icap_mkbdb-c-icap-mkbdb.obj `if test -f 'c-icap-mkbdb.c'; then $(CYGPATH_W) 'c-icap-mkbdb.c'; else $(CYGPATH_W) '$(srcdir)/c-icap-mkbdb.c'; fi` c_icap_stretch-c-icap-stretch.o: c-icap-stretch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_stretch_CFLAGS) $(CFLAGS) -MT c_icap_stretch-c-icap-stretch.o -MD -MP -MF $(DEPDIR)/c_icap_stretch-c-icap-stretch.Tpo -c -o c_icap_stretch-c-icap-stretch.o `test -f 'c-icap-stretch.c' || echo '$(srcdir)/'`c-icap-stretch.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap_stretch-c-icap-stretch.Tpo $(DEPDIR)/c_icap_stretch-c-icap-stretch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='c-icap-stretch.c' object='c_icap_stretch-c-icap-stretch.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_stretch_CFLAGS) $(CFLAGS) -c -o c_icap_stretch-c-icap-stretch.o `test -f 'c-icap-stretch.c' || echo '$(srcdir)/'`c-icap-stretch.c c_icap_stretch-c-icap-stretch.obj: c-icap-stretch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_stretch_CFLAGS) $(CFLAGS) -MT c_icap_stretch-c-icap-stretch.obj -MD -MP -MF $(DEPDIR)/c_icap_stretch-c-icap-stretch.Tpo -c -o c_icap_stretch-c-icap-stretch.obj `if test -f 'c-icap-stretch.c'; then $(CYGPATH_W) 'c-icap-stretch.c'; else $(CYGPATH_W) '$(srcdir)/c-icap-stretch.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/c_icap_stretch-c-icap-stretch.Tpo $(DEPDIR)/c_icap_stretch-c-icap-stretch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='c-icap-stretch.c' object='c_icap_stretch-c-icap-stretch.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(c_icap_stretch_CFLAGS) $(CFLAGS) -c -o c_icap_stretch-c-icap-stretch.obj `if test -f 'c-icap-stretch.c'; then $(CYGPATH_W) 'c-icap-stretch.c'; else $(CYGPATH_W) '$(srcdir)/c-icap-stretch.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: c_icap-0.5.6/utils/c-icap-mkbdb.c0000664000175000017500000002670613371253152013415 00000000000000#include "common.h" #include #include #include #include #include #include #include "c-icap.h" #include "lookup_table.h" #include "cfg_param.h" #include "debug.h" #include BDB_HEADER_PATH(db.h) DB_ENV *env_db = NULL; DB *db = NULL; const ci_type_ops_t *key_ops = &ci_str_ops; const ci_type_ops_t *val_ops = &ci_str_ops; #define MAXLINE 65535 char *txtfile = NULL; char *dbfile = NULL; int DUMP_MODE = 0; int VERSION_MODE = 0; int USE_DBTREE = 0; long int PAGE_SIZE; ci_mem_allocator_t *allocator = NULL; int cfg_set_type(const char *directive, const char **argv, void *setdata); static struct ci_options_entry options[] = { {"-V", NULL, &VERSION_MODE, ci_cfg_version, "Print version and exits"}, {"-VV", NULL, &VERSION_MODE, ci_cfg_build_info, "Print version and build informations and exits"}, { "-d", "debug_level", &CI_DEBUG_LEVEL, ci_cfg_set_int, "The debug level" }, { "-i", "file.txt", &txtfile, ci_cfg_set_str, "The file contains the data (required)" }, { "-o", "file.db", &dbfile, ci_cfg_set_str, "The database to be created" }, { "-t", "string|int|ip",NULL, cfg_set_type, "The type of the key" }, { "-v", "string|int|ip", NULL, cfg_set_type, "The type of values" }, { "-p", "page_size", &PAGE_SIZE, ci_cfg_size_long, "The page size to use for the database" }, { "--btree", NULL, &USE_DBTREE, ci_cfg_enable, "Use B-Tree for indexes instead of Hash" }, { "--dump", NULL, &DUMP_MODE, ci_cfg_enable, "Do not update the database just dump it to the screen" }, {NULL, NULL, NULL, NULL} }; int open_db(char *path) { char *s,home[CI_MAX_PATH]; int ret; strncpy(home, path,CI_MAX_PATH); home[CI_MAX_PATH-1] = '\0'; s = strrchr(home,'/'); if (s) *s = '\0'; else /*no path in filename?*/ home[0]='\0'; /* * Create an environment and initialize it for additional error * reporting. */ if ((ret = db_env_create(&env_db, 0)) != 0) { return 0; } ci_debug_printf(5, "bdb_table_open: Environment created OK.\n"); env_db->set_data_dir(env_db, home); ci_debug_printf(5, "bdb_table_open: Data dir set to %s.\n", home); /* Open the environment */ if ((ret = env_db->open(env_db, home, DB_CREATE | DB_INIT_LOCK | DB_INIT_MPOOL /*| DB_SYSTEM_MEM*/, 0)) != 0) { ci_debug_printf(1, "bdb_table_open: Environment open failed: %s\n", db_strerror(ret)); env_db->close(env_db, 0); return 0; } ci_debug_printf(5, "bdb_table_open: DB environment setup OK.\n"); if ((ret = db_create(&db, env_db, 0)) != 0) { ci_debug_printf(1, "db_create: %s\n", db_strerror(ret)); return 0; } if (PAGE_SIZE > 512 && PAGE_SIZE <= 64*1024) db->set_pagesize(db, (uint32_t)PAGE_SIZE); if ((ret = db->open(db, NULL, path, NULL, (USE_DBTREE ? DB_BTREE : DB_HASH), DB_CREATE /*| DB_TRUNCATE*/, 0664)) != 0) { ci_debug_printf(1, "open db %s: %s\n", path, db_strerror(ret)); db->close(db, 0); return 0; } ci_debug_printf(5, "bdb_table_open: file %s created OK.\n",path); return 1; } void close_db() { db->close(db,0); env_db->close(env_db,0); } int dump_db() { DBC *dbc; DBT db_key, db_data; int ret, i; void *store; void **store_index; printf("Going to dump database!\n"); if (key_ops != &ci_str_ops ||val_ops != &ci_str_ops) { ci_debug_printf(1, "can not dump not string databases\n"); return 0; } if ((ret = db->cursor(db, NULL, &dbc, 0)) != 0) { ci_debug_printf(1, "error creating cursor\n"); return 0; } memset(&db_data, 0, sizeof(db_data)); memset(&db_key, 0, sizeof(db_key)); if ((ret = dbc->c_get(dbc, &db_key, &db_data, DB_SET_RANGE)) != 0) { ci_debug_printf(1, "error getting first element of DB : %s\n", db_strerror(ret)); dbc->c_close(dbc); return 0; } do { printf("%s :", (char *)db_key.data); if (db_data.data) { store = db_data.data; store_index = store; for (i = 0; store_index[i] != 0; i++) { store_index[i]+=(long int)store; } for (i = 0; store_index[i] != 0; i++) { printf("%s |", (char *)store_index[i]); } } printf("\n"); ret = dbc->c_get(dbc, &db_key, &db_data, DB_NEXT); } while (ret == 0); dbc->c_close(dbc); return 1; } int record_extract(char *line, void **key, int *keysize, void **val, int *valsize) { char *s, *v, *e; void *avalue; void *store, *store_value; void **store_index; int i, row_cols = 0, avalue_size, store_value_size; *key = NULL; *val = NULL; *keysize = 0; *valsize = 0; if (!(s = index(line,':'))) { row_cols = 1; } else { row_cols = 2; while ((s = index(s,','))) row_cols++,s++; } /*eat spaces .....*/ s = line; while (*s == ' ' || *s == '\t') s++; v = s; if (*s == '#') /*it is a comment*/ return 1; if (*s == '\0') /*it is a blank line*/ return 1; if (row_cols == 1) e = s + strlen(s); else e = index(s,':'); s = e+1; /*Now points to the end (*s = '\0') or after the ':' */ e--; while (*e == ' ' || *e == '\t' || *e == '\n') e--; *(e+1) = '\0'; (*key) = key_ops->dup(v, allocator); (*keysize) = key_ops->size(*key); if (row_cols > 1) { if (row_cols > 128) /*More than 128 cols?*/ return -1; /*We are going to store the data part of the db as folows: [indx1,indx2,indx3,NULL,val1.....,val2...] indx*: are of type void* and has size of sizeof(void*). val* are the values */ /*Allocate a enough mem for storing the values*/ (*val) = allocator->alloc(allocator, 65535); /*We need row_cols elements for storing pointers to values + 1 element for NULL termination ellement*/ store = (*val); store_index = (*val); store_value = (*val) + row_cols*sizeof(void *); store_value_size = 65535 - row_cols*sizeof(void *); (*valsize) = row_cols*sizeof(void *); for (i = 0; *s != '\0' && i< row_cols-1; i++) { /*we have vals*/ while (*s == ' ' || *s =='\t') s++; /*find the start of the string*/ v = s; e = s; while (*e != ',' && *e != '\0') e++; if (*e == '\0') s = e; else s = e + 1; e--; while (*e == ' ' || *e == '\t' || *e == '\n') e--; *(e+1) = '\0'; avalue = val_ops->dup(v, allocator); avalue_size = val_ops->size(avalue); if ((*valsize)+avalue_size >= store_value_size) { allocator->free(allocator,avalue); store_index[i] = 0; return -1; } memcpy(store_value, avalue, avalue_size); /*Put on the index the position of the current */ store_index[i] = (void *)(store_value - store); void *apos = store + (long int)store_index[i]; printf("\t\t- Storing val:%s at pos:%p(%s:%d)\n", (char *)avalue, store_index[i], (char *)(apos),avalue_size); store_value += avalue_size; (*valsize) += avalue_size; allocator->free(allocator,avalue); avalue = NULL; } store_index[i]=0; } else { *val = NULL;; *valsize = 0; } return 1; } void store_db(void *key, int keysize, void *val, int valsize) { DBT db_key, db_data; int ret; memset(&db_key, 0, sizeof(db_key)); memset(&db_data, 0, sizeof(db_data)); db_key.data = key; db_key.size = keysize; db_data.data = val; db_data.size = valsize; ret = db->put(db, NULL, &db_key, &db_data, 0); if (ret!=0) ci_debug_printf(1, "db_create: %s (key size:%d, val size:%d)\n", db_strerror(ret), keysize, valsize); } int cfg_set_type(const char *directive, const char **argv, void *setdata) { const ci_type_ops_t *ops = &ci_str_ops; if (argv[0] == NULL) { ci_debug_printf(1, "error not argument for %s argument\n", argv[0]); return 0; } if (0 == strcmp(argv[0], "string")) { ops = &ci_str_ops; } else if (0 == strcmp(argv[0], "int")) { ci_debug_printf(1, "%s: not implemented type %s\n", directive, argv[0]); return 0; } else if (0 == strcmp(argv[0], "ip")) { ci_debug_printf(1, "%s: not implemented type %s\n", directive, argv[0]); return 0; } if (0 == strcmp(directive, "-t")) { key_ops = ops; } else if (0 == strcmp(directive, "-v")) { val_ops = ops; } return 1; } void log_errors(void *unused, const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } void vlog_errors(void *unused, const char *format, va_list ap) { vfprintf(stderr, format, ap); } int main(int argc, char **argv) { FILE *f = NULL; char outfile[CI_MAX_PATH]; char line[MAXLINE]; int len; void *key, *val; int keysize,valsize; CI_DEBUG_LEVEL = 1; ci_cfg_lib_init(); if (!ci_args_apply(argc, argv, options) || (!txtfile && !DUMP_MODE && !VERSION_MODE)) { ci_args_usage(argv[0], options); exit(-1); } if (VERSION_MODE) exit(0); #if ! defined(_WIN32) __log_error = (void (*)(void *, const char *,...)) log_errors; /*set c-icap library log function */ #else __vlog_error = vlog_errors; /*set c-icap library log function for win32..... */ #endif if (!(allocator = ci_create_os_allocator())) { ci_debug_printf(1, "Error allocating mem allocator!\n"); return -1; } if (DUMP_MODE && !dbfile) { ci_debug_printf(1, "\nError: You need to specify the database to dump ('-o file.db')\n\n"); ci_args_usage(argv[0], options); exit(-1); } if (!dbfile) { strncpy(outfile, txtfile, CI_MAX_PATH); outfile[CI_MAX_PATH-1] = '\0'; len=strlen(outfile); if (len > CI_MAX_PATH-5) { ci_debug_printf(1,"The filename %s is too long\n", outfile); exit(0); } strcat(outfile,".db"); } else { strncpy(outfile, dbfile, CI_MAX_PATH); outfile[CI_MAX_PATH-1] = '\0'; } if (!open_db(outfile)) { ci_debug_printf(1, "Error opening bdb file %s\n", outfile); if (f) fclose(f); return -1; } if (DUMP_MODE) { dump_db(); } else { if ((f = fopen(txtfile, "r+")) == NULL) { ci_debug_printf(1, "Error opening file: %s\n", txtfile); return -1; } while (fgets(line,MAXLINE,f)) { line[MAXLINE-1]='\0'; if (!record_extract(line, &key, &keysize, &val, &valsize)) { ci_debug_printf(1, "Error parsing line : %s\n", line); break; } else if (key) /*if it is not comment or blank line */ store_db(key, keysize, val, valsize); } fclose(f); } close_db(); ci_mem_allocator_destroy(allocator); return 0; } c_icap-0.5.6/utils/Makefile.am0000664000175000017500000000261113371253152013061 00000000000000 CONFIGDIR=@sysconfdir@ PKGLIBDIR=@pkglibdir@ MODULESDIR=$(pkglibdir)/ SERVICESDIR=$(pkglibdir)/ #CONFIGDIR=$(sysconfdir)/ LOGDIR=$(localstatedir)/log/ SOCKDIR=/var/run/c-icap RPATH_FLAG= if USE_RPATH RPATH_FLAG+=-rpath @libdir@ endif #UTILS_LDADD = @THREADS_LDADD@ @DL_ADD_FLAG@ @ZLIB_LNDIR_LDADD@ @BZLIB_LNDIR_LDADD@ @BROTLI_LNDIR_LDADD@ @PCRE_LNDIR_LDADD@ @OPENSSL_LNDIR_LDADD@ UTILS_LDADD = @THREADS_LDADD@ @DL_ADD_FLAG@ $(EXT_PROGRAMS_MKLIB) bin_PROGRAMS = c-icap-client c-icap-stretch if USEBDB bin_PROGRAMS += c-icap-mkbdb endif #other ..... c_icap_client_SOURCES = c-icap-client.c c_icap_client_CFLAGS= -I$(top_srcdir)/include/ -I$(top_srcdir)/ -I$(top_builddir)/include/ @OPENSSL_ADD_FLAG@ c_icap_client_LDADD= $(top_builddir)/libicapapi.la $(UTILS_LDADD) c_icap_client_LDFLAGS = -rdynamic $(RPATH_FLAG) @THREADS_LDFLAGS@ c_icap_mkbdb_SOURCES = c-icap-mkbdb.c c_icap_mkbdb_CFLAGS= -I$(top_srcdir)/include/ -I$(top_srcdir)/ -I$(top_builddir)/include/ @BDB_ADD_FLAG@ c_icap_mkbdb_LDADD= $(top_builddir)/libicapapi.la $(UTILS_LDADD) @BDB_ADD_LDADD@ c_icap_mkbdb_LDFLAGS = -rdynamic $(RPATH_FLAG) @THREADS_LDFLAGS@ c_icap_stretch_SOURCES = c-icap-stretch.c c_icap_stretch_CFLAGS= -I$(top_srcdir)/include/ -I$(top_srcdir)/ -I$(top_builddir)/include/ @OPENSSL_ADD_FLAG@ c_icap_stretch_LDADD = $(top_builddir)/libicapapi.la $(UTILS_LDADD) c_icap_stretch_LDFLAGS= -rdynamic $(RPATH_FLAG) @THREADS_LDFLAGS@ c_icap-0.5.6/utils/c-icap-client.c0000664000175000017500000003170313570502665013614 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include #include #include #include #include #include #include #include #include "request.h" #include "simple_api.h" #include "net_io.h" #include "cfg_param.h" #include "debug.h" #if defined(USE_OPENSSL) #include "net_io_ssl.h" #include #endif /*Must declared ....*/ int CONN_TIMEOUT = 300; void printhead(void *d, const char *head, const char *value) { if (!head || !*head) { ci_debug_printf(1, "\t%s\n", value); } else { ci_debug_printf(1, "\t%s: %s\n", head, value); } } void print_headers(ci_request_t * req) { int type; ci_headers_list_t *headers; ci_debug_printf(1, "\nICAP HEADERS:\n"); ci_headers_iterate(req->response_header, NULL, printhead); ci_debug_printf(1, "\n"); if ((headers = ci_http_response_headers(req)) == NULL) { headers = ci_http_request_headers(req); type = ICAP_REQMOD; } else type = ICAP_RESPMOD; if (headers) { ci_debug_printf(1, "%s HEADERS:\n", ci_method_string(type)); ci_headers_iterate(headers, NULL, printhead); ci_debug_printf(1, "\n"); } } void build_respmod_headers(int fd, ci_headers_list_t *headers) { struct stat filestat; int filesize; char lbuf[512]; // struct tm ltime; time_t ltimet; ci_headers_add(headers, "HTTP/1.0 200 OK"); fstat(fd, &filestat); filesize = filestat.st_size; strcpy(lbuf, "Date: "); time(<imet); ctime_r(<imet, lbuf + strlen(lbuf)); lbuf[strlen(lbuf) - 1] = '\0'; ci_headers_add(headers, lbuf); strcpy(lbuf, "Last-Modified: "); ctime_r(<imet, lbuf + strlen(lbuf)); lbuf[strlen(lbuf) - 1] = '\0'; ci_headers_add(headers, lbuf); sprintf(lbuf, "Content-Length: %d", filesize); ci_headers_add(headers, lbuf); } void build_reqmod_headers(char *url, const char *method, int fd, ci_headers_list_t *headers) { struct stat filestat; int filesize; char lbuf[1024]; time_t ltimet; snprintf(lbuf,1024, "%s %s HTTP/1.0", method, url); lbuf[1023] = '\0'; ci_headers_add(headers, lbuf); strcpy(lbuf, "Date: "); time(<imet); ctime_r(<imet, lbuf + strlen(lbuf)); lbuf[strlen(lbuf) - 1] = '\0'; if (fd > 0) { fstat(fd, &filestat); filesize = filestat.st_size; strcpy(lbuf, "Last-Modified: "); ctime_r(<imet, lbuf + strlen(lbuf)); lbuf[strlen(lbuf) - 1] = '\0'; ci_headers_add(headers, lbuf); sprintf(lbuf, "Content-Length: %d", filesize); ci_headers_add(headers, lbuf); } ci_headers_add(headers, lbuf); ci_headers_add(headers, "User-Agent: C-ICAP-Client/x.xx"); } int fileread(void *fd, char *buf, int len) { int ret; ret = read(*(int *) fd, buf, len); if (ret == 0) return CI_EOF; return ret; } int filewrite(void *fd, char *buf, int len) { int ret; ret = write(*(int *) fd, buf, len); return ret; } void copy_data(int fd_in, int fd_out, ci_off_t copy_from) { char buf[4095]; size_t len; int ret; lseek(fd_in, copy_from, SEEK_SET); while ((len = read(fd_in, buf, sizeof(buf))) > 0) { ret = write(fd_out, buf, len); assert(ret == len); } } int add_xheader(const char *directive, const char **argv, void *setdata) { ci_headers_list_t **xh = (ci_headers_list_t **)setdata; const char *h; if (argv == NULL || argv[0] == NULL) { ci_debug_printf(1, "Missing arguments in directive:%s\n", directive); return 0; } h = argv[0]; if (!strchr(h, ':')) { printf("The header :%s should have the form \"header: value\" \n", h); return 0; } if (*xh == NULL) *xh = ci_headers_create(); ci_headers_add(*xh, h); return 1; } char *icap_server = "localhost"; int port = 1344; int preview_size = -1; char *service = "echo"; char *input_file = NULL; char *output_file = NULL; char *request_url = NULL; char *resp_url = NULL; char *method_str = "GET"; int send_headers = 1; int send_preview = 1; int allow204 = 1; int allow206 = 0; int verbose = 0; ci_headers_list_t *xheaders = NULL; ci_headers_list_t *http_xheaders = NULL; ci_headers_list_t *http_resp_xheaders = NULL; #if defined(USE_OPENSSL) int use_tls = 0; int tls_verify = 1; const char *tls_method = NULL; #endif int VERSION_MODE = 0; static struct ci_options_entry options[] = { {"-V", NULL, &VERSION_MODE, ci_cfg_version, "Print version and exits"}, {"-VV", NULL, &VERSION_MODE, ci_cfg_build_info, "Print version and build informations and exits"}, { "-i", "icap_servername", &icap_server, ci_cfg_set_str, "The icap server name" }, {"-p", "port", &port, ci_cfg_set_int, "The server port"}, {"-s", "service", &service, ci_cfg_set_str, "The service name"}, #if defined(USE_OPENSSL) {"-tls", NULL, &use_tls, ci_cfg_enable, "Use TLS"}, {"-tls-method", "tls_method", &tls_method, ci_cfg_set_str, "Use TLS method"}, {"-tls-no-verify", NULL, &tls_verify, ci_cfg_disable, "Disable server certificate verify"}, #endif { "-f", "filename", &input_file, ci_cfg_set_str, "Send this file to the icap server.\nDefault is to send an options request" }, { "-o", "filename", &output_file, ci_cfg_set_str, "Save output to this file.\nDefault is to send to stdout" }, {"-method", "method", &method_str, ci_cfg_set_str,"Use 'method' as method of the request modification"}, {"-req","url",&request_url,ci_cfg_set_str,"Send a request modification instead of response modification"}, {"-resp","url",&resp_url,ci_cfg_set_str,"Send a responce modification request with request url the 'url'"}, { "-d", "level", &CI_DEBUG_LEVEL, ci_cfg_set_int, "debug level info to stdout" }, { "-noreshdr", NULL, &send_headers, ci_cfg_disable, "Do not send reshdr headers" }, {"-nopreview", NULL, &send_preview, ci_cfg_disable, "Do not send preview data"}, {"-no204", NULL, &allow204, ci_cfg_disable, "Do not allow204 outside preview"}, {"-206", NULL, &allow206, ci_cfg_enable, "Support allow206"}, {"-x", "xheader", &xheaders, add_xheader, "Include xheader in icap request headers"}, {"-hx", "xheader", &http_xheaders, add_xheader, "Include xheader in http request headers"}, {"-rhx", "xheader", &http_resp_xheaders, add_xheader, "Include xheader in http response headers"}, {"-w", "preview", &preview_size, ci_cfg_set_int, "Sets the maximum preview data size"}, {"-v", NULL, &verbose, ci_cfg_enable, "Print response headers"}, {NULL, NULL, NULL, NULL} }; void log_errors(ci_request_t * req, const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } void vlog_errors(ci_request_t * req, const char *format, va_list ap) { vfprintf(stderr, format, ap); } int main(int argc, char **argv) { int fd_in = 0, fd_out = 0; int ret; char ip[CI_IPLEN]; ci_connection_t *conn; ci_request_t *req; ci_headers_list_t *req_headers = NULL; ci_headers_list_t *resp_headers = NULL; ci_client_library_init(); CI_DEBUG_LEVEL = 1; /*Default debug level is 1 */ if (!ci_args_apply(argc, argv, options)) { ci_args_usage(argv[0], options); exit(-1); } if (VERSION_MODE) exit(0); #if ! defined(_WIN32) __log_error = (void (*)(void *, const char *,...)) log_errors; /*set c-icap library log function */ #else __vlog_error = vlog_errors; /*set c-icap library log function for win32..... */ #endif #if defined(USE_OPENSSL) if (use_tls) { ci_tls_client_options_t tlsOpts; ci_tls_init(); memset((void *)&tlsOpts, 0, sizeof(ci_tls_client_options_t)); tlsOpts.method = tls_method; tlsOpts.verify = tls_verify; SSL_CTX *ctx = ci_tls_create_context(&tlsOpts); if (!(conn = ci_tls_connect(icap_server, port, 0, ctx, CONN_TIMEOUT))) { ci_debug_printf(1, "Failed to establish SSL connection to the icap server.\n"); exit(-1); } } else #endif if (!(conn = ci_connect_to(icap_server, port, 0, CONN_TIMEOUT))) { ci_debug_printf(1, "Failed to connect to icap server.....\n"); exit(-1); } req = ci_client_request(conn, icap_server, service); if (xheaders) ci_icap_append_xheaders(req, xheaders); ci_client_get_server_options(req, CONN_TIMEOUT); ci_debug_printf(10, "OK done with options!\n"); ci_conn_remote_ip(conn, ip); ci_debug_printf(1, "ICAP server:%s, ip:%s, port:%d\n\n", icap_server, ip, port); if (!send_preview) { req->preview = -1; } else if (preview_size >= 0 && preview_size < req->preview) { req->preview = preview_size; } /*If service does not support allow 204 disable it*/ if (!req->allow204) allow204 = 0; if (!input_file && !request_url && !resp_url) { ci_debug_printf(1, "OPTIONS:\n"); ci_debug_printf(1, "\tAllow 204: %s\n\tPreview: %d\n\tKeep alive: %s\n", (req->allow204 ? "Yes" : "No"), req->preview, (req->keepalive ? "Yes" : "No") ); print_headers(req); } else { if (input_file && (fd_in = open(input_file, O_RDONLY)) < 0) { ci_debug_printf(1, "Error opening file %s\n", input_file); exit(-1); } if (output_file) { if ((fd_out = open(output_file, O_CREAT | O_RDWR | O_EXCL, S_IRWXU | S_IRGRP)) < 0) { ci_debug_printf(1, "Error opening output file %s\n", output_file); exit(-1); } } else { fd_out = fileno(stdout); } ci_client_request_reuse(req); ci_debug_printf(10, "Preview:%d keepalive:%d,allow204:%d\n", req->preview, req->keepalive, req->allow204); ci_debug_printf(10, "OK allocating request going to send request\n"); req->type = ICAP_RESPMOD; if (allow204) req->allow204 = 1; if (allow206) req->allow206 = 1; if (xheaders) ci_icap_append_xheaders(req, xheaders); if (request_url) { req_headers = ci_headers_create(); build_reqmod_headers(request_url, method_str, fd_in, req_headers); req->type = ICAP_REQMOD; } else if (send_headers) { resp_headers = ci_headers_create(); build_respmod_headers(fd_in, resp_headers); if (resp_url) { req_headers = ci_headers_create(); build_reqmod_headers(resp_url, method_str, 0, req_headers); } } if (req_headers && http_xheaders) ci_headers_addheaders(req_headers, http_xheaders); if (resp_headers && http_resp_xheaders) ci_headers_addheaders(resp_headers, http_resp_xheaders); ret = ci_client_icapfilter(req, CONN_TIMEOUT, req_headers, resp_headers, (fd_in > 0 ? (&fd_in): NULL), (int (*)(void *, char *, int)) fileread, &fd_out, (int (*)(void *, char *, int)) filewrite); if (ret == 206) { ci_debug_printf(1, "Partial modification (Allow 206 response): " "use %ld from the original body data\n", req->i206_use_original_body); copy_data(fd_in, fd_out, req->i206_use_original_body); } close(fd_in); close(fd_out); if (ret == 204) { ci_debug_printf(1, "No modification needed (Allow 204 response)\n"); if (output_file) unlink(output_file); } if (verbose) print_headers(req); ci_debug_printf(2, "Done\n"); } ci_connection_destroy(conn); ci_client_library_release(); return 0; } c_icap-0.5.6/utils/c-icap-stretch.c0000664000175000017500000005302313542401647014006 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "request.h" #include "ci_threads.h" #include "simple_api.h" #include "net_io.h" #include "cfg_param.h" #include "debug.h" /*GLOBALS ........*/ int CONN_TIMEOUT = 30; char *servername = "localhost"; int PORT = 1344; char *service = "echo"; int threadsnum = 10; int MAX_REQUESTS = 100; int VERSION_MODE = 0; int DoReqmod = 0; int DoTransparent = 0; #define MAX_URLS 32768 char *URLS[MAX_URLS]; int URLS_COUNT = 0; time_t START_TIME = 0; int FILES_NUMBER = 0; char **FILES = NULL; ci_thread_t *threads; ci_thread_mutex_t filemtx; int file_indx = 0; int requests_stats = 0; int failed_requests_stats = 0; int soft_failed_requests_stats = 0; int in_bytes_stats = 0; int out_bytes_stats = 0; int req_errors_rw = 0; int req_errors_r = 0; int _THE_END = 0; char **xclient_headers = NULL; int xclient_headers_num =0; ci_headers_list_t *xheaders = NULL; ci_headers_list_t *http_xheaders = NULL; ci_headers_list_t *http_resp_xheaders = NULL; ci_thread_mutex_t statsmtx; void print_stats() { time_t rtime; time(&rtime); printf("Statistics:\n\t Files used :%d\n\t Number of threads :%d\n\t" " Requests served :%d\n\t Requests failed :%d\n\t Requests soft failed :%d\n\t" " Incoming bytes :%d\n\t Outgoing bytes :%d\n" " \t Write Errors :%d\n", FILES_NUMBER, threadsnum, requests_stats, failed_requests_stats, soft_failed_requests_stats, in_bytes_stats, out_bytes_stats, req_errors_rw); rtime = rtime - START_TIME; printf("Running for %u seconds\n", (unsigned int) rtime); } static void sigint_handler(int sig) { int i = 0; /* */ signal(SIGINT, SIG_IGN); signal(SIGCHLD, SIG_IGN); if (sig == SIGTERM) { printf("SIGTERM signal received for main server.\n"); printf("Going to term children....\n"); } else if (sig == SIGINT) { printf("SIGINT signal received for icap-stretch.\n"); } else { printf("Signal %d received. Exiting ....\n", sig); } _THE_END = 1; for (i = 0; i < threadsnum; i++) { if (threads[i]) ci_thread_join(threads[i]); //What if a child is blocked?????? } ci_thread_mutex_destroy(&filemtx); print_stats(); exit(0); } void str_trim(char *str) { char *s, *e; if (!str) return; s = str; e = NULL; while (*s == ' ') { e = s; while (*e != '\0') { *e = *(e+1); e++; } } /*if (e) e--; else */ e = str+strlen(str); while (*(--e) == ' ' && e >= str) *e = '\0'; } int load_urls(char *filename) { FILE *f; #define URL_SIZE 1024 char line[URL_SIZE+1]; URLS_COUNT = 0; memset(URLS, 0, MAX_URLS * sizeof(char *)); if ((f = fopen(filename, "r")) == NULL) { printf("Error opening magic file: %s\n", filename); return 0; } while (fgets(line,URL_SIZE,f) != NULL && URLS_COUNT != MAX_URLS) { line[strlen(line)-1] = '\0'; str_trim(line); if (line[0] != '#' && line[0] != '\0') { URLS[URLS_COUNT] = strdup(line); URLS_COUNT++; } } fclose(f); return 1; } char *xclient_header() { if (!xclient_headers_num) return NULL; int indx = (int) ((((double) rand()) / (double) RAND_MAX) * (double)xclient_headers_num); return xclient_headers[indx]; } void build_headers(int fd, ci_headers_list_t *headers) { struct stat filestat; int filesize; char lbuf[512]; time_t ltimet; ci_headers_add(headers, "200 OK HTTP/1.1"); ci_headers_add(headers, "Filetype: Unknown"); ci_headers_add(headers, "User: chtsanti"); fstat(fd, &filestat); filesize = filestat.st_size; strcpy(lbuf, "Date: "); time(<imet); ctime_r(<imet, lbuf + strlen(lbuf)); lbuf[strlen(lbuf) - 1] = '\0'; ci_headers_add(headers, lbuf); strcpy(lbuf, "Last-Modified: "); ctime_r(<imet, lbuf + strlen(lbuf)); lbuf[strlen(lbuf) - 1] = '\0'; ci_headers_add(headers, lbuf); sprintf(lbuf, "Content-Length: %d", filesize); ci_headers_add(headers, lbuf); if (http_resp_xheaders) ci_headers_addheaders(headers, http_resp_xheaders); } void build_request_headers(const char *url, const char *method, ci_headers_list_t *headers) { char lbuf[1024]; time_t ltimet; snprintf(lbuf,1024, "%s %s HTTP/1.0", method, url); lbuf[1023] = '\0'; ci_headers_add(headers, lbuf); strcpy(lbuf, "Date: "); time(<imet); ctime_r(<imet, lbuf + strlen(lbuf)); lbuf[strlen(lbuf) - 1] = '\0'; ci_headers_add(headers, lbuf); ci_headers_add(headers, "User-Agent: C-ICAP-Client/x.xx"); if (http_xheaders) ci_headers_addheaders(headers, http_xheaders); } int fileread(void *fd, char *buf, int len) { int ret; ret = read(*(int *) fd, buf, len); if (ret == 0) return CI_EOF; return ret; } int filewrite(void *fd, char *buf, int len) { return len; } int do_req(ci_request_t *req, char *url, int *keepalive, int transparent) { int ret; char lbuf[1024]; char host[512]; char path[512]; char *s; time_t ltimet; ci_headers_list_t *headers; int fd_out = 0; headers = ci_headers_create(); if (transparent) { if ((s = strchr(url, '/')) != NULL) { strncpy(host, url, 512 > (s-url) ? (s-url): 512); host[512 > (s-url) ? (s-url): 511] = '\0'; strncpy(path, s, 512); path[511] = '\0'; } else { strncpy(host, url, 512); host[511] = '\0'; strcpy(path, "/index.html"); } snprintf(lbuf,1024, "GET %s HTTP/1.0", path); lbuf[1023] = '\0'; } else { if (strstr(url, "://")) snprintf(lbuf,1024, "GET %s HTTP/1.0", url); else snprintf(lbuf,1024, "GET http://%s HTTP/1.0", url); lbuf[1023] = '\0'; } ci_headers_add(headers, lbuf); snprintf(lbuf,1024, "Host: %s", host); lbuf[1023] = '\0'; ci_headers_add(headers, lbuf); strcpy(lbuf, "Date: "); time(<imet); ctime_r(<imet, lbuf + strlen(lbuf)); lbuf[strlen(lbuf) - 1] = '\0'; ci_headers_add(headers, lbuf); ci_headers_add(headers, "User-Agent: C-ICAP-Stretch/x.xx"); if (http_xheaders) ci_headers_addheaders(headers, http_xheaders); req->type = ICAP_REQMOD; ret = ci_client_icapfilter(req, CONN_TIMEOUT, headers, NULL, NULL, (int (*)(void *, char *, int)) fileread, &fd_out, (int (*)(void *, char *, int)) filewrite); if (ret <=0 && req->bytes_out == 0) { ci_debug_printf(2, "Is the ICAP connection closed?\n"); *keepalive = 0; return 0; } if (ret <= 0) { ci_debug_printf(1, "Error sending requests \n"); *keepalive = 0; return -1; } *keepalive = req->keepalive; ci_headers_destroy(headers); ci_thread_mutex_lock(&statsmtx); in_bytes_stats += req->bytes_in; out_bytes_stats += req->bytes_out; ci_thread_mutex_unlock(&statsmtx); return 1; } int threadjobreqmod() { ci_request_t *req; ci_connection_t *conn; char *xh; int indx, keepalive, ret; int arand = 0, p; while (!_THE_END) { if (!(conn = ci_connect_to(servername, PORT, 0, CONN_TIMEOUT))) { ci_debug_printf(1, "Failed to connect to icap server.....\n"); exit(-1); } req = ci_client_request(conn, servername, service); req->type = ICAP_RESPMOD; req->preview = 512; req->allow206 = 1; req->allow204 = 1; for (;;) { xh = xclient_header(); if (xh) ci_icap_add_xheader(req, xh); if (xheaders) ci_icap_append_xheaders(req, xheaders); keepalive = 0; indx = (int) ((((double) arand) / (double) RAND_MAX) * (double)URLS_COUNT); if ((ret = do_req(req, URLS[indx], &keepalive, DoTransparent)) <= 0) { ci_thread_mutex_lock(&statsmtx); if (ret == 0) soft_failed_requests_stats++; else failed_requests_stats++; requests_stats++; arand = rand(); /*rand is not thread safe .... */ ci_thread_mutex_unlock(&statsmtx); printf("Request failed...\n"); break; } ci_thread_mutex_lock(&statsmtx); requests_stats++; arand = rand(); /*rand is not thread safe .... */ ci_thread_mutex_unlock(&statsmtx); if (_THE_END) { printf("The end: thread dying\n"); ci_request_destroy(req); return 0; } if (keepalive == 0) break; p = (int) ((((double) arand) / (double) RAND_MAX) * 10.0); if (p == 5 || p == 7 || p == 3) { // 30% possibility .... // printf("OK, closing the connection......\n"); break; } usleep(500000); ci_client_request_reuse(req); } ci_connection_hard_close(conn); ci_request_destroy(req); if (!_THE_END) usleep(1000000); } return 1; } int do_file(ci_request_t *req, char *input_file, int *keepalive) { int fd_in,fd_out; int ret, arand; int indx; ci_headers_list_t *headers, *request_headers = NULL; const char *useUrl = NULL; if (URLS_COUNT > 0) { ci_thread_mutex_lock(&statsmtx); arand = rand(); /*rand is not thread safe .... */ ci_thread_mutex_unlock(&statsmtx); indx = (int) ((((double) arand) / (double) RAND_MAX) * (double)URLS_COUNT); useUrl = URLS[indx]; } if ((fd_in = open(input_file, O_RDONLY)) < 0) { ci_debug_printf(1, "Error opening file %s\n", input_file); return 0; } fd_out = 0; headers = ci_headers_create(); build_headers(fd_in, headers); if (useUrl) { request_headers = ci_headers_create(); build_request_headers(useUrl, "GET", request_headers); } ret = ci_client_icapfilter(req, CONN_TIMEOUT, request_headers, headers, &fd_in, (int (*)(void *, char *, int)) fileread, &fd_out, (int (*)(void *, char *, int)) filewrite); close(fd_in); if (ret <=0 && req->bytes_out == 0) { ci_debug_printf(2, "Is the ICAP connection closed?\n"); *keepalive = 0; return 0; } if (ret<= 0) { ci_debug_printf(1, "Error sending requests \n"); *keepalive = 0; return -1; } *keepalive = req->keepalive; ci_headers_destroy(headers); // printf("Done(%d bytes).\n",totalbytes); ci_thread_mutex_lock(&statsmtx); in_bytes_stats += req->bytes_in; out_bytes_stats += req->bytes_out; ci_thread_mutex_unlock(&statsmtx); return 1; } int threadjobsendfiles() { ci_request_t *req; ci_connection_t *conn; char *xh; int indx, keepalive, ret; int arand; while (1) { if (!(conn = ci_connect_to(servername, PORT, 0, CONN_TIMEOUT))) { ci_debug_printf(1, "Failed to connect to icap server.....\n"); exit(-1); } req = ci_client_request(conn, servername, service); for (;;) { ci_thread_mutex_lock(&filemtx); indx = file_indx; if (file_indx == (FILES_NUMBER - 1)) file_indx = 0; else file_indx++; ci_thread_mutex_unlock(&filemtx); xh = xclient_header(); if (xh) ci_icap_add_xheader(req, xh); if (xheaders) ci_icap_append_xheaders(req, xheaders); keepalive = 0; req->type = ICAP_RESPMOD; req->preview = 512; req->allow206 = 1; req->allow204 = 1; if ((ret = do_file(req, FILES[indx], &keepalive)) <= 0) { ci_thread_mutex_lock(&statsmtx); if (ret == 0) soft_failed_requests_stats++; else failed_requests_stats++; ci_thread_mutex_unlock(&statsmtx); printf("Request failed...\n"); break; } ci_thread_mutex_lock(&statsmtx); requests_stats++; arand = rand(); /*rand is not thread safe .... */ ci_thread_mutex_unlock(&statsmtx); if (_THE_END) { printf("The end: thread dying\n"); ci_request_destroy(req); return 0; } if (keepalive == 0) break; arand = (int) ((((double) arand) / (double) RAND_MAX) * 10.0); if (arand == 5 || arand == 7 || arand == 3) { // 30% possibility .... // printf("OK, closing the connection......\n"); break; } // sleep(1); usleep(500000); // printf("Keeping alive connection\n"); ci_client_request_reuse(req); } ci_connection_hard_close(conn); ci_request_destroy(req); if (_THE_END) { printf("The end: thread dying ps 2\n"); return 0; } usleep(1000000); } return 1; } void usage(char *myname) { printf("Usage:\n %s servername service threadsnum max_requests file1 file2 .....\n", myname); printf("or:\n"); printf(" %s -req servername service threadsnum max_requests file\n", myname); } int add_xheader(const char *directive, const char **argv, void *setdata) { ci_headers_list_t **xh = (ci_headers_list_t **)setdata; const char *h; if (argv == NULL || argv[0] == NULL) { ci_debug_printf(1, "Missing arguments in directive:%s\n", directive); return 0; } h = argv[0]; if (!strchr(h, ':')) { ci_debug_printf(1, "The header :%s should have the form \"header: value\" \n", h); return 0; } if (*xh == NULL) *xh = ci_headers_create(); ci_headers_add(*xh, h); return 1; } static int FILES_SIZE =0; int cfg_files_to_use(const char *directive, const char **argv, void *setdata) { assert ((void *)FILES == *(void **)setdata); if (argv == NULL || argv[0] == NULL) { ci_debug_printf(1, "Missing arguments in directive:%s\n", directive); return 0; } if (FILES == NULL) { FILES_SIZE = 1024; FILES = malloc(FILES_SIZE*sizeof(char*)); } if (FILES_NUMBER == FILES_SIZE) { FILES_SIZE += 1024; FILES = realloc(FILES, FILES_SIZE*sizeof(char*)); } FILES[FILES_NUMBER++] = strdup(argv[0]); ci_debug_printf(1, "Append file %s to file list\n", argv[0]); return 1; } int add_xclient_headers(const char *directive, const char **argv, void *setdata) { int ip1, ip2, ip3, ip4_start, ip4_end, i; const char *ip, *s; char *e; char buf[256]; if (argv == NULL || argv[0] == NULL) { ci_debug_printf(1, "Missing arguments in directive:%s\n", directive); return 0; } ip = argv[0]; if (xclient_headers == NULL) xclient_headers = malloc(256*sizeof(char*)); /*I am expecting something like this: 192.168.1.1-15 */ s = ip; ip1 = strtol(s, &e, 10); if (*e != '.') return 0; s = e+1; ip2 = strtol(s, &e, 10); if (*e != '.') return 0; s = e+1; ip3 = strtol(s, &e, 10); if (*e != '.') return 0; s = e+1; ip4_start = strtol(s, &e, 10); if (*e == '-') { s = e+1; ip4_end = strtol(s, &e, 10); } else ip4_end = ip4_start; for (i = ip4_start; i <= ip4_end; i++) { sprintf(buf, "X-Client-IP: %d.%d.%d.%d", ip1, ip2,ip3,i); xclient_headers[xclient_headers_num++] = strdup(buf); } return 1; } char *urls_file = NULL; static struct ci_options_entry options[] = { {"-V", NULL, &VERSION_MODE, ci_cfg_version, "Print version and exits"}, {"-VV", NULL, &VERSION_MODE, ci_cfg_build_info, "Print version and build informations and exits"}, { "-i", "icap_servername", &servername, ci_cfg_set_str, "The ICAP server name" }, {"-p", "port", &PORT, ci_cfg_set_int, "The ICAP server port"}, {"-s", "service", &service, ci_cfg_set_str, "The service name"}, { "-urls", "filename", &urls_file, ci_cfg_set_str, "File with urls to use for reqmod stress test" }, { "-req", NULL, &DoReqmod, ci_cfg_enable, "Send a request modification instead of response modification requests" }, { "-m", "max-requests", &MAX_REQUESTS, ci_cfg_set_int, "the maximum requests to send" }, { "-t", "threads-number", &threadsnum, ci_cfg_set_int, "number of threads to start" }, { "-d", "level", &CI_DEBUG_LEVEL, ci_cfg_set_int, "debug level info to stdout" }, // {"-nopreview", NULL, &send_preview, ci_cfg_disable, "Do not send preview data"}, {"-x", "xheader", &xheaders, add_xheader, "Include xheader in icap request headers"}, {"-hx", "xheader", &http_xheaders, add_xheader, "Include xheader in http request headers"}, {"-rhx", "xheader", &http_resp_xheaders, add_xheader, "Include xheader in http response headers"}, {"-hcx", "X-Client-IP", &xclient_headers, add_xclient_headers, "Include this X-Client-IP header in request"}, // {"-w", "preview", &preview_size, ci_cfg_set_int, "Sets the maximum preview data size"}, {"$$", NULL, &FILES, cfg_files_to_use, "files to send"}, {NULL, NULL, NULL, NULL} }; void log_errors(ci_request_t * req, const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } void vlog_errors(ci_request_t * req, const char *format, va_list ap) { vfprintf(stderr, format, ap); } int main(int argc, char **argv) { int i; ci_client_library_init(); CI_DEBUG_LEVEL = 1; /*Default debug level is 1 */ int ret = ci_args_apply(argc, argv, options); if (VERSION_MODE) exit(0); if (!ret || (DoReqmod != 0 && urls_file == NULL) || (DoReqmod == 0 && FILES == NULL)) { ci_args_usage(argv[0], options); exit(-1); } #if ! defined(_WIN32) __log_error = (void (*)(void *, const char *,...)) log_errors; /*set c-icap library log function */ #else __vlog_error = vlog_errors; /*set c-icap library log function for win32..... */ #endif signal(SIGPIPE, SIG_IGN); signal(SIGINT, sigint_handler); time(&START_TIME); srand((int) START_TIME); if (urls_file && !load_urls(urls_file)) { ci_debug_printf(1, "The file contains URL list %s does not exist\n", urls_file); exit(1); } threads = malloc(sizeof(ci_thread_t) * threadsnum); if (!threads) { ci_debug_printf(1, "Error allocation memory for threads array\n"); exit(-1); } for (i = 0; i < threadsnum; i++) threads[i] = 0; if (DoReqmod) { for (i = 0; i < threadsnum; i++) { printf("Create thread %d\n", i); ci_thread_create(&(threads[i]), (void *(*)(void *)) threadjobreqmod, (void *) NULL /*data*/); sleep(1); } } else { ci_thread_mutex_init(&filemtx); ci_thread_mutex_init(&statsmtx); printf("Files to send:%d\n", FILES_NUMBER); for (i = 0; i < threadsnum; i++) { printf("Create thread %d\n", i); ci_thread_create(&(threads[i]), (void *(*)(void *)) threadjobsendfiles, NULL); // sleep(1); } } while (1) { sleep(1); if (MAX_REQUESTS && requests_stats >= MAX_REQUESTS) { printf("Oops max requests reached. Exiting .....\n"); _THE_END = 1; break; } print_stats(); } for (i = 0; i < threadsnum; i++) { ci_thread_join(threads[i]); printf("Thread %d exited\n", i); } print_stats(); ci_thread_mutex_destroy(&filemtx); ci_thread_mutex_destroy(&statsmtx); ci_client_library_release(); return 0; } c_icap-0.5.6/ChangeLog0000664000175000017500000000000013371253152011425 00000000000000c_icap-0.5.6/access.c0000664000175000017500000000515113371253152011274 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "request.h" #include "module.h" #include "cfg_param.h" #include "debug.h" #include "access.h" #include "simple_api.h" #include "net_io.h" /********************************************************************************************/ extern access_control_module_t default_acl; access_control_module_t *default_access_controllers[] = { &default_acl, NULL }; access_control_module_t **used_access_controllers = default_access_controllers; int access_reset() { used_access_controllers = default_access_controllers; return 1; } int access_check_client(ci_request_t *req) { int i = 0, res; if (!used_access_controllers) return CI_ACCESS_ALLOW; i = 0; while (used_access_controllers[i] != NULL) { if (used_access_controllers[i]->client_access) { res = used_access_controllers[i]->client_access(req); if (res != CI_ACCESS_UNKNOWN) return res; } i++; } return CI_ACCESS_ALLOW; } int check_request(ci_request_t * req) { int res, i = 0; while (used_access_controllers[i] != NULL) { if (used_access_controllers[i]->request_access) { res = used_access_controllers[i]->request_access(req); if (res != CI_ACCESS_UNKNOWN) return res; } i++; } return CI_ACCESS_ALLOW; } int access_check_request(ci_request_t * req) { int res; if (!used_access_controllers) return CI_ACCESS_ALLOW; ci_debug_printf(9,"Going to check request for access control restrictions\n"); res = check_request(req); ci_debug_printf(9,"Access control: %s\n", (res == CI_ACCESS_ALLOW? "ALLOW": (res == CI_ACCESS_DENY?"DENY":"UNKNOWN"))); return res; } c_icap-0.5.6/aserver.c0000664000175000017500000001155413541155572011514 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include #include "net_io.h" #include "debug.h" #include "module.h" #include "log.h" #include "cfg_param.h" #include "filetype.h" #include "acl.h" #include "txtTemplate.h" #include "commands.h" /* extern char *PIDFILE; extern char *RUN_USER; extern char *RUN_GROUP; extern int PORT; */ extern int DAEMON_MODE; extern int MAX_SECS_TO_LINGER; char MY_HOSTNAME[CI_MAXHOSTNAMELEN + 1]; void init_conf_tables(); int init_body_system(); int config(int, char **); int init_server(); int start_server(); int store_pid(char *pidfile); int clear_pid(char *pidfile); int is_icap_running(char *pidfile); int set_running_permissions(char *user, char *group); void init_internal_lookup_tables(); void request_stats_init(); int mem_init(); void init_http_auth(); void compute_my_hostname() { char hostname[64]; struct hostent *hent; int ret; ret = gethostname(hostname, 63); if (ret == 0) { hostname[63] = '\0'; if ((hent = gethostbyname(hostname)) != NULL) { strncpy(MY_HOSTNAME, hent->h_name, CI_MAXHOSTNAMELEN); MY_HOSTNAME[CI_MAXHOSTNAMELEN] = '\0'; } else strcpy(MY_HOSTNAME, hostname); } else strcpy(MY_HOSTNAME, "localhost"); } #if ! defined(_WIN32) void run_as_daemon() { int fd; int pid, sid; pid = fork(); if (pid < 0) { ci_debug_printf(1, "Unable to fork. exiting..."); exit(-1); } if (pid > 0) exit(0); /* Change the file mode mask */ umask(0); /* Create a new SID for the child process */ sid = setsid(); if (sid < 0) { ci_debug_printf(1, "Unable to create a new SID for the main process. exiting..."); exit(-1); } /* Change the current working directory */ if ((chdir("/")) < 0) { ci_debug_printf(1, "Unable to change the working directory. exiting..."); exit(-1); } /* Direct standard file descriptors to "/dev/null"*/ fd = open("/dev/null", O_RDWR); if (fd < 0) { ci_debug_printf(1, "Unable to open '/dev/null'. exiting..."); exit(-1); } if (dup2(fd, STDIN_FILENO) < 0) { ci_debug_printf(1, "Unable to set stdin to '/dev/null'. exiting..."); exit(-1); } if (dup2(fd, STDOUT_FILENO) < 0) { ci_debug_printf(1, "Unable to set stdout to '/dev/null'. exiting..."); exit(-1); } if (dup2(fd, STDERR_FILENO) < 0) { ci_debug_printf(1, "Unable to set stderr to '/dev/null'. exiting..."); exit(-1); } close(fd); } #endif int main(int argc, char **argv) { #if ! defined(_WIN32) __log_error = (void (*)(void *, const char *,...)) log_server; /*set c-icap library log function */ #else __vlog_error = vlog_server; /*set c-icap library log function */ #endif mem_init(); init_internal_lookup_tables(); ci_acl_init(); init_http_auth(); if (init_body_system() != CI_OK) { ci_debug_printf(1, "Can not initialize body system\n"); exit(-1); } ci_txt_template_init(); ci_txt_template_set_dir(DATADIR"templates"); commands_init(); if (!(CI_CONF.MAGIC_DB = ci_magic_db_load(CI_CONF.magics_file))) { ci_debug_printf(1, "Can not load magic file %s!!!\n", CI_CONF.magics_file); } init_conf_tables(); request_stats_init(); init_modules(); init_services(); config(argc, argv); compute_my_hostname(); ci_debug_printf(2, "My hostname is: %s\n", MY_HOSTNAME); if (!log_open()) { ci_debug_printf(1, "Can not init loggers. Exiting.....\n"); exit(-1); } #if ! defined(_WIN32) if (is_icap_running(CI_CONF.PIDFILE)) { ci_debug_printf(1, "c-icap server already running!\n"); exit(-1); } if (DAEMON_MODE) run_as_daemon(); if (!set_running_permissions(CI_CONF.RUN_USER, CI_CONF.RUN_GROUP)) exit(-1); store_pid(CI_CONF.PIDFILE); #endif if (!init_server()) return -1; post_init_modules(); post_init_services(); start_server(); clear_pid(CI_CONF.PIDFILE); return 0; } c_icap-0.5.6/regex.c0000664000175000017500000001230613371253152011145 00000000000000#include "common.h" #include "debug.h" #include "array.h" #include "ci_regex.h" #ifdef HAVE_PCRE #include #else #include #endif char *ci_regex_parse(const char *str, int *flags, int *recursive) { int slen; const char *e; char *s; if (*str != '/') return NULL; ++str; slen = strlen(str); e = str + slen; while (*e != '/' && e != str) --e; if (*e != '/') return NULL; slen = e - str; s = malloc( (slen + 1) * sizeof(char)); strncpy(s, str, slen); s[slen] = '\0'; *flags = 0; #ifdef HAVE_PCRE *flags |= PCRE_NEWLINE_ANY; *flags |= PCRE_NEWLINE_ANYCRLF; #else *flags |= REG_EXTENDED; // *flags |= REG_NOSUB; #endif while (*e != '\0') { #ifdef HAVE_PCRE if (*e == 'i') *flags = *flags | PCRE_CASELESS; else if (*e == 'm') *flags |= PCRE_MULTILINE; else if (*e == 's') *flags |= PCRE_DOTALL; else if (*e == 'x') *flags |= PCRE_EXTENDED; else if (*e == 'A') *flags |= PCRE_ANCHORED; else if (*e == 'D') *flags |= PCRE_DOLLAR_ENDONLY; else if (*e == 'U') *flags |= PCRE_UNGREEDY; else if (*e == 'X') *flags |= PCRE_EXTRA; else if (*e == 'D') *flags |= PCRE_DOLLAR_ENDONLY; else if (*e == 'u') *flags |= PCRE_UTF8; #else if (*e == 'i') *flags = *flags | REG_ICASE; else if (*e == 'm') *flags |= REG_NEWLINE; #endif else if (*e == 'g') *recursive = 1; ++e; } return s; } ci_regex_t ci_regex_build(const char *regex_str, int regex_flags) { #ifdef HAVE_PCRE pcre *re; const char *error; int erroffset; re = pcre_compile(regex_str, regex_flags, &error, &erroffset, NULL); if (re == NULL) { ci_debug_printf(2, "PCRE compilation failed at offset %d: %s\n", erroffset, error); return NULL; } return re; #else int retcode; regex_t *regex = malloc(sizeof(regex_t)); /*reset regex_struct*/ memset(regex, 0, sizeof(regex_t)); retcode = regcomp(regex, regex_str, regex_flags); if (retcode) { free(regex); regex = NULL; } return regex; #endif } void ci_regex_free(ci_regex_t regex) { #ifdef HAVE_PCRE pcre_free((pcre *)regex); #else regfree((regex_t *)regex); free(regex); #endif } #ifdef HAVE_PCRE #define OVECCOUNT 30 /* should be a multiple of 3 */ #endif int ci_regex_apply(const ci_regex_t regex, const char *str, int len, int recurs, ci_list_t *matches, const void *user_data) { int count = 0, i; ci_regex_replace_part_t parts; if (!str) return 0; #ifdef HAVE_PCRE int ovector[OVECCOUNT]; int rc; int offset = 0; int str_length = len >=0 ? len : strlen(str); do { memset(ovector, 0, sizeof(ovector)); rc = pcre_exec(regex, NULL, str, str_length, offset, 0, ovector, OVECCOUNT); if (rc >= 0 && ovector[0] != ovector[1]) { ++count; ci_debug_printf(9, "Match pattern (pos:%d-%d): '%.*s'\n", ovector[0], ovector[1], ovector[1]-ovector[0], str+ovector[0]); offset = ovector[1]; if (matches) { parts.user_data = user_data; memset(parts.matches, 0, sizeof(ci_regex_matches_t)); for (i = 0; i < 10 && ovector[2*i+1] > ovector[2*i]; ++i) { ci_debug_printf(9, "\t sub-match pattern (pos:%d-%d): '%.*s'\n", ovector[2*i], ovector[2*i+1], ovector[2*i + 1] - ovector[2*i], str+ovector[2*i]); parts.matches[i].s = ovector[2*i]; parts.matches[i].e = ovector[2*i+1]; } ci_list_push_back(matches, (void *)&parts); } } } while (recurs && rc >=0 && offset < str_length); #else int retcode; regmatch_t pmatch[10]; do { if ((retcode = regexec(regex, str, 10, pmatch, 0)) == 0) { ++count; ci_debug_printf(9, "Match pattern (pos:%d-%d): '%.*s'\n", pmatch[0].rm_so, pmatch[0].rm_eo, pmatch[0].rm_eo - pmatch[0].rm_so, str+pmatch[0].rm_so); if (matches) { parts.user_data = user_data; memset(parts.matches, 0, sizeof(ci_regex_matches_t)); for (i = 0; i < 10 && pmatch[i].rm_eo > pmatch[i].rm_so; ++i) { ci_debug_printf(9, "\t sub-match pattern (pos:%d-%d): '%.*s'\n", pmatch[i].rm_so, pmatch[i].rm_eo, pmatch[i].rm_eo - pmatch[i].rm_so, str+pmatch[i].rm_so); parts.matches[i].s = pmatch[i].rm_so; parts.matches[i].e = pmatch[i].rm_eo; } ci_list_push_back(matches, (void *)&parts); } if (pmatch[0].rm_so >= 0 && pmatch[0].rm_eo >= 0 && pmatch[0].rm_so != pmatch[0].rm_eo) { str += pmatch[0].rm_eo; ci_debug_printf(8, "I will check again starting from: %s\n", str); } else /*stop here*/ str = NULL; } } while (recurs && str && *str != '\0' && retcode == 0); #endif ci_debug_printf(5, "ci_regex_apply matches count: %d\n", count); return count; } c_icap-0.5.6/install-sh0000755000175000017500000003546313570504056011705 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # $RANDOM is not portable (e.g. dash); use it when possible to # lower collision chance tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # As "mkdir -p" follows symlinks and we work in /tmp possibly; so # create the $tmpdir first (and fail if unsuccessful) to make sure # that nobody tries to guess the $tmpdir name. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: c_icap-0.5.6/txt_format.c0000664000175000017500000004654413371253152012235 00000000000000/* * Copyright (C) 2004-2010 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "request.h" #include "simple_api.h" #include "debug.h" #include "txt_format.h" #define MAX_VARIABLE_SIZE 256 int fmt_none(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_percent(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_remoteip(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_localip(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_icapstatus(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_icapmethod(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_service(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_username(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_request(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_localtime(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_gmttime(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_seconds(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_httpclientip(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_httpserverip(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_http_req_url_o(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_http_req_head_o(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_http_res_head_o(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_icap_req_head(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_icap_res_head(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_req_bytes_rcv(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_req_bytes_sent(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_req_http_bytes_rcv(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_req_http_bytes_sent(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_req_body_bytes_rcv(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_req_body_bytes_sent(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_req_preview_hex(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_req_preview_len(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_logstr(ci_request_t *req_data, char *buf,int len, const char *param); int fmt_req_attribute(ci_request_t *req_data, char *buf,int len, const char *param); /** \brief Internal formating directives table. \ingroup FORMATING * * This table define the following directives:\n * \em "%a": Remote IP-Address \n * \em "%la": Local IP Address \n * \em "%lp": Local port \n * \em "%>a": Http Client IP Address \n * \em "%ho": Modified Http request header \n * \em "%huo": Modified Http request url \n * \em "%ih": Icap request header \n * \em "%hi": Http request header \n * \em "%a", "Http Client IP Address", fmt_httpclientip}, {"%hi", "Http request header", fmt_none}, {"%>ho", "Modified Http request header", fmt_http_req_head_o}, {"%huo", "Modified Http request url", fmt_http_req_url_o}, {"%hu", "Http request url", fmt_none}, {"%ih", "Icap request header", fmt_icap_req_head}, {"% 0) { if (*s == '%') { fmte = check_tables(s, user_table, &directive_len, &width, &left_align, parameter); ci_debug_printf(7,"Width: %d, Parameter:%s\n", width, parameter); if (width != 0) space = width = (remainsformat(req_data, b, space, parameter); if (val_len <= 0) val_len = fmt_none(req_data, b, space, parameter); if (val_len > space) val_len = space; b += val_len; for (i = 0; i < width-val_len; i++) b[i]=' '; b += width-val_len; } else if ((lb = malloc((space+1)*sizeof(char))) != NULL) { val_len = fmte->format(req_data, lb, space, parameter); if (val_len <= 0) val_len = fmt_none(req_data, lb, space, parameter); if (val_len > space) val_len = space; for (i = 0; i < width-val_len; i++) b[i] = ' '; b += width-val_len; for (i = 0; i < val_len; i++) b[i] = lb[i]; b += val_len; free(lb); lb = NULL; } /*else allocation failed! Just ignore?????*/ remains -= width; } else { val_len = fmte->format(req_data, b, space, parameter); if (val_len <= 0) val_len = fmt_none(req_data, b, space, parameter); if (val_len > space) val_len = space; b += val_len; remains -= val_len; } s += directive_len; } else *b++ = *s++, remains--; } else *b++ = *s++, remains--; } *b = '\0'; return len-remains; } /******************************************************************/ int fmt_remoteip(ci_request_t *req, char *buf,int len, const char *param) { if (lenconnection, buf)) strcpy(buf, "-" ); return strlen(buf); } int fmt_localip(ci_request_t *req, char *buf,int len, const char *param) { if (lenconnection, buf)) strcpy(buf, "-" ); return strlen(buf); } int fmt_icapmethod(ci_request_t *req, char *buf,int len, const char *param) { int i; const char *s = ci_method_string(req->type); for (i = 0; i < len && *s; i++,s++) buf[i] = *s; return i; } int fmt_service(ci_request_t *req, char *buf,int len, const char *param) { int i; char *s = req->service; for (i = 0; i < len && *s; i++,s++) buf[i] = *s; return i; } int fmt_username(ci_request_t *req, char *buf,int len, const char *param) { int i; char *s = req->user; for (i = 0; i < len && *s; i++,s++) buf[i] = *s; return i; } int fmt_request(ci_request_t *req, char *buf,int len, const char *param) { int i; char *s = req->service; for (i = 0; i< len && *s; i++,s++) buf[i] = *s; if (req->args[0] != '\0' && i < len) { buf[i] = '?'; s = req->args; i++; for (; i < len && *s; i++,s++) buf[i] = *s; } return i; } int fmt_localtime(ci_request_t *req, char *buf,int len, const char *param) { struct tm tm; time_t t; const char *tfmt = "%d/%b/%Y:%H:%M:%S %z"; if (!len) return 0; if (param && param[0] != '\0') { tfmt = param; } t = time(&t); localtime_r(&t, &tm); return strftime(buf, len, tfmt, &tm); } int fmt_gmttime(ci_request_t *req, char *buf,int len, const char *param) { struct tm tm; time_t t; const char *tfmt = "%d/%b/%Y:%H:%M:%S"; if (!len) return 0; if (param && param[0] != '\0') { tfmt = param; } t = time(&t); gmtime_r(&t, &tm); return strftime(buf, len, tfmt, &tm); } int fmt_icapstatus(ci_request_t *req, char *buf,int len, const char *param) { return snprintf(buf, len, "%d", ci_error_code(req->return_code)); } int fmt_seconds(ci_request_t *req, char *buf,int len, const char *param) { time_t tm; time(&tm); return snprintf(buf, len, "%ld", tm); } int fmt_httpclientip(ci_request_t *req, char *buf,int len, const char *param) { const char *s; int i; if (!len) return 0; if ((s = ci_headers_value(req->request_header, "X-Client-IP")) != NULL) { for (i = 0; i < len && *s != '\0' && *s != '\r' && *s != '\n'; i++,s++) buf[i] = *s; return i; } else { *buf = '-'; return 1; } } int fmt_httpserverip(ci_request_t *req, char *buf,int len, const char *param) { const char *s; int i; if (!len) return 0; if ((s = ci_headers_value(req->request_header, "X-Server-IP")) != NULL) { for (i = 0; i < len && *s != '\0' && *s != '\r' && *s != '\n'; i++,s++) buf[i] = *s; return i; } else { *buf = '-'; return 1; } } int fmt_http_req_url_o(ci_request_t *req, char *buf,int len, const char *param) { if (!len) return 0; return ci_http_request_url(req, buf, len); } int fmt_http_req_head_o(ci_request_t *req, char *buf,int len, const char *param) { const char *s = NULL; int i; if (!len) return 0; if (!param || param[0] == '\0') { s = ci_http_request(req); } else { s = ci_http_request_get_header(req, param); } if (s) { for (i = 0; i < len && *s != '\0' && *s != '\r' && *s != '\n'; i++,s++) buf[i] = *s; return i; } else { *buf = '-'; return 1; } } int fmt_http_res_head_o(ci_request_t *req, char *buf,int len, const char *param) { const char *s = NULL; int i; ci_headers_list_t *http_resp_headers; if (!len) return 0; if (!param || param[0] == '\0') { http_resp_headers = ci_http_response_headers(req); if (http_resp_headers && http_resp_headers->used) s = http_resp_headers->headers[0]; } else { s = ci_http_response_get_header(req, param); } if (s) { for (i = 0; i < len && *s != '\0' && *s != '\r' && *s != '\n'; i++,s++) buf[i] = *s; return i; } else { *buf = '-'; return 1; } } int fmt_icap_req_head(ci_request_t *req, char *buf,int len, const char *param) { const char *s = NULL; int i; if (!len) return 0; if (!param || param[0] == '\0') { if (req->request_header && req->request_header->used) s = req->request_header->headers[0]; } else { s = ci_headers_value(req->request_header, param); } if (s) { for (i = 0; i < len && *s != '\0' && *s != '\r' && *s != '\n'; i++,s++) buf[i] = *s; return i; } else { *buf = '-'; return 1; } } int fmt_icap_res_head(ci_request_t *req, char *buf,int len, const char *param) { const char *s = NULL; int i; if (!len) return 0; if (!param || param[0] == '\0') { if (req->response_header && req->response_header->used) s = req->response_header->headers[0]; } else { s = ci_headers_value(req->response_header, param); /*if not found try xheaders which will also sent to user*/ if (!s && req->xheaders) s = ci_headers_value(req->xheaders, param); } if (s) { for (i = 0; i < len && *s != '\0' && *s != '\r' && *s != '\n'; i++,s++) buf[i] = *s; return i; } else { *buf = '-'; return 1; } } int fmt_req_bytes_rcv(ci_request_t *req, char *buf,int len, const char *param) { return snprintf(buf, len, "%" PRINTF_OFF_T, (CAST_OFF_T) req->bytes_in); } int fmt_req_bytes_sent(ci_request_t *req, char *buf,int len, const char *param) { return snprintf(buf, len, "%" PRINTF_OFF_T, (CAST_OFF_T) req->bytes_out); } int fmt_req_http_bytes_rcv(ci_request_t *req, char *buf,int len, const char *param) { return snprintf(buf, len, "%" PRINTF_OFF_T, (CAST_OFF_T) req->http_bytes_in); } int fmt_req_http_bytes_sent(ci_request_t *req, char *buf,int len, const char *param) { return snprintf(buf, len, "%" PRINTF_OFF_T, (CAST_OFF_T) req->http_bytes_out); } int fmt_req_body_bytes_rcv(ci_request_t *req, char *buf,int len, const char *param) { return snprintf(buf, len, "%" PRINTF_OFF_T, (CAST_OFF_T) req->body_bytes_in); } int fmt_req_body_bytes_sent(ci_request_t *req, char *buf,int len, const char *param) { return snprintf(buf, len, "%" PRINTF_OFF_T, (CAST_OFF_T) req->body_bytes_out); } int fmt_req_preview_hex(ci_request_t *req, char *buf,int len, const char *param) { int i, num, n, bytes; if (!len) return 0; if (req->preview_data.used <= 0) { *buf = '-'; return 1; } if (param) { num = strtol(param, NULL, 10); } else num = 5; n = 0; for (i = 0; i < num && i < req->preview_data.used && len > 0; i++) { if (req->preview_data.buf[i] >= ' ' && req->preview_data.buf[i] <= '~') { buf[n++] = req->preview_data.buf[i]; len --; } else { bytes = snprintf(buf+n, len, "\\x%X",0xFF & (buf[i])); if (bytes > len) bytes = len; n += bytes; len -= bytes; } } return n; } int fmt_req_preview_len(ci_request_t *req, char *buf, int len, const char *param) { if (!len) return 0; if (req->preview >= 0) return snprintf(buf, len, "%d", req->preview_data.used); *buf = '-'; return 1; } int fmt_logstr(ci_request_t *req, char *buf,int len, const char *param) { int i; const char *s; if (!req->log_str) return 0; s = req->log_str; for (i = 0; i < len && *s; i++,s++) buf[i] = *s; return i; } int fmt_req_attribute(ci_request_t *req, char *buf,int len, const char *param) { int i; const char *s; if (!req->attributes) return 0; if (! (s =ci_str_array_search(req->attributes, param))) return 0; for (i = 0; i < len && *s; i++, s++) buf[i] = *s; return i; } c_icap-0.5.6/Makefile.am0000664000175000017500000001335213371253152011725 00000000000000srcdir = @srcdir@ top_builddir=@top_builddir@ CONFIGDIR=@sysconfdir@ PKGLIBDIR=@pkglibdir@ MODULESDIR=$(pkglibdir)/ SERVICESDIR=$(pkglibdir)/ #CONFIGDIR=$(sysconfdir)/ DATADIR=$(pkgdatadir)/ LOGDIR=$(localstatedir)/log/ SOCKDIR=/var/run/c-icap DOXYGEN=@doxygen_bin@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = . utils modules services tests docs lib_LTLIBRARIES=libicapapi.la bin_PROGRAMS = c-icap bin_SCRIPTS = c-icap-config c-icap-libicapapi-config UTIL_LIB_SOURCES=net_io.c util.c os/unix/net_io.c os/unix/proc_mutex.c os/unix/shared_mem.c os/unix/threads.c os/unix/utilfunc.c os/unix/dlib.c if USE_OPENSSL UTIL_LIB_SOURCES += openssl/net_io_ssl.c endif if USE_REGEX UTIL_LIB_SOURCES += regex.c endif UTIL_SOURCES=os/unix/proc_utils.c RPATH_FLAG= if USE_RPATH RPATH_FLAG+=-rpath @libdir@ endif libicapapi_la_SOURCES= header.c body.c decode.c encode.c simple_api.c request_common.c \ filetype.c debug.c cfg_lib.c mem.c service_lib.c \ cache.c lookup_table.c lookup_file_table.c hash.c \ txt_format.c stats.c types_ops.c acl.c txtTemplate.c \ array.c registry.c md5.c $(UTIL_LIB_SOURCES) c_icap_SOURCES = aserver.c request.c cfg_param.c \ proc_threads_queues.c http_auth.c \ access.c log.c service.c module.c \ commands.c mpmt_server.c dlib.c info.c \ default_acl.c port.c $(UTIL_SOURCES) # libicapapi ...... libicapapi_la_CFLAGS= $(INVISIBILITY_CFLAG) -I$(srcdir)/include/ -Iinclude/ @ZLIB_ADD_FLAG@ @OPENSSL_ADD_FLAG@ @BZLIB_ADD_FLAG@ @BROTLI_ADD_FLAG@ @PCRE_ADD_FLAG@ -DCI_BUILD_LIB libicapapi_la_LIBADD = @ZLIB_ADD_LDADD@ @BZLIB_ADD_LDADD@ @BROTLI_ADD_LDADD@ @PCRE_ADD_LDADD@ @DL_ADD_FLAG@ @THREADS_LDADD@ @OPENSSL_ADD_LDADD@ libicapapi_la_LDFLAGS= -shared -version-info @CICAPLIB_VERSION@ @THREADS_LDFLAGS@ export EXT_PROGRAMS_MKLIB = @ZLIB_LNDIR_LDADD@ @BZLIB_LNDIR_LDADD@ @BROTLI_LNDIR_LDADD@ @PCRE_LNDIR_LDADD@ @OPENSSL_LNDIR_LDADD@ #c_icap the main server c_icap_DEPENDENCIES=libicapapi.la c_icap_CFLAGS= $(INVISIBILITY_CFLAG) -I$(top_srcdir)/include/ -I$(top_builddir)/include/ \ -DCONFDIR=\"$(CONFIGDIR)\" -DMODSDIR=\"$(MODULESDIR)\" \ -DSERVDIR=\"$(SERVICESDIR)\" -DLOGDIR=\"$(LOGDIR)\" \ -DDATADIR=\"$(DATADIR)\" @OPENSSL_ADD_FLAG@ c_icap_LDADD = libicapapi.la @DL_ADD_FLAG@ @THREADS_LDADD@ $(EXT_PROGRAMS_MKLIB) c_icap_LDFLAGS = -rdynamic $(RPATH_FLAG) @THREADS_LDFLAGS@ INCS = access.h body.h cfg_param.h c-icap-conf.h c-icap.h ci_threads.h \ commands.h debug.h dlib.h filetype.h header.h log.h mem.h module.h \ net_io.h proc_mutex.h proc_threads_queues.h request.h service.h \ shared_mem.h simple_api.h util.h lookup_table.h hash.h stats.h acl.h \ cache.h txt_format.h types_ops.h txtTemplate.h array.h registry.h \ md5.h ci_regex.h net_io_ssl.h port.h ALL_INCS=$(INCS:%.h=include/%.h) pkginclude_HEADERS = $(ALL_INCS) do_subst=sed -e 's%[@]SYSCONFDIR[@]%$(CONFIGDIR)%g' \ -e 's%[@]PACKAGE_VERSION[@]%$(PACKAGE_VERSION)%g' \ -e 's%[@]PACKAGE[@]%$(PACKAGE)%g' \ -e 's%[@]prefix[@]%$(prefix)%g' \ -e 's%[@]LIBDIR[@]%$(libdir)%g' \ -e 's%[@]PKGINCLUDEDIR[@]%$(pkgincludedir)%g' \ -e 's%[@]INCLUDEDIR[@]%$(includedir)%g' \ -e 's%[@]PKGLIBDIR[@]%$(pkglibdir)%g' \ -e 's%[@]PKGDATADIR[@]%$(pkgdatadir)%g' \ -e 's%[@]CFLAGS[@]%$(CFLAGS)%g' \ -e 's%[@]MODULES_LIBADD[@]%$(MODULES_LIBADD)%g' \ -e 's%[@]MODULES_CFLAGS[@]%$(MODULES_CFLAGS)%g' \ -e 's%[@]EXT_PROGRAMS_LIBADD[@]%$(EXT_PROGRAMS_MKLIB)%g' \ -e 's%[@]SOCKDIR[@]%$(SOCKDIR)%g' CLEANFILES = c-icap-config c-icap-libicapapi-config # The c-icap.conf, c-icap-config, and c-icap-libicapapi-config must rebuild # on every new configure run. The include/c-icap-conf.h is rebuild when # configure runs so it is a good test. c-icap.conf: c-icap.conf.in include/c-icap-conf.h $(do_subst) < $(srcdir)/c-icap.conf.in > $@ c-icap-config: c-icap-config.in include/c-icap-conf.h $(do_subst) < $(srcdir)/c-icap-config.in > $@ chmod 755 $@ c-icap-libicapapi-config: c-icap-libicapapi-config.in include/c-icap-conf.h $(do_subst) < $(srcdir)/c-icap-libicapapi-config.in > $@ chmod 755 $@ doc: $(DOXYGEN) $(srcdir)/c-icap.dox install-data-local: c-icap.conf $(mkinstalldirs) $(DESTDIR)$(CONFIGDIR); $(INSTALL) c-icap.conf $(DESTDIR)$(CONFIGDIR)/c-icap.conf.default $(INSTALL) $(srcdir)/c-icap.magic $(DESTDIR)$(CONFIGDIR)/c-icap.magic.default if test ! -f $(DESTDIR)$(CONFIGDIR)/c-icap.conf; then $(INSTALL) c-icap.conf $(DESTDIR)$(CONFIGDIR)/c-icap.conf; fi if test ! -f $(DESTDIR)$(CONFIGDIR)/c-icap.magic; then $(INSTALL) $(srcdir)/c-icap.magic $(DESTDIR)$(CONFIGDIR)/c-icap.magic; fi $(mkinstalldirs) $(DESTDIR)$(LOGDIR); $(mkinstalldirs) $(DESTDIR)$(SOCKDIR); chgrp nogroup $(DESTDIR)$(LOGDIR) || echo -e "*********\nWARNING! Can not set group for the log dir $(DESTDIR)$(LOGDIR)\n*********\n" chmod 775 $(DESTDIR)$(LOGDIR) chgrp nogroup $(DESTDIR)$(SOCKDIR) || echo -e "*********\nWARNING! Can not set group for the c-icap socket store dir $(DESTDIR)$(SOCKDIR)\n\n*********\n" chmod 775 $(DESTDIR)$(SOCKDIR) EXTRA_DIST = RECONF config-w32.h makefile.w32 \ c_icap_dll.mak c-icap.conf.in c-icap.magic c_icap.mak c_icap.def \ contrib/get_file.pl contrib/convert_old_magic.pl \ winnt_server.c os/win32/dll_entry.c os/win32/makefile.w32 \ os/win32/net_io.c os/win32/proc_mutex.c \ os/win32/shared_mem.c os/win32/threads.c os/win32/utilfunc.c \ common.h \ c-icap-config.in c-icap-libicapapi-config.in c-icap.dox \ build/c_icap_version.awk \ openssl/build_openssl_opts.pl \ openssl/openssl_options.c c_icap-0.5.6/docs/0000775000175000017500000000000013570504160010674 500000000000000c_icap-0.5.6/docs/Makefile.in0000664000175000017500000004773613570504057012707 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = docs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/autoconf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BDB_ADD_FLAG = @BDB_ADD_FLAG@ BDB_ADD_LDADD = @BDB_ADD_LDADD@ BDB_LNDIR_LDADD = @BDB_LNDIR_LDADD@ BROTLI_ADD_FLAG = @BROTLI_ADD_FLAG@ BROTLI_ADD_LDADD = @BROTLI_ADD_LDADD@ BROTLI_LNDIR_LDADD = @BROTLI_LNDIR_LDADD@ BZLIB_ADD_FLAG = @BZLIB_ADD_FLAG@ BZLIB_ADD_LDADD = @BZLIB_ADD_LDADD@ BZLIB_LNDIR_LDADD = @BZLIB_LNDIR_LDADD@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CICAPLIB_VERSION = @CICAPLIB_VERSION@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ C_ICAP_HEX_VERSION = @C_ICAP_HEX_VERSION@ DEFINE_INT64 = @DEFINE_INT64@ DEFINE_INT8 = @DEFINE_INT8@ DEFINE_OFF_T = @DEFINE_OFF_T@ DEFINE_SIZE_OFF_T = @DEFINE_SIZE_OFF_T@ DEFINE_SIZE_T = @DEFINE_SIZE_T@ DEFINE_SIZE_VOID_P = @DEFINE_SIZE_VOID_P@ DEFINE_UINT64 = @DEFINE_UINT64@ DEFINE_UINT8 = @DEFINE_UINT8@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_ADD_FLAG = @DL_ADD_FLAG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTTYPES_H = @INTTYPES_H@ INVISIBILITY_CFLAG = @INVISIBILITY_CFLAG@ LD = @LD@ LDAP_ADD_FLAG = @LDAP_ADD_FLAG@ LDAP_ADD_LDADD = @LDAP_ADD_LDADD@ LDAP_LNDIR_LDADD = @LDAP_LNDIR_LDADD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEMCACHED_ADD_FLAG = @MEMCACHED_ADD_FLAG@ MEMCACHED_ADD_LDADD = @MEMCACHED_ADD_LDADD@ MEMCACHED_LNDIR_LDADD = @MEMCACHED_LNDIR_LDADD@ MKDIR_P = @MKDIR_P@ MODULES_CFLAGS = @MODULES_CFLAGS@ MODULES_LIBADD = @MODULES_LIBADD@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_ADD_FLAG = @OPENSSL_ADD_FLAG@ OPENSSL_ADD_LDADD = @OPENSSL_ADD_LDADD@ OPENSSL_LNDIR_LDADD = @OPENSSL_LNDIR_LDADD@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_ADD_FLAG = @PCRE_ADD_FLAG@ PCRE_ADD_LDADD = @PCRE_ADD_LDADD@ PCRE_LNDIR_LDADD = @PCRE_LNDIR_LDADD@ POSIX_FILE_LOCK = @POSIX_FILE_LOCK@ POSIX_MAPPED_FILES = @POSIX_MAPPED_FILES@ POSIX_SEMAPHORES = @POSIX_SEMAPHORES@ POSIX_SHARED_MEM = @POSIX_SHARED_MEM@ PTHREADS_RWLOCK = @PTHREADS_RWLOCK@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSV_IPC = @SYSV_IPC@ SYS_TYPES_H = @SYS_TYPES_H@ THREADS_LDADD = @THREADS_LDADD@ THREADS_LDFLAGS = @THREADS_LDFLAGS@ USE_COMPAT = @USE_COMPAT@ USE_IPV6 = @USE_IPV6@ USE_OPENSSL = @USE_OPENSSL@ USE_POLL = @USE_POLL@ USE_REGEX = @USE_REGEX@ VERSION = @VERSION@ VISIBILITY_ATTR = @VISIBILITY_ATTR@ ZLIB_ADD_FLAG = @ZLIB_ADD_FLAG@ ZLIB_ADD_LDADD = @ZLIB_ADD_LDADD@ ZLIB_LNDIR_LDADD = @ZLIB_LNDIR_LDADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen_bin = @doxygen_bin@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ has_doxygen = @has_doxygen@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perlccflags = @perlccflags@ perlcore = @perlcore@ perlldflags = @perlldflags@ perllib = @perllib@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = man all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: c_icap-0.5.6/docs/Makefile.am0000664000175000017500000000001613371253152012646 00000000000000SUBDIRS = man c_icap-0.5.6/docs/man/0000775000175000017500000000000013570504160011447 500000000000000c_icap-0.5.6/docs/man/Makefile.in0000664000175000017500000004262013570504057013445 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = docs/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/autoconf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man8dir = $(mandir)/man8 am__installdirs = "$(DESTDIR)$(man8dir)" NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BDB_ADD_FLAG = @BDB_ADD_FLAG@ BDB_ADD_LDADD = @BDB_ADD_LDADD@ BDB_LNDIR_LDADD = @BDB_LNDIR_LDADD@ BROTLI_ADD_FLAG = @BROTLI_ADD_FLAG@ BROTLI_ADD_LDADD = @BROTLI_ADD_LDADD@ BROTLI_LNDIR_LDADD = @BROTLI_LNDIR_LDADD@ BZLIB_ADD_FLAG = @BZLIB_ADD_FLAG@ BZLIB_ADD_LDADD = @BZLIB_ADD_LDADD@ BZLIB_LNDIR_LDADD = @BZLIB_LNDIR_LDADD@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CICAPLIB_VERSION = @CICAPLIB_VERSION@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ C_ICAP_HEX_VERSION = @C_ICAP_HEX_VERSION@ DEFINE_INT64 = @DEFINE_INT64@ DEFINE_INT8 = @DEFINE_INT8@ DEFINE_OFF_T = @DEFINE_OFF_T@ DEFINE_SIZE_OFF_T = @DEFINE_SIZE_OFF_T@ DEFINE_SIZE_T = @DEFINE_SIZE_T@ DEFINE_SIZE_VOID_P = @DEFINE_SIZE_VOID_P@ DEFINE_UINT64 = @DEFINE_UINT64@ DEFINE_UINT8 = @DEFINE_UINT8@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_ADD_FLAG = @DL_ADD_FLAG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTTYPES_H = @INTTYPES_H@ INVISIBILITY_CFLAG = @INVISIBILITY_CFLAG@ LD = @LD@ LDAP_ADD_FLAG = @LDAP_ADD_FLAG@ LDAP_ADD_LDADD = @LDAP_ADD_LDADD@ LDAP_LNDIR_LDADD = @LDAP_LNDIR_LDADD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEMCACHED_ADD_FLAG = @MEMCACHED_ADD_FLAG@ MEMCACHED_ADD_LDADD = @MEMCACHED_ADD_LDADD@ MEMCACHED_LNDIR_LDADD = @MEMCACHED_LNDIR_LDADD@ MKDIR_P = @MKDIR_P@ MODULES_CFLAGS = @MODULES_CFLAGS@ MODULES_LIBADD = @MODULES_LIBADD@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_ADD_FLAG = @OPENSSL_ADD_FLAG@ OPENSSL_ADD_LDADD = @OPENSSL_ADD_LDADD@ OPENSSL_LNDIR_LDADD = @OPENSSL_LNDIR_LDADD@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_ADD_FLAG = @PCRE_ADD_FLAG@ PCRE_ADD_LDADD = @PCRE_ADD_LDADD@ PCRE_LNDIR_LDADD = @PCRE_LNDIR_LDADD@ POSIX_FILE_LOCK = @POSIX_FILE_LOCK@ POSIX_MAPPED_FILES = @POSIX_MAPPED_FILES@ POSIX_SEMAPHORES = @POSIX_SEMAPHORES@ POSIX_SHARED_MEM = @POSIX_SHARED_MEM@ PTHREADS_RWLOCK = @PTHREADS_RWLOCK@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSV_IPC = @SYSV_IPC@ SYS_TYPES_H = @SYS_TYPES_H@ THREADS_LDADD = @THREADS_LDADD@ THREADS_LDFLAGS = @THREADS_LDFLAGS@ USE_COMPAT = @USE_COMPAT@ USE_IPV6 = @USE_IPV6@ USE_OPENSSL = @USE_OPENSSL@ USE_POLL = @USE_POLL@ USE_REGEX = @USE_REGEX@ VERSION = @VERSION@ VISIBILITY_ATTR = @VISIBILITY_ATTR@ ZLIB_ADD_FLAG = @ZLIB_ADD_FLAG@ ZLIB_ADD_LDADD = @ZLIB_ADD_LDADD@ ZLIB_LNDIR_LDADD = @ZLIB_LNDIR_LDADD@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen_bin = @doxygen_bin@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ has_doxygen = @has_doxygen@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perlccflags = @perlccflags@ perlcore = @perlcore@ perlldflags = @perlldflags@ perllib = @perllib@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ CONFIGDIR = @sysconfdir@ PKGLIBDIR = @pkglibdir@ MODULESDIR = $(pkglibdir)/ SERVICESDIR = $(pkglibdir)/ LOGDIR = $(localstatedir)/log/ SOCKDIR = /var/run/c-icap do_subst = sed -e 's%[@]SYSCONFDIR[@]%$(CONFIGDIR)%g' \ -e 's%[@]PACKAGE_STRING[@]%$(PACKAGE_STRING)%g' manpages = c-icap.8 c-icap-client.8 c-icap-config.8 c-icap-libicapapi-config.8 \ c-icap-stretch.8 c-icap-mkbdb.8 manpages_src = $(manpages:.8=.8.in) CLEANFILES = $(manpages) SUFFIXES = .8.in .8 man_MANS = $(manpages) EXTRA_DIST = $(manpages_src) all: all-am .SUFFIXES: .SUFFIXES: .8.in .8 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/man/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man8 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man8 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-man \ uninstall-man8 .PRECIOUS: Makefile .8.in.8: $(do_subst) < $< > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: c_icap-0.5.6/docs/man/c-icap-mkbdb.8.in0000664000175000017500000000315613371253152014304 00000000000000.TH c-icap-mkbdb 8 "@PACKAGE_STRING@" .SH NAME c-icap-mkbdb - simple ICAP clientutility to create Berkeley DB lookup tables .SH SYNOPSIS .B c-icap-mkbdb [ .B \-V ] [ .B \-VV ] [ .B \-d debug_level ] [ .B \-i file.txt ] [ .B \-o file.db ] [ .B \-t string|int|ip ] [ .B \-v string|int|ip ] [ .B \-\-dump ] .SH DESCRIPTION .B c-icap-mkbdb utility can be used to create Berkeley DB databases which can be used as lookup tables by the c-icap server. .SH OPTIONS .IP "-V" Print version .IP "-VV" Print build informations .IP "-d debug_level" The debug level .IP "-i file.txt" The file contains the data (required). The line format of this file must be: .br .I "key: value1, value2, ...." .IP "-o file.db" The database to be created .IP "-t string|int|ip" The type of the key. Select .B "string" for string keys, .B "int" for integer keys or .B "ip" for using IP addresses as keys. The "string" is the default. .IP "-v string|int|ip" The type of the values. The "string" is the default. .IP "-p page_size[k]" The page size to use. Can not be less than 512 bytes or greater than 64k. Read berkeleyDB manual for default values. .IP "--btree" Use B-Tree as access method for the database. By default uses Hash. .IP "--dump" Do not update the database just dump it to the screen. .SH EXAMPLES .TP c-icap-mkbdb \-o keys \-i keys.txt It builds the .B keys Berkeley DB database, using string type for keys and values. .TP c-icap-mkbdb \-o keys \-\-dump Dump the contents of the keys database .SH SEE ALSO .BR c-icap "(8)" .BR c-icap-client "(8)" .BR c-icap-stretch "(8)" .BR c-icap-config "(8)" .BR c-icap-libicapapi-config "(8)" .SH AUTHOR Tsantilas Christos c_icap-0.5.6/docs/man/c-icap.8.in0000664000175000017500000001070213371253152013222 00000000000000.TH c-icap 8 "@PACKAGE_STRING@" .SH NAME c-icap - ICAP filtering server .SH SYNOPSIS .B c-icap [ .B \-V ] [ .B \-VV ] [ .B \-f " config-file" ] [ .B \-N ] [ .B \-d " debug-level" ] [ .B \-D ] .SH DESCRIPTION .B c-icap is an implementation of an ICAP server. It can be used with HTTP proxies that support the ICAP protocol. Most of the comercial HTTP proxies must support ICAP pcotocol. .SH OPTIONS .IP "-V" Print version .IP "-VV" Print build informations .IP "-f config-file" Specify the configuration file .IP "-N" Do not run as daemon .IP "-d level" Specify the debug level .IP "-D" Print debug info to stdout .SH FILES .I @SYSCONFDIR@/c-icap.conf .RS The main configuration file .RE .I @SYSCONFDIR@/c-icap.magic .RS In this file defined the types of files and the groups of file types. .RE .I /var/run/c-icap.pid .RS By default c-icap writes its pid in this file. The path of this file can changed using the PidFile configuration parameter in the c-icap.conf file .RE .I /var/run/c-icap.ctl .RS The commands socket. This file used to send commands to the icap server from command line. For information about implemented commands look below in the "Implemented commands" sub-section .SH NOTES .SS Implemented commands Currently the following commands are implemented: .IP "stop" .RS The c-icap will shutdown .RE .IP "reconfigure" .RS The service will reread the config file without the need to stop and restart the c-icap server. The services will be reinitialized .RE .IP "relog" .RS This command causes c-icap to close and reopen the log files. This is very useful for log rotation. .RE .PP Services and modules can define their own commands. .PP \fBExamples:\fR .IP "To reconfigure c-icap:" echo \-n "reconfigure" > /var/run/c-icap.ctl .IP "To rotate access log:" mv /var/log/c-icap/access.log /var/log/c-icap/access.log.1 echo \-n "relog" > /var/run/c-icap.ctl .RE .SS Lookup tables Lookup tables are simple read-only databases. A lookup table can defined in c-icap.conf file using the form: .RE type:path .RE where the \fBtype\fR is the type of lookup table and \fBpath\fR is the extra information required to use the table (e.g. file path). Currently the following lookup table types defined internally by c-icap: .IP file Simple text file databases. The database records are stored in text files in the form: .RS key[: value1, value2 ...] .RE .RS .IP "example path definition:" .RS file:/path/to/the/file.txt .RE .RE .IP hash Similar to file lookup tables but c-icap uses fast hashes for searching. .RS .IP "example path definition:" .RS hash:/path/to/the/file.txt .RE .RE .IP regex Similar to the file lookup tables but the keys are regular expressions in the form /regex/flags . For possible flags values please read 'Regex expressions' paragraph in this manual. .RS .IP "example regex lookup table data:" /^[a-m].*/i: group1 .br /^[n-z].*/i: group2 .RE .IP "example path definition:" .RS regex:/path/to/the/file.txt .RE .RE .SS Regex expressions The c-icap regex expressions have the form /regex_definition/flags where "flags" is one or more letters, its of them express a flag. .IP "Common flags" .RS g This flag forces the score multiplied by the number of regex expression matches. For example if the expression matches 5 times and the devined score value is 10 then the final score will be 50. .RE .RS i Do caseless matching .RE .RS m Match-any-character operators don't match a newline and ^$ operators does not match newlines within data .RE .IP "If the module compiled using the pcre library the following flags can be used" .RS s (PCRE_DOTALL) matches anything including NL .RE .RS x (PCRE_EXTENDED) Ignore whitespace and # comments .RE .RS A (PCRE_ANCHORED) Force pattern anchoring .RE .RS D (PCRE_DOLLAR_ENDONLY) $ not to match newline at end .RE .RS U (PCRE_UNGREEDY) Invert greediness of quantifiers .RE .RS X (PCRE_EXTRA) PCRE extra features .RE .RS u (PCRE_UTF8) Run in UTF-8 mode .RE .SS Runtime information Someone can retrieve runtime information using the \fBinfo\fR service. The information includes bytes received and transmited, active services, information about service usage and many other. The information provided in HTML and text format. .PP \fBExample:\fR .IP "Retrieve runtime information from command line:" .RS c-icap-client \-i localhost \-s "info?view=text" \-req "a_url" .RE .SH SEE ALSO .BR c-icap-client "(8)" .BR c-icap-stretch "(8)" .BR c-icap-config "(8)" .BR c-icap-libicapapi-config "(8)" .BR c-icap-mkbdb "(8)" .SH BUGS Many... .SH AUTHOR Tsantilas Christos c_icap-0.5.6/docs/man/Makefile.am0000664000175000017500000000105413371253152013424 00000000000000 CONFIGDIR=@sysconfdir@ PKGLIBDIR=@pkglibdir@ MODULESDIR=$(pkglibdir)/ SERVICESDIR=$(pkglibdir)/ LOGDIR=$(localstatedir)/log/ SOCKDIR=/var/run/c-icap do_subst=sed -e 's%[@]SYSCONFDIR[@]%$(CONFIGDIR)%g' \ -e 's%[@]PACKAGE_STRING[@]%$(PACKAGE_STRING)%g' manpages = c-icap.8 c-icap-client.8 c-icap-config.8 c-icap-libicapapi-config.8 \ c-icap-stretch.8 c-icap-mkbdb.8 manpages_src = $(manpages:.8=.8.in) CLEANFILES = $(manpages) SUFFIXES = .8.in .8 .8.in.8: $(do_subst) < $< > $@ man_MANS = $(manpages) EXTRA_DIST = $(manpages_src) c_icap-0.5.6/docs/man/c-icap-config.8.in0000664000175000017500000000172413371253152014471 00000000000000.TH c-icap-config 8 "@PACKAGE_STRING@" .SH NAME c-icap-config - script to get information about c-icap server .SH SYNOPSIS .B c-icap-config [ .B --cflags ] [ .B --libs ] [ .B --datarootdir ] [ .B --configdir ] [ .B --version ] [ .B --config ] .SH DESCRIPTION .B c-icap-config is a script to get information about c-icap server and compile options must used to build c-icap server modules and services. .SH OPTIONS .IP --cflags print preprocessor and compiler flags should used to compile a c-icap service or module .IP --libs print linker flags should used to build a c-icap service or module .IP --datarootdir print the c-icap data directory .IP --configdir print the c-icap configuration directory .IP --version print the c-icap server version .IP --config print the c-icap server compile configuration .SH SEE ALSO .BR c-icap "(8)" .BR c-icap-client "(8)" .BR c-icap-stretch "(8)" .BR c-icap-libicapapi-config "(8)" .BR c-icap-mkbdb "(8)" .SH AUTHOR Tsantilas Christos c_icap-0.5.6/docs/man/c-icap-libicapapi-config.8.in0000664000175000017500000000132213371253152016556 00000000000000.TH c-icap-libicapapi-config 8 "@PACKAGE_STRING@" .SH NAME c-icap-libicapapi-config - script to get information about c-icap library .SH SYNOPSIS .B c-icap-libicapapi-config [ .B --cflags ] [ .B --libs ] [ .B --version ] .SH DESCRIPTION .B c-icap-libicapapi-config is a script to get compile options must used to use c-icap library. .SH OPTIONS .IP --cflags print preprocessor and compiler flags should used to compile a c-icap service or module .IP --libs print linker flags should used to link with c-icap library .IP --version print the c-icap server version .SH SEE ALSO .BR c-icap "(8)" .BR c-icap-client "(8)" .BR c-icap-stretch "(8)" .BR c-icap-config "(8)" .BR c-icap-mkbdb "(8)" .SH AUTHOR Tsantilas Christos c_icap-0.5.6/docs/man/c-icap-stretch.8.in0000664000175000017500000000317413371253152014701 00000000000000.TH c-icap-stretch 8 "@PACKAGE_STRING@" .SH NAME c-icap-stretch - A simple utility for stretching ICAP servers .SH SYNOPSIS .B c-icap-stretch [ .B \-V ] [ .B \-VV ] [ .B \-i "icap_servername" ] [ .B \-p "port" ] [ .B \-s "service" ] [ .B \-urls "filename" ] [ .B \-req ] [ .B \-m "max-requests" ] [ .B \-t "threads-number" ] [ .B \-d "debug level" ] [ .B \-x "icap-header" ] [ .B \-hx "http-request-header" ] [ .B \-rhx "http-response-header" ] .B file1 file2 ... .SH DESCRIPTION .B c-icap-stretch is a simple utility for loading ICAP servers. .SH OPTIONS .IP "-V" Print version .IP "-VV" Print build informations .IP "-i icap_servername" The hostname of the icap server. The default is localhost .IP "-p port" The server port. The default port value is 1344 .IP "-s service" The service name. The default service name is "echo" .IP "-urls filename" File with urls, one url per line, to use for stress test .IP "-req" Send request modification requests .IP "-m max-requests" The maximum requests to send .IP "-t threads-number" The number of client threads to start .IP "-d level" debug level info to stdout .IP "-x icap-header" Include the icap-header in icap request headers .IP "-hx http-request-header" Include the http-request-header in http request headers .IP "-rhx http-response-header" Include the http-response-header in http response headers .IP "file1 file2 ..." The files to use as body data to the ICAP requests. .SH SEE ALSO .BR c-icap "(8)" .BR c-icap-client "(8)" .BR c-icap-config "(8)" .BR c-icap-libicapapi-config "(8)" .BR c-icap-mkbdb "(8)" .SH BUGS It can used only for ICAP response modification services. .SH AUTHOR Tsantilas Christos c_icap-0.5.6/docs/man/c-icap-client.8.in0000664000175000017500000000401713371253152014500 00000000000000.TH c-icap-client 8 "@PACKAGE_STRING@" .SH NAME c-icap-client - simple ICAP client .SH SYNOPSIS .B c-icap-client [ .B \-V ] [ .B \-VV ] [ .B \-i "icap_servername" ] [ .B \-p "port" ] [ .B \-s "service" ] [ .B \-f "input_file" ] [ .B \-o "out_file" ] [ .B \-req "url" ] [ .B \-resp "url" ] [ .B \-d "debug level" ] [ .B \-noreshdr ] [ .B \-nopreview ] [ .B \-no204 ] [ .B \-206 ] [ .B \-x "icap-header" ] [ .B \-hx "http-request-header" ] [ .B \-rhx "http-response-header" ] [ .B \-w preview_size ] [ .B \-v ] .SH DESCRIPTION .B c-icap-client is a simple ICAP client. It can be used to test your icap server configuration. .SH OPTIONS .IP "-V" Print version .IP "-VV" Print build informations .IP "-i icap_servername" The hostname of the icap server. The default is localhost .IP "-p port" The server port. The default port value is 1344 .IP "-s service" The service name. The default service name is "echo" .IP "-f filename" Send this file to the icap server. Default is to send an options request .IP "-o filename" Save output to this file. Default is to send to stdout .IP "-req url" Send a request modification instead of response modification, using as http url the url provided with this option. .IP "-resp url" Send a response modification with http request headers, using as http url the url provided with this option. .IP "-d level" debug level info to stdout .IP "-noreshdr" Do not send reshdr headers .IP "-nopreview" Do not send preview request data .IP "-no204" Do not allow204 outside preview .IP "-206" Support 206 responses .IP "-x icap-header" Include the icap-header in icap request headers .IP "-hx http-request-header" Include the http-request-header in http request headers .IP "-rhx http-response-header" Include the http-response-header in http response headers .IP "-w preview" Sets the maximum preview data size to preview .IP "-v" Print response headers .SH SEE ALSO .BR c-icap "(8)" .BR c-icap-stretch "(8)" .BR c-icap-config "(8)" .BR c-icap-libicapapi-config "(8)" .BR c-icap-mkbdb "(8)" .SH BUGS Many... .SH AUTHOR Tsantilas Christos c_icap-0.5.6/configure.ac0000664000175000017500000006015213570504044012157 00000000000000dnl Process this file with autoconf to produce a configure script. dnl AC_INIT(c_icap,m4_normalize(m4_include([VERSION.m4]))) AC_INIT(c_icap,0.5.6) CICAPLIB_VERSION=5:6:0 AC_SUBST(CICAPLIB_VERSION) dnl CICAPLIB_VERSION is the libtool current[:revision[:age]] version info dnl libtool directions about version info dnl - library source code has changed since the last update c:r:a => c:r+1:a dnl - interfaces have been added, removed, or changed c:r:a => c+1:0:a dnl - interfaces have been added c:r:a => c:r:a+1 dnl - interfaces have been removed c:r:a => c:r:0 AC_CONFIG_SRCDIR(aserver.c) AM_MAINTAINER_MODE AM_CONFIG_HEADER(autoconf.h) AM_INIT_AUTOMAKE([subdir-objects]) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_HOST AC_USE_SYSTEM_EXTENSIONS AC_PROG_AWK AC_PROG_CC AM_PROG_CC_C_O AC_C_BIGENDIAN AC_DISABLE_STATIC AC_LIBTOOL_DLOPEN AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) dnl Define c-icap version C_ICAP_HEX_VERSION=`echo $PACKAGE_VERSION | $AWK -f $srcdir/build/c_icap_version.awk` AC_SUBST(C_ICAP_HEX_VERSION) dnl Checks for OS specific flags and posix threads libraries..... case "$host_os" in linux*) CFLAGS="-D_REENTRANT $CFLAGS" THREADS_LDADD="-lpthread" THREADS_LDFLAGS="" ;; solaris2.*) CFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS $CFLAGS" LIBS="-lsocket -lnsl -lrt $LIBS" THREADS_LDADD="-lpthread" THREADS_LDFLAGS="" ;; freebsd5*) ## If I understand how all those threading models works correctly ## in FreeBSD I will make an option in configure script ## --with-freebsd-threads={c_r,pthreads,linuxthreads,thr} ## If I am correct I must compile c-icap with the way ## external libraries are compiled. (The clamav uses -lc_r and I had problems ## using a different threading model) ## FreeBSD linuxthreads flags # CFLAGS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads $CFLAGS" # THREADS_LDADD="-llthread -lgcc_r" # THREADS_LDFLAGS="-L/usr/local/lib" ## FreeBSD Standard threads CFLAGS="-pthread -D_THREAD_SAFE $CFLAGS" THREADS_LDADD="-XCClinker -lc_r" THREADS_LDFLAGS="" ## FreeBSD has pthreads rwlocks from version 3 (I think) # AC_DEFINE(HAVE_PTHREADS_RWLOCK,1,[Define HAVE_PTHREADS_RWLOCK if pthreads library supports rwlocks]) ## 1:1 threads # CFLAGS="-D_THREAD_SAFE $CFLAGS" # THREADS_LDADD="-XCClinker -lthr" # THREADS_LDFLAGS="" ;; freebsd6*) CFLAGS="-D_THREAD_SAFE $CFLAGS" THREADS_LDADD="-XCClinker -lthr" THREADS_LDFLAGS="" ;; cygwin*) CFLAGS="-D_REENTRANT $CFLAGS" THREADS_LDADD="-lpthread" THREADS_LDFLAGS=""; iscygwin="yes" ;; *) CFLAGS="-D_REENTRANT $CFLAGS" THREADS_LDADD="-lpthread" THREADS_LDFLAGS="" ;; esac TEST_LIBS="$TEST_LIBS $THREADS_LDADD" AC_SUBST(THREADS_LDADD) AC_SUBST(THREADS_LDFLAGS) AC_DEFINE_UNQUOTED(C_ICAP_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure c-icap]) AC_DEFINE_UNQUOTED(C_ICAP_CONFIG_HOST_TYPE, "$host",[Host type from configure]) CFLAGS="$CFLAGS -Wall" AC_CACHE_CHECK([for __attribute__((visibility("default")))], ac_cv_default_visibility_attribute, [ echo 'int __attribute__ ((visibility ("default"))) foo_visible (void) { return 1; } int foo_invisible(void) {return 1;}' > conftest.c ac_cv_default_visibility_attribute=no if AC_TRY_COMMAND(${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then if grep '\.hidden.*foo_invisible' conftest.s >/dev/null && ! grep '\.hidden.*foo_visible' conftest.s >/dev/null; then ac_cv_default_visibility_attribute=yes fi # Else try to detect visibility for Sun solaris: # CC -xldscope={global|hidden} # and use __global/__hidden inside C code # elif fi rm -f conftest.* ]) INVISIBILITY_CFLAG="" VISIBILITY_ATTR="0" if test $ac_cv_default_visibility_attribute = yes; then AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE, 1, [Define if __attribute__((visibility("default"))) is supported.]) INVISIBILITY_CFLAG="-fvisibility=hidden" VISIBILITY_ATTR="1" fi AC_SUBST(INVISIBILITY_CFLAG) AC_SUBST(VISIBILITY_ATTR) AC_ARG_ENABLE(large_files, [ --enable-large-files Enable large files support], [ if test $enableval = "yes"; then large_file_support="yes" else large_file_support="no" fi ], [ large_file_support="yes" ] ) echo "checking whether large file support should enabled:"$large_file_support if test $large_file_support = "yes"; then CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" #here I must put a check if the -D_FILE_OFFSET_BITS makes the off_t an 64bit integer # and if not supported warning the user #Possibly checks for systems which supports large files using different defines.... #later ....... fi USE_IPV6="0" AC_ARG_ENABLE(ipv6, [ --enable-ipv6 Enable ipv6 support], [ if test $enableval = "yes"; then ipv6_support="yes" AC_DEFINE(HAVE_IPV6,1,[Define HAVE_IPV6 if OS supports ipv6]) USE_IPV6="1" fi ], [ ipv6_support="no" ] ) AC_SUBST(USE_IPV6) AC_ARG_ENABLE(sysvipc, [ --enable-sysvipc Enable SYSV/IPC for shared memory if supported], [ if test $enableval = "yes"; then sysvipc="yes" else sysvipc="no" fi ], [ sysvipc="yes" ] ) AC_ARG_ENABLE(poll, [ --disable-poll Disable poll(2) support], [ if test $enableval = "no"; then enablepoll="no" else enablepoll="yes" fi ], [ enablepoll="yes" ] ) USE_COMPAT="0" AC_MSG_CHECKING([Keep library compatibility]) AC_ARG_ENABLE(lib_compat, [ --enable-lib-compat Enable library compatibility with older c-icap versions], [ if test $enableval = "yes"; then lib_compat="yes" AC_MSG_RESULT(yes) USE_COMPAT="1" fi ], [ lib_compat="no" AC_MSG_RESULT(no) ] ) AC_SUBST(USE_COMPAT) # Checks for programs AC_CHECK_PROG(has_doxygen, doxygen, "yes", "no") if test a"$has_doxygen" = "ayes"; then doxygen_bin=doxygen else doxygen_bin="echo Doxygen is not installed /" fi AC_SUBST(doxygen_bin) # Check if we need to enable rpath when linking with libraries AC_ARG_ENABLE(rpath, [ --enable-rpath hardcode runtime library paths], [ case "$enableval" in yes) enable_rpath="yes"; ;; no) enable_rpath="no"; ;; *) enable_rpath="yes"; # Build list with libraries to use rpath ENABLE_RPATH_LIBS=`echo $enableval| tr ';:,' ' '` echo "Enable rpath for libs:"$ENABLE_RPATH_LIBS # search into $ENABLE_RPATH_LIBS using: # if test "${ENABLE_RPATH_LIBS#*zlib}" != "$ENABLE_RPATH_LIBS"; then echo found; fi ;; esac ], [enable_rpath="no"] ) #Routines used for checking libraries AC_DEFUN([ICFG_STATE_SAVE],[ #save state ICFG_OLD_CFLAGS=$CFLAGS ICFG_OLD_LDFLAGS=$LDFLAGS ICFG_OLD_LIBS=$LIBS ]) #Routines used for checking libraries AC_DEFUN([ICFG_STATE_ROLLBACK],[ #save state CFLAGS=$ICFG_OLD_CFLAGS LDFLAGS=$ICFG_OLD_LDFLAGS LIBS=$ICFG_OLD_LIBS ]) AC_DEFUN([ICFG_BUILD_FLAGS_2], [ # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n $2; then $1_ADD_FLAG=-I$2 else $1_ADD_FLAG="" fi $1_LNDIR_LDADD="" if test -n $3; then if test "a$enable_rpath" = "ayes"; then $1_ADD_LDADD="-Wl,-rpath -Wl,$3 -L$3 "$4 else $1_ADD_LDADD="-L$3 "$4 $1_LNDIR_LDADD="-L$3 "$4 fi else $1_ADD_LDADD=$4 fi AC_SUBST($1_LNDIR_LDADD) AC_SUBST($1_ADD_LDADD) AC_SUBST($1_ADD_FLAG) ] ) AC_DEFUN([ICFG_BUILD_FLAGS], [ if test "a$2" != "a"; then ICFG_BUILD_FLAGS_2($1, $2/include, $2/lib, $3) else ICFG_BUILD_FLAGS_2($1, "", "", $3) fi ] ) # Checks for libraries AC_ARG_WITH(perl, [ --with-perl Path to perl binary], [ case "$withval" in yes) perlbin="perl" ;; no ) perlbin=""; perlcore=""; ;; * ) perlbin=$withval ;; esac ], [ perlbin=""; perlcore=""; ] ) if test a"$perlbin" != a; then perlcore=`$perlbin -MConfig -e 'print $Config{archlib}'`/CORE; perllib=`$perlbin -MConfig -e 'print $Config{libs}'`; perlccflags=`$perlbin -MConfig -e 'print $Config{ccflags}'`; perlldflags=`$perlbin -MConfig -e 'print $Config{ccdlflags}'`; fi AC_SUBST(perlcore) AC_SUBST(perllib) AC_SUBST(perlccflags) AC_SUBST(perlldflags) AC_ARG_WITH(openssl, [ --with-openssl Path to openssl], [ case "$withval" in yes) openssl=yes; ;; no) openssl=no; ;; *) openssl=yes; opensslpath=$withval; ;; esac ], [ openssl=yes] ) if test "a$openssl" != "ano"; then ICFG_STATE_SAVE(OPENSSL) if test "a$opensslpath" != "a"; then CFLAGS="$CFLAGS -I$opensslpath/include" LDFLAGS="$LDFLAGS -L$opensslpath/lib" fi LIBS="-lssl -lcrypto $LIBS" (test -n "$opensslpath" && echo -n "checking for OpenSSL library under $opensslpath... ") || echo -n "checking for OpenSSL library... "; AC_LINK_IFELSE( [AC_LANG_SOURCE( [ #include int main(int argc, char *argv[]) { int ret = SSL_library_init(); return ret; } ]) ], [openssl=yes; echo "yes";], [openssl=no; echo "no"] ) if test "a$openssl" = "ayes"; then AC_DEFINE(HAVE_OPENSSL,1,[Define HAVE_OPENSSL if openssl is installed]) ICFG_BUILD_FLAGS(OPENSSL, $opensslpath, "-lssl -lcrypto") fi ICFG_STATE_ROLLBACK fi USE_OPENSSL="1" if test a"$openssl" = "ano"; then USE_OPENSSL="0" fi AC_SUBST(USE_OPENSSL) AC_CHECK_LIB(dl,dlopen,DL_ADD_FLAG=" -ldl") AC_SUBST(DL_ADD_FLAG) AC_ARG_WITH(zlib, [ --with-zlib Path to zlib library], [ case "$withval" in yes) zlib=yes; ;; no) zlib=no; ;; *) zlib=yes; zlibpath=$withval; ;; esac ], [ zlib=yes] ) if test "a$zlib" != "ano"; then ICFG_STATE_SAVE(ZLIB) if test "a$zlibpath" != "a"; then CFLAGS="$CFLAGS -I$zlib/include" LDFLAGS="$LDFLAGS -L$zlib/lib" fi AC_CHECK_LIB(z,inflate,[zlib=yes],[zlib=no]) ICFG_STATE_ROLLBACK fi if test "a$zlib" = "ano"; then AC_MSG_WARN("zlib required for the c-icap's internal filetype recognizer!") else AC_DEFINE(HAVE_ZLIB,1,[Define HAVE_ZLIB if zlib installed]) ICFG_BUILD_FLAGS(ZLIB, $zlibpath, "-lz") fi AC_ARG_WITH(bzlib, [ --with-bzlib Path to bzlib library], [ case "$withval" in yes) bzlib=yes; ;; no) bzlib=no; ;; *) bzlib=yes; bzlibpath=$withval; ;; esac ], [ bzlib=yes] ) if test "a$bzlib" != "ano"; then ICFG_STATE_SAVE(BZLIB) if test "a$bzlibpath" != "a"; then CFLAGS="$CFLAGS -I$bzlibpath/include" LDFLAGS="$LDFLAGS -L$bzlibpath/lib" fi AC_CHECK_LIB(bz2,BZ2_bzDecompressInit,[bzlib=yes],[bzlib=no]) ICFG_STATE_ROLLBACK fi if test "a$bzlib" = "ano"; then AC_MSG_WARN("bzlib required for the c-icap's internal filetype recognizer!") else AC_DEFINE(HAVE_BZLIB,1,[Define HAVE_BZLIB if bzlib installed]) ICFG_BUILD_FLAGS(BZLIB, $bzlibpath, "-lbz2") fi AC_ARG_WITH(brotli, [ --with-brotli Path to brotli library], [ case "$withval" in yes) brotli=yes; ;; no) brotli=no; ;; *) brotli=yes; brotlipath=$withval; ;; esac ], [ brotli=yes] ) if test "a$brotli" != "ano"; then ICFG_STATE_SAVE(BROTLI) if test "a$brotlipath" != "a"; then CFLAGS="$CFLAGS -I$brotlipath/include" LDFLAGS="$LDFLAGS -L$brotlipath/lib -lbrotlicommon" fi AC_CHECK_LIB(brotlidec,BrotliDecoderDecompressStream,[brotli=yes],[brotli=no]) ICFG_STATE_ROLLBACK fi if test "a$brotli" = "ano"; then AC_MSG_WARN("brotli required for the c-icap's internal filetype recognizer!") else AC_DEFINE(HAVE_BROTLI,1,[Define HAVE_BROTLI if brotli installed]) ICFG_BUILD_FLAGS(BROTLI, "$brotlipath", "-lbrotlicommon -lbrotlidec -lbrotlienc") # fix BROTLI_LNDIR_LDADD the linker does not find brotlicommon even if # it is linked to libicapapi using rpath if test "a$brotlipath" != "a" -a "a$BROTLI_LNDIR_LDADD" = "a"; then BROTLI_LNDIR_LDADD="-L$brotlipath/lib -lbrotlicommon" AC_SUBST(BROTLI_LNDIR_LDADD) fi fi libdb="yes" libdbpath="" AC_ARG_WITH(bdb, [ --with-bdb Where to find Berkeley DB library ], [ case "$withval" in yes) libdb="yes" ;; no ) libdb="no" ;; * ) libdb="yes" libdbpath=$withval ;; esac ], ) if test "a$libdb" != "ano"; then if test "a$libdbpath" != "a"; then CFLAGS="-I$libdbpath/include $CFLAGS" LDFLAGS="-L$libdbpath/lib $LDFLAGS" fi # We are going to see if we can found a Berkeley DB located under a # libdbpath/include/db4x directory and use lbdbpath/lib/libdb-4.x library. ICFG_STATE_SAVE(BDB) OLD_LIBS=$LIBS for DBVER in "" 6 6.3 6.2 6.1 6.0 5 5.4 5.3 5.2 5.1 5.0 4 4.9 4.8 4.7 4.6 4.5 4.4 4.3 4.2; do if test -z $DBVER; then usedblib="-ldb" incdbdir="" else usedblib="-ldb-$DBVER" incdbdir=db`echo $DBVER|sed 's/\.//'`"/" fi if test -z "$libdbpath"; then print_libdbpath="..." else print_libdbpath="under $libdbpath..." fi echo -n "checking for BerleleyDB v$DBVER $print_libdbpath" LIBS="$usedblib $OLD_LIBS" AC_LINK_IFELSE( [AC_LANG_SOURCE( [ #include <${incdbdir}db.h> int main(){ int major,minor,patch; if (!db_version(&major,&minor,&patch)) return -1; return 0; } ]) ], [echo yes;libdb="yes";], [echo "no";libdb="no";] ) if test a"$libdb" = "ayes"; then ICFG_BUILD_FLAGS(BDB, "$libdbpath", $usedblib) AC_DEFINE(HAVE_BDB, 1, [Define HAVE_BDB if berkeley DB is installed]) AC_DEFINE_UNQUOTED(BDB_HEADER_PATH(incfile), [<${incdbdir}incfile>], [Set DB_HEADER_PATH macro to compute berkeley DB header subpath]) break; fi done ICFG_STATE_ROLLBACK fi libldap="yes" AC_ARG_WITH(ldap, [ --with-ldap Where to find LDAP libraries ], [ case "$withval" in yes) libldap="yes" ;; no ) libldap="no" ;; * ) libldap="yes" libldappath=$withval ;; esac ], ) if test "a$libldap" != "ano"; then ICFG_STATE_SAVE(LDAP) if test "a$libldappath" != "a"; then CFLAGS="$CFLAGS -I$libldappath/include" LDFLAGS="$LDFLAGS -L$libldappath/lib" fi useldaplib="" AC_CHECK_LIB(ldap_r, ldap_search_ext_s, [libldap="yes";useldaplib="ldap_r"], [libldap="no"] ) if test "a$libldap" = "ano"; then AC_CHECK_LIB(ldap, ldap_search_ext_s, [libldap="yes";useldaplib="ldap"], [libldap="no"] ) fi if test "a$libldap" = "ayes"; then AC_DEFINE(HAVE_LDAP, 1, [Define HAVE_LDAP if LDAP libraries are installed]) ICFG_BUILD_FLAGS(LDAP, "$libldappath", "-l$useldaplib -llber") fi ICFG_STATE_ROLLBACK fi # Detect memcached library libmemcached="yes" libmemcachedpath="" AC_ARG_WITH(memcached, [ --with-memcached Where to find Memcached library ], [ case "$withval" in yes) libmemcached="yes" ;; no ) libmemcached="no" ;; * ) libmemcachedpath=$withval libmemcached="yes" ;; esac ], ) if test a"$libmemcached" != "ano"; then ICFG_STATE_SAVE(MEMCACHED) if test a"$libmemcachedpath" != "a"; then CFLAGS="-l$libmemcachedpath/include $CFLAGS" fi AC_CHECK_HEADERS(libmemcached/memcached.h, [libmemcached="yes"],[libmemcached="no"]) if test "a$libmemcached" = "ayes"; then ICFG_BUILD_FLAGS(MEMCACHED, "$libmemcachedpath", "-lmemcached -lmemcachedutil") fi ICFG_STATE_ROLLBACK fi # Check for PCRE regex library AC_ARG_WITH(pcre, [ --with-pcre Path to PCRE library], [ case "$withval" in yes) pcre=yes; ;; no) pcre=no; ;; *) pcre=yes; pcrepath=$withval; ;; esac ], [ pcre=yes] ) if test a"$pcre" != "ano"; then ICFG_STATE_SAVE(PCRE) if test "a$pcrepath" != "a"; then CFLAGS="$CFLAGS -I$pcrepath/include" LDFLAGS="$LDFLAGS -L$pcrepath/lib" fi AC_CHECK_HEADERS(pcre.h, AC_CHECK_LIB(pcre, pcre_exec,[pcre=yes],[pcre=no]), [pcre=no] ) if test "a$pcre" = "ayes"; then AC_DEFINE(HAVE_PCRE,1,[Define HAVE_PCRE if pcre installed]) ICFG_BUILD_FLAGS(PCRE, "$pcrepath", "-lpcre") fi ICFG_STATE_ROLLBACK fi # Check for header files AC_HEADER_STDC AC_CHECK_HEADERS(strings.h unistd.h sys/stat.h limits.h) SYS_TYPES_H="0" AC_CHECK_HEADERS(sys/types.h, [AC_DEFINE(HAVE_SYS_TYPES_H,1,[Define HAVE_SYS_TYPES_H if you have the header file.]) SYS_TYPES_H="1" ] ) AC_SUBST(SYS_TYPES_H) INTTYPES_H="0" AC_CHECK_HEADERS(inttypes.h, [AC_DEFINE(HAVE_INTTYPES_H,1,[Define HAVE_INTTYPES_H if you have the header file.]) INTTYPES_H="1" ] ) AC_SUBST(INTTYPES_H) posix_regex=no AC_CHECK_HEADERS(regex.h, [posix_regex=yes;AC_DEFINE(HAVE_REGEX,1,[Define HAVE_REGEX if regex.h exists (posix regular expressions - maybe more tests needed)])], [posix_regex=no] ) USE_REGEX=0 if test "a$pcre" = "ayes" -o "a$posix_regex" = "ayes"; then USE_REGEX=1 fi AC_SUBST(USE_REGEX) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST DEFINE_SIZE_T="0" AC_CHECK_TYPE(size_t,,[DEFINE_SIZE_T="1"]) AC_SUBST(DEFINE_SIZE_T) DEFINE_OFF_T="0" AC_CHECK_TYPE(off_t,,[DEFINE_OFF_T="1"]) AC_SUBST(DEFINE_OFF_T) AC_CHECK_SIZEOF(off_t) DEFINE_SIZE_OFF_T=$ac_cv_sizeof_off_t AC_SUBST(DEFINE_SIZE_OFF_T) AC_CHECK_SIZEOF(void *) DEFINE_SIZE_VOID_P=$ac_cv_sizeof_void_p AC_SUBST(DEFINE_SIZE_VOID_P) DEFINE_UINT8="0" AC_CHECK_TYPE(uint8_t,,[DEFINE_UINT8="1"]) AC_SUBST(DEFINE_UINT8) DEFINE_INT8="0" AC_CHECK_TYPE(int8_t,,[DEFINE_INT8="1"]) AC_SUBST(DEFINE_INT8) DEFINE_UINT64="0" AC_CHECK_TYPE(uint64_t,,[DEFINE_UINT64="1"]) AC_SUBST(DEFINE_UINT64) DEFINE_INT64="0" AC_CHECK_TYPE(int64_t,,[DEFINE_INT64="1"]) AC_SUBST(DEFINE_INT64) #some type size (currently they are not used) AC_CHECK_SIZEOF(short) DEFINE_SIZEOFF_SHORT=$ac_cv_sizeof_short AC_CHECK_SIZEOF(int) DEFINE_SIZEOFF_INT=$ac_cv_sizeof_int AC_CHECK_SIZEOF(long) DEFINE_SIZEOFF_LONG=$ac_cv_sizeof_long AC_CHECK_SIZEOF(long long) DEFINE_SIZEOFF_LONG_LONG=$ac_cv_sizeof_long_long # Checks for library functions. #Here we are changing the LIBS variable and save the current value to OLD_LIBS variable EXTRALIBS="" OLD_LIBS="$LIBS" LIBS="$LIBS $TEST_LIBS" #AC_FUNC_VPRINTF AC_CHECK_FUNCS(nanosleep, AC_DEFINE(HAVE_NANOSLEEP,1,[Define HAVE_NANOSLEEP if nanosleep exists]) ) AC_CHECK_FUNCS(inet_aton, AC_DEFINE(HAVE_INET_ATON,1,[Define HAVE_INET_ATON if inet_aton exists]) ) AC_CHECK_FUNCS(strnstr, AC_DEFINE(HAVE_STRNSTR,1,[Define HAVE_STRNSTR if strnstr exists]) ) AC_CHECK_FUNCS(strcasestr, AC_DEFINE(HAVE_STRCASESTR,1,[Define HAVE_STRCASESTR if strcasestr exists]) ) AC_CHECK_FUNCS(strncasestr, AC_DEFINE(HAVE_STRNCASESTR,1,[Define HAVE_STRNCASESTR if strncasestr exists]) ) AC_CHECK_FUNCS(setgroups) AC_FUNC_STRERROR_R USE_POLL="0" if test a"$enablepoll" != "ano"; then AC_CHECK_HEADERS(poll.h, AC_CHECK_FUNCS(poll, USE_POLL="1" ) ) fi AC_SUBST(USE_POLL) # if test a"$USE_POLL" = "1"; then # AC_DEFINE(HAVE_POLL,1,[Define HAVE_POLL if poll(2) exists and we can use it]) # fi #sysv ipc SYSV_IPC="0" AC_CHECK_HEADERS(sys/ipc.h, [AC_DEFINE(HAVE_SYSV_IPC,1,[Define HAVE_SYSV_IPC if sys/ipc.h exists (maybe more tests needed)]) SYSV_IPC="1" ] ) AC_SUBST(SYSV_IPC) POSIX_MAPPED_FILES="0" AC_CHECK_FUNCS(mmap munmap, [AC_DEFINE(HAVE_POSIX_MAPPED_FILES,1,[Define HAVE_POSIX_MAPPED_FILES if mmap and munmap exists]) POSIX_MAPPED_FILES="1" ] ) AC_SUBST(POSIX_MAPPED_FILES) dnl Checking if union semun exists in this system. AC_MSG_CHECKING([if union semun defined]) AC_TRY_COMPILE( [ #include #include #include ], [union semun a_semun;], AC_DEFINE(HAVE_UNION_SEMUN,1,[Define HAVE_UNION_SEMUN if union semun defined in ipc]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no), ) dnl Checking if interprocess posix semaphores works.... AC_CACHE_CHECK([if posix 1003.1b interprocess semaphores works], ac_cv_10031b_ipc_sem, [AC_TRY_RUN([ #include #include int main(int argc,char **argv){ sem_t s; pid_t pid; int status; if(sem_init(&s,1,1)!=0){ return -1; } if((pid=fork())==0){ if(sem_post(&s)<0){ exit(-1); } exit(0); } else { waitpid(pid,&status,0); if(WEXITSTATUS(status)!=0) exit(-1); } sem_destroy(&s); exit(0); } ], ac_cv_10031b_ipc_sem=yes, ac_cv_10031b_ipc_sem=no, [AC_MSG_ERROR([cross-compiling, presetting ac_cv_10031b_ipc_sem=(yes|no) will help])] ) ] ) AS_IF( [test $ac_cv_10031b_ipc_sem = yes], [AC_DEFINE(HAVE_POSIX_SEMAPHORES,1,[Define HAVE_POSIX_SEMAPHORES if posix 1003.1b semaphores works]) POSIX_SEMAPHORES="1" ],[ POSIX_SEMAPHORES="0"] ) AC_SUBST(POSIX_SEMAPHORES) dnl Checking for file locking AC_CACHE_CHECK([if fcntl file locking works], ac_cv_fcntl, [AC_TRY_RUN([ #include #include int main(int argc,char **argv){ struct flock fl; int fd; fd=open("autoconf.h.in",O_RDWR); fl.l_type=F_WRLCK; fl.l_whence=SEEK_SET; fl.l_start=0; fl.l_len=0; if(fcntl(fd,F_SETLKW,&fl)<0){ close(fd); return -1; } close(fd); return 0; } ], ac_cv_fcntl=yes, ac_cv_fcntl=no, [AC_MSG_ERROR([cross-compiling, presetting ac_cv_fcntl=(yes|no) will help])] ) ] ) AS_IF( [test $ac_cv_fcntl = yes], [AC_DEFINE(HAVE_POSIX_FILE_LOCK,1,[Define HAVE_POSIX_FILE_LOCK if posix fcntl file locking works]) POSIX_FILE_LOCK="1" ],[ POSIX_FILE_LOCK="0" ] ) AC_SUBST(POSIX_FILE_LOCK) AC_MSG_CHECKING([if posix shared mem works]) AC_TRY_COMPILE( [ #include #include #include ], [int fd = shm_open("foo", O_CREAT|O_RDWR, S_IRUSR | S_IWUSR); if (fd < 0) return 0; if (shm_unlink("foo") < 0) return 0; ], AC_DEFINE(HAVE_POSIX_SHARED_MEM, 1, [Define HAVE_POSIX_SHARED_MEM if shm_open/shm_unlink functions implemented]) [AC_MSG_RESULT(yes) POSIX_SHARED_MEM="1" ], [AC_MSG_RESULT(no) POSIX_SHARED_MEM="0" ], ) if test a"$POSIX_SHARED_MEM" = "a1"; then # Linux and solaris define the shm_open in -rt library. # This library already included in LIBS for solaris case "$host_os" in linux*) EXTRALIBS="$EXTRALIBS -lrt" ;; *) esac fi AC_SUBST(POSIX_SHARED_MEM) #pthread_rwlock PTHREADS_RWLOCK="0" AC_MSG_CHECKING([if have pthread_rwlock]) AC_TRY_COMPILE( [#include ], [pthread_rwlock_t lock;], AC_DEFINE(HAVE_PTHREADS_RWLOCK,1,[Define HAVE_PTHREADS_RWLOCK if pthreads library supports rwlocks]) PTHREADS_RWLOCK="1" AC_MSG_RESULT(yes), AC_MSG_RESULT(no), ) AC_SUBST(PTHREADS_RWLOCK) #We are pouting back real LIBS variable LIBS=$OLD_LIBS LIBS="$LIBS $EXTRALIBS" #Configure common flags MODULES_LIBADD="" if test a"$iscygwin" != a; then MODULES_LIBADD="-L../../ -licapapi" fi MODULES_CFLAGS="$INVISIBILITY_CFLAG -DCI_BUILD_MODULE" AC_SUBST(MODULES_LIBADD) AC_SUBST(MODULES_CFLAGS) #general parameters AM_CONDITIONAL(ISCYGWIN,[test a"$iscygwin" != a]) # Now determine which modules will going to build ..... AM_CONDITIONAL(USE_OPENSSL, [test a"$openssl" != "ano"]) AM_CONDITIONAL(USE_REGEX, [test a"$pcre" = "ayes" -o a"$posix_regex" = "ayes"]) AM_CONDITIONAL(USEPERL,[test a"$perlcore" != a]) AM_CONDITIONAL(USEBDB, [test a"$libdb" != ano]) AM_CONDITIONAL(USELDAP, [test a"$libldap" != ano]) AM_CONDITIONAL(USEMEMCACHED, [test a"$libmemcached" != ano]) AM_CONDITIONAL(USE_RPATH, [test "a$enable_rpath" != "ano"]) AC_OUTPUT([ include/c-icap-conf.h Makefile utils/Makefile services/Makefile services/echo/Makefile services/ex-206/Makefile modules/Makefile tests/Makefile docs/Makefile docs/man/Makefile ]) c_icap-0.5.6/commands.c0000664000175000017500000001725013371253152011637 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include #include "common.h" #include "c-icap.h" #include "net_io.h" #include "debug.h" #include "log.h" #include "commands.h" #include "cfg_param.h" #include "registry.h" struct schedule_data { char name[CMD_NM_SIZE]; time_t when; void *data; }; /*The list of commands*/ static ci_list_t *COMMANDS_LIST = NULL;; /* The list of request for ONDEMAND_CMD commands*/ static ci_list_t *COMMANDS_QUEUE = NULL; ci_thread_mutex_t COMMANDS_MTX; void commands_init() { ci_thread_mutex_init(&COMMANDS_MTX); COMMANDS_LIST = ci_list_create(64, sizeof(ci_command_t)); COMMANDS_QUEUE = ci_list_create(64, sizeof(struct schedule_data)); } void register_command(const char *name, int type, void (*command_action) (const char *name, int type, const char **argv)) { if (! (type & ALL_PROC_CMD)) { ci_debug_printf(1, "Can not register command %s ! Wrong type\n", name ); return; } ci_command_t cmd; strncpy(cmd.name, name, CMD_NM_SIZE); cmd.name[CMD_NM_SIZE - 1] = '\0'; cmd.type = type; cmd.data = NULL; cmd.command_action = command_action; ci_thread_mutex_lock(&COMMANDS_MTX); ci_list_push(COMMANDS_LIST, &cmd); ci_thread_mutex_unlock(&COMMANDS_MTX); ci_debug_printf(5, "Command %s registered\n", name); } void register_command_extend(const char *name, int type, void *data, void (*command_action) (const char *name, int type, void *data)) { if (type != CHILD_START_CMD && type != CHILD_STOP_CMD && type != ONDEMAND_CMD) { ci_debug_printf(1, "Can not register extend command %s ! wrong type\n", name ); return; } ci_command_t cmd; strncpy(cmd.name, name, CMD_NM_SIZE); cmd.name[CMD_NM_SIZE - 1] = '\0'; cmd.type = type; cmd.data = data; cmd.command_action_extend = command_action; ci_thread_mutex_lock(&COMMANDS_MTX); ci_list_push(COMMANDS_LIST, &cmd); ci_thread_mutex_unlock(&COMMANDS_MTX); ci_debug_printf(5, "Extend command %s registered\n", name); } void commands_reset() { if (COMMANDS_QUEUE) { ci_list_destroy(COMMANDS_QUEUE); COMMANDS_QUEUE = ci_list_create(64, sizeof(struct schedule_data)); } if (COMMANDS_LIST) { ci_list_destroy(COMMANDS_LIST); COMMANDS_LIST = ci_list_create(64, sizeof(ci_command_t)); } } /* Currently we are using the following functions which defined in cfg_param.c file These functions must moved to a utils.c file ... */ char **split_args(char *args); void free_args(char **argv); int cb_check_command(void *data, const void *obj) { const ci_command_t **rcommand = (const ci_command_t **)data; const ci_command_t *cur_item = (const ci_command_t *)obj; if (*rcommand && strcmp((*rcommand)->name, cur_item->name) == 0) { *rcommand = cur_item; return 1; } return 0; } ci_command_t *find_command(const char *cmd_line) { int len; char *s; ci_command_t tmpCmd; ci_command_t *cmd; if (COMMANDS_LIST == NULL) { ci_debug_printf(5, "None command registered\n"); return NULL; } s = strchr(cmd_line, ' '); if (s) len = s - cmd_line; else len = strlen(cmd_line); if (len && len < CMD_NM_SIZE) { strncpy(tmpCmd.name, cmd_line, len); tmpCmd.name[len] = '\0'; cmd = &tmpCmd; ci_list_iterate(COMMANDS_LIST, &cmd, cb_check_command); if (cmd != &tmpCmd) /*We found an cmd stored in list. Return it*/ return cmd; } return NULL; } int execute_command(ci_command_t * command, char *cmdline, int exec_type) { char **args; if (!command) return 0; args = split_args(cmdline); command->command_action(args[0], exec_type, (const char **)(args + 1)); free_args(args); return 1; } static int exec_cmd_step(void *data, const void *cmd) { int cmd_type = *((int *)data); ci_command_t *command = (ci_command_t *)cmd; ci_debug_printf(7, "Check command: %s, type: %d \n", command->name, command->type); if (command->type == cmd_type) { ci_debug_printf(5, "Execute command:%s \n", command->name); command->command_action_extend (command->name, command->type, command->data); } return 0; } static int execute_child_commands (int cmd_type) { ci_debug_printf(5, "Going to execute child commands\n"); if (COMMANDS_LIST == NULL) { ci_debug_printf(5, "None command registered\n"); return 0; } ci_list_iterate(COMMANDS_LIST, &cmd_type, exec_cmd_step); return 1; } int commands_execute_start_child() { return execute_child_commands(CHILD_START_CMD); } int commands_execute_stop_child() { return execute_child_commands(CHILD_STOP_CMD); } void ci_command_register_ctl_cmd(const char *name, int type, void (*command_action)(const char *name,int type, const char **argv)) { register_command(name, type, command_action); } void ci_command_register_action(const char *name, int type, void *data, void (*command_action) (const char *name, int type, void *data)) { register_command_extend(name, type, data, command_action); } void ci_command_schedule_on(const char *name, void *data, time_t time) { struct schedule_data sch; memset(&sch, 0, sizeof(struct schedule_data)); strncpy(sch.name, name, CMD_NM_SIZE); sch.name[CMD_NM_SIZE - 1] = '\0'; sch.when = time; sch.data = data; if (ci_list_search(COMMANDS_QUEUE, &sch)) { ci_debug_printf(7, "command %s already scheduled for execution on %ld, ignore\n", name, time); return; } ci_thread_mutex_lock(&COMMANDS_MTX); ci_list_push(COMMANDS_QUEUE, &sch); ci_thread_mutex_unlock(&COMMANDS_MTX); ci_debug_printf(9, "command %s scheduled for execution\n", name); } void ci_command_schedule(const char *name, void *data, time_t afterSecs) { time_t tm; time(&tm); tm += afterSecs; ci_command_schedule_on(name, data, tm); } static int cb_check_queue(void *data, const void *item) { struct schedule_data *sch = (struct schedule_data *)item; time_t tm = *((time_t *)data); if (sch->when < tm) { ci_command_t *cmd = find_command(sch->name); if (cmd) { ci_debug_printf(9, "Execute command:%s \n", cmd->name); cmd->command_action_extend (cmd->name, cmd->type, (sch->data ? sch->data : cmd->data)); } ci_thread_mutex_lock(&COMMANDS_MTX); ci_list_remove(COMMANDS_QUEUE, sch); ci_thread_mutex_unlock(&COMMANDS_MTX); } return 0; } void commands_exec_scheduled() { time_t tm; ci_debug_printf(10, "Going to execute child commands\n"); if (COMMANDS_LIST == NULL) { ci_debug_printf(10, "None command registered\n"); } if (!COMMANDS_QUEUE) return; time(&tm); ci_list_iterate(COMMANDS_QUEUE, &tm, cb_check_queue); } c_icap-0.5.6/cfg_lib.c0000664000175000017500000001714013541155572011427 00000000000000/* * Copyright (C) 2004-2010 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include #include "cfg_param.h" #include "mem.h" #include "debug.h" /*************************************************************************/ /* Memory managment for config parameters definitions and implementation */ #define ALLOCATOR_SIZE 65536 ci_mem_allocator_t *cfg_params_allocator = NULL; void ci_cfg_lib_init() { cfg_params_allocator = ci_create_serial_allocator(ALLOCATOR_SIZE); } void ci_cfg_lib_reset() { cfg_params_allocator->reset(cfg_params_allocator); } void *ci_cfg_alloc_mem(int size) { return cfg_params_allocator->alloc(cfg_params_allocator, size); } /****************************************************************/ /* Command line options implementation, function and structures */ void ci_args_usage(const char *progname, struct ci_options_entry *options) { int i; printf("Usage : \n"); printf("%s", progname); for (i = 0; options[i].name != NULL; i++) { if (options[i].name[0] == '$') printf(" [file1] [file2] ..."); else printf(" [%s %s]", options[i].name, (options[i].parameter == NULL ? "" : options[i].parameter)); } printf("\n\n"); for (i = 0; options[i].name != NULL; i++) if (options[i].name[0] == '$') printf(" [file1] [file2] ...\t: %s\n", options[i].msg); else printf("%s %s\t\t: %s\n", options[i].name, (options[i].parameter == NULL ? "\t" : options[i].parameter), options[i].msg); } struct ci_options_entry *search_options_table(const char *directive, struct ci_options_entry *options) { int i; const char *option_search; if (directive[0] != '-') option_search = "$$"; else option_search = directive; for (i = 0; options[i].name != NULL; i++) { if (0 == strcmp(option_search, options[i].name)) return &options[i]; } return NULL; } int ci_args_apply(int argc, char *argv[], struct ci_options_entry *options) { int i; struct ci_options_entry *entry; const char *act_args[2]; act_args[1] = NULL; for (i = 1; i < argc; i++) { if ((entry = search_options_table(argv[i], options)) == NULL) return 0; if (entry->parameter) { if (++i >= argc) return 0; act_args[0] = argv[i]; (*(entry->action)) (entry->name, act_args, entry->data); } else { /*maybe is the "$$" directive ....*/ if (strcmp(entry->name, "$$") == 0) { act_args[0] = argv[i]; (*(entry->action)) (entry->name, act_args, entry->data); } else (*(entry->action)) (entry->name, NULL, entry->data); } } return 1; } /****************************************************************************/ /*Various functions for setting parameters from command line or config file */ int ci_cfg_set_int(const char *directive, const char **argv, void *setdata) { int val = 0; char *end; if (setdata == NULL) return 0; if (argv == NULL || argv[0] == NULL) { ci_debug_printf(1, "Missing arguments in directive:%s\n", directive); return 0; } errno = 0; val = strtoll(argv[0], &end, 10); if ((val == 0 && errno != 0)) return 0; *((int *) setdata) = val; ci_debug_printf(2, "Setting parameter: %s=%d\n", directive, val); return 1; } int ci_cfg_set_str(const char *directive, const char **argv, void *setdata) { if (setdata == NULL) return 0; if (argv == NULL || argv[0] == NULL) { return 0; } if (!(*((char **) setdata) = ci_cfg_alloc_mem(strlen(argv[0]) + 1))) { return 0; } strcpy(*((char **) setdata), argv[0]); /* *((char **) setdata) = (char *) strdup(argv[0]); */ ci_debug_printf(2, "Setting parameter: %s=%s\n", directive, argv[0]); return 1; } int ci_cfg_onoff(const char *directive, const char **argv, void *setdata) { if (setdata == NULL) return 0; if (argv == NULL || argv[0] == NULL) { ci_debug_printf(1, "Missing arguments in directive:%s\n", directive); return 0; } if (strcasecmp(argv[0], "on") == 0) *((int *) setdata) = 1; else if (strcasecmp(argv[0], "off") == 0) *((int *) setdata) = 0; else return 0; ci_debug_printf(2, "Setting parameter: %s=%d\n", directive, *((int *) setdata)); return 1; } int ci_cfg_disable(const char *directive, const char **argv, void *setdata) { if (setdata == NULL) return 0; *((int *) setdata) = 0; ci_debug_printf(2, "Disabling parameter %s\n", directive); return 1; } int ci_cfg_enable(const char *directive, const char **argv, void *setdata) { if (setdata == NULL) return 0; *((int *) setdata) = 1; ci_debug_printf(2, "Enabling parameter %s\n", directive); return 1; } int ci_cfg_size_off(const char *directive, const char **argv, void *setdata) { ci_off_t val = 0; char *end; if (setdata == NULL) return 0; if (argv == NULL || argv[0] == NULL) { ci_debug_printf(1, "Missing arguments in directive:%s\n", directive); return 0; } errno = 0; val = ci_strto_off_t(argv[0], &end, 10); if ((val == 0 && errno != 0) || val < 0) return 0; if (*end == 'k' || *end == 'K') val = val * 1024; else if (*end == 'm' || *end == 'M') val = val * 1024 * 1024; if (val > 0) *((ci_off_t *) setdata) = val; ci_debug_printf(2, "Setting parameter: %s=%" PRINTF_OFF_T "\n", directive, (CAST_OFF_T) val); return 1; } int ci_cfg_size_long(const char *directive, const char **argv, void *setdata) { long int val = 0; char *end; if (setdata == NULL) return 0; if (argv == NULL || argv[0] == NULL) { ci_debug_printf(1, "Missing arguments in directive: %s\n", directive); return 0; } errno = 0; val = strtol(argv[0], &end, 10); if ((val == 0 && errno != 0) || val < 0) return 0; if (*end == 'k' || *end == 'K') val = val * 1024; else if (*end == 'm' || *end == 'M') val = val * 1024 * 1024; if (val > 0) *((long int *) setdata) = val; ci_debug_printf(2, "Setting parameter: %s=%ld\n", directive, val); return 1; } int ci_cfg_version(const char *directive, const char **argv, void *setdata) { if (setdata) *((int *) setdata) = 1; printf("%s\n", VERSION); return 1; } int ci_cfg_build_info(const char *directive, const char **argv, void *setdata) { if (setdata) *((int *) setdata) = 1; printf("c-icap version: %s\nConfigure script options: %s\nConfigured for host: %s\n", VERSION, C_ICAP_CONFIGURE_OPTIONS, C_ICAP_CONFIG_HOST_TYPE); return 1; } c_icap-0.5.6/array.c0000664000175000017500000005267013371253152011161 00000000000000/* * Copyright (C) 2011 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "debug.h" #include "mem.h" #include "array.h" #include #define array_item_size(type) ( (size_t)&((type *)0)[1]) ci_array_t * ci_array_new(size_t size) { ci_array_t *array; ci_mem_allocator_t *packer; void *buffer; buffer = ci_buffer_alloc(size); if (!buffer) return NULL; packer = ci_create_pack_allocator_on_memblock(buffer, size); if (!packer) { ci_buffer_free(buffer); return NULL; } array = ci_pack_allocator_alloc(packer, sizeof(ci_array_t)); if (!array) { ci_buffer_free(buffer); ci_mem_allocator_destroy(packer); return NULL; } array->max_size = size; array->count = 0; array->items = NULL; array->mem = buffer; array->alloc = packer; return array; } ci_array_t * ci_array_new2(size_t items, size_t item_size) { size_t array_size; array_size = ci_pack_allocator_required_size() + _CI_ALIGN(sizeof(ci_array_t)) + items * (_CI_ALIGN(item_size) + _CI_ALIGN(sizeof(ci_array_item_t))); return ci_array_new(array_size); } void ci_array_destroy(ci_array_t *array) { void *buffer = array->mem; assert(buffer); if (array->alloc) ci_mem_allocator_destroy(array->alloc); ci_buffer_free(buffer); } const ci_array_item_t * ci_array_add(ci_array_t *array, const char *name, const void *value, size_t size) { ci_array_item_t *item; ci_mem_allocator_t *packer = array->alloc; assert(packer); item = ci_pack_allocator_alloc_unaligned(packer, array_item_size(ci_array_item_t)); if (item) { item->name = ci_pack_allocator_alloc_from_rear(packer, strlen(name) + 1); item->value = ci_pack_allocator_alloc_from_rear(packer, size); } if (!item || !item->name || !item->value) { ci_debug_printf(2, "Not enough space to add the new item to array!\n"); return NULL; } strcpy(item->name, name); memcpy(item->value, value, size); /*The array->items should point to the first item...*/ if (array->items == NULL) array->items = item; array->count++; return item; } const void * ci_array_search(ci_array_t *array, const char *name) { int i; for (i = 0; i < array->count; i++) { if (strcmp(array->items[i].name, name) == 0) { return array->items[i].value; } } return NULL; } void ci_array_iterate(const ci_array_t *array, void *data, int (*fn)(void *data, const char *name, const void *)) { int i, ret = 0; for (i = 0; i < array->count && ret == 0; i++) { ret = (*fn)(data, array->items[i].name, array->items[i].value); } } #define MIN_P(p1, p2) ((void *)p1 < (void *)p2 ? (void *)p1 : (void *)p2) const ci_array_item_t *ci_array_pop(ci_array_t *array) { ci_array_item_t *item; if (array->count == 0) return NULL; /*Delete the last element*/ item = &array->items[array->count-1]; ci_pack_allocator_set_start_pos(array->alloc, item); /*Delete the content of the last element*/ array->count--; if (array->count == 0) ci_pack_allocator_set_end_pos(array->alloc, NULL); else ci_pack_allocator_set_end_pos(array->alloc, MIN_P(array->items[array->count-1].name, array->items[array->count-1].value) ); return item; } const ci_array_item_t *ci_array_get_item(ci_array_t *array, int pos) { if (pos >= array->count) return NULL; return &(array->items[pos]); } ci_ptr_array_t * ci_ptr_array_new2(size_t items) { size_t array_size; array_size = ci_pack_allocator_required_size() + _CI_ALIGN(sizeof(ci_ptr_array_t)) + items * (_CI_ALIGN(sizeof(void *)) + _CI_ALIGN(sizeof(ci_array_item_t))); return ci_ptr_array_new(array_size); } void * ci_ptr_array_search(ci_ptr_array_t *array, const char *name) { return (void *)ci_array_search(array, name); } const ci_array_item_t * ci_ptr_array_add(ci_ptr_array_t *ptr_array, const char *name, void *value) { ci_array_item_t *item; ci_mem_allocator_t *packer = ptr_array->alloc; assert(packer); item = ci_pack_allocator_alloc_unaligned(packer, array_item_size(ci_array_item_t)); if (item) item->name = ci_pack_allocator_alloc_from_rear(packer, strlen(name) + 1); if (!item || !item->name) { ci_debug_printf(2, "Not enough space to add the new item to array!\n"); return NULL; } strcpy(item->name, name); item->value = value; /*The array->items should point to the first item...*/ if (ptr_array->items == NULL) ptr_array->items = item; ptr_array->count++; return item; } const ci_array_item_t *ci_ptr_array_pop(ci_ptr_array_t *ptr_array) { ci_array_item_t *item; if (ptr_array->count == 0) return NULL; item = &ptr_array->items[ptr_array->count-1]; ci_pack_allocator_set_start_pos(ptr_array->alloc, item); ptr_array->count--; return item; } void * ci_ptr_array_pop_value(ci_ptr_array_t *ptr_array, char *name, size_t name_size) { const ci_array_item_t *item = ci_ptr_array_pop(ptr_array); if (!item) return NULL; strncpy(name, item->name, name_size); name[name_size-1] = '\0'; return item->value; } /**************************************************************************/ ci_dyn_array_t * ci_dyn_array_new(size_t size) { /*use 25% of memory for index.*/ size_t index_memory = size / 4; size_t items_memory = size - index_memory; size_t items_count = index_memory / sizeof(ci_array_item_t *); size_t item_size = items_memory / items_count; if (item_size < sizeof(ci_array_item_t)) item_size = sizeof(ci_array_item_t); return ci_dyn_array_new2(items_count, item_size); } ci_dyn_array_t * ci_dyn_array_new2(size_t items, size_t item_size) { ci_dyn_array_t *array; ci_mem_allocator_t *packer; size_t array_size; /* Items of size = item_size + sizeof(ci_array_item)+sizeof(name) for sizeof(name) assume a size of 16 bytes. We can not be accurate here.... */ array_size = _CI_ALIGN(sizeof(ci_dyn_array_t)) + items * (_CI_ALIGN(item_size) + _CI_ALIGN(sizeof(ci_array_item_t)) + _CI_ALIGN(16)); packer = ci_create_serial_allocator(array_size); if (!packer) { return NULL; } array = packer->alloc(packer, sizeof(ci_dyn_array_t)); if (!array) { ci_mem_allocator_destroy(packer); return NULL; } if (items < 32) items = 32; array->max_items = items; array->items = ci_buffer_alloc(items*sizeof(ci_array_item_t *)); array->count = 0; array->alloc = packer; return array; } void ci_dyn_array_destroy(ci_dyn_array_t *array) { if (array->items) ci_buffer_free(array->items); if (array->alloc) ci_mem_allocator_destroy(array->alloc); } const ci_array_item_t * ci_dyn_array_add(ci_dyn_array_t *array, const char *name, const void *value, size_t size) { ci_array_item_t *item; ci_array_item_t **items_space; ci_mem_allocator_t *packer = array->alloc; int name_size; if (array->count == array->max_items) { items_space = ci_buffer_realloc(array->items, (array->max_items + 32)*sizeof(ci_array_item_t *)); if (!items_space) return NULL; array->items = items_space; array->max_items += 32; } assert(packer); item = packer->alloc(packer, sizeof(ci_array_item_t)); if (!item) { ci_debug_printf(2, "Not enough space to add the new item %s to array!\n", name); return NULL; } name_size = strlen(name) + 1; item->name = packer->alloc(packer, name_size); if (size > 0) item->value = packer->alloc(packer, size); else item->value = NULL; if (!item->name || (!item->value && size > 0)) { ci_debug_printf(2, "Not enough space to add the new item %s to array!\n", name); /*packer->free does not realy free anything bug maybe in the future will be able to release memory*/ if (item->name) packer->free(packer, item->name); if (item->value) packer->free(packer, item->value); packer->free(packer, item); return NULL; } /*copy values*/ memcpy(item->name, name, name_size); if (size > 0) memcpy(item->value, value, size); else item->value = (void *)value; array->items[array->count++] = item; return item; } const void * ci_dyn_array_search(ci_dyn_array_t *array, const char *name) { int i; for (i = 0; i < array->count; ++i) if (strcmp(array->items[i]->name, name) == 0) return array->items[i]->value; /*did not found anything*/ return NULL; } void ci_dyn_array_iterate(const ci_dyn_array_t *array, void *data, int (*fn)(void *data, const char *name, const void *value)) { int i, ret = 0; for (i = 0; i < array->count && ret == 0; i++) ret = (*fn)(data, array->items[i]->name, array->items[i]->value); } const ci_array_item_t * ci_ptr_dyn_array_add(ci_ptr_dyn_array_t *array, const char *name, void *value) { return ci_dyn_array_add(array, name, value, 0); } /**************/ /* Vectors API */ ci_vector_t * ci_vector_create(size_t max_size) { ci_vector_t *vector; ci_mem_allocator_t *packer; void *buffer; void **indx; buffer = ci_buffer_alloc(max_size); if (!buffer) return NULL; packer = ci_create_pack_allocator_on_memblock(buffer, max_size); if (!packer) { ci_buffer_free(buffer); return NULL; } vector = ci_pack_allocator_alloc(packer, sizeof(ci_vector_t)); /*Allocate mem for the first item which points to NULL. Vectors are NULL terminated*/ indx = ci_pack_allocator_alloc_unaligned(packer, array_item_size(void *)); if (!vector || ! indx) { ci_buffer_free(buffer); ci_mem_allocator_destroy(packer); return NULL; } *indx = NULL; vector->max_size = max_size; vector->mem = buffer; vector->items = indx; vector->last = indx; vector->count = 0; vector->alloc = packer; return vector; } const void **ci_vector_cast_to_voidvoid(ci_vector_t *vector) { return (const void **)vector->items; } ci_vector_t *ci_vector_cast_from_voidvoid(const void **p) { const void *buf; ci_vector_t *v; v = (ci_vector_t *)((void *)p - _CI_ALIGN(sizeof(ci_vector_t))); buf = (void *)v - ci_pack_allocator_required_size(); /*Check if it is a valid vector. The ci_buffer_blocksize will return 0, if buf is not a ci_buffer object*/ assert(v->mem == buf); assert(ci_buffer_blocksize(buf) != 0); return v; } void ci_vector_destroy(ci_vector_t *vector) { void *buffer = vector->mem; assert(buffer); if (vector->alloc) ci_mem_allocator_destroy(vector->alloc); ci_buffer_free(buffer); } void * ci_vector_add(ci_vector_t *vector, const void *value, size_t size) { void *item, **indx; ci_mem_allocator_t *packer = vector->alloc; assert(packer); indx = ci_pack_allocator_alloc_unaligned(packer, array_item_size(void *)); item = ci_pack_allocator_alloc_from_rear(packer, size); if (!item || !indx) { ci_debug_printf(2, "Not enough space to add the new item to vector!\n"); return NULL; } memcpy(item, value, size); *(vector->last) = item; vector->last = indx; *(vector->last) = NULL; vector->count++; return item; } void * ci_vector_pop(ci_vector_t *vector) { void *p; if (vector->count == 0) return NULL; /*Delete the last NULL element*/ ci_pack_allocator_set_start_pos(vector->alloc, vector->last); /*Set last to the preview ellement*/ vector->count--; vector->last = &vector->items[vector->count]; /*Erase the content of last element*/ if (vector->count == 0) ci_pack_allocator_set_end_pos(vector->alloc, NULL); else ci_pack_allocator_set_end_pos(vector->alloc, vector->items[vector->count-1]); /*The last element must point to NULL*/ p = *(vector->last); *(vector->last) = NULL; return p; } void ci_vector_iterate(const ci_vector_t *vector, void *data, int (*fn)(void *data, const void *)) { int i, ret = 0; for (i = 0; vector->items[i] != NULL && ret == 0; i++) ret = (*fn)(data, vector->items[i]); } /*ci_str_vector functions */ void ci_str_vector_iterate(const ci_str_vector_t *vector, void *data, int (*fn)(void *data, const char *)) { ci_vector_iterate(vector, data, (int(*)(void *, const void *))fn); } const char * ci_str_vector_search(ci_str_vector_t *vector, const char *item) { int i; for (i = 0; vector->items[i] != NULL; i++) { if (strcmp(vector->items[i], item) == 0) return vector->items[i]; } return NULL; } /*ci_ptr_vector functions....*/ void * ci_ptr_vector_add(ci_vector_t *vector, void *value) { void **indx; ci_mem_allocator_t *packer = vector->alloc; assert(packer); if (!value) return NULL; indx = ci_pack_allocator_alloc_unaligned(packer, array_item_size(void *)); if (!indx) { ci_debug_printf(2, "Not enough space to add the new item to ptr_vector!\n"); return NULL; } /*Store the pointer to the last ellement */ *(vector->last) = value; /*And create a new NULL terminated item: */ vector->last = indx; *(vector->last) = NULL; vector->count++; return value; } /****************/ /* Lists API */ ci_list_t * ci_list_create(size_t init_size, size_t obj_size) { ci_list_t *list = NULL; ci_mem_allocator_t *alloc = NULL; if (init_size < 1024) init_size = 1024; alloc = ci_create_serial_allocator(init_size); list = alloc->alloc(alloc, sizeof(ci_list_t)); list->alloc = alloc; list->items = NULL; list->last = NULL; list->trash = NULL; list->cursor = NULL; list->obj_size = obj_size; /*By default do not use any handler*/ list->cmp_func = NULL; list->copy_func = NULL; list->free_func = NULL; return list; } void ci_list_destroy(ci_list_t *list) { ci_mem_allocator_t *alloc = list->alloc; ci_mem_allocator_destroy(alloc); } void ci_list_cmp_handler(ci_list_t *list, int (*cmp_func)(const void *obj, const void *user_data, size_t user_data_size)) { list->cmp_func = cmp_func; } void ci_list_free_handler(ci_list_t *list, void (*free_func)(void *obj)) { list->free_func = free_func; } void ci_list_copy_handler(ci_list_t *list, int (*copy_func)(void *newObj, const void *oldObj)) { list->copy_func = copy_func; } void ci_list_iterate(ci_list_t *list, void *data, int (*fn)(void *data, const void *obj)) { ci_list_item_t *it; for (list->cursor = list->items; list->cursor != NULL; ) { it = list->cursor; list->cursor = list->cursor->next; if ((*fn)(data, it->item)) return; } } static ci_list_item_t *list_alloc_item(ci_list_t *list, const void *data) { ci_list_item_t *it; if (list->trash) { it = list->trash; list->trash = list->trash->next; } else { it = list->alloc->alloc(list->alloc, sizeof(ci_list_item_t)); if (!it) return NULL; if (list->obj_size) { it->item = list->alloc->alloc(list->alloc, list->obj_size); if (!it->item) return NULL; } } it->next = NULL; if (list->obj_size) { memcpy(it->item, data, list->obj_size); if (list->copy_func) list->copy_func(it->item, data); } else it->item = (void *)data; return it; } const void * ci_list_push(ci_list_t *list, const void *data) { ci_list_item_t *it = list_alloc_item(list, data); if (!it) return NULL; if (list->items) { it->next = list->items; list->items = it; } else { list->items = list->last = it; } return it->item; } const void * ci_list_push_back(ci_list_t *list, const void *data) { ci_list_item_t *it = list_alloc_item(list, data); if (!it) return NULL; if (list->last != NULL) { list->last->next = it; list->last = it; } else { list->items = list->last = it; } return it->item; } void *ci_list_pop(ci_list_t *list, void *data) { ci_list_item_t *it = list->items; if (list->items == NULL) return NULL; if (list->last == list->items) { list->last = NULL; list->items = NULL; list->cursor = NULL; } else { if (list->cursor == list->items) list->cursor = list->items->next; list->items = list->items->next; } it->next = list->trash; list->trash = it; if (list->obj_size) { memcpy(data, it->item, list->obj_size); if (list->copy_func) list->copy_func(data, it->item); if (list->free_func) list->free_func(it->item); return data; } else return (*((void **)data) = it->item); } void *ci_list_pop_back(ci_list_t *list, void *data) { ci_list_item_t *tmp, *it = list->last; if (list->items == NULL) return NULL; if (list->last == list->items) { list->last = NULL; list->items = NULL; list->cursor = NULL; } else { if (list->cursor == list->last) list->cursor = NULL; for (tmp = list->items; tmp != NULL && tmp->next != list->last; tmp = tmp->next); assert(tmp != NULL); list->last = tmp; list->last->next = NULL; } it->next = list->trash; list->trash = it; if (list->obj_size) { memcpy(data, it->item, list->obj_size); if (list->copy_func) list->copy_func(data, it->item); if (list->free_func) list->free_func(it->item); return data; } else return (*((void **)data) = it->item); } static int default_cmp(const void *obj1, const void *obj2, size_t size) { return memcmp(obj1, obj2, size); } static int pointers_cmp(const void *obj1, const void *obj2, size_t size) { return (obj1 == obj2 ? 0 : (obj1 > obj2 ? 1 : -1)); } int ci_list_remove(ci_list_t *list, const void *obj) { ci_list_item_t *it, *prev; int (*cmp_func)(const void *, const void *, size_t); if (list->cmp_func) cmp_func = list->cmp_func; else if (list->obj_size) cmp_func = default_cmp; else cmp_func = pointers_cmp; prev = NULL; for (it = list->items; it != NULL; prev = it,it = it->next) { if (cmp_func(it->item, obj, list->obj_size) == 0) { if (prev) { prev->next = it->next; } else { /*it is the first item*/ list->items = it->next; } if (list->cursor == it) list->cursor = list->cursor->next; it->next = list->trash; list->trash = it; if (list->free_func && list->obj_size) list->free_func(it->item); return 1; } } return 0; } const void * ci_list_search(ci_list_t *list, const void *data) { ci_list_item_t *it; int (*cmp_func)(const void *, const void *, size_t); if (list->cmp_func) cmp_func = list->cmp_func; else if (list->obj_size) cmp_func = default_cmp; else cmp_func = pointers_cmp; for (it = list->items; it != NULL; it = it->next) { if (cmp_func(it->item, data, list->obj_size) == 0) return it->item; } return NULL; } const void * ci_list_search2(ci_list_t *list, const void *data, int (*cmp_func)(const void *obj, const void *user_data, size_t user_data_size)) { ci_list_item_t *it; for (it = list->items; it != NULL; it = it->next) { if (cmp_func(it->item, data, list->obj_size) == 0) return it->item; } return NULL; } void ci_list_sort(ci_list_t *list) { int (*cmp_func)(const void *, const void *, size_t); if (list->cmp_func) cmp_func = list->cmp_func; else if (list->obj_size) cmp_func = default_cmp; else cmp_func = pointers_cmp; ci_list_sort2(list, cmp_func); } void ci_list_sort2(ci_list_t *list, int (*cmp_func)(const void *obj1, const void *obj2, size_t obj_size)) { ci_list_item_t *it; ci_list_item_t *sortedHead = NULL, *sortedTail = NULL; ci_list_item_t **currentSorted, *currentHead; if (!list->items || ! list->items->next) return; it = list->items; while (it) { currentHead = it; it = it->next; currentSorted = &sortedHead; while (!(*currentSorted == NULL || cmp_func(currentHead->item, (*currentSorted)->item, list->obj_size) < 0)) currentSorted = &(*currentSorted)->next; currentHead->next = *currentSorted; *currentSorted = currentHead; if ((*currentSorted)->next == NULL) sortedTail = (*currentSorted); } list->items = sortedHead; list->last = sortedTail; } c_icap-0.5.6/configure0000775000175000017500000204065513570504055011612 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for c_icap 0.5.6. # # # 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 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || 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'" SHELL=${CONFIG_SHELL-/bin/sh} 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='c_icap' PACKAGE_TARNAME='c_icap' PACKAGE_VERSION='0.5.6' PACKAGE_STRING='c_icap 0.5.6' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="aserver.c" # 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='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS USE_RPATH_FALSE USE_RPATH_TRUE USEMEMCACHED_FALSE USEMEMCACHED_TRUE USELDAP_FALSE USELDAP_TRUE USEBDB_FALSE USEBDB_TRUE USEPERL_FALSE USEPERL_TRUE USE_REGEX_FALSE USE_REGEX_TRUE USE_OPENSSL_FALSE USE_OPENSSL_TRUE ISCYGWIN_FALSE ISCYGWIN_TRUE MODULES_CFLAGS MODULES_LIBADD PTHREADS_RWLOCK POSIX_SHARED_MEM POSIX_FILE_LOCK POSIX_SEMAPHORES POSIX_MAPPED_FILES SYSV_IPC USE_POLL DEFINE_INT64 DEFINE_UINT64 DEFINE_INT8 DEFINE_UINT8 DEFINE_SIZE_VOID_P DEFINE_SIZE_OFF_T DEFINE_OFF_T DEFINE_SIZE_T USE_REGEX INTTYPES_H SYS_TYPES_H PCRE_ADD_FLAG PCRE_ADD_LDADD PCRE_LNDIR_LDADD MEMCACHED_ADD_FLAG MEMCACHED_ADD_LDADD MEMCACHED_LNDIR_LDADD LDAP_ADD_FLAG LDAP_ADD_LDADD LDAP_LNDIR_LDADD BDB_ADD_FLAG BDB_ADD_LDADD BDB_LNDIR_LDADD BROTLI_ADD_FLAG BROTLI_ADD_LDADD BROTLI_LNDIR_LDADD BZLIB_ADD_FLAG BZLIB_ADD_LDADD BZLIB_LNDIR_LDADD ZLIB_ADD_FLAG ZLIB_ADD_LDADD ZLIB_LNDIR_LDADD DL_ADD_FLAG USE_OPENSSL OPENSSL_ADD_FLAG OPENSSL_ADD_LDADD OPENSSL_LNDIR_LDADD perlldflags perlccflags perllib perlcore doxygen_bin has_doxygen USE_COMPAT USE_IPV6 VISIBILITY_ATTR INVISIBILITY_CFLAG THREADS_LDFLAGS THREADS_LDADD C_ICAP_HEX_VERSION LIBTOOL_DEPS LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL OBJDUMP DLLTOOL AS EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE CICAPLIB_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_maintainer_mode enable_silent_rules enable_dependency_tracking enable_static enable_shared with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock enable_large_files enable_ipv6 enable_sysvipc enable_poll enable_lib_compat enable_rpath with_perl with_openssl with_zlib with_bzlib with_brotli with_bdb with_ldap with_memcached with_pcre ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP LT_SYS_LIBRARY_PATH' # 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_TARNAME}' 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 c_icap 0.5.6 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/c_icap] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of c_icap 0.5.6:";; esac 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] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-large-files Enable large files support --enable-ipv6 Enable ipv6 support --enable-sysvipc Enable SYSV/IPC for shared memory if supported --disable-poll Disable poll(2) support --enable-lib-compat Enable library compatibility with older c-icap versions --enable-rpath hardcode runtime library paths Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-perl Path to perl binary --with-openssl Path to openssl --with-zlib Path to zlib library --with-bzlib Path to bzlib library --with-brotli Path to brotli library --with-bdb Where to find Berkeley DB library --with-ldap Where to find LDAP libraries --with-memcached Where to find Memcached library --with-pcre Path to PCRE library 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 CPP C preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. 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 c_icap configure 0.5.6 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_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_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_c_preproc_warn_flag$ac_c_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_c_try_cpp # ac_fn_c_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_c_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_c_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_c_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_c_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_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_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_c_try_run # ac_fn_c_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_c_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_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_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_c_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_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { 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. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* 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 $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_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_c_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_c_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_c_check_type # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl 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 c_icap $as_me 0.5.6, 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 CICAPLIB_VERSION=5:6:0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ac_config_headers="$ac_config_headers autoconf.h" am__api_version='1.15' 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 whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; 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_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" $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 STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; 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_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip" $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_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" 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 STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P 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. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk 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_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # 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_AWK="$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 AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='c_icap' VERSION='0.5.6' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi 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=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_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi 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 depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi 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 { $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; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_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_c_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_c_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_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_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_c_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_c_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 \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi 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 { $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_c_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_c_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_c_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_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h for ac_prog in gawk mawk nawk awk 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_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # 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_AWK="$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 AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done 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 { $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=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_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi 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 depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes 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_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=no fi enable_dlopen=yes enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; 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_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # 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_AS="${ac_tool_prefix}as" $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 AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; 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_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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_AS="as" $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_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" 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 AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool" $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 DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_DLLTOOL="dlltool" $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" 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 DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump" $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 OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_OBJDUMP="objdump" $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_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" 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 OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_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 do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_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 '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "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_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_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_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_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 fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "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_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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_DUMPBIN="$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 DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" 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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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_DUMPBIN="$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_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" 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 DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump" $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 OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_OBJDUMP="objdump" $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_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" 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 OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool" $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 DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_DLLTOOL="dlltool" $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" 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 DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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_AR="$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 AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar 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_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_AR="$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_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" 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 AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; 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_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" $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 STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; 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_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip" $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_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" 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 STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; 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_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib" $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 RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; 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_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_RANLIB="ranlib" $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_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" 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 RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_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 do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_MANIFEST_TOOL="${ac_tool_prefix}mt" $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 MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_MANIFEST_TOOL="mt" $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_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" 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 MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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_DSYMUTIL="${ac_tool_prefix}dsymutil" $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 DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; 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_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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_DSYMUTIL="dsymutil" $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_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" 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 DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # 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_NMEDIT="${ac_tool_prefix}nmedit" $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 NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; 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_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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_NMEDIT="nmedit" $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_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" 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 NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; 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_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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_LIPO="${ac_tool_prefix}lipo" $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 LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; 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_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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_LIPO="lipo" $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_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" 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 LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; 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_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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_OTOOL="${ac_tool_prefix}otool" $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 OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; 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_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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_OTOOL="otool" $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_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" 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 OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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_OTOOL64="${ac_tool_prefix}otool64" $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 OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; 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_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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_OTOOL64="otool64" $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_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" 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 OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi link_all_deplibs=no else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=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_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=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_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=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_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi 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 CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: C_ICAP_HEX_VERSION=`echo $PACKAGE_VERSION | $AWK -f $srcdir/build/c_icap_version.awk` case "$host_os" in linux*) CFLAGS="-D_REENTRANT $CFLAGS" THREADS_LDADD="-lpthread" THREADS_LDFLAGS="" ;; solaris2.*) CFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS $CFLAGS" LIBS="-lsocket -lnsl -lrt $LIBS" THREADS_LDADD="-lpthread" THREADS_LDFLAGS="" ;; freebsd5*) ## If I understand how all those threading models works correctly ## in FreeBSD I will make an option in configure script ## --with-freebsd-threads={c_r,pthreads,linuxthreads,thr} ## If I am correct I must compile c-icap with the way ## external libraries are compiled. (The clamav uses -lc_r and I had problems ## using a different threading model) ## FreeBSD linuxthreads flags # CFLAGS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads $CFLAGS" # THREADS_LDADD="-llthread -lgcc_r" # THREADS_LDFLAGS="-L/usr/local/lib" ## FreeBSD Standard threads CFLAGS="-pthread -D_THREAD_SAFE $CFLAGS" THREADS_LDADD="-XCClinker -lc_r" THREADS_LDFLAGS="" ## FreeBSD has pthreads rwlocks from version 3 (I think) # AC_DEFINE(HAVE_PTHREADS_RWLOCK,1,[Define HAVE_PTHREADS_RWLOCK if pthreads library supports rwlocks]) ## 1:1 threads # CFLAGS="-D_THREAD_SAFE $CFLAGS" # THREADS_LDADD="-XCClinker -lthr" # THREADS_LDFLAGS="" ;; freebsd6*) CFLAGS="-D_THREAD_SAFE $CFLAGS" THREADS_LDADD="-XCClinker -lthr" THREADS_LDFLAGS="" ;; cygwin*) CFLAGS="-D_REENTRANT $CFLAGS" THREADS_LDADD="-lpthread" THREADS_LDFLAGS=""; iscygwin="yes" ;; *) CFLAGS="-D_REENTRANT $CFLAGS" THREADS_LDADD="-lpthread" THREADS_LDFLAGS="" ;; esac TEST_LIBS="$TEST_LIBS $THREADS_LDADD" cat >>confdefs.h <<_ACEOF #define C_ICAP_CONFIGURE_OPTIONS "$ac_configure_args" _ACEOF cat >>confdefs.h <<_ACEOF #define C_ICAP_CONFIG_HOST_TYPE "$host" _ACEOF CFLAGS="$CFLAGS -Wall" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__((visibility(\"default\")))" >&5 $as_echo_n "checking for __attribute__((visibility(\"default\")))... " >&6; } if ${ac_cv_default_visibility_attribute+:} false; then : $as_echo_n "(cached) " >&6 else echo 'int __attribute__ ((visibility ("default"))) foo_visible (void) { return 1; } int foo_invisible(void) {return 1;}' > conftest.c ac_cv_default_visibility_attribute=no if { ac_try='${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s 1>&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then if grep '\.hidden.*foo_invisible' conftest.s >/dev/null && ! grep '\.hidden.*foo_visible' conftest.s >/dev/null; then ac_cv_default_visibility_attribute=yes fi # Else try to detect visibility for Sun solaris: # CC -xldscope={global|hidden} # and use __global/__hidden inside C code # elif fi rm -f conftest.* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_default_visibility_attribute" >&5 $as_echo "$ac_cv_default_visibility_attribute" >&6; } INVISIBILITY_CFLAG="" VISIBILITY_ATTR="0" if test $ac_cv_default_visibility_attribute = yes; then $as_echo "#define HAVE_VISIBILITY_ATTRIBUTE 1" >>confdefs.h INVISIBILITY_CFLAG="-fvisibility=hidden" VISIBILITY_ATTR="1" fi # Check whether --enable-large_files was given. if test "${enable_large_files+set}" = set; then : enableval=$enable_large_files; if test $enableval = "yes"; then large_file_support="yes" else large_file_support="no" fi else large_file_support="yes" fi echo "checking whether large file support should enabled:"$large_file_support if test $large_file_support = "yes"; then CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" #here I must put a check if the -D_FILE_OFFSET_BITS makes the off_t an 64bit integer # and if not supported warning the user #Possibly checks for systems which supports large files using different defines.... #later ....... fi USE_IPV6="0" # Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then : enableval=$enable_ipv6; if test $enableval = "yes"; then ipv6_support="yes" $as_echo "#define HAVE_IPV6 1" >>confdefs.h USE_IPV6="1" fi else ipv6_support="no" fi # Check whether --enable-sysvipc was given. if test "${enable_sysvipc+set}" = set; then : enableval=$enable_sysvipc; if test $enableval = "yes"; then sysvipc="yes" else sysvipc="no" fi else sysvipc="yes" fi # Check whether --enable-poll was given. if test "${enable_poll+set}" = set; then : enableval=$enable_poll; if test $enableval = "no"; then enablepoll="no" else enablepoll="yes" fi else enablepoll="yes" fi USE_COMPAT="0" { $as_echo "$as_me:${as_lineno-$LINENO}: checking Keep library compatibility" >&5 $as_echo_n "checking Keep library compatibility... " >&6; } # Check whether --enable-lib_compat was given. if test "${enable_lib_compat+set}" = set; then : enableval=$enable_lib_compat; if test $enableval = "yes"; then lib_compat="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } USE_COMPAT="1" fi else lib_compat="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Checks for programs # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; 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_has_doxygen+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$has_doxygen"; then ac_cv_prog_has_doxygen="$has_doxygen" # 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_has_doxygen=""yes"" $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 test -z "$ac_cv_prog_has_doxygen" && ac_cv_prog_has_doxygen=""no"" fi fi has_doxygen=$ac_cv_prog_has_doxygen if test -n "$has_doxygen"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_doxygen" >&5 $as_echo "$has_doxygen" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test a"$has_doxygen" = "ayes"; then doxygen_bin=doxygen else doxygen_bin="echo Doxygen is not installed /" fi # Check if we need to enable rpath when linking with libraries # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; case "$enableval" in yes) enable_rpath="yes"; ;; no) enable_rpath="no"; ;; *) enable_rpath="yes"; # Build list with libraries to use rpath ENABLE_RPATH_LIBS=`echo $enableval| tr ';:,' ' '` echo "Enable rpath for libs:"$ENABLE_RPATH_LIBS # search into $ENABLE_RPATH_LIBS using: # if test "${ENABLE_RPATH_LIBS#*zlib}" != "$ENABLE_RPATH_LIBS"; then echo found; fi ;; esac else enable_rpath="no" fi #Routines used for checking libraries #Routines used for checking libraries # Checks for libraries # Check whether --with-perl was given. if test "${with_perl+set}" = set; then : withval=$with_perl; case "$withval" in yes) perlbin="perl" ;; no ) perlbin=""; perlcore=""; ;; * ) perlbin=$withval ;; esac else perlbin=""; perlcore=""; fi if test a"$perlbin" != a; then perlcore=`$perlbin -MConfig -e 'print $Config{archlib}'`/CORE; perllib=`$perlbin -MConfig -e 'print $Config{libs}'`; perlccflags=`$perlbin -MConfig -e 'print $Config{ccflags}'`; perlldflags=`$perlbin -MConfig -e 'print $Config{ccdlflags}'`; fi # Check whether --with-openssl was given. if test "${with_openssl+set}" = set; then : withval=$with_openssl; case "$withval" in yes) openssl=yes; ;; no) openssl=no; ;; *) openssl=yes; opensslpath=$withval; ;; esac else openssl=yes fi if test "a$openssl" != "ano"; then #save state ICFG_OLD_CFLAGS=$CFLAGS ICFG_OLD_LDFLAGS=$LDFLAGS ICFG_OLD_LIBS=$LIBS if test "a$opensslpath" != "a"; then CFLAGS="$CFLAGS -I$opensslpath/include" LDFLAGS="$LDFLAGS -L$opensslpath/lib" fi LIBS="-lssl -lcrypto $LIBS" (test -n "$opensslpath" && echo -n "checking for OpenSSL library under $opensslpath... ") || echo -n "checking for OpenSSL library... "; cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main(int argc, char *argv) { int ret = SSL_library_init(); return ret; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : openssl=yes; echo "yes"; else openssl=no; echo "no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "a$openssl" = "ayes"; then $as_echo "#define HAVE_OPENSSL 1" >>confdefs.h if test "a$opensslpath" != "a"; then # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n $opensslpath/include; then OPENSSL_ADD_FLAG=-I$opensslpath/include else OPENSSL_ADD_FLAG="" fi OPENSSL_LNDIR_LDADD="" if test -n $opensslpath/lib; then if test "a$enable_rpath" = "ayes"; then OPENSSL_ADD_LDADD="-Wl,-rpath -Wl,$opensslpath/lib -L$opensslpath/lib ""-lssl -lcrypto" else OPENSSL_ADD_LDADD="-L$opensslpath/lib ""-lssl -lcrypto" OPENSSL_LNDIR_LDADD="-L$opensslpath/lib ""-lssl -lcrypto" fi else OPENSSL_ADD_LDADD="-lssl -lcrypto" fi else # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n ""; then OPENSSL_ADD_FLAG=-I"" else OPENSSL_ADD_FLAG="" fi OPENSSL_LNDIR_LDADD="" if test -n ""; then if test "a$enable_rpath" = "ayes"; then OPENSSL_ADD_LDADD="-Wl,-rpath -Wl,"" -L"" ""-lssl -lcrypto" else OPENSSL_ADD_LDADD="-L"" ""-lssl -lcrypto" OPENSSL_LNDIR_LDADD="-L"" ""-lssl -lcrypto" fi else OPENSSL_ADD_LDADD="-lssl -lcrypto" fi fi fi #save state CFLAGS=$ICFG_OLD_CFLAGS LDFLAGS=$ICFG_OLD_LDFLAGS LIBS=$ICFG_OLD_LIBS fi USE_OPENSSL="1" if test a"$openssl" = "ano"; then USE_OPENSSL="0" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : DL_ADD_FLAG=" -ldl" fi # Check whether --with-zlib was given. if test "${with_zlib+set}" = set; then : withval=$with_zlib; case "$withval" in yes) zlib=yes; ;; no) zlib=no; ;; *) zlib=yes; zlibpath=$withval; ;; esac else zlib=yes fi if test "a$zlib" != "ano"; then #save state ICFG_OLD_CFLAGS=$CFLAGS ICFG_OLD_LDFLAGS=$LDFLAGS ICFG_OLD_LIBS=$LIBS if test "a$zlibpath" != "a"; then CFLAGS="$CFLAGS -I$zlib/include" LDFLAGS="$LDFLAGS -L$zlib/lib" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 $as_echo_n "checking for inflate in -lz... " >&6; } if ${ac_cv_lib_z_inflate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $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 inflate (); int main () { return inflate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_inflate=yes else ac_cv_lib_z_inflate=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_z_inflate" >&5 $as_echo "$ac_cv_lib_z_inflate" >&6; } if test "x$ac_cv_lib_z_inflate" = xyes; then : zlib=yes else zlib=no fi #save state CFLAGS=$ICFG_OLD_CFLAGS LDFLAGS=$ICFG_OLD_LDFLAGS LIBS=$ICFG_OLD_LIBS fi if test "a$zlib" = "ano"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"zlib required for the c-icap's internal filetype recognizer!\"" >&5 $as_echo "$as_me: WARNING: \"zlib required for the c-icap's internal filetype recognizer!\"" >&2;} else $as_echo "#define HAVE_ZLIB 1" >>confdefs.h if test "a$zlibpath" != "a"; then # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n $zlibpath/include; then ZLIB_ADD_FLAG=-I$zlibpath/include else ZLIB_ADD_FLAG="" fi ZLIB_LNDIR_LDADD="" if test -n $zlibpath/lib; then if test "a$enable_rpath" = "ayes"; then ZLIB_ADD_LDADD="-Wl,-rpath -Wl,$zlibpath/lib -L$zlibpath/lib ""-lz" else ZLIB_ADD_LDADD="-L$zlibpath/lib ""-lz" ZLIB_LNDIR_LDADD="-L$zlibpath/lib ""-lz" fi else ZLIB_ADD_LDADD="-lz" fi else # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n ""; then ZLIB_ADD_FLAG=-I"" else ZLIB_ADD_FLAG="" fi ZLIB_LNDIR_LDADD="" if test -n ""; then if test "a$enable_rpath" = "ayes"; then ZLIB_ADD_LDADD="-Wl,-rpath -Wl,"" -L"" ""-lz" else ZLIB_ADD_LDADD="-L"" ""-lz" ZLIB_LNDIR_LDADD="-L"" ""-lz" fi else ZLIB_ADD_LDADD="-lz" fi fi fi # Check whether --with-bzlib was given. if test "${with_bzlib+set}" = set; then : withval=$with_bzlib; case "$withval" in yes) bzlib=yes; ;; no) bzlib=no; ;; *) bzlib=yes; bzlibpath=$withval; ;; esac else bzlib=yes fi if test "a$bzlib" != "ano"; then #save state ICFG_OLD_CFLAGS=$CFLAGS ICFG_OLD_LDFLAGS=$LDFLAGS ICFG_OLD_LIBS=$LIBS if test "a$bzlibpath" != "a"; then CFLAGS="$CFLAGS -I$bzlibpath/include" LDFLAGS="$LDFLAGS -L$bzlibpath/lib" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompressInit in -lbz2" >&5 $as_echo_n "checking for BZ2_bzDecompressInit in -lbz2... " >&6; } if ${ac_cv_lib_bz2_BZ2_bzDecompressInit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $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 BZ2_bzDecompressInit (); int main () { return BZ2_bzDecompressInit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bz2_BZ2_bzDecompressInit=yes else ac_cv_lib_bz2_BZ2_bzDecompressInit=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_bz2_BZ2_bzDecompressInit" >&5 $as_echo "$ac_cv_lib_bz2_BZ2_bzDecompressInit" >&6; } if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = xyes; then : bzlib=yes else bzlib=no fi #save state CFLAGS=$ICFG_OLD_CFLAGS LDFLAGS=$ICFG_OLD_LDFLAGS LIBS=$ICFG_OLD_LIBS fi if test "a$bzlib" = "ano"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"bzlib required for the c-icap's internal filetype recognizer!\"" >&5 $as_echo "$as_me: WARNING: \"bzlib required for the c-icap's internal filetype recognizer!\"" >&2;} else $as_echo "#define HAVE_BZLIB 1" >>confdefs.h if test "a$bzlibpath" != "a"; then # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n $bzlibpath/include; then BZLIB_ADD_FLAG=-I$bzlibpath/include else BZLIB_ADD_FLAG="" fi BZLIB_LNDIR_LDADD="" if test -n $bzlibpath/lib; then if test "a$enable_rpath" = "ayes"; then BZLIB_ADD_LDADD="-Wl,-rpath -Wl,$bzlibpath/lib -L$bzlibpath/lib ""-lbz2" else BZLIB_ADD_LDADD="-L$bzlibpath/lib ""-lbz2" BZLIB_LNDIR_LDADD="-L$bzlibpath/lib ""-lbz2" fi else BZLIB_ADD_LDADD="-lbz2" fi else # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n ""; then BZLIB_ADD_FLAG=-I"" else BZLIB_ADD_FLAG="" fi BZLIB_LNDIR_LDADD="" if test -n ""; then if test "a$enable_rpath" = "ayes"; then BZLIB_ADD_LDADD="-Wl,-rpath -Wl,"" -L"" ""-lbz2" else BZLIB_ADD_LDADD="-L"" ""-lbz2" BZLIB_LNDIR_LDADD="-L"" ""-lbz2" fi else BZLIB_ADD_LDADD="-lbz2" fi fi fi # Check whether --with-brotli was given. if test "${with_brotli+set}" = set; then : withval=$with_brotli; case "$withval" in yes) brotli=yes; ;; no) brotli=no; ;; *) brotli=yes; brotlipath=$withval; ;; esac else brotli=yes fi if test "a$brotli" != "ano"; then #save state ICFG_OLD_CFLAGS=$CFLAGS ICFG_OLD_LDFLAGS=$LDFLAGS ICFG_OLD_LIBS=$LIBS if test "a$brotlipath" != "a"; then CFLAGS="$CFLAGS -I$brotlipath/include" LDFLAGS="$LDFLAGS -L$brotlipath/lib -lbrotlicommon" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BrotliDecoderDecompressStream in -lbrotlidec" >&5 $as_echo_n "checking for BrotliDecoderDecompressStream in -lbrotlidec... " >&6; } if ${ac_cv_lib_brotlidec_BrotliDecoderDecompressStream+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbrotlidec $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 BrotliDecoderDecompressStream (); int main () { return BrotliDecoderDecompressStream (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_brotlidec_BrotliDecoderDecompressStream=yes else ac_cv_lib_brotlidec_BrotliDecoderDecompressStream=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_brotlidec_BrotliDecoderDecompressStream" >&5 $as_echo "$ac_cv_lib_brotlidec_BrotliDecoderDecompressStream" >&6; } if test "x$ac_cv_lib_brotlidec_BrotliDecoderDecompressStream" = xyes; then : brotli=yes else brotli=no fi #save state CFLAGS=$ICFG_OLD_CFLAGS LDFLAGS=$ICFG_OLD_LDFLAGS LIBS=$ICFG_OLD_LIBS fi if test "a$brotli" = "ano"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"brotli required for the c-icap's internal filetype recognizer!\"" >&5 $as_echo "$as_me: WARNING: \"brotli required for the c-icap's internal filetype recognizer!\"" >&2;} else $as_echo "#define HAVE_BROTLI 1" >>confdefs.h if test "a"$brotlipath"" != "a"; then # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n "$brotlipath"/include; then BROTLI_ADD_FLAG=-I"$brotlipath"/include else BROTLI_ADD_FLAG="" fi BROTLI_LNDIR_LDADD="" if test -n "$brotlipath"/lib; then if test "a$enable_rpath" = "ayes"; then BROTLI_ADD_LDADD="-Wl,-rpath -Wl,"$brotlipath"/lib -L"$brotlipath"/lib ""-lbrotlicommon -lbrotlidec -lbrotlienc" else BROTLI_ADD_LDADD="-L"$brotlipath"/lib ""-lbrotlicommon -lbrotlidec -lbrotlienc" BROTLI_LNDIR_LDADD="-L"$brotlipath"/lib ""-lbrotlicommon -lbrotlidec -lbrotlienc" fi else BROTLI_ADD_LDADD="-lbrotlicommon -lbrotlidec -lbrotlienc" fi else # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n ""; then BROTLI_ADD_FLAG=-I"" else BROTLI_ADD_FLAG="" fi BROTLI_LNDIR_LDADD="" if test -n ""; then if test "a$enable_rpath" = "ayes"; then BROTLI_ADD_LDADD="-Wl,-rpath -Wl,"" -L"" ""-lbrotlicommon -lbrotlidec -lbrotlienc" else BROTLI_ADD_LDADD="-L"" ""-lbrotlicommon -lbrotlidec -lbrotlienc" BROTLI_LNDIR_LDADD="-L"" ""-lbrotlicommon -lbrotlidec -lbrotlienc" fi else BROTLI_ADD_LDADD="-lbrotlicommon -lbrotlidec -lbrotlienc" fi fi # fix BROTLI_LNDIR_LDADD the linker does not find brotlicommon even if # it is linked to libicapapi using rpath if test "a$brotlipath" != "a" -a "a$BROTLI_LNDIR_LDADD" = "a"; then BROTLI_LNDIR_LDADD="-L$brotlipath/lib -lbrotlicommon" fi fi libdb="yes" libdbpath="" # Check whether --with-bdb was given. if test "${with_bdb+set}" = set; then : withval=$with_bdb; case "$withval" in yes) libdb="yes" ;; no ) libdb="no" ;; * ) libdb="yes" libdbpath=$withval ;; esac fi if test "a$libdb" != "ano"; then if test "a$libdbpath" != "a"; then CFLAGS="-I$libdbpath/include $CFLAGS" LDFLAGS="-L$libdbpath/lib $LDFLAGS" fi # We are going to see if we can found a Berkeley DB located under a # libdbpath/include/db4x directory and use lbdbpath/lib/libdb-4.x library. #save state ICFG_OLD_CFLAGS=$CFLAGS ICFG_OLD_LDFLAGS=$LDFLAGS ICFG_OLD_LIBS=$LIBS OLD_LIBS=$LIBS for DBVER in "" 6 6.3 6.2 6.1 6.0 5 5.4 5.3 5.2 5.1 5.0 4 4.9 4.8 4.7 4.6 4.5 4.4 4.3 4.2; do if test -z $DBVER; then usedblib="-ldb" incdbdir="" else usedblib="-ldb-$DBVER" incdbdir=db`echo $DBVER|sed 's/\.//'`"/" fi if test -z "$libdbpath"; then print_libdbpath="..." else print_libdbpath="under $libdbpath..." fi echo -n "checking for BerleleyDB v$DBVER $print_libdbpath" LIBS="$usedblib $OLD_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <${incdbdir}db.h> int main(){ int major,minor,patch; if (!db_version(&major,&minor,&patch)) return -1; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : echo yes;libdb="yes"; else echo "no";libdb="no"; fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test a"$libdb" = "ayes"; then if test "a"$libdbpath"" != "a"; then # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n "$libdbpath"/include; then BDB_ADD_FLAG=-I"$libdbpath"/include else BDB_ADD_FLAG="" fi BDB_LNDIR_LDADD="" if test -n "$libdbpath"/lib; then if test "a$enable_rpath" = "ayes"; then BDB_ADD_LDADD="-Wl,-rpath -Wl,"$libdbpath"/lib -L"$libdbpath"/lib "$usedblib else BDB_ADD_LDADD="-L"$libdbpath"/lib "$usedblib BDB_LNDIR_LDADD="-L"$libdbpath"/lib "$usedblib fi else BDB_ADD_LDADD=$usedblib fi else # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n ""; then BDB_ADD_FLAG=-I"" else BDB_ADD_FLAG="" fi BDB_LNDIR_LDADD="" if test -n ""; then if test "a$enable_rpath" = "ayes"; then BDB_ADD_LDADD="-Wl,-rpath -Wl,"" -L"" "$usedblib else BDB_ADD_LDADD="-L"" "$usedblib BDB_LNDIR_LDADD="-L"" "$usedblib fi else BDB_ADD_LDADD=$usedblib fi fi $as_echo "#define HAVE_BDB 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define BDB_HEADER_PATH(incfile) <${incdbdir}incfile> _ACEOF break; fi done #save state CFLAGS=$ICFG_OLD_CFLAGS LDFLAGS=$ICFG_OLD_LDFLAGS LIBS=$ICFG_OLD_LIBS fi libldap="yes" # Check whether --with-ldap was given. if test "${with_ldap+set}" = set; then : withval=$with_ldap; case "$withval" in yes) libldap="yes" ;; no ) libldap="no" ;; * ) libldap="yes" libldappath=$withval ;; esac fi if test "a$libldap" != "ano"; then #save state ICFG_OLD_CFLAGS=$CFLAGS ICFG_OLD_LDFLAGS=$LDFLAGS ICFG_OLD_LIBS=$LIBS if test "a$libldappath" != "a"; then CFLAGS="$CFLAGS -I$libldappath/include" LDFLAGS="$LDFLAGS -L$libldappath/lib" fi useldaplib="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_search_ext_s in -lldap_r" >&5 $as_echo_n "checking for ldap_search_ext_s in -lldap_r... " >&6; } if ${ac_cv_lib_ldap_r_ldap_search_ext_s+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldap_r $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 ldap_search_ext_s (); int main () { return ldap_search_ext_s (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ldap_r_ldap_search_ext_s=yes else ac_cv_lib_ldap_r_ldap_search_ext_s=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_ldap_r_ldap_search_ext_s" >&5 $as_echo "$ac_cv_lib_ldap_r_ldap_search_ext_s" >&6; } if test "x$ac_cv_lib_ldap_r_ldap_search_ext_s" = xyes; then : libldap="yes";useldaplib="ldap_r" else libldap="no" fi if test "a$libldap" = "ano"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_search_ext_s in -lldap" >&5 $as_echo_n "checking for ldap_search_ext_s in -lldap... " >&6; } if ${ac_cv_lib_ldap_ldap_search_ext_s+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldap $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 ldap_search_ext_s (); int main () { return ldap_search_ext_s (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ldap_ldap_search_ext_s=yes else ac_cv_lib_ldap_ldap_search_ext_s=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_ldap_ldap_search_ext_s" >&5 $as_echo "$ac_cv_lib_ldap_ldap_search_ext_s" >&6; } if test "x$ac_cv_lib_ldap_ldap_search_ext_s" = xyes; then : libldap="yes";useldaplib="ldap" else libldap="no" fi fi if test "a$libldap" = "ayes"; then $as_echo "#define HAVE_LDAP 1" >>confdefs.h if test "a"$libldappath"" != "a"; then # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n "$libldappath"/include; then LDAP_ADD_FLAG=-I"$libldappath"/include else LDAP_ADD_FLAG="" fi LDAP_LNDIR_LDADD="" if test -n "$libldappath"/lib; then if test "a$enable_rpath" = "ayes"; then LDAP_ADD_LDADD="-Wl,-rpath -Wl,"$libldappath"/lib -L"$libldappath"/lib ""-l$useldaplib -llber" else LDAP_ADD_LDADD="-L"$libldappath"/lib ""-l$useldaplib -llber" LDAP_LNDIR_LDADD="-L"$libldappath"/lib ""-l$useldaplib -llber" fi else LDAP_ADD_LDADD="-l$useldaplib -llber" fi else # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n ""; then LDAP_ADD_FLAG=-I"" else LDAP_ADD_FLAG="" fi LDAP_LNDIR_LDADD="" if test -n ""; then if test "a$enable_rpath" = "ayes"; then LDAP_ADD_LDADD="-Wl,-rpath -Wl,"" -L"" ""-l$useldaplib -llber" else LDAP_ADD_LDADD="-L"" ""-l$useldaplib -llber" LDAP_LNDIR_LDADD="-L"" ""-l$useldaplib -llber" fi else LDAP_ADD_LDADD="-l$useldaplib -llber" fi fi fi #save state CFLAGS=$ICFG_OLD_CFLAGS LDFLAGS=$ICFG_OLD_LDFLAGS LIBS=$ICFG_OLD_LIBS fi # Detect memcached library libmemcached="yes" libmemcachedpath="" # Check whether --with-memcached was given. if test "${with_memcached+set}" = set; then : withval=$with_memcached; case "$withval" in yes) libmemcached="yes" ;; no ) libmemcached="no" ;; * ) libmemcachedpath=$withval libmemcached="yes" ;; esac fi if test a"$libmemcached" != "ano"; then #save state ICFG_OLD_CFLAGS=$CFLAGS ICFG_OLD_LDFLAGS=$LDFLAGS ICFG_OLD_LIBS=$LIBS if test a"$libmemcachedpath" != "a"; then CFLAGS="-l$libmemcachedpath/include $CFLAGS" fi for ac_header in libmemcached/memcached.h do : ac_fn_c_check_header_mongrel "$LINENO" "libmemcached/memcached.h" "ac_cv_header_libmemcached_memcached_h" "$ac_includes_default" if test "x$ac_cv_header_libmemcached_memcached_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBMEMCACHED_MEMCACHED_H 1 _ACEOF libmemcached="yes" else libmemcached="no" fi done if test "a$libmemcached" = "ayes"; then if test "a"$libmemcachedpath"" != "a"; then # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n "$libmemcachedpath"/include; then MEMCACHED_ADD_FLAG=-I"$libmemcachedpath"/include else MEMCACHED_ADD_FLAG="" fi MEMCACHED_LNDIR_LDADD="" if test -n "$libmemcachedpath"/lib; then if test "a$enable_rpath" = "ayes"; then MEMCACHED_ADD_LDADD="-Wl,-rpath -Wl,"$libmemcachedpath"/lib -L"$libmemcachedpath"/lib ""-lmemcached -lmemcachedutil" else MEMCACHED_ADD_LDADD="-L"$libmemcachedpath"/lib ""-lmemcached -lmemcachedutil" MEMCACHED_LNDIR_LDADD="-L"$libmemcachedpath"/lib ""-lmemcached -lmemcachedutil" fi else MEMCACHED_ADD_LDADD="-lmemcached -lmemcachedutil" fi else # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n ""; then MEMCACHED_ADD_FLAG=-I"" else MEMCACHED_ADD_FLAG="" fi MEMCACHED_LNDIR_LDADD="" if test -n ""; then if test "a$enable_rpath" = "ayes"; then MEMCACHED_ADD_LDADD="-Wl,-rpath -Wl,"" -L"" ""-lmemcached -lmemcachedutil" else MEMCACHED_ADD_LDADD="-L"" ""-lmemcached -lmemcachedutil" MEMCACHED_LNDIR_LDADD="-L"" ""-lmemcached -lmemcachedutil" fi else MEMCACHED_ADD_LDADD="-lmemcached -lmemcachedutil" fi fi fi #save state CFLAGS=$ICFG_OLD_CFLAGS LDFLAGS=$ICFG_OLD_LDFLAGS LIBS=$ICFG_OLD_LIBS fi # Check for PCRE regex library # Check whether --with-pcre was given. if test "${with_pcre+set}" = set; then : withval=$with_pcre; case "$withval" in yes) pcre=yes; ;; no) pcre=no; ;; *) pcre=yes; pcrepath=$withval; ;; esac else pcre=yes fi if test a"$pcre" != "ano"; then #save state ICFG_OLD_CFLAGS=$CFLAGS ICFG_OLD_LDFLAGS=$LDFLAGS ICFG_OLD_LIBS=$LIBS if test "a$pcrepath" != "a"; then CFLAGS="$CFLAGS -I$pcrepath/include" LDFLAGS="$LDFLAGS -L$pcrepath/lib" fi for ac_header in pcre.h do : ac_fn_c_check_header_mongrel "$LINENO" "pcre.h" "ac_cv_header_pcre_h" "$ac_includes_default" if test "x$ac_cv_header_pcre_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PCRE_H 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_exec in -lpcre" >&5 $as_echo_n "checking for pcre_exec in -lpcre... " >&6; } if ${ac_cv_lib_pcre_pcre_exec+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpcre $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 pcre_exec (); int main () { return pcre_exec (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pcre_pcre_exec=yes else ac_cv_lib_pcre_pcre_exec=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_pcre_pcre_exec" >&5 $as_echo "$ac_cv_lib_pcre_pcre_exec" >&6; } if test "x$ac_cv_lib_pcre_pcre_exec" = xyes; then : pcre=yes else pcre=no fi else pcre=no fi done if test "a$pcre" = "ayes"; then $as_echo "#define HAVE_PCRE 1" >>confdefs.h if test "a"$pcrepath"" != "a"; then # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n "$pcrepath"/include; then PCRE_ADD_FLAG=-I"$pcrepath"/include else PCRE_ADD_FLAG="" fi PCRE_LNDIR_LDADD="" if test -n "$pcrepath"/lib; then if test "a$enable_rpath" = "ayes"; then PCRE_ADD_LDADD="-Wl,-rpath -Wl,"$pcrepath"/lib -L"$pcrepath"/lib ""-lpcre" else PCRE_ADD_LDADD="-L"$pcrepath"/lib ""-lpcre" PCRE_LNDIR_LDADD="-L"$pcrepath"/lib ""-lpcre" fi else PCRE_ADD_LDADD="-lpcre" fi else # The *_LNDIR_LDADD used by external programs to link with cicapapi libibrary. # They must link with libraries options if the cicapapi is not linked with # -rpath option and not standard directories are used. # TODO: support multiple directories if test -n ""; then PCRE_ADD_FLAG=-I"" else PCRE_ADD_FLAG="" fi PCRE_LNDIR_LDADD="" if test -n ""; then if test "a$enable_rpath" = "ayes"; then PCRE_ADD_LDADD="-Wl,-rpath -Wl,"" -L"" ""-lpcre" else PCRE_ADD_LDADD="-L"" ""-lpcre" PCRE_LNDIR_LDADD="-L"" ""-lpcre" fi else PCRE_ADD_LDADD="-lpcre" fi fi fi #save state CFLAGS=$ICFG_OLD_CFLAGS LDFLAGS=$ICFG_OLD_LDFLAGS LIBS=$ICFG_OLD_LIBS fi # Check for header files { $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_c_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_c_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 for ac_header in strings.h unistd.h sys/stat.h limits.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 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 SYS_TYPES_H="0" for ac_header in sys/types.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" if test "x$ac_cv_header_sys_types_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_TYPES_H 1 _ACEOF $as_echo "#define HAVE_SYS_TYPES_H 1" >>confdefs.h SYS_TYPES_H="1" fi done INTTYPES_H="0" for ac_header in inttypes.h do : ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" if test "x$ac_cv_header_inttypes_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H 1 _ACEOF $as_echo "#define HAVE_INTTYPES_H 1" >>confdefs.h INTTYPES_H="1" fi done posix_regex=no for ac_header in regex.h do : ac_fn_c_check_header_mongrel "$LINENO" "regex.h" "ac_cv_header_regex_h" "$ac_includes_default" if test "x$ac_cv_header_regex_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_REGEX_H 1 _ACEOF posix_regex=yes; $as_echo "#define HAVE_REGEX 1" >>confdefs.h else posix_regex=no fi done USE_REGEX=0 if test "a$pcre" = "ayes" -o "a$posix_regex" = "ayes"; then USE_REGEX=1 fi # Checks for typedefs, structures, and compiler characteristics. { $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_c_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 DEFINE_SIZE_T="0" ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else DEFINE_SIZE_T="1" fi DEFINE_OFF_T="0" ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes; then : else DEFINE_OFF_T="1" fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 $as_echo_n "checking size of off_t... " >&6; } if ${ac_cv_sizeof_off_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : else if test "$ac_cv_type_off_t" = yes; then { { $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 "cannot compute sizeof (off_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_off_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 $as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF DEFINE_SIZE_OFF_T=$ac_cv_sizeof_off_t # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 $as_echo_n "checking size of void *... " >&6; } if ${ac_cv_sizeof_void_p+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : else if test "$ac_cv_type_void_p" = yes; then { { $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 "cannot compute sizeof (void *) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_void_p=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 $as_echo "$ac_cv_sizeof_void_p" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF DEFINE_SIZE_VOID_P=$ac_cv_sizeof_void_p DEFINE_UINT8="0" ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "$ac_includes_default" if test "x$ac_cv_type_uint8_t" = xyes; then : else DEFINE_UINT8="1" fi DEFINE_INT8="0" ac_fn_c_check_type "$LINENO" "int8_t" "ac_cv_type_int8_t" "$ac_includes_default" if test "x$ac_cv_type_int8_t" = xyes; then : else DEFINE_INT8="1" fi DEFINE_UINT64="0" ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "$ac_includes_default" if test "x$ac_cv_type_uint64_t" = xyes; then : else DEFINE_UINT64="1" fi DEFINE_INT64="0" ac_fn_c_check_type "$LINENO" "int64_t" "ac_cv_type_int64_t" "$ac_includes_default" if test "x$ac_cv_type_int64_t" = xyes; then : else DEFINE_INT64="1" fi #some type size (currently they are not used) # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 $as_echo_n "checking size of short... " >&6; } if ${ac_cv_sizeof_short+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : else if test "$ac_cv_type_short" = yes; then { { $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 "cannot compute sizeof (short) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 $as_echo "$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF DEFINE_SIZEOFF_SHORT=$ac_cv_sizeof_short # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $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 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF DEFINE_SIZEOFF_INT=$ac_cv_sizeof_int # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $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 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF DEFINE_SIZEOFF_LONG=$ac_cv_sizeof_long # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 $as_echo_n "checking size of long long... " >&6; } if ${ac_cv_sizeof_long_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long_long" = yes; then { { $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 "cannot compute sizeof (long long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 $as_echo "$ac_cv_sizeof_long_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF DEFINE_SIZEOFF_LONG_LONG=$ac_cv_sizeof_long_long # Checks for library functions. #Here we are changing the LIBS variable and save the current value to OLD_LIBS variable EXTRALIBS="" OLD_LIBS="$LIBS" LIBS="$LIBS $TEST_LIBS" #AC_FUNC_VPRINTF for ac_func in nanosleep do : ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" if test "x$ac_cv_func_nanosleep" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NANOSLEEP 1 _ACEOF $as_echo "#define HAVE_NANOSLEEP 1" >>confdefs.h fi done for ac_func in inet_aton do : ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton" if test "x$ac_cv_func_inet_aton" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INET_ATON 1 _ACEOF $as_echo "#define HAVE_INET_ATON 1" >>confdefs.h fi done for ac_func in strnstr do : ac_fn_c_check_func "$LINENO" "strnstr" "ac_cv_func_strnstr" if test "x$ac_cv_func_strnstr" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRNSTR 1 _ACEOF $as_echo "#define HAVE_STRNSTR 1" >>confdefs.h fi done for ac_func in strcasestr do : ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr" if test "x$ac_cv_func_strcasestr" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRCASESTR 1 _ACEOF $as_echo "#define HAVE_STRCASESTR 1" >>confdefs.h fi done for ac_func in strncasestr do : ac_fn_c_check_func "$LINENO" "strncasestr" "ac_cv_func_strncasestr" if test "x$ac_cv_func_strncasestr" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRNCASESTR 1 _ACEOF $as_echo "#define HAVE_STRNCASESTR 1" >>confdefs.h fi done for ac_func in setgroups do : ac_fn_c_check_func "$LINENO" "setgroups" "ac_cv_func_setgroups" if test "x$ac_cv_func_setgroups" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SETGROUPS 1 _ACEOF fi done ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" if test "x$ac_cv_have_decl_strerror_r" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R $ac_have_decl _ACEOF for ac_func in strerror_r do : ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" if test "x$ac_cv_func_strerror_r" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR_R 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 $as_echo_n "checking whether strerror_r returns char *... " >&6; } if ${ac_cv_func_strerror_r_char_p+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); return !p || x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_strerror_r_char_p=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else # strerror_r is not declared. Choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default extern char *strerror_r (); int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); return ! isalpha (x); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strerror_r_char_p=yes 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_func_strerror_r_char_p" >&5 $as_echo "$ac_cv_func_strerror_r_char_p" >&6; } if test $ac_cv_func_strerror_r_char_p = yes; then $as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h fi USE_POLL="0" if test a"$enablepoll" != "ano"; then for ac_header in poll.h do : ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" if test "x$ac_cv_header_poll_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_POLL_H 1 _ACEOF for ac_func in poll do : ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll" if test "x$ac_cv_func_poll" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_POLL 1 _ACEOF USE_POLL="1" fi done fi done fi # if test a"$USE_POLL" = "1"; then # AC_DEFINE(HAVE_POLL,1,[Define HAVE_POLL if poll(2) exists and we can use it]) # fi #sysv ipc SYSV_IPC="0" for ac_header in sys/ipc.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/ipc.h" "ac_cv_header_sys_ipc_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ipc_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_IPC_H 1 _ACEOF $as_echo "#define HAVE_SYSV_IPC 1" >>confdefs.h SYSV_IPC="1" fi done POSIX_MAPPED_FILES="0" for ac_func in mmap munmap do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF $as_echo "#define HAVE_POSIX_MAPPED_FILES 1" >>confdefs.h POSIX_MAPPED_FILES="1" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking if union semun defined" >&5 $as_echo_n "checking if union semun defined... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { union semun a_semun; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_UNION_SEMUN 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking if posix 1003.1b interprocess semaphores works" >&5 $as_echo_n "checking if posix 1003.1b interprocess semaphores works... " >&6; } if ${ac_cv_10031b_ipc_sem+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : as_fn_error $? "cross-compiling, presetting ac_cv_10031b_ipc_sem=(yes|no) will help" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main(int argc,char **argv){ sem_t s; pid_t pid; int status; if(sem_init(&s,1,1)!=0){ return -1; } if((pid=fork())==0){ if(sem_post(&s)<0){ exit(-1); } exit(0); } else { waitpid(pid,&status,0); if(WEXITSTATUS(status)!=0) exit(-1); } sem_destroy(&s); exit(0); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_10031b_ipc_sem=yes else ac_cv_10031b_ipc_sem=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_10031b_ipc_sem" >&5 $as_echo "$ac_cv_10031b_ipc_sem" >&6; } if test $ac_cv_10031b_ipc_sem = yes; then : $as_echo "#define HAVE_POSIX_SEMAPHORES 1" >>confdefs.h POSIX_SEMAPHORES="1" else POSIX_SEMAPHORES="0" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl file locking works" >&5 $as_echo_n "checking if fcntl file locking works... " >&6; } if ${ac_cv_fcntl+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : as_fn_error $? "cross-compiling, presetting ac_cv_fcntl=(yes|no) will help" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main(int argc,char **argv){ struct flock fl; int fd; fd=open("autoconf.h.in",O_RDWR); fl.l_type=F_WRLCK; fl.l_whence=SEEK_SET; fl.l_start=0; fl.l_len=0; if(fcntl(fd,F_SETLKW,&fl)<0){ close(fd); return -1; } close(fd); return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_fcntl=yes else ac_cv_fcntl=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fcntl" >&5 $as_echo "$ac_cv_fcntl" >&6; } if test $ac_cv_fcntl = yes; then : $as_echo "#define HAVE_POSIX_FILE_LOCK 1" >>confdefs.h POSIX_FILE_LOCK="1" else POSIX_FILE_LOCK="0" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if posix shared mem works" >&5 $as_echo_n "checking if posix shared mem works... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { int fd = shm_open("foo", O_CREAT|O_RDWR, S_IRUSR | S_IWUSR); if (fd < 0) return 0; if (shm_unlink("foo") < 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_POSIX_SHARED_MEM 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } POSIX_SHARED_MEM="1" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } POSIX_SHARED_MEM="0" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test a"$POSIX_SHARED_MEM" = "a1"; then # Linux and solaris define the shm_open in -rt library. # This library already included in LIBS for solaris case "$host_os" in linux*) EXTRALIBS="$EXTRALIBS -lrt" ;; *) esac fi #pthread_rwlock PTHREADS_RWLOCK="0" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if have pthread_rwlock" >&5 $as_echo_n "checking if have pthread_rwlock... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { pthread_rwlock_t lock; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_PTHREADS_RWLOCK 1" >>confdefs.h PTHREADS_RWLOCK="1" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #We are pouting back real LIBS variable LIBS=$OLD_LIBS LIBS="$LIBS $EXTRALIBS" #Configure common flags MODULES_LIBADD="" if test a"$iscygwin" != a; then MODULES_LIBADD="-L../../ -licapapi" fi MODULES_CFLAGS="$INVISIBILITY_CFLAG -DCI_BUILD_MODULE" #general parameters if test a"$iscygwin" != a; then ISCYGWIN_TRUE= ISCYGWIN_FALSE='#' else ISCYGWIN_TRUE='#' ISCYGWIN_FALSE= fi # Now determine which modules will going to build ..... if test a"$openssl" != "ano"; then USE_OPENSSL_TRUE= USE_OPENSSL_FALSE='#' else USE_OPENSSL_TRUE='#' USE_OPENSSL_FALSE= fi if test a"$pcre" = "ayes" -o a"$posix_regex" = "ayes"; then USE_REGEX_TRUE= USE_REGEX_FALSE='#' else USE_REGEX_TRUE='#' USE_REGEX_FALSE= fi if test a"$perlcore" != a; then USEPERL_TRUE= USEPERL_FALSE='#' else USEPERL_TRUE='#' USEPERL_FALSE= fi if test a"$libdb" != ano; then USEBDB_TRUE= USEBDB_FALSE='#' else USEBDB_TRUE='#' USEBDB_FALSE= fi if test a"$libldap" != ano; then USELDAP_TRUE= USELDAP_FALSE='#' else USELDAP_TRUE='#' USELDAP_FALSE= fi if test a"$libmemcached" != ano; then USEMEMCACHED_TRUE= USEMEMCACHED_FALSE='#' else USEMEMCACHED_TRUE='#' USEMEMCACHED_FALSE= fi if test "a$enable_rpath" != "ano"; then USE_RPATH_TRUE= USE_RPATH_FALSE='#' else USE_RPATH_TRUE='#' USE_RPATH_FALSE= fi ac_config_files="$ac_config_files include/c-icap-conf.h Makefile utils/Makefile services/Makefile services/echo/Makefile services/ex-206/Makefile modules/Makefile tests/Makefile docs/Makefile docs/man/Makefile" 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= 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 if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ISCYGWIN_TRUE}" && test -z "${ISCYGWIN_FALSE}"; then as_fn_error $? "conditional \"ISCYGWIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_OPENSSL_TRUE}" && test -z "${USE_OPENSSL_FALSE}"; then as_fn_error $? "conditional \"USE_OPENSSL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_REGEX_TRUE}" && test -z "${USE_REGEX_FALSE}"; then as_fn_error $? "conditional \"USE_REGEX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USEPERL_TRUE}" && test -z "${USEPERL_FALSE}"; then as_fn_error $? "conditional \"USEPERL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USEBDB_TRUE}" && test -z "${USEBDB_FALSE}"; then as_fn_error $? "conditional \"USEBDB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USELDAP_TRUE}" && test -z "${USELDAP_FALSE}"; then as_fn_error $? "conditional \"USELDAP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USEMEMCACHED_TRUE}" && test -z "${USEMEMCACHED_FALSE}"; then as_fn_error $? "conditional \"USEMEMCACHED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_RPATH_TRUE}" && test -z "${USE_RPATH_FALSE}"; then as_fn_error $? "conditional \"USE_RPATH\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${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 c_icap $as_me 0.5.6, 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" config_commands="$ac_config_commands" _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 Configuration commands: $config_commands 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="\\ c_icap config.status 0.5.6 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' MKDIR_P='$MKDIR_P' AWK='$AWK' 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 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _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 "autoconf.h") CONFIG_HEADERS="$CONFIG_HEADERS autoconf.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "include/c-icap-conf.h") CONFIG_FILES="$CONFIG_FILES include/c-icap-conf.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; "services/Makefile") CONFIG_FILES="$CONFIG_FILES services/Makefile" ;; "services/echo/Makefile") CONFIG_FILES="$CONFIG_FILES services/echo/Makefile" ;; "services/ex-206/Makefile") CONFIG_FILES="$CONFIG_FILES services/ex-206/Makefile" ;; "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/man/Makefile") CONFIG_FILES="$CONFIG_FILES docs/man/Makefile" ;; *) 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 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands 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 :C $CONFIG_COMMANDS" 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 ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; 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 s&@MKDIR_P@&$ac_MKDIR_P&;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 # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Whether or not to build static libraries. build_old_libs=$enable_static # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; 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 c_icap-0.5.6/compile0000755000175000017500000001624513570504056011254 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: c_icap-0.5.6/header.c0000664000175000017500000004753213541156313011274 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include #include #include #include "debug.h" #include "header.h" const char *ci_common_headers[] = { "Cache-Control", "Connection", "Date", "Expires", "Pragma", "Trailer", "Upgrade", /*And ICAP speciffic headers ..... */ "Encapsulated" }; const char *ci_methods[] = { "", /*0x00 */ "OPTIONS", /*0x01 */ "REQMOD", /*0x02 */ "", /*0x03 */ "RESPMOD" /*0x04 */ }; const char *ci_request_headers[] = { "Authorization", "Allow", "From", "Host", /*REQUIRED ...... */ "Referer", "User-Agent", /*And ICAP specific headers ..... */ "Preview" }; const char *ci_responce_headers[] = { "Server", /*ICAP spacific headers */ "ISTag" }; const char *ci_options_headers[] = { "Methods", "Service", "ISTag", "Encapsulated", "Opt-body-type", "Max-Connections", "Options-TTL", "Date", "Service-ID", "Allow", "Preview", "Transfer-Preview", "Transfer-Ignore", "Transfer-Complete" }; const struct ci_error_code ci_error_codes[] = { {100, "Continue"}, /*Continue after ICAP Preview */ {200, "OK"}, {204, "Unmodified"}, /*No modifications needed */ {206, "Partial Content"}, /*Partial content modification*/ {400, "Bad request"}, /*Bad request */ {401, "Unauthorized"}, {403, "Forbidden"}, {404, "Service not found"}, /*ICAP Service not found */ {405, "Not allowed"}, /*Method not allowed for service (e.g., RESPMOD requested for service that supports only REQMOD). */ {407, "Authentication Required"}, {408, "Request timeout"}, /*Request timeout. ICAP server gave up waiting for a request from an ICAP client */ {500, "Server error"}, /*Server error. Error on the ICAP server, such as "out of disk space" */ {501, "Not implemented"}, /*Method not implemented. This response is illegal for an OPTIONS request since implementation of OPTIONS is mandatory. */ {502, "Bad Gateway"}, /*Bad Gateway. This is an ICAP proxy and proxying produced an error. */ {503, "Service overloaded"}, /*Service overloaded. The ICAP server has exceeded a maximum connection limit associated with this service; the ICAP client should not exceed this limit in the future. */ {505, "Unsupported version"} /*ICAP version not supported by server. */ }; /* #ifdef __CYGWIN__ int ci_error_code(int ec){ return (ec >= EC_100 && ec < EC_MAX ? ci_error_codes[ec].code:1000); } const char *unknownerrorcode = "UNKNOWN ERROR CODE"; const char *ci_error_code_string(int ec){ return (ec >= EC_100 && ec < EC_MAX?ci_error_codes[ec].str:unknownerrorcode); } #endif */ const char *ci_encaps_entities[] = { "req-hdr", "res-hdr", "req-body", "res-body", "null-body", "opt-body" }; #ifdef __CYGWIN__ const char *unknownentity = "UNKNOWN"; const char *unknownmethod = "UNKNOWN"; const char *ci_method_string(int method) { return (method <= ICAP_RESPMOD && method >= ICAP_OPTIONS ? CI_Methods[method] : unknownmethod); } const char *ci_encaps_entity_string(int e) { return (e <= ICAP_OPT_BODY && e >= ICAP_REQ_HDR ? CI_EncapsEntities[e] : unknownentity); } #endif ci_headers_list_t *ci_headers_create() { ci_headers_list_t *h; h = malloc(sizeof(ci_headers_list_t)); if (!h) { ci_debug_printf(1, "Error allocation memory for ci_headers_list_t (header.c: ci_headers_create)\n"); return NULL; } h->headers = NULL; h->buf = NULL; if (!(h->headers = malloc(HEADERSTARTSIZE * sizeof(char *))) || !(h->buf = malloc(HEADSBUFSIZE * sizeof(char)))) { ci_debug_printf(1, "Server Error: Error allocation memory \n"); if (h->headers) free(h->headers); if (h->buf) free(h->buf); free(h); return NULL; } h->size = HEADERSTARTSIZE; h->used = 0; h->bufsize = HEADSBUFSIZE; h->bufused = 0; h->packed = 0; return h; } void ci_headers_destroy(ci_headers_list_t * h) { free(h->headers); free(h->buf); free(h); } int ci_headers_setsize(ci_headers_list_t * h, int size) { char *newbuf; int new_size; if (size < h->bufsize) return 1; /*Allocate buffer of size multiple of HEADSBUFSIZE */ new_size = (size / HEADSBUFSIZE + 1) * HEADSBUFSIZE; newbuf = realloc(h->buf, new_size * sizeof(char)); if (!newbuf) { ci_debug_printf(1, "Server Error:Error allocation memory \n"); return 0; } h->buf = newbuf; h->bufsize = new_size; return 1; } void ci_headers_reset(ci_headers_list_t * h) { h->packed = 0; h->used = 0; h->bufused = 0; } const char *ci_headers_add(ci_headers_list_t * h, const char *line) { char *newhead, **newspace, *newbuf; int len, linelen; int i = 0; if (h->packed) { /*Not in edit mode*/ return NULL; } if (h->used == h->size) { len = h->size + HEADERSTARTSIZE; newspace = realloc(h->headers, len * sizeof(char *)); if (!newspace) { ci_debug_printf(1, "Server Error:Error allocation memory \n"); return NULL; } h->headers = newspace; h->size = len; } linelen = strlen(line); len = h->bufsize; while ( len - h->bufused < linelen + 4 ) len += HEADSBUFSIZE; if (len > h->bufsize) { newbuf = realloc(h->buf, len * sizeof(char)); if (!newbuf) { ci_debug_printf(1, "Server Error:Error allocation memory \n"); return NULL; } h->buf = newbuf; h->bufsize = len; h->headers[0] = h->buf; for (i = 1; i < h->used; i++) h->headers[i] = h->headers[i - 1] + strlen(h->headers[i - 1]) + 2; } newhead = h->buf + h->bufused; strcpy(newhead, line); h->bufused += linelen + 2; //2 char size for \r\n at the end of each header *(newhead + linelen + 1) = '\n'; *(newhead + linelen + 3) = '\n'; if (newhead) h->headers[h->used++] = newhead; return newhead; } int ci_headers_addheaders(ci_headers_list_t * h, const ci_headers_list_t * headers) { int len, i; char *newbuf, **newspace; if (h->packed) { /*Not in edit mode*/ return 0; } len = h->size; while ( len - h->used < headers->used ) len += HEADERSTARTSIZE; if ( len > h->size ) { newspace = realloc(h->headers, len * sizeof(char *)); if (!newspace) { ci_debug_printf(1, "Server Error: Error allocating memory \n"); return 0; } h->headers = newspace; h->size = len; } len = h->bufsize; while (len - h->bufused < headers->bufused + 2) len += HEADSBUFSIZE; if (len > h->bufsize) { newbuf = realloc(h->buf, len * sizeof(char)); if (!newbuf) { ci_debug_printf(1, "Server Error: Error allocating memory \n"); return 0; } h->buf = newbuf; h->bufsize = len; } memcpy(h->buf + h->bufused, headers->buf, headers->bufused + 2); h->bufused += headers->bufused; h->used += headers->used; h->headers[0] = h->buf; for (i = 1; i < h->used; i++) h->headers[i] = h->headers[i - 1] + strlen(h->headers[i - 1]) + 2; return 1; } const char *ci_headers_first_line2(ci_headers_list_t *h, size_t *return_size) { const char *eol; if (h->used == 0) return NULL; eol = h->used > 1 ? (h->headers[1] - 1) : (h->buf + h->bufused); while ((eol > h->buf) && (*eol == '\0' || *eol == '\r' || *eol == '\n')) --eol; *return_size = eol - h->buf + 1; return h->buf; } const char *ci_headers_first_line(ci_headers_list_t *h) { if (h->used == 0) return NULL; return h->buf; } static const char *do_header_search(ci_headers_list_t * h, const char *header, const char **value, const char **end) { int i; size_t header_size = strlen(header); const char *h_end = (h->buf + h->bufused); const char *check_head, *lval; if (!header_size) return NULL; for (i = 0; i < h->used; i++) { check_head = h->headers[i]; if (h_end < check_head + header_size) return NULL; if (*(check_head + header_size) != ':') continue; if (strncasecmp(check_head, header, header_size) == 0) { lval = check_head + header_size + 1; if (value) { while (lval <= h_end && (*lval == ' ' || *lval == '\t')) ++(lval); *value = lval; } if (end) { *end = (i < h->used -1) ? (h->headers[i + 1] - 1) : (h->buf + h->bufused - 1); if (*end < lval) /*parse error in headers ?*/ return NULL; while ((*end > lval) && (**end == '\0' || **end == '\r' || **end == '\n')) --(*end); } return check_head; } } return NULL; } const char *ci_headers_search(ci_headers_list_t * h, const char *header) { return do_header_search(h, header, NULL, NULL); } const char *ci_headers_search2(ci_headers_list_t * h, const char *header, size_t *return_size) { const char *phead, *pend = NULL; if ((phead = do_header_search(h, header, NULL, &pend))) { *return_size = (pend != NULL) ? (pend - phead + 1) : 0; return phead; } *return_size = 0; return NULL; } const char *ci_headers_value(ci_headers_list_t * h, const char *header) { const char *pval, *phead; pval = NULL; if ((phead = do_header_search(h, header, &pval, NULL))) return pval; return NULL; } const char *ci_headers_value2(ci_headers_list_t * h, const char *header, size_t *return_size) { const char *pval, *phead, *pend = NULL; pval = NULL; if ((phead = do_header_search(h, header, &pval, &pend))) { *return_size = (pend != NULL) ? (pend - pval + 1) : 0; return pval; } return NULL; } const char *ci_headers_copy_value(ci_headers_list_t * h, const char *header, char *buf, size_t len) { const char *phead = NULL, *pval = NULL, *pend = NULL; char *dest, *dest_end; phead = do_header_search(h, header, &pval, &pend); if (phead == NULL || pval == NULL || pend == NULL) return NULL; /*skip spaces at the beginning*/ while (isspace(*pval) && pval < pend) pval++; while (isspace(*pend) && pend > pval) pend--; /*copy value to buf*/ dest = buf; dest_end = buf + len -1; for (; dest < dest_end && pval <= pend; dest++, pval++) *dest = *pval; *dest = '\0'; return buf; } int ci_headers_remove(ci_headers_list_t * h, const char *header) { const char *h_end; char *phead; int i, j, cur_head_size, rest_len; size_t header_size; if (h->packed) { /*Not in edit mode*/ return 0; } h_end = (h->buf + h->bufused); header_size = strlen(header); for (i = 0; i < h->used; i++) { phead = h->headers[i]; if (h_end < phead + header_size) return 0; if (*(phead + header_size) != ':') continue; if (strncasecmp(phead, header, header_size) == 0) { /*remove it........ */ if (i == h->used - 1) { phead = h->headers[i]; *phead = '\r'; *(phead + 1) = '\n'; h->bufused = (phead - h->buf); (h->used)--; return 1; } else { cur_head_size = h->headers[i + 1] - h->headers[i]; rest_len = h->bufused - (h->headers[i] - h->buf) - cur_head_size; ci_debug_printf(5, "remove_header : remain len %d\n", rest_len); memmove(phead, h->headers[i + 1], rest_len); /*reconstruct index..... */ h->bufused -= cur_head_size; (h->used)--; for (j = i + 1; j < h->used; j++) { cur_head_size = strlen(h->headers[j - 1]); h->headers[j] = h->headers[j - 1] + cur_head_size + 1; if (h->headers[j][0] == '\n') (h->headers[j])++; } return 1; } } } return 0; } const char *ci_headers_replace(ci_headers_list_t * h, const char *header, const char *newval) { if (h->packed) /*Not in edit mode*/ return NULL; return NULL; } #define eoh(s) ((*s == '\r' && *(s+1) == '\n' && *(s+2) != '\t' && *(s+2) != ' ') || (*s == '\n' && *(s+1) != '\t' && *(s+1) != ' ')) int ci_headers_iterate(ci_headers_list_t * h, void *data, void (*fn)(void *, const char *head, const char *value)) { char header[256]; char value[8196]; char *s; int i, j; for (i = 0; i < h->used; i++) { s = h->headers[i]; for (j = 0; j < sizeof(header)-1 && *s != ':' && *s != ' ' && *s != '\0' && *s != '\r' && *s != '\n'; s++, j++) header[j] = *s; header[j] = '\0'; if (*s == ':') { s++; } else { header[0] = '\0'; s = h->headers[i]; } while (*s == ' ') s++; for (j = 0; j < sizeof(value)-1 && *s != '\0' && !eoh(s); s++, j++) value[j] = *s; value[j] = '\0'; fn(data, header, value); } return 1; } void ci_headers_pack(ci_headers_list_t * h) { /*Put the \r\n sequence at the end of each header before sending...... */ int i = 0, len = 0; for (i = 0; i < h->used; i++) { len = strlen(h->headers[i]); if (h->headers[i][len + 1] == '\n') { h->headers[i][len] = '\r'; /* h->headers[i][len+1] = '\n';*/ } else { /* handle the case that headers seperated with a '\n' only */ h->headers[i][len] = '\n'; } } if (h->buf[h->bufused + 1] == '\n') { h->buf[h->bufused] = '\r'; /* h->buf[h->bufused+1] = '\n';*/ h->bufused += 2; } else { /* handle the case that headers seperated with a '\n' only */ h->buf[h->bufused] = '\n'; h->bufused++; } h->packed = 1; } int ci_headers_unpack(ci_headers_list_t * h) { int len, eoh; char **newspace; char *ebuf, *str; if (h->bufused < 2) /*???????????? */ return EC_400; ebuf = h->buf + h->bufused - 2; /* ebuf now must indicate the last \r\n so: */ if (*ebuf != '\r' && *ebuf != '\n') { /*Some sites return (this is bug ) a simple '\n' as end of header ..... */ ci_debug_printf(3, "Parse error. The end chars are %c %c (%d %d) not the \\r \n", *ebuf, *(ebuf + 1), (unsigned int) *ebuf, (unsigned int) *(ebuf + 1)); return EC_400; /*Bad request .... */ } *ebuf = '\0'; h->headers[0] = h->buf; h->used = 1; for (str = h->buf; str < ebuf; str++) { /*Construct index of headers */ eoh = 0; if ((*str == '\r' && *(str + 1) == '\n')) { if ((str + 2) >= ebuf || (*(str + 2) != '\t' && *(str + 2) != ' ')) eoh = 1; } else if (*str == '\n' && *(str + 1) != '\t' && *(str + 1) != ' ') { /*handle the case that headers seperated with a '\n' only */ eoh = 1; } else if (*str == '\0') /*Then we have a problem. This char is important for us. Yes can happen! */ *str = ' '; if (eoh) { *str = '\0'; if (h->size <= h->used) { /* Resize the headers index space ........ */ len = h->size + HEADERSTARTSIZE; newspace = realloc(h->headers, len * sizeof(char *)); if (!newspace) { ci_debug_printf(1, "Server Error: Error allocating memory \n"); return EC_500; } h->headers = newspace; h->size = len; } str++; if (*str == '\n') str++; /* handle the case that headers seperated with a '\n' only */ h->headers[h->used] = str; h->used++; } } h->packed = 0; /*OK headers index construction ...... */ return EC_100; } size_t ci_headers_pack_to_buffer(ci_headers_list_t *heads, char *buf, size_t size) { size_t n; int i; char *pos; n = heads->bufused; if (!heads->packed) n += 2; if (n > size) return 0; memcpy(buf, heads->buf, heads->bufused); if (!heads->packed) { pos = buf; for (i = 0; i < heads->used; ++i) { pos = strchr(pos, '\0'); if (pos[1] == '\n') pos[0] = '\r'; else pos[0] = '\n'; } buf[heads->bufused] = '\r'; buf[heads->bufused+1] = '\n'; } return n; } /********************************************************************************************/ /* Entities List */ ci_encaps_entity_t *mk_encaps_entity(int type, int val) { ci_encaps_entity_t *h; h = malloc(sizeof(ci_encaps_entity_t)); if (!h) return NULL; h->start = val; h->type = type; if (type == ICAP_REQ_HDR || type == ICAP_RES_HDR) h->entity = ci_headers_create(); else h->entity = NULL; return h; } void destroy_encaps_entity(ci_encaps_entity_t * e) { if (e->type == ICAP_REQ_HDR || e->type == ICAP_RES_HDR) { ci_headers_destroy((ci_headers_list_t *) e->entity); } else free(e->entity); free(e); } int get_encaps_type(const char *buf, int *val, char **endpoint) { if (0 == strncmp(buf, "req-hdr", 7)) { *val = strtol(buf + 8, endpoint, 10); return ICAP_REQ_HDR; } if (0 == strncmp(buf, "res-hdr", 7)) { *val = strtol(buf + 8, endpoint, 10); return ICAP_RES_HDR; } if (0 == strncmp(buf, "req-body", 8)) { *val = strtol(buf + 9, endpoint, 10); return ICAP_REQ_BODY; } if (0 == strncmp(buf, "res-body", 8)) { *val = strtol(buf + 9, endpoint, 10); return ICAP_RES_BODY; } if (0 == strncmp(buf, "null-body", 9)) { *val = strtol(buf + 10, endpoint, 10); return ICAP_NULL_BODY; } return -1; } int sizeofheader(ci_headers_list_t * h) { /* int size=0,i; for(i=0;iused;i++){ size+=strlen(h->headers[i])+2; } size+=2; return size; */ return h->bufused + 2; } int sizeofencaps(ci_encaps_entity_t * e) { if (e->type == ICAP_REQ_HDR || e->type == ICAP_RES_HDR) { return sizeofheader((ci_headers_list_t *) e->entity); } return 0; } c_icap-0.5.6/INSTALL0000644000175000017500000003661413570504056010731 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. c_icap-0.5.6/log.c0000664000175000017500000002641013570502471010617 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include #include #include #include "log.h" #include "util.h" #include "access.h" #include "module.h" #include "cfg_param.h" #include "debug.h" #include "txt_format.h" #include "acl.h" #include "proc_threads_queues.h" #include "commands.h" #include #include logger_module_t *default_logger = NULL; void logformat_release(); int log_open() { if (default_logger) return default_logger->log_open(); return 0; } void log_close() { if (default_logger) { default_logger->log_close(); } } void log_reset() { logformat_release(); default_logger = NULL; } void log_access(ci_request_t * req, int status) { /*req can not be NULL */ if (!req) return; if (default_logger) default_logger->log_access(req); } extern process_pid_t MY_PROC_PID; void log_server(ci_request_t * req, const char *format, ...) { /*req can be NULL......... */ va_list ap; char prefix[64]; va_start(ap, format); if (default_logger) { if (MY_PROC_PID) snprintf(prefix, 64, "%u/%u", (unsigned int)MY_PROC_PID, (unsigned int)ci_thread_self()); else /*probably the main process*/ strcpy(prefix, "main proc"); default_logger->log_server(prefix, format, ap); /*First argument must be changed..... */ } va_end(ap); } void vlog_server(ci_request_t * req, const char *format, va_list ap) { if (default_logger) default_logger->log_server("", format, ap); } /*************************************************************/ /* logformat */ /* Maybe logformat manipulation functions should moved to the c-icap library, because some platforms (eg. MS-WINDOWS) can not use functions and objects defined in main executable. At this time ony the sys_logger.c module uses these functions which make sense on unix platforms (where there is not a such problem). Moreover the sys_logger can be compiled inside c-icap main executable to avoid such problems. */ struct logformat { char *name; char *fmt; struct logformat *next; }; struct logformat *LOGFORMATS = NULL; int logformat_add(const char *name, const char *format) { struct logformat *lf, *tmp; lf = malloc(sizeof(struct logformat)); if (!lf) { ci_debug_printf(1, "Error allocating memory in add_logformat\n"); return 0; } lf->name = strdup(name); lf->fmt = strdup(format); if (!lf->name || !lf->fmt) { ci_debug_printf(1, "Error strduping in add_logformat\n"); free(lf); return 0; } lf->next = NULL; if (LOGFORMATS==NULL) { LOGFORMATS = lf; return 1; } tmp = LOGFORMATS; while (tmp->next != NULL) tmp = tmp->next; tmp->next = lf; return 1; } void logformat_release() { struct logformat *cur, *tmp; if (!(tmp = LOGFORMATS)) return; do { cur = tmp; tmp = tmp->next; free(cur->name); free(cur->fmt); free(cur); } while (tmp); LOGFORMATS = NULL; } char *logformat_fmt(const char *name) { struct logformat *tmp; if (!(tmp = LOGFORMATS)) return NULL; while (tmp) { if (strcmp(tmp->name, name) == 0) return tmp->fmt; tmp = tmp->next; } return NULL; } /******************************************************************/ /* file_logger implementation. This is the default logger */ /* */ int file_log_open(); void file_log_close(); void file_log_access(ci_request_t *req); void file_log_server(const char *server, const char *format, va_list ap); void file_log_relog(const char *name, int type, const char **argv); /*char *LOGS_DIR = LOGDIR;*/ char *SERVER_LOG_FILE = LOGDIR "/cicap-server.log"; /*char *ACCESS_LOG_FILE = LOGDIR "/cicap-access.log";*/ struct logfile { char *file; FILE *access_log; const char *log_fmt; ci_access_entry_t *access_list; ci_thread_rwlock_t rwlock; struct logfile *next; }; struct logfile *ACCESS_LOG_FILES = NULL; static ci_thread_rwlock_t systemlog_rwlock; logger_module_t file_logger = { "file_logger", NULL, file_log_open, file_log_close, file_log_access, file_log_server, NULL /*NULL configuration table */ }; FILE *server_log = NULL; const char *DEFAULT_LOG_FORMAT = "%tl, %la %a %im %iu %is"; FILE *logfile_open(const char *fname) { FILE *f = fopen(fname, "a+"); if (f) setvbuf(f, NULL, _IONBF, 0); return f; } int file_log_open() { int error = 0, ret = 0; struct logfile *lf; assert(ret == 0); register_command("relog", MONITOR_PROC_CMD | CHILDS_PROC_CMD, file_log_relog); for (lf = ACCESS_LOG_FILES; lf != NULL; lf = lf->next) { if (!lf->file) { ci_debug_printf (1, "This is a bug! lf->file==NULL\n"); continue; } if (lf->log_fmt == NULL) lf->log_fmt = (char *)DEFAULT_LOG_FORMAT; if (ci_thread_rwlock_init(&(lf->rwlock)) != 0) { ci_debug_printf (1, "WARNING! Can not initialize structures for log file: %s\n", lf->file); continue; } lf->access_log = logfile_open(lf->file); if (!lf->access_log) { error = 1; ci_debug_printf (1, "WARNING! Can not open log file: %s\n", lf->file); } } ret = ci_thread_rwlock_init(&systemlog_rwlock); if (ret != 0) return 0; server_log = logfile_open(SERVER_LOG_FILE); if (!server_log) return 0; if (error) return 0; else return 1; } void file_log_close() { struct logfile *lf, *tmp; lf = ACCESS_LOG_FILES; while (lf != NULL) { if (lf->access_log) fclose(lf->access_log); free(lf->file); if (lf->access_list) ci_access_entry_release(lf->access_list); ci_thread_rwlock_destroy(&(lf->rwlock)); // Initialize logfile::rwlock tmp = lf; lf = lf->next; ACCESS_LOG_FILES = lf; free(tmp); } if (server_log) fclose(server_log); server_log = NULL; ci_thread_rwlock_destroy(&systemlog_rwlock); // destroy rwlock } void file_log_relog(const char *name, int type, const char **argv) { struct logfile *lf; /* This code should match the appropriate code from file_log_close */ for (lf = ACCESS_LOG_FILES; lf != NULL; lf = lf->next) { ci_thread_rwlock_wrlock(&(lf->rwlock)); /*obtain a write lock. When this function returns all file_log_access will block until write unlock*/ if (lf->access_log) fclose(lf->access_log); lf->access_log = logfile_open(lf->file); ci_thread_rwlock_unlock(&(lf->rwlock)); if (!lf->access_log) ci_debug_printf (1, "WARNING! Can not open log file: %s\n", lf->file); } ci_thread_rwlock_wrlock(&systemlog_rwlock); if (server_log) fclose(server_log); server_log = logfile_open(SERVER_LOG_FILE); ci_thread_rwlock_unlock(&systemlog_rwlock); /*if !server_log ???*/ } void file_log_access(ci_request_t *req) { struct logfile *lf; char logline[4096]; for (lf = ACCESS_LOG_FILES; lf != NULL; lf = lf->next) { if (lf->access_list && !(ci_access_entry_match_request(lf->access_list, req) == CI_ACCESS_ALLOW)) { ci_debug_printf(6, "access log file %s does not match, skiping\n", lf->file); continue; } ci_debug_printf(6, "Log request to access log file %s\n", lf->file); ci_format_text(req, lf->log_fmt, logline, sizeof(logline), NULL); ci_thread_rwlock_rdlock(&lf->rwlock); /*obtain a read lock*/ if (lf->access_log) fprintf(lf->access_log,"%s\n", logline); ci_thread_rwlock_unlock(&lf->rwlock); /*obtain a read lock*/ } } void file_log_server(const char *server, const char *format, va_list ap) { char buf[1024]; if (!server_log) return; ci_strtime(buf); /* requires STR_TIME_SIZE=64 bytes size */ const size_t len = strlen(buf); const size_t written = snprintf(buf + len, sizeof(buf) - len, ", %s, %s", server, format); assert(written < sizeof(buf) - len); ci_thread_rwlock_rdlock(&systemlog_rwlock); /*obtain a read lock*/ vfprintf(server_log, buf, ap); ci_thread_rwlock_unlock(&systemlog_rwlock); /*release a read lock*/ } int file_log_addlogfile(const char *file, const char *format, const char **acls) { char *access_log_file, *access_log_format; const char *acl_name; struct logfile *lf, *newlf; int i; access_log_file = strdup(file); if (!access_log_file) return 0; if (format) { /*the folowing return format txt or NULL. It is OK*/ access_log_format = logformat_fmt(format); } else access_log_format = NULL; newlf = malloc(sizeof(struct logfile)); newlf->file = access_log_file; newlf->log_fmt = (access_log_format != NULL? access_log_format : DEFAULT_LOG_FORMAT); newlf->access_log = NULL; newlf->access_list = NULL; newlf->next = NULL; if (acls != NULL && acls[0] != NULL) { if (ci_access_entry_new(&(newlf->access_list), CI_ACCESS_ALLOW) == NULL) { ci_debug_printf(1, "Error creating access list for access log file %s!\n", newlf->file); free(newlf->file); free(newlf); return 0; } for (i = 0; acls[i] != NULL; i++) { acl_name = acls[i]; if (!ci_access_entry_add_acl_by_name(newlf->access_list, acl_name)) { ci_debug_printf(1, "Error addind acl %s to access list for access log file %s!\n", acl_name, newlf->file); ci_access_entry_release(newlf->access_list); free(newlf->file); free(newlf); return 0; } } } if (!ACCESS_LOG_FILES) { ACCESS_LOG_FILES = newlf; } else { for (lf = ACCESS_LOG_FILES; lf->next != NULL; lf = lf->next) { if (strcmp(lf->file, newlf->file)==0) { ci_debug_printf(1, "Access log file %s already defined!\n", newlf->file); if (newlf->access_list) ci_access_entry_release(newlf->access_list); free(newlf->file); free(newlf); return 0; } } lf->next = newlf; } return 1; } c_icap-0.5.6/build/0000775000175000017500000000000013570504160011043 500000000000000c_icap-0.5.6/build/c_icap_version.awk0000664000175000017500000000040113371253152014446 00000000000000{ n=match($0, /^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$/); if (n==0) { t=gsub(/[^[:digit:]]/, "", $0); printf("0xF%0.11X", $0); } else { split($0, a, "."); printf("0x%0.4X%0.4X%0.4X", a[1], a[2], a[3]); } } c_icap-0.5.6/decode.c0000664000175000017500000006300713541156606011267 00000000000000/* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "body.h" #include "simple_api.h" #include "debug.h" #ifdef HAVE_ZLIB #include #endif #ifdef HAVE_BZLIB #include #endif #ifdef HAVE_BROTLI #include "brotli/decode.h" #include "brotli/encode.h" #include "brotli/types.h" #include "brotli/port.h" #endif unsigned char base64_table[] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 0, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255, 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }; int ci_base64_decode(const char *encoded, char *decoded, int len) { int i; unsigned char *str,*result; if (!encoded || !decoded || !len) return 0; str = (unsigned char *)encoded; result = (unsigned char *)decoded; for (i = len; i > 3; i -= 3) { /*if one of the last 4 bytes going to be proccessed is not valid just stops processing. This "if" cover the '\0' string termination character of str (because base64_table[0] = 255) */ if (base64_table[*str]>63 || base64_table[*(str+1)] > 63 || base64_table[*(str+2)] > 63 ||base64_table[*(str+3)] > 63) break; /*6 bits from the first + 2 last bits from second*/ *(result++) = (base64_table[*str] << 2) | (base64_table[*(str+1)] >>4); /*last 4 bits from second + first 4 bits from third*/ *(result++) = (base64_table[*(str+1)] << 4) | (base64_table[*(str+2)] >>2); /*last 2 bits from third + 6 bits from forth */ *(result++) = (base64_table[*(str+2)] << 6) | (base64_table[*(str+3)]); str += 4; } *result = '\0'; return len-i; } char *ci_base64_decode_dup(const char *encoded) { int len; char *result; len = strlen(encoded); len = ((len+3)/4)*3+1; if (!(result = malloc(len*sizeof(char)))) return NULL; ci_base64_decode(encoded,result,len); return result; } /* byte1____ byte2____ byte3____ */ /* 123456 78 1234 5678 12 345678 */ /* b64_1_ b64_2__ b64_3__ b64_4_ */ #define dobase64(s, b0, b1, b2) \ s[k++] = base64_set[(b0 >> 2) & 0x3F]; \ s[k++] = base64_set[((b0 << 4) | (b1 >> 4)) & 0x3F]; \ s[k++] = base64_set[((b1 << 2) | (b2 >> 6)) & 0x3F]; \ s[k++] = base64_set[b2 & 0x3F]; int ci_base64_encode(const unsigned char *data, size_t len, char *out, size_t outlen) { int i, k; const char *base64_set = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ "abcdefghijklmnopqrstuvwxyz"\ "0123456789"\ "+/"; for (i = 0, k = 0; i < (len - 3) && k < (outlen - 4); i += 3) { dobase64(out, data[i], data[i + 1], data[i + 2]); } /*if the outlen is enough big*/ if (k < (outlen -4) && i < len) { dobase64(out, (i < len ? data[i] : 0), (i + 1 < len ? data[i + 1] : 0), (i + 2 < len ? data[i + 2] : 0)); } out[k] = '\0'; return k; } /*url decoders */ CI_DECLARE_FUNC(int) url_decoder(const char *input,char *output, int output_len) { int i, k; char str[3]; i = 0; k = 0; while ((input[i] != '\0') && (k < output_len-1)) { if (input[i] == '%') { str[0] = input[i+1]; str[1] = input[i+2]; str[2] = '\0'; output[k] = strtol(str, NULL, 16); i = i + 3; } else if (input[i] == '+') { output[k] = ' '; i++; } else { output[k] = input[i]; i++; } k++; } output[k] = '\0'; if (k == output_len-1) return -1; return 1; } CI_DECLARE_FUNC(int) url_decoder2(char *input) { int i, k; char str[3]; i = 0; k = 0; while (input[i] != '\0') { if (input[i] == '%') { str[0] = input[i+1]; str[1] = input[i+2]; str[2] = '\0'; input[k] = strtol(str, NULL, 16); i = i + 3; } else if (input[i] == '+') { input[k] = ' '; i++; } else { input[k] = input[i]; i++; } k++; } input[k] = '\0'; return 1; } #define CHUNK 8192 static const char *uncompress_errors[] = { "uncompress: No Error", "uncompress: Uncompression Failure", "uncompress: Write Failed", "uncompress: Input Corrupted", "uncompress: Compression Bomb" }; const char *ci_decompress_error(int err) { ci_debug_printf (7, "Inflate error %d\n", err); if (err < CI_UNCOMP_ERR_NONE && err >= CI_UNCOMP_ERR_BOMB) return uncompress_errors[-err]; return "No Error"; } const char *ci_inflate_error(int err) { return ci_decompress_error(err); } int ci_encoding_method(const char *content_encoding) { if (!content_encoding) return CI_ENCODE_NONE; if (strcasestr(content_encoding, "gzip") != NULL) { return CI_ENCODE_GZIP; } if (strcasestr(content_encoding, "deflate") != NULL) { return CI_ENCODE_DEFLATE; } if (strcasestr(content_encoding, "br") != NULL) { return CI_ENCODE_BROTLI; } if (strcasestr(content_encoding, "bzip2") != NULL) { return CI_ENCODE_BZIP2; } return CI_ENCODE_UNKNOWN; } static int write_membuf_func(void *obj, const char *buf, size_t len) { return ci_membuf_write((ci_membuf_t *)obj, buf, len, 0); } static int write_simple_file_func(void *obj, const char *buf, size_t len) { return ci_simple_file_write((ci_simple_file_t *)obj, buf, len, 0); } struct unzipBuf { char *buf; size_t buf_size; size_t out_len; }; static char *get_buf_outbuf(void *obj, unsigned int *len) { struct unzipBuf *ab = (struct unzipBuf *)obj; *len = ab->buf_size; return ab->buf; } static int write_once_to_outbuf(void *obj, const char *buf, size_t len) { struct unzipBuf *ab = (struct unzipBuf *)obj; ab->out_len = ab->buf_size < len ? ab->buf_size : len; memcpy(ab->buf, buf, ab->out_len); /*Return 0 to abort immediately uncompressing. We are interesting only for the first bytes*/ return 0; } /*return CI_INFLATE_ERRORS */ int ci_decompress_to_membuf(int encoding_format, const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { switch (encoding_format) { case CI_ENCODE_NONE: return CI_UNCOMP_OK; break; #ifdef HAVE_ZLIB case CI_ENCODE_GZIP: case CI_ENCODE_DEFLATE: return ci_inflate_to_membuf(inbuf, inlen, outbuf, max_size); break; #endif #ifdef HAVE_BZLIB case CI_ENCODE_BZIP2: return ci_bzunzip_to_membuf(inbuf, inlen, outbuf, max_size); break; #endif #ifdef HAVE_BROTLI case CI_ENCODE_BROTLI: return ci_brinflate_to_membuf(inbuf, inlen, outbuf, max_size); break; #endif case CI_ENCODE_UNKNOWN: default: return CI_UNCOMP_ERR_ERROR; break; } } /*return CI_INFLATE_ERRORS */ int ci_decompress_to_simple_file(int encoding_format, const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { switch (encoding_format) { case CI_ENCODE_NONE: return CI_UNCOMP_OK; break; #ifdef HAVE_ZLIB case CI_ENCODE_GZIP: case CI_ENCODE_DEFLATE: return ci_inflate_to_simple_file(inbuf, inlen, outbuf, max_size); break; #endif #ifdef HAVE_BZLIB case CI_ENCODE_BZIP2: return ci_bzunzip_to_simple_file(inbuf, inlen, outbuf, max_size); break; #endif #ifdef HAVE_BROTLI case CI_ENCODE_BROTLI: return ci_brinflate_to_simple_file(inbuf, inlen, outbuf, max_size); break; #endif case CI_ENCODE_UNKNOWN: default: return CI_UNCOMP_ERR_ERROR; break; } } #ifdef HAVE_BROTLI #define DEFAULT_LGWIN 22 #define DEFAULT_QUALITY 11 #define kFileBufferSize 16384 int Br_Decompress(BrotliDecoderState* s, const char *buf, int inlen, void *outbuf, char *(*get_outbuf)(void *obj, unsigned int *len), int (*writefunc)(void *obj, const char *buf, size_t len), ci_off_t max_size) { size_t available_in = 0; const uint8_t* next_in = NULL; size_t available_out = kFileBufferSize; uint8_t* next_out; unsigned have, written, can_write; long long outsize; size_t total_out = 0; BrotliDecoderResult result = BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT; uint8_t *out, OUT[kFileBufferSize]; ci_debug_printf(4, "data-compression: brotli decompress called size: %d\n", inlen); next_in = (uint8_t *)buf; available_in = inlen; outsize = 0; for (;;) { if (get_outbuf) { unsigned int outbuf_size; out = (uint8_t *)get_outbuf(outbuf, &outbuf_size); if (!out) return CI_UNCOMP_ERR_OUTPUT; available_out = outbuf_size; } else { out = OUT; available_out = kFileBufferSize; } next_out = out; result = BrotliDecoderDecompressStream(s, &available_in, &next_in, &available_out, &next_out, &total_out); have = kFileBufferSize - available_out; can_write = (max_size > 0 && (max_size - outsize) < have) ? (max_size - outsize) : have; if ((written = writefunc(outbuf, (char *)out, can_write)) != can_write) { ci_debug_printf(2, "data-compression: brotli decoded data not written to output (%u/%u)\n", written, have); return CI_UNCOMP_ERR_OUTPUT; } outsize += written; if (written < have) { if ((outsize/inlen) > 100) { ci_debug_printf(1, "data-compression: brotli Compression ratio UncompSize/CompSize = %" PRINTF_OFF_T "/%" PRINTF_OFF_T " = %" PRINTF_OFF_T "! Is it a zip bomb? aborting!\n", (CAST_OFF_T)outsize, (CAST_OFF_T)inlen, (CAST_OFF_T)(outsize/inlen)); return CI_UNCOMP_ERR_BOMB; } else { ci_debug_printf(4, "data-compression: brotli Object is bigger than max allowed file\n"); return CI_UNCOMP_ERR_NONE; } } switch (result) { case BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: if (available_in == 0) { ci_debug_printf(2, "data-compression: brotli needs more data, but there are not available\n"); return CI_UNCOMP_ERR_CORRUPT; } ci_debug_printf(4, "data-compression: brotli needs more input\n"); break; case BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: /* Nothing to do - output is already written. */ break; case BROTLI_DECODER_RESULT_SUCCESS: if (available_in != 0) { ci_debug_printf(4, "data-compression: brotli finished but available_in != 0\n"); return CI_UNCOMP_ERR_CORRUPT; } ci_debug_printf(4, "data-compression: brotli total uncompressed size: %lld (%lld)\n", outsize, (long long)total_out); return CI_UNCOMP_OK; default: ci_debug_printf(2, "data-compression: brotli corrupt input\n"); return CI_UNCOMP_ERR_CORRUPT; } } } int ci_mem_brinflate(const char *inbuf, int inlen, void *outbuf, char *(*get_outbuf)(void *obj, unsigned int *len), int (*writefunc)(void *obj, const char *buf, size_t len), ci_off_t max_size) { BROTLI_BOOL ccode = BROTLI_TRUE; BrotliDecoderState *s; s = BrotliDecoderCreateInstance(NULL, NULL, NULL); if (!s) { ci_debug_printf(4, "data-compression: brotli out of memory\n"); return -1; } ccode = Br_Decompress(s, inbuf, inlen, outbuf, get_outbuf, writefunc, max_size); BrotliDecoderDestroyInstance(s); return ccode; } int ci_brinflate_to_membuf(const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { int ret = ci_mem_brinflate(inbuf, inlen, outbuf, NULL, write_membuf_func, max_size); ci_membuf_write(outbuf, "", 0, 1); return ret; } int ci_brinflate_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { int ret = ci_mem_brinflate(inbuf, inlen, outbuf, NULL, write_simple_file_func, max_size); ci_simple_file_write(outbuf, "", 0, 1); return ret; } static int brotli_inflate_step(const char *buf, int len, char *unzipped_buf, int *unzipped_buf_len) { struct unzipBuf ub; ub.buf = unzipped_buf; ub.buf_size = *unzipped_buf_len; ub.out_len = 0; int ret = ci_mem_brinflate(buf, len, &ub, get_buf_outbuf, write_once_to_outbuf, len); ci_debug_printf(5, "brotli_inflate_step: retcode %d, unzipped data: %d\n", ret, (int)ub.out_len); if (ub.out_len > 0) { /* there are output data even if there are errors*/ *unzipped_buf_len = ub.out_len; return CI_OK; } return CI_ERROR; } #else int ci_brinflate_to_membuf(const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { ci_debug_printf(1, "brotlidecode is not supported.\n"); return CI_UNCOMP_ERR_NONE; } int ci_brinflate_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { ci_debug_printf(1, "brotlidecode is not supported.\n"); return CI_UNCOMP_ERR_NONE; } #endif #ifdef HAVE_ZLIB #define ZIP_HEAD_CRC 0x02 /* bit 1 set: header CRC present */ #define ZIP_EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ #define ZIP_ORIG_NAME 0x08 /* bit 3 set: original file name present */ #define ZIP_COMMENT 0x10 /* bit 4 set: file comment present */ static void *alloc_a_buffer(void *op, unsigned int items, unsigned int size) { return ci_buffer_alloc(items*size); } static void free_a_buffer(void *op, void *ptr) { ci_buffer_free(ptr); } /*return CI_INFLATE_ERRORS */ int ci_mem_inflate(const char *inbuf, size_t inlen, void *out_obj, char *(*get_outbuf)(void *obj, unsigned int *len), int (*writefunc)(void *obj, const char *buf, size_t len), ci_off_t max_size) { int ret, retriable; unsigned have, written, can_write, out_size; ci_off_t unzipped_size; z_stream strm; unsigned char *out, OUT[CHUNK]; /* allocate inflate state */ strm.zalloc = alloc_a_buffer; strm.zfree = free_a_buffer; strm.opaque = Z_NULL; strm.avail_in = 0; strm.next_in = Z_NULL; ret = inflateInit2(&strm, 32 + 15); if (ret != Z_OK) return CI_UNCOMP_ERR_ERROR; retriable = 1; unzipped_size = 0; strm.next_in = (unsigned char*)inbuf; strm.avail_in = inlen; /* run inflate() on input until output buffer not full */ do { do_mem_inflate_retry: if (get_outbuf) { out = (unsigned char *)get_outbuf(out_obj, &out_size); strm.next_out = out; strm.avail_out = out_size; if (!out || !strm.avail_out) { inflateEnd(&strm); return CI_UNCOMP_ERR_OUTPUT; } } else { strm.avail_out = out_size = CHUNK; strm.next_out = out = OUT; } ret = inflate(&strm, Z_NO_FLUSH); if (ret == Z_STREAM_ERROR) { //probably means memory overrun/overwrite etc ci_debug_printf(1, "Zlib/Z_STREAM_ERROR, corrupted input data to inflate?\n"); } switch (ret) { case Z_NEED_DICT: case Z_DATA_ERROR: if (retriable) { ret = inflateInit2(&strm, -15); retriable = 0; if (ret == Z_OK) { strm.avail_in = inlen; strm.next_in = (unsigned char *)inbuf; goto do_mem_inflate_retry; } /*else let fail ...*/ } case Z_STREAM_ERROR: case Z_MEM_ERROR: inflateEnd(&strm); return CI_UNCOMP_ERR_CORRUPT; } retriable = 0; // No more retries allowed have = out_size - strm.avail_out; can_write = (max_size > 0 && (max_size - unzipped_size) < have) ? (max_size - unzipped_size) : have; if ((written = writefunc(out_obj, (char *)out, can_write)) != can_write) { inflateEnd(&strm); return CI_UNCOMP_ERR_OUTPUT; } unzipped_size += written; if (written < have) { inflateEnd(&strm); if ( (unzipped_size/inlen) > 100) { ci_debug_printf(1, "Compression ratio UncompSize/CompSize = %" PRINTF_OFF_T "/%" PRINTF_OFF_T " = %" PRINTF_OFF_T "! Is it a zip bomb? aborting!\n", (CAST_OFF_T)unzipped_size, (CAST_OFF_T)inlen, (CAST_OFF_T)(unzipped_size/inlen)); return CI_UNCOMP_ERR_BOMB; /*Probably compression bomb object*/ } else { ci_debug_printf(4, "Object is bigger than max allowed file\n"); return CI_UNCOMP_ERR_NONE; } } } while (strm.avail_out == 0); /* clean up and return */ inflateEnd(&strm); /* ret == Z_STREAM_END means that the decompression was succesfull else the output data are corrupted or not produced at all. Example case is when the input data are not enough to produce a single byte of decompressed data, so the inflate() return Z_OK (eg during preview request with few preview data) */ return ret == Z_STREAM_END ? CI_UNCOMP_OK : CI_UNCOMP_ERR_CORRUPT; } int ci_inflate_to_membuf(const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { int ret = ci_mem_inflate(inbuf, inlen, outbuf, NULL, write_membuf_func, max_size); ci_membuf_write(outbuf, "", 0, 1); return ret; } int ci_inflate_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { int ret = ci_mem_inflate(inbuf, inlen, outbuf, NULL, write_simple_file_func, max_size); ci_simple_file_write(outbuf, "", 0, 1); return ret; } static int zlib_inflate_step(const char *buf, int len, char *unzipped_buf, int *unzipped_buf_len) { struct unzipBuf ub; ub.buf = unzipped_buf; ub.buf_size = *unzipped_buf_len; ub.out_len = 0; int ret = ci_mem_inflate(buf, len, &ub, get_buf_outbuf, write_once_to_outbuf, len); ci_debug_printf(5, "zlib_inflate_step: retcode %d, unzipped data: %d\n", ret, (int)ub.out_len); if (ub.out_len > 0) { *unzipped_buf_len = ub.out_len; return CI_OK; } return CI_ERROR; } #else int ci_inflate_to_membuf(const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { ci_debug_printf(1, "zlib/inflate is not supported.\n"); return CI_UNCOMP_ERR_NONE; } int ci_inflate_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { ci_debug_printf(1, "zlib/inflate is not supported.\n"); return CI_UNCOMP_ERR_NONE; } #endif #ifdef HAVE_BZLIB static void *bzalloc_a_buffer(void *op, int items, int size) { return ci_buffer_alloc(items*size); } static void bzfree_a_buffer(void *op, void *ptr) { ci_buffer_free(ptr); } /* TODO: fix to allow write directly to out_obj internal buffers instead of using out[CHUNK] buffer */ int ci_mem_bzunzip(const char *buf, int inlen, void *out_obj, char *(*get_outbuf)(void *obj, unsigned int *len), int (*writefunc)(void *obj, const char *buf, size_t len), ci_off_t max_size) { /*we can use BZ2_bzBuffToBuffDecompress but we need to use our buffer_alloc interface...*/ int ret; unsigned have, written, can_write, out_size; ci_off_t unzipped_size; bz_stream strm; char *out, OUT[CHUNK]; strm.bzalloc = bzalloc_a_buffer; strm.bzfree = bzfree_a_buffer; strm.opaque = NULL; strm.avail_in = 0; strm.next_in = NULL; ret = BZ2_bzDecompressInit(&strm, 0, 0); if (ret != BZ_OK) { ci_debug_printf(1, "Error initializing bzlib (BZ2_bzDeompressInit return:%d)\n", ret); return CI_UNCOMP_ERR_ERROR; } strm.next_in = (char *)buf; strm.avail_in = inlen; unzipped_size = 0; do { if (get_outbuf) { out = get_outbuf(out_obj, &out_size); strm.next_out = out; strm.avail_out = out_size; if (!out || !strm.avail_out) { BZ2_bzDecompressEnd(&strm); return CI_UNCOMP_ERR_OUTPUT; } } else { strm.avail_out = out_size = CHUNK; strm.next_out = out = OUT; } ret = BZ2_bzDecompress(&strm); switch (ret) { case BZ_PARAM_ERROR: case BZ_DATA_ERROR: case BZ_DATA_ERROR_MAGIC: case BZ_MEM_ERROR: BZ2_bzDecompressEnd(&strm); return CI_UNCOMP_ERR_ERROR; } have = out_size - strm.avail_out; can_write = (max_size > 0 && (max_size - unzipped_size) < have) ? (max_size - unzipped_size) : have; if (!have || (written = writefunc(out_obj, (char *)out, can_write)) != can_write) { BZ2_bzDecompressEnd(&strm); return CI_UNCOMP_ERR_OUTPUT; } unzipped_size += written; if (written < have) { BZ2_bzDecompressEnd(&strm); if ( (unzipped_size/inlen) > 100) { ci_debug_printf(1, "Compression ratio UncompSize/CompSize = %" PRINTF_OFF_T "/%" PRINTF_OFF_T " = %" PRINTF_OFF_T "! Is it a zip bomb? aborting!\n", (CAST_OFF_T)unzipped_size, (CAST_OFF_T)inlen, (CAST_OFF_T)(unzipped_size/inlen)); return CI_UNCOMP_ERR_BOMB; /*Probably compression bomb object*/ } else { ci_debug_printf(4, "Object is bigger than max allowed file\n"); return CI_UNCOMP_ERR_NONE; } } } while (strm.avail_out == 0); BZ2_bzDecompressEnd(&strm); return CI_UNCOMP_OK; } int ci_bzunzip_to_membuf(const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { int ret = ci_mem_bzunzip(inbuf, inlen, outbuf, NULL, write_membuf_func, max_size); ci_membuf_write(outbuf, "", 0, 1); return ret; } int ci_bzunzip_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { int ret = ci_mem_bzunzip(inbuf, inlen, outbuf, NULL, write_simple_file_func, max_size); ci_simple_file_write(outbuf, "", 0, 1); return ret; } static int bzlib_uncompress_step(const char *buf, int len, char *unzipped_buf, int *unzipped_buf_len) { struct unzipBuf ub; ub.buf = unzipped_buf; ub.buf_size = *unzipped_buf_len; ub.out_len = 0; int ret = ci_mem_bzunzip(buf, len, &ub, get_buf_outbuf, write_once_to_outbuf, len); ci_debug_printf(5, "bzlib_uncompress_step: retcode %d, unzipped data: %d\n", ret, (int)ub.out_len); if (ub.out_len > 0) { *unzipped_buf_len = ub.out_len; return CI_OK; } return CI_ERROR; } #else int ci_bzunzip_to_membuf(const char *inbuf, size_t inlen, ci_membuf_t *outbuf, ci_off_t max_size) { ci_debug_printf(1, "bzlib/bzunzip is not supported.\n"); return CI_UNCOMP_ERR_NONE; } int ci_bzunzip_to_simple_file(const char *inbuf, size_t inlen, struct ci_simple_file *outbuf, ci_off_t max_size) { ci_debug_printf(1, "bzlib/bzunzip is not supported.\n"); return CI_UNCOMP_ERR_NONE; } #endif int ci_uncompress_preview(int compress_method, const char *buf, int len, char *unzipped_buf, int *unzipped_buf_len) { #ifdef HAVE_BZLIB if (compress_method == CI_ENCODE_BZIP2) return bzlib_uncompress_step(buf, len, unzipped_buf, unzipped_buf_len); else #endif #ifdef HAVE_BROTLI if (compress_method == CI_ENCODE_BROTLI) return brotli_inflate_step(buf, len, unzipped_buf, unzipped_buf_len); else #endif #ifdef HAVE_ZLIB return zlib_inflate_step(buf, len, unzipped_buf, unzipped_buf_len); #endif return CI_ERROR; } c_icap-0.5.6/util.c0000664000175000017500000001054613371253152011014 00000000000000/* * Copyright (C) 2004-2011 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "array.h" #include "util.h" #include #include #include const char *ci_strnstr(const char *s, const char *find, size_t slen) { size_t len = strlen(find); if (len == 0) return NULL; while (len <= slen) { if (*s == *find && strncmp(s, find, len) == 0 ) return s; s++,slen--; } return NULL; } const char *ci_strcasestr(const char *str, const char *find) { const char *s, *c, *f; for (s = str; *s != '\0'; ++s) { for (f = find, c = s; ; ++f, ++c) { if (*f == '\0') /*find matched s*/ return s; if (*c == '\0') /*find is longer than the remaining string */ return NULL; if (tolower(*c) != tolower(*f)) break; } } return NULL; } const char *ci_strncasestr(const char *s, const char *find, size_t slen) { size_t len = strlen(find); if (len == 0) return NULL; while (len <= slen) { if (tolower(*s) == tolower(*find) && strncasecmp(s, find, len) == 0 ) return s; s++,slen--; } return NULL; } static const char *atol_err_erange = "ERANGE"; static const char *atol_err_conversion = "CONVERSION_ERROR"; static const char *atol_err_nonumber = "NO_DIGITS_ERROR"; long int ci_atol_ext(const char *str, const char **error) { char *e; long int val; errno = 0; val = strtol(str, &e, 10); if (error) { *error = NULL; if (errno == ERANGE && (val == LONG_MAX || val == LONG_MIN)) *error = atol_err_erange; else if (errno != 0 && val == 0) *error = atol_err_conversion; else if (e == str) *error = atol_err_nonumber; if (*error) return 0; } if (val) { if (*e == 'k' || * e == 'K') val = val * 1024; else if (*e == 'm' || * e == 'M') val = val * 1024 * 1024; } return val; } void ci_str_trim(char *str) { char *s, *e; if (!str) return; s = str; e = NULL; while (isspace(*s)) { e = s; while (*e != '\0') { *e = *(e+1); e++; } } /*if (e) e--; else */ e = str+strlen(str); e--; while (isspace(*e) && e >= str) {*e = '\0'; --e;}; } char *ci_str_trim2(char *s) { char *e; if (!s) return NULL; while (isspace(*s)) ++s; e = s + strlen(s); e--; while (isspace(*e) && e >= s) {*e = '\0'; --e;}; return s; } char * ci_strerror(int error, char *buf, size_t buflen) { #if defined(STRERROR_R_CHAR_P) return strerror_r(error, buf, buflen); #elif defined(HAVE_STRERROR_R) if (strerror_r(error, buf, buflen) == 0) return buf; #else snprintf(buf, buflen, "%d", error); buf[buflen - 1] = '\0'; return buf; #endif } /* TODO: support escaped chars, */ ci_dyn_array_t *ci_parse_key_value_list(const char *str, char sep) { char *s, *e, *k, *v; ci_dyn_array_t *args_array; s = strdup(str); if (!s) return NULL; args_array = ci_dyn_array_new(1024); k = s; while (k) { if ((e = strchr(k, sep))) { *e = '\0'; e++; } if ((v = strchr(k, '='))) { *v = '\0'; ++v; } k = ci_str_trim2(k); if (v) v = ci_str_trim2(v); if (*k) { ci_dyn_array_add(args_array, k, v ? v : "", v ? strlen(v) + 1 : 1); } k = (e && *e) ? e : NULL; } return args_array; } c_icap-0.5.6/README0000664000175000017500000000157013371253152010550 00000000000000The c-icap server http://c-icap.sourceforge.net/ c-icap is an implementation of an ICAP server. It can be used with HTTP proxies that support the ICAP protocol to implement content adaptation and filtering services. Most of the commercial HTTP proxies must support the ICAP protocol. The open source Squid proxy server supports it. Major features: - ICAP over TLS support - C API for developing custom content adaptation and filtering services - plugins interface - LDAP integration - simple ICAP client API For support, use the following resources: - General discussion related to c-icap server: c-icap-users@lists.sourceforge.net - Basic installation and configuration instructions: https://sourceforge.net/p/c-icap/wiki/configcicap/ - c-icap service developers should start from here: https://sourceforge.net/p/c-icap/wiki/Developers/ c_icap-0.5.6/dlib.c0000664000175000017500000000452513371253152010751 00000000000000/* * Copyright (C) 2004-2008 Christos Tsantilas * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA. */ #include "common.h" #include "c-icap.h" #include "dlib.h" struct dlib_entry { char *file; char *name; CI_DLIB_HANDLE handle; int forceUnload; struct dlib_entry *next; }; struct dlib_entry *dlib_list = NULL; int ci_dlib_entry(const char *name, const char *file, CI_DLIB_HANDLE handle, int forceUnload) { struct dlib_entry *dl_e, *dl_cur; if (!name || !file || !handle) return 0; dl_e = malloc(sizeof(struct dlib_entry)); if (!dl_e) return 0; dl_e->file = strdup(file); if (!dl_e->file) { free(dl_e); return 0; } dl_e->name = strdup(name); if (!dl_e->name) { free(dl_e->file); free(dl_e); return 0; } dl_e->handle = handle; dl_e->forceUnload = forceUnload; dl_e->next = NULL; if (dlib_list == NULL) { dlib_list = dl_e; return 1; } dl_cur = dlib_list; while (dl_cur->next != NULL) dl_cur = dl_cur->next; dl_cur->next = dl_e; return 1; } int ci_dlib_closeall() { struct dlib_entry *dl_e, *dl_cur; int ret, error = 0; dl_cur = dlib_list; while (dl_cur != NULL) { dl_e = dl_cur; dl_cur = dl_cur->next; if (dl_e->forceUnload) { ret = ci_module_unload(dl_e->handle, dl_e->name); if (!ret) error = 1; } if (dl_e->name) free(dl_e->name); if (dl_e->file) free(dl_e->file); free(dl_e); } dlib_list = NULL; if (error) return 0; return 1; } c_icap-0.5.6/c-icap-config.in0000664000175000017500000000320613371253152012615 00000000000000#!/bin/sh prefix=@prefix@ PKGLIBDIR=@PKGLIBDIR@/ LIBDIR=@LIBDIR@/ CONFIGDIR=@SYSCONFDIR@/ DATADIR=@PKGDATADIR@/ #LOGDIR= SOCKDIR=@SOCKDIR@ INCDIR=@INCLUDEDIR@ INCDIR2=@PKGINCLUDEDIR@ VERSION=@PACKAGE_VERSION@ CICAPCFLAGS="@CFLAGS@" CICAPLDFLAGS= CICAPLIBS= CFLAGS="@MODULES_CFLAGS@ @CFLAGS@" LIBS=@MODULES_LIBADD@ LDFLAGS="" usage() { cat <