gnarwl-3.6/0000755000175100037440000000000011150326024012000 5ustar koboldadmingnarwl-3.6/contrib/0000755000175100037440000000000010215037505013444 5ustar koboldadmingnarwl-3.6/contrib/scripts/0000755000175100037440000000000010215037505015133 5ustar koboldadmingnarwl-3.6/contrib/Makefile0000644000175100037440000000005610215047236015107 0ustar koboldadmincatch: $(MAKE) -C .. all clean: install: gnarwl-3.6/contrib/README0000644000175100037440000000006110215047236014323 0ustar koboldadminThis directory contains contributions to gnarwl. gnarwl-3.6/contrib/horde/0000755000175100037440000000000010215037505014545 5ustar koboldadmingnarwl-3.6/contrib/horde/gnarwl.php0000644000175100037440000000611510215047236016555 0ustar koboldadmin, 2003. */ class Vacation_Driver_gnarwl extends Vacation_Driver { var $params; function Vacation_Driver_gnarwl($params = array()) { $this->params = $params; } function check_config() { if (empty($this->params['ldap_server']) || empty($this->params['ldap_base']) ) { $this->err_str = _("The module is not properly configured!"); return false; } return true; } /* * @param string $user The username to enable vacation for. * @param string $realm The realm of the user - isn't used with gnarwl. * @param string $pass The password for the user. * @param string $message The message to install. */ function set_vacation($user, $realm, $pass, $message) { if (!$this->check_config()) {return false;} $connect=ldap_connect($this->params['ldap_server']) or die($this->err_str = ("Can't connect to LDAP Server") ); $bind=ldap_bind($connect, "uid=$user,".$this->params['ldap_base'], $pass); if ($bind) { $info["vacationInfo"]=utf8_encode($message); $info["vacationActive"]="TRUE"; $r=ldap_modify($connect,"uid=$user," . $this->params['ldap_base'], $info); if (!$r) {$this->err_str = _(ldap_error($connect));return false;} } else {$this->err_str = _("Couldn't bind to LDAP server");return false;} return true; ldap_close($connect); } function unset_vacation($user, $realm, $pass, $message) { if (!$this->check_config()) {return false;} $connect=ldap_connect($this->params['ldap_server']) or die($this->err_str = ("Can't connect to LDAP Server") ); $bind=ldap_bind($connect, "uid=$user,".$this->params['ldap_base'], $pass); if ($bind) { $info["vacationActive"]="FALSE"; $r=ldap_modify($connect,"uid=$user," . $this->params['ldap_base'], $info); if (!$r) {$this->err_str = _(ldap_error($connect));return false;} } else {$this->err_str = _("Couldn't bind to LDAP server");return false;} return true; ldap_close($connect); } } ?> gnarwl-3.6/src/0000755000175100037440000000000011150326001012562 5ustar koboldadmingnarwl-3.6/src/damnit.c0000644000175100037440000001022211030253476014213 0ustar koboldadmin#include #include #include #include #include #include #include #include #include "dbaccess.h" #include "config.h" #include "util.h" // How to display data char *format="%time -> %entry\n"; /** * Print usage information */ void printUsage() { printf("\nDAMNIT(v%s) - DAtabase MAnagement InTerface\n\n\ Damnit is a tool for listing/editing gnarwl's database files.\n\ Options:\n\n\ \t-h\t\t\t print usage information\n\ \t-d []\t delete from \n\ \t-a []\t add to \n\ \t-l \t\t list database file\n\ \t-f \t\t select output format (use with -l)\n\n",VERSION); exit(EXIT_SUCCESS); } /** * Print the contents of a db file (formated) * @param key key in the database * @param val value in the database */ void printFormated(const char* key, const time_t val) { char *tmp=NULL; char *tmp2=NULL; cpyStr(&tmp,format); cpyStr(&tmp2,ctime(&val)); if (tmp2[strlen(tmp2)-1]=='\n') tmp2[strlen(tmp2)-1]='\0'; expandVars(&tmp,"%entry",(char*)key); expandVars(&tmp,"%time",tmp2); expandVars(&tmp,"%tstamp","%d"); expandVars(&tmp,"\\n","\n"); expandVars(&tmp,"\\t","\t"); /* free(tmp2); tmp2=(char*)calloc(strlen(tmp)+2,sizeof(char)); if(tmp2==NULL) oom(); strcpy(tmp2,tmp); if (tmp2[strlen(tmp2)]!='\n') tmp2[strlen(tmp2)]='\n'; */ printf(tmp,(int)val); free(tmp); free(tmp2); } /** * List the contents of a db file */ void listFile(char *name) { GDBM_FILE dbf; datum key; datum val; time_t t; dbf=dbOpen(name,GDBM_READER); if (dbf==NULL) { printf("IO Error: %s\n",name); exit(EXIT_FAILURE); } key = gdbm_firstkey ( dbf ); while (key.dptr!=NULL) { val = gdbm_fetch(dbf,key); if (val.dsize==sizeof(time_t)) { memcpy(&t,val.dptr,sizeof(t)); printFormated(key.dptr,t); } free(val.dptr); val.dptr=key.dptr; key = gdbm_nextkey(dbf,key); free(val.dptr); } dbClose(dbf); } void addToFile(char *fname, char *entry) { GDBM_FILE dbf; datum key; datum val; time_t t; dbf=dbOpen(fname,GDBM_WRCREAT); if (dbf==NULL) { printf("IO error: %s\n",fname); exit(EXIT_FAILURE); } t=time(NULL); key.dptr=entry; key.dsize=strlen(entry)+1; val.dptr=(char*)malloc(sizeof(t)); if (val.dptr==NULL) { printf("Out of memory"); exit(EXIT_FAILURE); } memcpy(val.dptr,&t,sizeof(t)); val.dsize=sizeof(t); if (gdbm_store(dbf,key,val,GDBM_REPLACE)!=0) { printf("IO error: %s\n",fname); dbClose(dbf); exit(EXIT_FAILURE); } dbClose(dbf); } void delFromFile(char* fname, char* entry) { GDBM_FILE dbf; datum key; dbf=dbOpen(fname,GDBM_WRITER); if (dbf==NULL) { printf("IO error: %s\n",fname); exit(EXIT_FAILURE); } key.dptr=entry; key.dsize=strlen(entry)+1; if (!gdbm_exists(dbf,key)) { printf("Key not in database: %s\n",entry); exit(EXIT_FAILURE); } if (gdbm_delete(dbf,key)!=0) { printf("IO error: %s",fname); dbClose(dbf); exit(EXIT_FAILURE); } dbClose(dbf); } int main(int argc,char **argv) { int ch; char* fname=NULL; char* val=NULL; char buf[MAXLINE]; setDefaults(); if (argc==1) printUsage(); while ((ch = getopt(argc, argv, "hf:l:a:d:")) != EOF) { switch((char)ch) { case 'h': printUsage(); case 'f': {format=optarg;break;} case 'l': { listFile(optarg); exit(EXIT_SUCCESS); } case 'a': { fname=optarg; val=argv[optind]; if (val!=NULL) addToFile(fname,val); else while (fgets(buf,(int)sizeof(buf),stdin) && (*buf != '\n')) { if (buf[strlen(buf)-1]=='\n') buf[strlen(buf)-1]='\0'; addToFile(fname,buf); } exit(EXIT_SUCCESS); } case 'd': { fname=optarg; val=argv[optind]; if (val!=NULL) delFromFile(fname,val); else while (fgets(buf,(int)sizeof(buf),stdin) && (*buf != '\n')) { if (buf[strlen(buf)-1]=='\n') buf[strlen(buf)-1]='\0'; delFromFile(fname,buf); } exit(EXIT_SUCCESS); } } } return EXIT_SUCCESS; } gnarwl-3.6/src/config.h0000644000175100037440000000347310215047236014222 0ustar koboldadmin/** * Holds the data of the config file */ struct conf { char *base; // LDAP base char *uid; // LDAP bind dn char *pwd; // LDAP bind password char *server; // LDAP server char *qfilter; // LDAP query filter char *result; // LDAP attribute containing the mail body int scope; // LDAP search scope int port; // LDAP server port int protver; // LDAP protocol version char *charset; // Locale charset for character conversion char *mfilter; // Path to dbfile, containing mail deny patterns char *dbdir; // Path where the blockfiles are stored char *mta; // Path to the MTA char *mta_opts; // Optional arguments for the MTA char *blist; // Path to dbfile, containing address deny patterns char *mailheader; // Path to the txtfile, containing standard header char *mailfooter; // Path to the txtfile, containing standard footer char *map_sender; // Macroname for "From:" header char *map_receiver; // Macroname for "To:" and "Cc:" header char **recv_header; // Which headers hold recepient addresses char *map_subject; // Macroname for "Subject:" header char **macro_attr; // List of additional LDAP attributes char **macro_name; // List of macronames for the attributes above int dbexp; // How long to block emailaddresses int maxmail; // max number of recepients allowed int maxheader; // max number of header lines allowed in mail int umask; // file creation mask for db files }; /** * Enter a key/value pair into the config structure * @param key the keyword from the configfile * @param val the value of the keyword from the configfile */ void putEntry(char*, char*); /** * Fill the configstructure with default values */ void setDefaults(void); /** * Fill the configstructure with values from a configfile * @param fname name of the configfile */ void readConf(char*); gnarwl-3.6/src/util.h0000644000175100037440000000331410215047236013724 0ustar koboldadmin/** * Out Of Memory - print error message to syslog, exit ungracefully */ void oom(); /** * Replace variables in text. * @param txt the text buffer * @param s string representing the variable * @param r replacement for s * If txt or s is NULL, this function will simply return, if r is null, s * will be cut out of txt (in this case r is modifyed). If s is/contains * a substring of r, this function returns without doing anything. */ void expandVars(char** txt,char* s,char* r); /** * Split a string into tokens. * @param str the string to split * @param idx stop tokenization after finding idx tokens (the rest of the * string will be put into the last token, no matter how many delimeters it * may contain). A value of 0 means: return the complete string, while -1 * stands for unlimited tokens. * @param delim char to * @return a NULL terminated array with substrings of str */ char **splitString(const char*, int idx, char delim); /** * Read the contents of a file * @param fname - name of the file to read * @return a pointer do the read in content or NULL */ char* readFile(char* fname); /** * Strip anything of a string, that is not a valid rcf822 address. * @param d the "dirty" emailaddress. Anything, that does not like like * an emaladdress is stripped of. The argument will be set to NULL, if * it does not contain a valid address. */ void cleanAddress(char** d); /** * Copy a string * @param dest destination buffer - will first be freed and then made * the proper size to hold the src string * @param src source string */ void cpyStr(char** des, const char* src); /** * Convert between charsets. * @param txt pointer to the string to convert */ void translateString(char** txt); gnarwl-3.6/src/dbaccess.c0000644000175100037440000001511011150323404014477 0ustar koboldadmin#include #include #include #include #include #include #include #include #include #include #include #include #include "config.h" #include "util.h" #include "dbaccess.h" #include "mailhandler.h" #ifndef __LCLINT__ #include #endif extern struct conf cfg; extern char* sender; extern char** receivers; extern char* subject; extern int verbose; /** * Cache for file pointed to by cfg.mailheader */ char* header=NULL; /** * Cache for file pointed to by cfg.mailfooter */ char* footer=NULL; /** * Persistant connection to the LDAP server */ LDAP *ldcon; void dbCacheHF(void) { if (header!=NULL || footer!=NULL) return; if (cfg.mailheader!=NULL) { header=readFile(cfg.mailheader); } if (cfg.mailfooter!=NULL) { footer=readFile(cfg.mailfooter); } if (header==NULL) header=(char*)calloc(1,sizeof(char)); if (footer==NULL) footer=(char*)calloc(1,sizeof(char)); } int dbCheck( char* she, char* me) { GDBM_FILE dbf=NULL; char *fname=NULL; datum data; datum key; time_t t; // Skip the whole hassle, if the admin feels lucky if (cfg.dbexp==0) return TRUE; fname=(char*)calloc(strlen(me)+strlen(cfg.dbdir)+5,sizeof(char)); if (fname==NULL) oom(); strcpy(fname,cfg.dbdir); if (fname[strlen(fname)-1]!='/') fname[strlen(fname)]='/'; strcat(fname,me); dbf=dbOpen(fname,GDBM_READER); if (dbf==NULL) dbf=dbOpen(fname,GDBM_WRCREAT); if (dbf==NULL) { syslog(LOG_MAIL|LOG_WARNING,"CRIT/IO %s",fname); exit(EXIT_FAILURE); } key.dptr=she; key.dsize=(int)strlen(she)+1; data=gdbm_fetch(dbf,key); if (data.dptr==NULL) { gdbm_close(dbf); free(fname); return TRUE; } gdbm_close(dbf); memcpy(&t,data.dptr,sizeof(t)); free(data.dptr); free(fname); if (time(NULL)-t>TIMEFACTOR*cfg.dbexp) return TRUE; return FALSE; } void dbLock( char* he, char* me) { GDBM_FILE dbf; char *fname; datum key; datum data; time_t ret; // Skip the whole hassle, if the admin feels lucky if (cfg.dbexp==0) return; fname=(char*)calloc(strlen(me)+strlen(cfg.dbdir)+5,sizeof(char)); if (fname==NULL) oom(); strcpy(fname,cfg.dbdir); if (fname[strlen(fname)-1]!='/') fname[strlen(fname)]='/'; strcat(fname,me); dbf=dbOpen(fname,GDBM_WRITER); if (dbf==NULL) { syslog(LOG_MAIL|LOG_WARNING,"CRIT/IO error locking '%s' for writing",fname); exit(EXIT_FAILURE); } key.dptr=he; key.dsize=strlen(he)+1; ret=time(NULL); data.dptr=(char*)malloc(sizeof(ret)); if (data.dptr==NULL) oom(); memcpy(data.dptr,&ret,sizeof(ret)); data.dsize=(int)sizeof(ret); free(fname); if (gdbm_store(dbf,key,data,GDBM_REPLACE)!=0) { gdbm_close(dbf); syslog(LOG_MAIL|LOG_WARNING,"CRIT/IO %s",me); exit (EXIT_FAILURE); } gdbm_close(dbf); } GDBM_FILE dbOpen( char* fname, int mode) { GDBM_FILE dbf; int retrycount=0; struct stat fs; if (fname==NULL) return NULL; if ( (mode==GDBM_READER) && (stat(fname,&fs)==-1) ) return NULL; do { dbf=gdbm_open(fname,0,mode,cfg.umask,NULL); if (dbf!=NULL) break; retrycount++; srand(time(NULL)); sleep(1+(int) (10.0*rand()/(RAND_MAX+1.0))); } while ((errno == EAGAIN) && (retrycount<=10)); return dbf; } void dbClose(GDBM_FILE dbf_ptr) { if (dbf_ptr==NULL) return; gdbm_close(dbf_ptr); dbf_ptr=NULL; } int dbContains(const char* str_ptr, GDBM_FILE dbf_ptr) { datum key; if ((str_ptr==NULL) || (dbf_ptr==NULL)) return FALSE; key.dptr=(char*)str_ptr; key.dsize=(int)strlen(key.dptr)+1; if (gdbm_exists(dbf_ptr,key)) return TRUE; return FALSE; } void dbConnect() { int rc; ldcon=ldap_init(cfg.server,cfg.port); if (ldcon==NULL) { syslog(LOG_MAIL|LOG_ERR,"CRIT/LDAP Connection failed"); exit(EXIT_FAILURE); } #ifdef HAVE_LDAP_SET_OPTION if (cfg.protver==LDAP_PROTOCOL_DETECT) { int prot=LDAP_VERSION2; ldap_set_option(ldcon,LDAP_OPT_PROTOCOL_VERSION, &prot); if (ldap_simple_bind_s(ldcon,cfg.uid,cfg.pwd)==LDAP_SUCCESS) return; prot=LDAP_VERSION3; ldap_set_option(ldcon,LDAP_OPT_PROTOCOL_VERSION, &prot); if (ldap_simple_bind_s(ldcon,cfg.uid,cfg.pwd)==LDAP_SUCCESS) return; } else ldap_set_option(ldcon,LDAP_OPT_PROTOCOL_VERSION, &cfg.protver); #endif rc=ldap_simple_bind_s(ldcon,cfg.uid,cfg.pwd); if (rc!=LDAP_SUCCESS) { syslog(LOG_MAIL|LOG_ERR,"CRIT/LDAP %s",ldap_err2string(rc)); exit(EXIT_FAILURE); } } void dbDisconnect() { if (header!=NULL) { free(header); header=NULL;} if (footer!=NULL) { free(footer); footer=NULL;} ldap_unbind(ldcon); } char** dbQuery(const char* mail) { LDAPMessage *res; struct timeval maxwait; char *tmp=NULL; char **entry; char **retbuf; int i; maxwait.tv_sec=LDAPQUERY_MAXWAIT; maxwait.tv_usec=0; cpyStr(&tmp,cfg.qfilter); expandVars(&tmp,cfg.map_receiver,(char*)mail); expandVars(&tmp,cfg.map_sender,sender); i=ldap_search_st(ldcon,cfg.base,cfg.scope,tmp,cfg.macro_attr,0,&maxwait,&res); if (i!=LDAP_SUCCESS) { if (verbose>=LVL_WARN) { syslog(LOG_MAIL|LOG_WARNING,"WARN/LDAP Wrong query base?"); } retbuf=(char**)calloc(1,sizeof(char**)); if (retbuf==NULL) oom(); return retbuf; } i=ldap_count_entries(ldcon,res); retbuf=(char**)calloc(i+1,sizeof(char**)); if (retbuf==NULL) oom(); if (i==0){ if (verbose>=LVL_DEBUG) syslog(LOG_MAIL|LOG_DEBUG,"DEBUG/LDAP No match: %s",tmp); return retbuf; } free(tmp); tmp=NULL; dbCacheHF(); res=ldap_first_entry(ldcon,res); if (res==NULL) return retbuf; i=0; while(res!=NULL) { int count=0; char **attr; entry=ldap_get_values(ldcon,res,cfg.result); if (entry!=NULL && entry[0]!=NULL) { retbuf[i]=(char*)malloc((strlen(header)+strlen(footer)+strlen(entry[0])+5)*sizeof(char)); if (retbuf[i]==NULL) oom(); retbuf[i][0]='\0'; strcat(retbuf[i],header); strcat(retbuf[i],entry[0]); strcat(retbuf[i],footer); expandVars(&retbuf[i],cfg.map_subject,subject); expandVars(&retbuf[i],cfg.map_sender,sender); expandVars(&retbuf[i],cfg.map_receiver,(char*)mail); while(cfg.macro_name[count]!=NULL) { attr=ldap_get_values(ldcon,res,cfg.macro_attr[count]); if (attr!=NULL && attr[0]!=NULL) { expandVars(&retbuf[i],cfg.macro_name[count],attr[0]); ldap_value_free(attr); } else expandVars(&retbuf[i],cfg.macro_name[count],""); count++; } ldap_value_free(entry); i++; } res=ldap_next_entry(ldcon,res); } return retbuf; } gnarwl-3.6/src/util.c0000644000175100037440000001050111030253741013707 0ustar koboldadmin#include #include #include #include #include #include #include #include #include #include #ifdef HAVE_ICONV #include #endif #include "config.h" #include "util.h" #ifndef __LCLINT__ #include #endif extern int verbose; extern struct conf cfg; void expandVars(char** txt, char* s,char *r) { int x; int ns; int sl; char *tmp; char *tmp2=NULL; if (((*txt)==NULL) || (s==NULL)) return; if (r==NULL) r=""; // Quickfix: If s is/contains a substring of r, bail out before going into // an infinite loop for(x=0;x<(int)strlen(r);x++) { if (!strcasecmp(r+x,s)) { return; } } cpyStr(&tmp2,*txt); sl=strlen(tmp2); for (x=0;x-1) x=len; while(str[x]!=delim && x=0;m--) if (s[m]=='>') { r=m-1; break; } for(m=0;m<(int)strlen(s);m++) { if (r>-1 && l>-1) { if (mr) s[m]='*'; } else { if (! ( ((s[m]>47)&&(s[m]<58)) || ((s[m]>63)&&(s[m]<91)) || ((s[m]>96)&&(s[m]<123)) || s[m]=='.' || s[m]=='-' || s[m]=='_' ) ) s[m]='*'; } } tmp=splitString(s,1,'*'); m=1; while (tmp[m]!=NULL) {free(tmp[m]); m++;} free(*d); *d=tmp[0]; if (tmp[0]!=NULL) for(m=0;m<(int)strlen(tmp[0]);m++) tmp[0][m]=(char)tolower(tmp[0][m]); } void cpyStr(char** dest, const char* src) { if (*dest!=NULL) free(*dest); *dest=(char*)malloc((strlen(src)+1)*sizeof(char)); if (*dest==NULL) oom(); strcpy(*dest,src); } void translateString(char** txt) { #ifdef HAVE_ICONV char* in=*txt; char* out; size_t inlen; size_t outlen; iconv_t conv; char* to; #endif if (cfg.charset==NULL) return; #ifdef HAVE_ICONV conv=iconv_open(cfg.charset, LDAP_CHARSET); if (conv != (iconv_t) -1) { inlen=strlen(in); outlen=inlen; to=(char*)calloc(inlen+1,sizeof(char)); if (to==NULL) oom(); out=to; while(inlen > 0 && outlen > 0) { if(iconv(conv, &in, &inlen, &out, &outlen) != 0) { in++; inlen--; } } iconv_close(conv); *out='\0'; free(*txt); *txt=to; } else { syslog(LOG_MAIL|LOG_WARNING,"WARN/MAIL charset conversion failed (errno: %s)",strerror(errno)); } #endif } gnarwl-3.6/src/mailhandler.c0000644000175100037440000001375611030253705015231 0ustar koboldadmin#include #include #include #include #include #include #include #ifndef __LCLINT__ #include #endif #include #include "mailhandler.h" #include "config.h" #include "util.h" #include "dbaccess.h" /** * config structure from config.h */ extern struct conf cfg; /** * Verbose logging? */ extern int verbose; /** * Filepointer to the blacklist */ GDBM_FILE dbf_b=NULL; /** * Filepointer to the mailfilter */ GDBM_FILE dbf_f=NULL; void addAddr(const char* adr) { int i=0; if (adr==NULL) return; while(receivers[i]!=NULL) { if(!strcasecmp(receivers[i], adr)) return; i++; } if (dbContains(adr,dbf_b)) { mail_status=mail_status|MAIL_BLADDR; return; } if (i>cfg.maxmail) { mail_status=mail_status|MAIL_TOOMANY; return; } receivers=(char**)realloc(receivers,(i+2)*sizeof(char**)); if (receivers==NULL) oom(); receivers[i]=NULL; receivers[i+1]=NULL; cpyStr(&(receivers[i]),adr); } void parseHeader(const char* hl) { char** tmp; int i=0; tmp=splitString(hl,1,':'); if (tmp[0]==NULL || tmp[1]==NULL) return; // Cosmetics: Strip leading space of header data if (tmp[1][0]==' ') memmove(tmp[1],tmp[1]+sizeof(char),strlen(tmp[1])); if(!strcasecmp("sender",tmp[0]) && (mail_status&MAIL_PREDEF_SENDER)!=MAIL_PREDEF_SENDER) { cleanAddress(&tmp[1]); if (tmp[1]==NULL) { mail_status=mail_status|MAIL_LACK; } else { cpyStr(&sender,tmp[1]); } mail_status=mail_status|MAIL_HAS_SENDER; } if(!strcasecmp("reply-to",tmp[0]) && (mail_status&MAIL_PREDEF_SENDER)!=MAIL_PREDEF_SENDER && (mail_status&MAIL_HAS_SENDER)!=MAIL_HAS_SENDER) { cleanAddress(&tmp[1]); if (tmp[1]==NULL) { mail_status=mail_status|MAIL_LACK; } else { cpyStr(&sender,tmp[1]); } mail_status=mail_status|MAIL_HAS_REPLYTO; } if(!strcasecmp("from",tmp[0]) && (mail_status&MAIL_PREDEF_SENDER)!=MAIL_PREDEF_SENDER && (mail_status&MAIL_HAS_SENDER)!=MAIL_HAS_SENDER && (mail_status&MAIL_HAS_REPLYTO)!=MAIL_HAS_REPLYTO) { cleanAddress(&tmp[1]); if (tmp[1]==NULL) { mail_status=mail_status|MAIL_LACK; } else { cpyStr(&sender,tmp[1]); } } if(!strcasecmp("subject",tmp[0])) { cpyStr(&subject,tmp[1]); } if(!strcasecmp("message-id",tmp[0])) { cpyStr(&messageid,tmp[1]); } while( (mail_status&MAIL_PREDEF_RECEIVER)!=MAIL_PREDEF_RECEIVER && cfg.recv_header[i]!=NULL) { if((!strcasecmp(cfg.recv_header[i],tmp[0]) ) ) { char** buf=NULL; int c=0; buf=splitString(tmp[1],-1,','); while(buf[c]!=NULL) { cleanAddress(&buf[c]); addAddr(buf[c]); free(buf[c]); c++; } } i++; } free(tmp[0]); free(tmp[1]); } void readFromSTDIN(void) { char ibuf[MAXLINE]; // "inputbuffer" char *bbuf=NULL; // "backbuffer" int lc=0; while (fgets(ibuf,(int)sizeof(ibuf)-1,stdin) && (*ibuf != '\n') && (lc <= cfg.maxheader)) { // delete trailing newline character (messes up folded lines and filter) ibuf[strlen(ibuf)-1]='\0'; if (dbContains(ibuf,dbf_f)) mail_status=mail_status|MAIL_BADHEADER; if (bbuf==NULL) cpyStr(&bbuf,ibuf); else { if (ibuf[0]==' ' || ibuf[0]=='\t') { bbuf=(char*)realloc(bbuf,(strlen(bbuf)+strlen(ibuf)+1)*sizeof(char)); if (bbuf==NULL) oom(); strcat(bbuf,ibuf+sizeof(char)); } else { parseHeader(bbuf); free(bbuf); bbuf=NULL; cpyStr(&bbuf,ibuf); } } lc++; } if (bbuf!=NULL) { parseHeader(bbuf); free(bbuf);} if (lc>cfg.maxheader) mail_status=mail_status|MAIL_TOOBIG; // Dummy instruction to empty stdin while (fgets(ibuf,(int)sizeof(ibuf)-1,stdin)) lc++; return; } int receiveMail(char** recv, const char* sndr) { mail_status=MAIL_NOTSPECIAL; messageid=NULL; sender=NULL; subject=NULL; cpyStr(&messageid,"No ID found"); receivers=(char**)calloc(1,sizeof(char**)); if (receivers==NULL) oom(); if (cfg.mfilter!=NULL) { dbf_f=dbOpen(cfg.mfilter,GDBM_READER); if (dbf_f==NULL && (verbose>=LVL_WARN) ) { syslog(LOG_MAIL|LOG_WARNING,"WARN/IO %s",cfg.mfilter); } } if (cfg.blist!=NULL) { dbf_b=dbOpen(cfg.blist,GDBM_READER); if (dbf_b==NULL && (verbose>=LVL_WARN) ) { syslog(LOG_MAIL|LOG_WARNING,"WARN/IO %s",cfg.blist); } } if (recv[0]!=NULL) { int i=0; mail_status=mail_status|MAIL_PREDEF_RECEIVER; while(recv[i]!=NULL) {addAddr(recv[i]);i++;} } if (sndr!=NULL) { sender=NULL; mail_status=mail_status|MAIL_PREDEF_SENDER; cpyStr(&sender,sndr); } readFromSTDIN(); if (sender==NULL || receivers[0]==NULL) mail_status=mail_status|MAIL_LACK; dbClose(dbf_f); dbClose(dbf_b); if (verbose>=LVL_DEBUG) { syslog(LOG_MAIL|LOG_DEBUG,"DEBUG/MAIL Code: %d MessageID: %s",mail_status,messageid); } if (mail_status>=MAIL_BADHEADER) return FALSE; return TRUE; } void sendMail(char* addr, char* body) { int p[2]; int c; char* tmp=NULL; FILE *desc; if (pipe(p)!=0) { syslog(LOG_MAIL|LOG_ERR,"CRIT/MAIL pipe to MTA failed"); exit(EXIT_FAILURE); } c=fork(); if (c<0) { syslog(LOG_MAIL|LOG_ERR,"CRIT/MAIL couldn't fork MTA"); exit(EXIT_FAILURE); } if (c==0) { (void)dup2(p[0],0); (void)close(p[0]); (void)close(p[1]); tmp=(char*)calloc((strlen(cfg.mta)+strlen(cfg.mta_opts)+4),sizeof(char)); if(tmp==NULL) oom(); strcpy(tmp,cfg.mta); tmp[strlen(cfg.mta)]=' '; strcat(tmp,cfg.mta_opts); expandVars(&tmp,cfg.map_sender,sender); expandVars(&tmp,cfg.map_receiver,addr); (void)execv(cfg.mta,splitString(tmp,-1,' ')); syslog(LOG_MAIL|LOG_ERR,"CRIT/MAIL execv(3) returned: %s",tmp); exit(EXIT_FAILURE); } close(p[0]); desc=fdopen(p[1],"w"); fprintf(desc,body); fclose(desc); wait(NULL); if (verbose>=LVL_INFO) { syslog(LOG_MAIL|LOG_INFO,"INFO/MAIL sent mail: %s -> %s",addr, sender); } if(tmp!=NULL) free(tmp); } gnarwl-3.6/src/Makefile0000644000175100037440000000064510215047236014242 0ustar koboldadminOBJ=config.o dbaccess.o util.o mailhandler.o SOBJ=config.o dbaccess.o util.o catch: $(MAKE) -C .. all: clean compile compile: $(OBJ) $(SOBJ) $(CC) $(CFLAGS) $(LFLAGS) -o $(BIN) gnarwl.c $(OBJ) $(CC) $(CFLAGS) $(LFLAGS) -o $(SBIN) damnit.c $(SOBJ) clean: rm -f DEADJOE *.o *~ $(BIN) $(SBIN) install: mkdir -m 755 -p $(BINDIR) $(SBINDIR) install -m 755 -s $(BIN) $(BINDIR) install -m 755 -s $(SBIN) $(SBINDIR) gnarwl-3.6/src/config.c0000644000175100037440000001277711030254022014211 0ustar koboldadmin#include #include #include #include #include #ifndef __LCLINT__ #include #endif #include #include "config.h" #include "util.h" #ifndef LDAP_VERSION2 #define PROTVER2 LDAP_PROTOCOL_DETECT #else #define PROTVER2 LDAP_VERSION2 #endif #ifndef LDAP_VERSION3 #define PROTVER3 LDAP_PROTOCOL_DETECT #else #define PROTVER3 LDAP_VERSION3 #endif struct conf cfg; int verbose=LVL_CRIT; void putEntry(char* key, char* val) { if (key==NULL || val==NULL) return; if (!strcasecmp(key,"login")) { cfg.uid=val; return; } if (!strcasecmp(key,"password")) { cfg.pwd=val; return; } if (!strcasecmp(key,"badheaders")) { cfg.mfilter=val; return; } if (!strcasecmp(key,"blacklist")) { cfg.blist=val; return; } if (!strcasecmp(key,"forceheader")) { cfg.mailheader=val; return; } if (!strcasecmp(key,"forcefooter")) { cfg.mailfooter=val; return; } // val may not be NULL below if (!strcasecmp(key,"map_field")) { int i=0; char **entry=splitString(val,1,' '); free(val); if (entry[1]==NULL) return; while(cfg.macro_attr[i]!=NULL) i++; cfg.macro_attr=(char**)realloc(cfg.macro_attr,(i+2)*sizeof(char**)); cfg.macro_name=(char**)realloc(cfg.macro_name,(i+2)*sizeof(char**)); if (cfg.macro_attr==NULL || cfg.macro_name==NULL) oom(); cfg.macro_attr[i+1]=NULL; cfg.macro_name[i+1]=NULL; cfg.macro_attr[i]=entry[1]; cfg.macro_name[i]=entry[0]; return; } if (!strcasecmp(key,"server")) { cfg.server=val; return; } if (!strcasecmp(key,"port")) { cfg.port=atoi(val); return; } if (!strcasecmp(key,"scope")) { if (!strcasecmp(val,"base")) cfg.scope=LDAP_SCOPE_BASE; if (!strcasecmp(val,"one")) cfg.scope=LDAP_SCOPE_ONELEVEL; if (!strcasecmp(val,"sub")) cfg.scope=LDAP_SCOPE_SUBTREE; return; } if (!strcasecmp(key,"base")) { cfg.base=val; return; } if (!strcasecmp(key,"queryfilter")) { cfg.qfilter=val; return; } if (!strcasecmp(key,"result")) { cfg.result=val; return; } if (!strcasecmp(key,"charset")) { cfg.charset=val; return; } if (!strcasecmp(key,"map_sender")) { cfg.map_sender=val; return; } if (!strcasecmp(key,"map_receiver")) { cfg.map_receiver=val; return; } if (!strcasecmp(key,"blockfiles")) { cfg.dbdir=val; return; } if (!strcasecmp(key,"blockexpire")) { cfg.dbexp=atoi(val); return; } if (!strcasecmp(key,"mta")) { char** tmp=splitString(val,1,' '); free(val); val=NULL; if(tmp[0]!=NULL) cfg.mta=tmp[0]; if(tmp[1]!=NULL) cfg.mta_opts=tmp[1]; return; } if (!strcasecmp(key,"recvheader")) { int i=0; char** tmp=splitString(val,-1,' '); free(val); while(cfg.recv_header[i]!=NULL) { free(cfg.recv_header[i]); i++; } free(cfg.recv_header); i=0; while(tmp[i]!=0) i++; cfg.recv_header=(char**)malloc((i+1)*sizeof(char**)); cfg.recv_header=tmp; return; } if (!strcasecmp(key,"map_subject")) { cfg.map_subject=val; return; } if (!strcasecmp(key,"maxreceivers")) { cfg.maxmail=atoi(val); return; } if (!strcasecmp(key,"maxheader")) { // Adding 2 is a cosmetical fix cfg.maxheader=atoi(val)+2; return; } if (!strcasecmp(key,"loglevel")) { verbose=atoi(val); return; } if (!strcasecmp(key,"umask")) { //val[0]=' '; cfg.umask=(int)strtol(val,NULL,8); return; } if (!strcasecmp(key,"protocol")) { switch(atoi(val)) { case 2: {cfg.protver=PROTVER2; break;} case 3: {cfg.protver=PROTVER3; break;} } return; } syslog(LOG_MAIL|LOG_WARNING,"WARN/CFG Unknown config directive: %s",key); } void setDefaults(void) { cfg.umask=UMASK; cfg.base=DEFAULT_BASE; cfg.protver=LDAP_PROTOCOL_DETECT; cfg.uid=NULL; cfg.pwd=NULL; cfg.server=DEFAULT_SERVER; cfg.qfilter=DEFAULT_QFILTER; cfg.mfilter=NULL; cfg.scope=LDAP_SCOPE_SUBTREE; cfg.port=LDAP_PORT; cfg.dbdir=BLOCKDIR; cfg.dbexp=DEFAULT_EXPIRE; cfg.mta=DEFAULT_MTA; cfg.mta_opts=""; cfg.blist=NULL; cfg.charset=NULL; cfg.maxmail=DEFAULT_MAIL_LIMIT; cfg.maxheader=DEFAULT_MAIL_LIMIT; cfg.result=DEFAULT_MES; cfg.map_sender=DEFAULT_MAP_SENDER; cfg.map_receiver=DEFAULT_MAP_RECEIVER; cfg.map_subject=DEFAULT_MAP_SUBJECT; cfg.macro_attr=(char**)calloc(1,sizeof(char**)); cfg.macro_name=(char**)calloc(1,sizeof(char**)); cfg.recv_header=(char**)calloc(3,sizeof(char**)); cpyStr(&cfg.recv_header[0],"to"); cpyStr(&cfg.recv_header[1],"cc"); if (cfg.macro_attr==NULL || cfg.macro_name==NULL) oom(); } void readConf(char *cfile) { FILE *fptr; char buf[MAXLINE]; char** tmp; int pos=0; setDefaults(); fptr=fopen(cfile,"r"); if (fptr==NULL) { syslog(LOG_MAIL|LOG_ERR,"CRIT/IO %s",cfile); exit(EXIT_FAILURE); } while(((fgets(buf, (size_t)sizeof(buf), fptr)) && (buf != NULL))) { if (!((buf[0]=='#') || (*buf=='\n'))) { if (buf[strlen(buf)-1]=='\n') buf[strlen(buf)-1]='\0'; tmp=splitString(buf,1,' '); //printf("%s:%s\n",tmp[0],tmp[1]); putEntry(tmp[0],tmp[1]); free(tmp[0]); } } (void)fclose(fptr); while(cfg.macro_attr[pos]!=NULL) pos++; tmp=(char**)calloc(sizeof(char**)*2+pos*sizeof(char**),sizeof(char**)); if (tmp==NULL) oom(); memcpy(tmp,cfg.macro_attr,sizeof(char**)*pos); tmp[pos]=cfg.result; free(cfg.macro_attr); cfg.macro_attr=tmp; } gnarwl-3.6/src/mailhandler.h0000644000175100037440000000366410627636461015252 0ustar koboldadmin/** * Mail is ok */ #define MAIL_NOTSPECIAL 0 /** * Mail contains at least one blacklisted recepient */ #define MAIL_BLADDR 1 /** * Mail has predefined sender address */ #define MAIL_PREDEF_SENDER 2 /** * Mail has a predefined recepient address */ #define MAIL_PREDEF_RECEIVER 4 /** * Mail has a "reply-to:" header */ #define MAIL_HAS_REPLYTO 8 /** * Mail contains a forbidden header line */ #define MAIL_BADHEADER 16 /** * Mail has too many headers */ #define MAIL_TOOBIG 32 /** * Mail specifies to many recepients */ #define MAIL_TOOMANY 64 /** * Mail lacks important information */ #define MAIL_LACK 128 /** * Mail has a "Sender:" header */ #define MAIL_HAS_SENDER 256 /** * Status of the mail (calculated by ORing the above macros) */ int mail_status; /** * Message ID */ char* messageid; /** * sender of incomming mail (filled by receiveMail() ) */ char* sender; /** * subject of incomming mail (filled by receiveMail() ) */ char* subject; /** * receivers of incomming mail (filled by receiveMail() ) */ char** receivers; /** * Parse a headerline * @param hl pointer to the header to inspect */ void parseHeader(const char* hl); /** * Does the actual reading of the mail(header) from stdin. * @return number of lines read from stdin or -1 if the header contains * lines, that are no allowed */ void readFromSTDIN(void); /** * Takes care of retreiving and parsing mail. * @param recv Use these receivers, instead of searching the mail * @param sndr Use this sender, instead of searching the mail * @return TRUE the Mail contains all the data required for replying to */ int receiveMail(char** recv, const char* sndr); /** * Put a new mail address in the list of recepient mails * @param adr the a copy of adr will be put into the list */ void addAddr(const char* adr); /** * Send out mail * @param addr who is sending the mail * @param body the mail itself */ void sendMail(char* addr, char* body); gnarwl-3.6/src/gnarwl.c0000644000175100037440000000444411030253566014242 0ustar koboldadmin#include #include #include #include #ifndef __LCLINT__ #include #endif #include #include "util.h" #include "config.h" #include "dbaccess.h" #include "mailhandler.h" /* * We can't feed addresses from the "-a" switch directly to addAddr(), * as cfg.blacklist may not be set up, yet. So we cache them here. */ char** tmprecv=NULL; void printUsage(void) { printf("\nGNARWL(v%s) - Gnu Neat Auto Reply With LDAP\n\n\ Read email through stdin, reply to it, if nescessary\n\ Options:\n\n\ \t-h\t\tprint help\n\ \t-a
\tforce receiver address\n\ \t-s
\tforce sender address\n\ \t-c \tuse configfile (default: %s)\n\ \n",VERSION,CFGFILE); exit(EXIT_SUCCESS); } void tmpAddrStore(const char* adr) { int i=0; if(adr==NULL || adr[0]=='\0') return; while(tmprecv[i]!=NULL) { if(!strcasecmp(tmprecv[i],adr)) return; i++; } tmprecv=(char**)realloc(tmprecv,(i+2)*sizeof(char**)); if(tmprecv==NULL) oom(); tmprecv[i]=NULL; tmprecv[i+1]=NULL; cpyStr(&(tmprecv[i]),adr); cleanAddress(&(tmprecv[i])); } int main(int argc, char **argv) { int ch; char* cfg_file; char** rep; char* sndr=NULL; extern char** receivers; extern int verbose; cfg_file=CFGFILE; tmprecv=(char**)calloc(1,sizeof(char**)); if (tmprecv==NULL) oom(); while ((ch = getopt(argc, argv, "hc:a:s:")) != EOF) { switch((char)ch) { case 'h': printUsage(); break; case 'c': cfg_file=optarg;break; case 'a': tmpAddrStore(optarg);break; case 's': cpyStr(&sndr,optarg);cleanAddress(&sndr);break; } } openlog("gnarwl",LOG_PID,LOG_MAIL); readConf(cfg_file); if (receiveMail(tmprecv,sndr)==FALSE) return EXIT_SUCCESS; ch=0; dbConnect(); while(receivers[ch]!=NULL) { int i=0; rep=dbQuery(receivers[ch]); while(rep[i]!=NULL) { if (dbCheck(sender,receivers[ch])) { translateString(&rep[i]); sendMail(receivers[ch],rep[i]); dbLock(sender,receivers[ch]); } else { if (verbose>=LVL_DEBUG) { syslog(LOG_MAIL|LOG_DEBUG,"DEBUG/MAIL blocked: %s & %s",sender,receivers[ch]); } } free(rep[i]); i++; } ch++; } dbDisconnect(); closelog(); return EXIT_SUCCESS; } gnarwl-3.6/src/dbaccess.h0000644000175100037440000000364010215047235014517 0ustar koboldadmin#include #include /** * Reads the contents of cfg.mailheader and cfg.mailfooter. The data * is put in the global vars "header" and "footer". If the files are * not accessable, an empty string will be stored in the variables. * Subsequent calls to this method do nothing. */ void dbCacheHF(void); /** * Check whether or not it is ok to send a message * @param she the address to send to * @param me the address to act for * @return TRUE if gnarwl is allowed to send a mail for the she/me combo */ int dbCheck(char* she, char* me); /** * Lock a sender/receiver combo in the database * @param he remote address * @param me local address * @return TRUE entry was successfully entered into the database */ void dbLock( char* he, char* me); /** * Convinience method for opening gdbm files * @param fname name of the file to open. If NULL is passed, this function * simply returns; * @param mode, directly passed through to gdbm_open * @return a pointer to the opened file or NULL, if file could not be opened. */ GDBM_FILE dbOpen( char* fname, int mode); /** * Convinience method for closing gdbm files. * param dbf_ptr filepointer to close (may be NULL). After closing, the file, * dbf_ptr is set to NULL. */ void dbClose(GDBM_FILE dbf_ptr); /** * Convinience method, for checking, whether a string is stored as key * in a database. * @param str_ptr string to look for * @param dbf_ptr database to search * @return TRUE str_ptr is found as key in dbf_ptr. FALSE otherweise, or if * NULL was passed as a parameter. */ int dbContains(const char* str_ptr, GDBM_FILE dbf_ptr); /** * Connect to the LDAP database */ void dbConnect(); /** * Disconnect from LDAP database and clean up */ void dbDisconnect(); /** * Do a query on the LDAP database * @param mail emailaddress to query with * @return an NULL terminated array of emails, that belong to "mail". */ char** dbQuery(const char* mail); gnarwl-3.6/configure.ac0000644000175100037440000000304610215047236014277 0ustar koboldadmin# Process this file with autoconf to produce a configure script. AC_INIT() AC_CONFIG_HEADERS(conf.h) AC_CONFIG_FILES(Makefile) # Checks for programs. AC_PROG_CC AC_ARG_WITH(homedir,AC_HELP_STRING([--with-homedir=DIR],[Homedir for the gnarwl user]),[homedir="$withval"],[homedir="\${prefix}/var/lib/gnarwl"]) AC_ARG_WITH(docdir,AC_HELP_STRING([--with-docdir=DIR],[Where to install the docs]),docdir="$withval",docdir="\${prefix}/share/doc/packages/gnarwl") AC_ARG_WITH(useradd_prog,AC_HELP_STRING([--with-useradd_prog=DIR],[Programm for adding users]),useradd_prog="$withval",useradd_prog="/usr/sbin/useradd") AC_ARG_WITH(useradd_args,AC_HELP_STRING([--with-useradd_args=ARG],[Arguments for the useradd programm]),useradd_args="$withval",useradd_args="-r -s /bin/false -c \"Email autoreply agent\" -d \$(HOMEDIR) \$(BIN)") AC_ARG_WITH(mta,AC_HELP_STRING([--with-mta=prog],[MTA to use]),mta="\"$withval\"",mta="\"/usr/sbin/sendmail\"") AC_SUBST(homedir) AC_SUBST(docdir) AC_SUBST(useradd_prog) AC_SUBST(useradd_args) AC_ARG_WITH(permmask,AC_HELP_STRING([--with-permmask=MASK],[File creation mask for database files]),permmask="$withval",permmask="0600") AC_ARG_WITH(maxline,AC_HELP_STRING([--with-maxline=NUMBER],[Maximum input buffer line length]),maxline="$withval",maxline="2100") AC_SUBST(permmask) AC_SUBST(maxline) AC_CHECK_LIB([gdbm], [gdbm_open]) AC_CHECK_LIB([ldap],[ldap_init]) AC_CHECK_FUNCS([ldap_set_option]) AC_CHECK_FUNCS([iconv]) AC_DEFINE_UNQUOTED(UMASK,$permmask) AC_DEFINE_UNQUOTED(MAXLINE,$maxline) AC_DEFINE_UNQUOTED(DEFAULT_MTA,$mta) AC_OUTPUT gnarwl-3.6/data/0000755000175100037440000000000011150325605012715 5ustar koboldadmingnarwl-3.6/data/gnarwl-3.2.spec0000644000175100037440000000512410215047236015367 0ustar koboldadmin%define name gnarwl %define sname damnit %define version 3.2 %define mansec 8 %define homedir /var/lib/%{name} %define useradd_prg /usr/sbin/useradd %define useradd_arg -r -s /bin/false -c "Email autoreply agent" -d %{homedir} %{name} Name: %{name} Summary: An email autoresponder with LDAP support Version: %{version} Release: 1 License: GPL Group: Applications/Communications Source: %{name}-%{version}.tgz Requires: gdbm, openldap2 BuildRoot: %_tmppath/%{name}-%{version}-buildroot Packager: Patrick Ahlbrecht URL: http://www.oss.billiton.de/ %description Gnarwl is an email autoresponder, intended to be a successor to the old vacation(1) program. With gnarwl users are no longer required to have full blown system accounts, but may store their autoreply text compfortably within an LDAP database. %prep %setup %build ./configure --prefix=/usr --sysconfdir=%{_sysconfdir} --with-homedir=%{homedir} make %install %__rm -rf $RPM_BUILD_ROOT %__mkdir -p $RPM_BUILD_ROOT/%{_bindir} %__mkdir -p $RPM_BUILD_ROOT/%{_sbindir} %__mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man%{mansec} %__mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir} %__mkdir -p $RPM_BUILD_ROOT/%{homedir}/block %__mkdir -p $RPM_BUILD_ROOT/%{homedir}/bin %__cp src/%{name} $RPM_BUILD_ROOT/%{_bindir} %__cp src/%{sname} $RPM_BUILD_ROOT/%{_sbindir} %__cp data/header.txt $RPM_BUILD_ROOT/%{homedir} %__cp data/footer.txt $RPM_BUILD_ROOT/%{homedir} %__cp data/gnarwl.cfg $RPM_BUILD_ROOT/%{_sysconfdir} %__cp doc/%{name}.%{mansec} $RPM_BUILD_ROOT/%{_mandir}/man%{mansec} %__cp doc/%{sname}.%{mansec} $RPM_BUILD_ROOT/%{_mandir}/man%{mansec} %__gzip $RPM_BUILD_ROOT/%{_mandir}/man%{mansec}/* %__strip $RPM_BUILD_ROOT/%{_bindir}/%{name} %__strip $RPM_BUILD_ROOT/%{_sbindir}/%{sname} echo \|%{_bindir}/%{name} > $RPM_BUILD_ROOT/%{homedir}/.forward cat data/badheaders.txt | src/%{sname} -a $RPM_BUILD_ROOT/%{homedir}/badheaders.db cat data/blacklist.txt | src/%{sname} -a $RPM_BUILD_ROOT/%{homedir}/blacklist.db %files %defattr(0644,root,root) %doc doc/FAQ %doc doc/INSTALL %doc doc/LICENSE %doc doc/AUTHORS %doc doc/HISTORY %doc doc/README %doc doc/README.upgrade %doc doc/ISPEnv.schema %doc doc/ISPEnv2.schema %doc doc/example.ldif %{_mandir}/man%{mansec}/%{name}.%{mansec}.gz %{_mandir}/man%{mansec}/%{sname}.%{mansec}.gz %defattr(0755,root,root) %{_bindir}/%{name} %{_sbindir}/%{sname} %defattr(-,gnarwl,root) %{homedir} %defattr(0400,gnarwl,root) %config %{_sysconfdir}/%{name}.cfg %clean %__rm -rf $RPM_BUILD_ROOT %pre if ! %__grep %{name} /etc/passwd > /dev/null; then echo "Creating system account \"%{name}\"" ; %{useradd_prg} %{useradd_arg} ; fi gnarwl-3.6/data/gnarwl-3.4.spec0000644000175100037440000000512411035524743015375 0ustar koboldadmin%define name gnarwl %define sname damnit %define version 3.4 %define mansec 8 %define homedir /var/lib/%{name} %define useradd_prg /usr/sbin/useradd %define useradd_arg -r -s /bin/false -c "Email autoreply agent" -d %{homedir} %{name} Name: %{name} Summary: An email autoresponder with LDAP support Version: %{version} Release: 1 License: GPL Group: Applications/Communications Source: %{name}-%{version}.tgz Requires: gdbm, openldap2 BuildRoot: %_tmppath/%{name}-%{version}-buildroot Packager: Patrick Ahlbrecht URL: http://www.oss.billiton.de/ %description Gnarwl is an email autoresponder, intended to be a successor to the old vacation(1) program. With gnarwl users are no longer required to have full blown system accounts, but may store their autoreply text compfortably within an LDAP database. %prep %setup %build ./configure --prefix=/usr --sysconfdir=%{_sysconfdir} --with-homedir=%{homedir} make %install %__rm -rf $RPM_BUILD_ROOT %__mkdir -p $RPM_BUILD_ROOT/%{_bindir} %__mkdir -p $RPM_BUILD_ROOT/%{_sbindir} %__mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man%{mansec} %__mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir} %__mkdir -p $RPM_BUILD_ROOT/%{homedir}/block %__mkdir -p $RPM_BUILD_ROOT/%{homedir}/bin %__cp src/%{name} $RPM_BUILD_ROOT/%{_bindir} %__cp src/%{sname} $RPM_BUILD_ROOT/%{_sbindir} %__cp data/header.txt $RPM_BUILD_ROOT/%{homedir} %__cp data/footer.txt $RPM_BUILD_ROOT/%{homedir} %__cp data/gnarwl.cfg $RPM_BUILD_ROOT/%{_sysconfdir} %__cp doc/%{name}.%{mansec} $RPM_BUILD_ROOT/%{_mandir}/man%{mansec} %__cp doc/%{sname}.%{mansec} $RPM_BUILD_ROOT/%{_mandir}/man%{mansec} %__gzip $RPM_BUILD_ROOT/%{_mandir}/man%{mansec}/* %__strip $RPM_BUILD_ROOT/%{_bindir}/%{name} %__strip $RPM_BUILD_ROOT/%{_sbindir}/%{sname} echo \|%{_bindir}/%{name} > $RPM_BUILD_ROOT/%{homedir}/.forward cat data/badheaders.txt | src/%{sname} -a $RPM_BUILD_ROOT/%{homedir}/badheaders.db cat data/blacklist.txt | src/%{sname} -a $RPM_BUILD_ROOT/%{homedir}/blacklist.db %files %defattr(0644,root,root) %doc doc/FAQ %doc doc/INSTALL %doc doc/LICENSE %doc doc/AUTHORS %doc doc/HISTORY %doc doc/README %doc doc/README.upgrade %doc doc/ISPEnv.schema %doc doc/ISPEnv2.schema %doc doc/example.ldif %{_mandir}/man%{mansec}/%{name}.%{mansec}.gz %{_mandir}/man%{mansec}/%{sname}.%{mansec}.gz %defattr(0755,root,root) %{_bindir}/%{name} %{_sbindir}/%{sname} %defattr(-,gnarwl,root) %{homedir} %defattr(0400,gnarwl,root) %config %{_sysconfdir}/%{name}.cfg %clean %__rm -rf $RPM_BUILD_ROOT %pre if ! %__grep %{name} /etc/passwd > /dev/null; then echo "Creating system account \"%{name}\"" ; %{useradd_prg} %{useradd_arg} ; fi gnarwl-3.6/data/header.txt0000644000175100037440000000023410215047236014707 0ustar koboldadminFrom: $fullname <$recepient> To: $sender X-mailer: GNARWL MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit Subject: Re: $subject gnarwl-3.6/data/footer.txt0000644000175100037440000000003410215047236014753 0ustar koboldadmin -- $fullname <$recepient> gnarwl-3.6/data/Makefile0000644000175100037440000000133010215047236014354 0ustar koboldadmincatch: $(MAKE) -C .. all all: clean spec config clean: rm -f $(BIN)-$(VER).spec gnarwl.cfg config: @sed "s\\_HOMEDIR_\\$(HOMEDIR)\\g ; s\\_VER_\\$(VER)\\g ; s\\_MAN_SEC_\\$(MAN_SEC)\\g" < config.tmpl > gnarwl.cfg spec: @sed "s\\_BIN_\\$(BIN)\\g ; s\\_VER_\\$(VER)\\g; s\\_SBIN_\\$(SBIN)\\g; s\\_SEC_\\$(MAN_SEC)\\g" < spec.tmpl > $(BIN)-$(VER).spec install: mkdir -m 755 -p $(HOMEDIR)/block $(HOMEDIR)/bin $(CONFDIR) echo \|$(BINDIR)/$(BIN) > $(HOMEDIR)/.forward install -m 644 header.txt $(HOMEDIR) install -m 644 footer.txt $(HOMEDIR) install -m 600 gnarwl.cfg $(CONFDIR) cat badheaders.txt | $(SBINDIR)/$(SBIN) -a $(HOMEDIR)/badheaders.db cat blacklist.txt | $(SBINDIR)/$(SBIN) -a $(HOMEDIR)/blacklist.db gnarwl-3.6/data/blacklist.txt0000644000175100037440000000005110215047236015424 0ustar koboldadminroot root@localhost webmaster postmaster gnarwl-3.6/data/config.tmpl0000644000175100037440000000763310215047236015073 0ustar koboldadmin# # This is an example configfile for gnarwl(_MAN_SEC_) v_VER_, listing every # available directive. Empty lines and lines beginning with a pound symbol # are ignored by the software. Please keep in mind, that gnarwl uses a # very basic parser for reading this file. Therefore some restrictions are # put on the format: # # 1. Only whitespaces (no tabs) are allowed as delimeter between key and # value(s). # 2. Whitespaces can neither be escaped nor quoted. # 3. Macros must be declared before use. # # Name of the macro, refering to the "From:" field of a received mail map_sender $sender # Name of the macro, refering to the "To:" or "Cc:" field of a received mail map_receiver $recepient # Name of the macro, refering to the "Subject:" field of a received mail map_subject $subject # Bind a database field to a macroname map_field $begin vacationStart # Bind a database field to a macroname map_field $end vacationEnd # Bind a database field to a macroname map_field $fullname cn # Bind a database field to a macroname map_field $deputy vacationForward # LDAP Server to bind to server localhost # Port, the LDAP server is listening on port 389 # search scope (base|one|sub) scope sub # Destinguished name to bind with (leave empty to bind anonymously) login # Password to bind with (leave empty to bind anonymously) password # Which protocol <0|2|3> to use for binding. The deafult is 0, which stands # for "autodetect". protocol 0 # From where to start searching the LDAP tree (you have to change this!) base o=my_organization # Query filter to use for ldapsearch queryfilter (&(mail=$recepient)(vacationActive=TRUE)) # The attribute to querying for. The content of this field will be pasted # between header and footer (see also: forceheader and forcefooter # directives) afterwards all macros are expanded and the result is piped # through to the MTA (see also: mta directive). result vacationInfo # The files in this directory are used to keep track on who was sent # an automatic reply from whom and when. blockfiles _HOMEDIR_/block/ # File permissions to use for newly created database files umask 0644 # After how many hours the block on a specific sender/receiver combo expires. # Set to 0 to deactivate this feature (not recommended). blockexpire 48 # How to send mail. Specify full name to your MTA plus arguments. Only the # map_sender and map_receiver macros are expanded. This program must be # able to accept email from stdin. mta /usr/sbin/sendmail -F $recepient # Ignore mails, that specify too many receivers maxreceivers 64 # Ignore mails with too many headerlines (avoid DOS attacks) maxheader 512 # If outgoing mail may contain non ASCII characters, specify your locale # charset here for character conversion. Check iconv(1) for allowed values. # Leave blank to disable this feature. charset ISO8859-1 # If gnarwl reads a mailheaderline, that exactly matches an entry in this # database file, the mail will be ignored (usefull for preventing autoreplies # to mailinglists). Case does matter, no wildcard expansion. # Leave empty to deactivate. badheaders _HOMEDIR_/badheaders.db # Gnarwl will never autoreply for emailaddresses found in the blacklist # (usefull for preventing autoreplies from root, postmaster, etc.). Leave # Empty to disable this feature. blacklist _HOMEDIR_/blacklist.db # The contents of this textfile are pasted in front of each outgoing mail. forceheader _HOMEDIR_/header.txt # The contents of this textfile are appended to each outgoing mail. forcefooter _HOMEDIR_/footer.txt # Whitespace delimeted list of headernames, which may contain receiving # emailaddresses (case insignificant). recvheader To Cc # Set loglevel (0|1|2|3). A higher loglevel always contains all lower # loglevels. # 0 - Critical messages only. Anything, gnarwl cannot continue afterwards. # 1 - Warnings. Gnarwl can continue, but with reduced functionality. # 2 - Info. General information on gnarwl's status. # 3 - Debug. loglevel 1 gnarwl-3.6/data/gnarwl-3.3.spec0000644000175100037440000000512410401367141015365 0ustar koboldadmin%define name gnarwl %define sname damnit %define version 3.3 %define mansec 8 %define homedir /var/lib/%{name} %define useradd_prg /usr/sbin/useradd %define useradd_arg -r -s /bin/false -c "Email autoreply agent" -d %{homedir} %{name} Name: %{name} Summary: An email autoresponder with LDAP support Version: %{version} Release: 1 License: GPL Group: Applications/Communications Source: %{name}-%{version}.tgz Requires: gdbm, openldap2 BuildRoot: %_tmppath/%{name}-%{version}-buildroot Packager: Patrick Ahlbrecht URL: http://www.oss.billiton.de/ %description Gnarwl is an email autoresponder, intended to be a successor to the old vacation(1) program. With gnarwl users are no longer required to have full blown system accounts, but may store their autoreply text compfortably within an LDAP database. %prep %setup %build ./configure --prefix=/usr --sysconfdir=%{_sysconfdir} --with-homedir=%{homedir} make %install %__rm -rf $RPM_BUILD_ROOT %__mkdir -p $RPM_BUILD_ROOT/%{_bindir} %__mkdir -p $RPM_BUILD_ROOT/%{_sbindir} %__mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man%{mansec} %__mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir} %__mkdir -p $RPM_BUILD_ROOT/%{homedir}/block %__mkdir -p $RPM_BUILD_ROOT/%{homedir}/bin %__cp src/%{name} $RPM_BUILD_ROOT/%{_bindir} %__cp src/%{sname} $RPM_BUILD_ROOT/%{_sbindir} %__cp data/header.txt $RPM_BUILD_ROOT/%{homedir} %__cp data/footer.txt $RPM_BUILD_ROOT/%{homedir} %__cp data/gnarwl.cfg $RPM_BUILD_ROOT/%{_sysconfdir} %__cp doc/%{name}.%{mansec} $RPM_BUILD_ROOT/%{_mandir}/man%{mansec} %__cp doc/%{sname}.%{mansec} $RPM_BUILD_ROOT/%{_mandir}/man%{mansec} %__gzip $RPM_BUILD_ROOT/%{_mandir}/man%{mansec}/* %__strip $RPM_BUILD_ROOT/%{_bindir}/%{name} %__strip $RPM_BUILD_ROOT/%{_sbindir}/%{sname} echo \|%{_bindir}/%{name} > $RPM_BUILD_ROOT/%{homedir}/.forward cat data/badheaders.txt | src/%{sname} -a $RPM_BUILD_ROOT/%{homedir}/badheaders.db cat data/blacklist.txt | src/%{sname} -a $RPM_BUILD_ROOT/%{homedir}/blacklist.db %files %defattr(0644,root,root) %doc doc/FAQ %doc doc/INSTALL %doc doc/LICENSE %doc doc/AUTHORS %doc doc/HISTORY %doc doc/README %doc doc/README.upgrade %doc doc/ISPEnv.schema %doc doc/ISPEnv2.schema %doc doc/example.ldif %{_mandir}/man%{mansec}/%{name}.%{mansec}.gz %{_mandir}/man%{mansec}/%{sname}.%{mansec}.gz %defattr(0755,root,root) %{_bindir}/%{name} %{_sbindir}/%{sname} %defattr(-,gnarwl,root) %{homedir} %defattr(0400,gnarwl,root) %config %{_sysconfdir}/%{name}.cfg %clean %__rm -rf $RPM_BUILD_ROOT %pre if ! %__grep %{name} /etc/passwd > /dev/null; then echo "Creating system account \"%{name}\"" ; %{useradd_prg} %{useradd_arg} ; fi gnarwl-3.6/data/badheaders.txt0000644000175100037440000000014010215047236015535 0ustar koboldadminPrecedence: list Precedence: bulk Precedence: junk X-Mailer: GNARWL To: undisclosed-recipients:;gnarwl-3.6/data/spec.tmpl0000644000175100037440000000513110215047236014547 0ustar koboldadmin%define name _BIN_ %define sname _SBIN_ %define version _VER_ %define mansec _SEC_ %define homedir /var/lib/%{name} %define useradd_prg /usr/sbin/useradd %define useradd_arg -r -s /bin/false -c "Email autoreply agent" -d %{homedir} %{name} Name: %{name} Summary: An email autoresponder with LDAP support Version: %{version} Release: 1 License: GPL Group: Applications/Communications Source: %{name}-%{version}.tgz Requires: gdbm, openldap2 BuildRoot: %_tmppath/%{name}-%{version}-buildroot Packager: Patrick Ahlbrecht URL: http://www.oss.billiton.de/ %description Gnarwl is an email autoresponder, intended to be a successor to the old vacation(1) program. With gnarwl users are no longer required to have full blown system accounts, but may store their autoreply text compfortably within an LDAP database. %prep %setup %build ./configure --prefix=/usr --sysconfdir=%{_sysconfdir} --with-homedir=%{homedir} make %install %__rm -rf $RPM_BUILD_ROOT %__mkdir -p $RPM_BUILD_ROOT/%{_bindir} %__mkdir -p $RPM_BUILD_ROOT/%{_sbindir} %__mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man%{mansec} %__mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir} %__mkdir -p $RPM_BUILD_ROOT/%{homedir}/block %__mkdir -p $RPM_BUILD_ROOT/%{homedir}/bin %__cp src/%{name} $RPM_BUILD_ROOT/%{_bindir} %__cp src/%{sname} $RPM_BUILD_ROOT/%{_sbindir} %__cp data/header.txt $RPM_BUILD_ROOT/%{homedir} %__cp data/footer.txt $RPM_BUILD_ROOT/%{homedir} %__cp data/gnarwl.cfg $RPM_BUILD_ROOT/%{_sysconfdir} %__cp doc/%{name}.%{mansec} $RPM_BUILD_ROOT/%{_mandir}/man%{mansec} %__cp doc/%{sname}.%{mansec} $RPM_BUILD_ROOT/%{_mandir}/man%{mansec} %__gzip $RPM_BUILD_ROOT/%{_mandir}/man%{mansec}/* %__strip $RPM_BUILD_ROOT/%{_bindir}/%{name} %__strip $RPM_BUILD_ROOT/%{_sbindir}/%{sname} echo \|%{_bindir}/%{name} > $RPM_BUILD_ROOT/%{homedir}/.forward cat data/badheaders.txt | src/%{sname} -a $RPM_BUILD_ROOT/%{homedir}/badheaders.db cat data/blacklist.txt | src/%{sname} -a $RPM_BUILD_ROOT/%{homedir}/blacklist.db %files %defattr(0644,root,root) %doc doc/FAQ %doc doc/INSTALL %doc doc/LICENSE %doc doc/AUTHORS %doc doc/HISTORY %doc doc/README %doc doc/README.upgrade %doc doc/ISPEnv.schema %doc doc/ISPEnv2.schema %doc doc/example.ldif %{_mandir}/man%{mansec}/%{name}.%{mansec}.gz %{_mandir}/man%{mansec}/%{sname}.%{mansec}.gz %defattr(0755,root,root) %{_bindir}/%{name} %{_sbindir}/%{sname} %defattr(-,gnarwl,root) %{homedir} %defattr(0400,gnarwl,root) %config %{_sysconfdir}/%{name}.cfg %clean %__rm -rf $RPM_BUILD_ROOT %pre if ! %__grep %{name} /etc/passwd > /dev/null; then echo "Creating system account \"%{name}\"" ; %{useradd_prg} %{useradd_arg} ; fi gnarwl-3.6/Makefile.in0000644000175100037440000000302611030254645014054 0ustar koboldadmin################################################################ ## ## Config time. ## ## # General settings (these shouldn't be changed) ## BIN=gnarwl SBIN=damnit MAN_SEC=8 VER=$(shell basename `pwd` | sed s\\$(BIN)-\\\\) ## # Path settings (no trailing slashes!) ## prefix=@prefix@ exec_prefix=@exec_prefix@ HOMEDIR=@homedir@ BLOCKDIR=$(HOMEDIR)/block BINDIR=@bindir@ SBINDIR=@sbindir@ DOCDIR=@docdir@ MANDIR=@mandir@ CONFDIR=@sysconfdir@ DATAROOTDIR=@datarootdir@ ## # Adding system accounts ## USERADD_PROG=@useradd_prog@ USERADD_ARGS=@useradd_args@ ## # Compiler settings ## CC=@CC@ CFLAGS=-DLDAP_DEPRECATED -DBLOCKDIR=\"$(BLOCKDIR)\" -DCFGFILE=\"$(CONFDIR)/gnarwl.cfg\" -DVERSION=\"$(VER)\" -g -Wall -O2 -I.. LFLAGS=-lldap -lgdbm -ldl -lresolv ## ## No serviceable parts below ## ################################################################ export VER BIN SBIN CC CFLAGS LFLAGS HOMEDIR BINDIR SBINDIR DOCDIR MANDIR CONFDIR MAN_SEC all: $(MAKE) -C src all $(MAKE) -C doc all $(MAKE) -C data all clean: rm -f DEADJOE $(MAKE) -C src clean $(MAKE) -C doc clean $(MAKE) -C data clean distclean: clean rm -f Makefile config.* conf.h rm -rf autom4te.cache docs: $(MAKE) -C doc all tarball: distclean cd ..; tar -czf $(BIN)-$(VER).tgz $(shell basename $(shell pwd)) install: $(MAKE) -C src install $(MAKE) -C doc install $(MAKE) -C data install $(MAKE) -C contrib install perm: grep $(BIN) /etc/passwd > /dev/null || $(USERADD_PROG) $(USERADD_ARGS) chown -R $(BIN) $(HOMEDIR) chown $(BIN) $(CONFDIR)/gnarwl.cfg gnarwl-3.6/conf.h.in0000644000175100037440000000277410215047236013523 0ustar koboldadmin// Multiply config directive "db_expire" with this value #define TIMEFACTOR 3600 // How many seconds to wait for LDAP data, before giving up #define LDAPQUERY_MAXWAIT 10 // Defaults for several config directives #define DEFAULT_SERVER "localhost" #define DEFAULT_QFILTER "(&(mail=$recepient)(vacationActive=TRUE)" #define DEFAULT_MES "vacationInfo" #define DEFAULT_BASE "" #define DEFAULT_EXPIRE 48 #define DEFAULT_MAIL_LIMIT 256 #define DEFAULT_MAP_SENDER "$sender" #define DEFAULT_MAP_RECEIVER "$recepient" #define DEFAULT_MAP_SUBJECT "$subject" #define LDAP_PROTOCOL_DETECT 0 #define LDAP_CHARSET "UTF-8" // Verbositylevel #define LVL_CRIT 0 #define LVL_WARN 1 #define LVL_INFO 2 #define LVL_DEBUG 3 /* */ // Having this call allows to select the protocol #undef HAVE_LDAP_SET_OPTION // Having this call allows for charset translation #undef HAVE_ICONV // What to use as default MTA #undef DEFAULT_MTA // Maximum size for input buffer #undef MAXLINE // File permission mask #undef UMASK /* */ // Don't change ;-) #define TRUE 1 #define FALSE 0 // Failsafe. Just in case (guess some sane values) #ifndef CFGFILE #define CFGFILE "/etc/gnarwl.cfg" #endif #ifndef VERSION #define VERSION " " #endif #ifndef BLOCKDIR #define BLOCKDIR "/tmp/" #endif #ifndef DEFAULT_MTA #define DEFAULT_MTA "/usr/sbin/sendmail" #endif #ifndef MAXLINE #define MAXLINE 2100 #endif #ifndef BLOCKDIR #define BLOCKDIR "/tmp" #endif #ifndef UMASK #define UMASK 0600 #endif gnarwl-3.6/configure0000755000175100037440000033477611030251255013733 0ustar koboldadmin#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # Zsh 3.x and 4.x performs 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs 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_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # 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 } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file 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 -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT homedir useradd_prog useradd_args permmask maxline LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # 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' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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 ;; -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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 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 .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-homedir=DIR Homedir for the gnarwl user --with-docdir=DIR Where to install the docs --with-useradd_prog=DIR Programm for adding users --with-useradd_args=ARG Arguments for the useradd programm --with-mta=prog MTA to use --with-permmask=MASK File creation mask for database files --with-maxline=NUMBER Maximum input buffer line length 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 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,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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_config_headers="$ac_config_headers conf.h" ac_config_files="$ac_config_files Makefile" # Checks for programs. 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* 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" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac 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 # Check whether --with-homedir was given. if test "${with_homedir+set}" = set; then withval=$with_homedir; homedir="$withval" else homedir="\${prefix}/var/lib/gnarwl" fi # Check whether --with-docdir was given. if test "${with_docdir+set}" = set; then withval=$with_docdir; docdir="$withval" else docdir="\${prefix}/share/doc/packages/gnarwl" fi # Check whether --with-useradd_prog was given. if test "${with_useradd_prog+set}" = set; then withval=$with_useradd_prog; useradd_prog="$withval" else useradd_prog="/usr/sbin/useradd" fi # Check whether --with-useradd_args was given. if test "${with_useradd_args+set}" = set; then withval=$with_useradd_args; useradd_args="$withval" else useradd_args="-r -s /bin/false -c \"Email autoreply agent\" -d \$(HOMEDIR) \$(BIN)" fi # Check whether --with-mta was given. if test "${with_mta+set}" = set; then withval=$with_mta; mta="\"$withval\"" else mta="\"/usr/sbin/sendmail\"" fi # Check whether --with-permmask was given. if test "${with_permmask+set}" = set; then withval=$with_permmask; permmask="$withval" else permmask="0600" fi # Check whether --with-maxline was given. if test "${with_maxline+set}" = set; then withval=$with_maxline; maxline="$withval" else maxline="2100" fi { echo "$as_me:$LINENO: checking for gdbm_open in -lgdbm" >&5 echo $ECHO_N "checking for gdbm_open in -lgdbm... $ECHO_C" >&6; } if test "${ac_cv_lib_gdbm_gdbm_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgdbm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 gdbm_open (); int main () { return gdbm_open (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_gdbm_gdbm_open=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gdbm_gdbm_open=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_gdbm_gdbm_open" >&5 echo "${ECHO_T}$ac_cv_lib_gdbm_gdbm_open" >&6; } if test $ac_cv_lib_gdbm_gdbm_open = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGDBM 1 _ACEOF LIBS="-lgdbm $LIBS" fi { echo "$as_me:$LINENO: checking for ldap_init in -lldap" >&5 echo $ECHO_N "checking for ldap_init in -lldap... $ECHO_C" >&6; } if test "${ac_cv_lib_ldap_ldap_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldap $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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_init (); int main () { return ldap_init (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ldap_ldap_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ldap_ldap_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_init" >&5 echo "${ECHO_T}$ac_cv_lib_ldap_ldap_init" >&6; } if test $ac_cv_lib_ldap_ldap_init = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBLDAP 1 _ACEOF LIBS="-lldap $LIBS" fi for ac_func in ldap_set_option do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* 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_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in iconv do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* 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_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done cat >>confdefs.h <<_ACEOF #define UMASK $permmask _ACEOF cat >>confdefs.h <<_ACEOF #define MAXLINE $maxline _ACEOF cat >>confdefs.h <<_ACEOF #define DEFAULT_MTA $mta _ACEOF 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # Zsh 3.x and 4.x performs 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # 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 } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file 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 -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "conf.h") CONFIG_HEADERS="$CONFIG_HEADERS conf.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim homedir!$homedir$ac_delim useradd_prog!$useradd_prog$ac_delim useradd_args!$useradd_args$ac_delim permmask!$permmask$ac_delim maxline!$maxline$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 51; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[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="$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 || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 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 "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi gnarwl-3.6/doc/0000755000175100037440000000000011352357142012556 5ustar koboldadmingnarwl-3.6/doc/README.upgrade0000644000175100037440000000653711023462067015075 0ustar koboldadmin############### # What's new? # ############### You only need to read this file, if upgrading from a v2.x release. Like version 2.0, version 3.0 is a major rewrite of the code. Again only a few more features were planned, but it turned out, that the codebase was still quite cumbersome and in large parts overly complex as well as ineffecient. Especially the mailparser proved to be a real nightmare here, which finally led to a nearly complete redesign of the according routines. - Several bugfixes - Improved documentation - Many optimizations - More modularized code - Improved logging - Added GNU autoconf configure script - Added RPM specfile - Renamed (nearly) any config directive - Modernized Makefiles - Gnarwl will now complain about misspelled config directives - Replaced billiton.schema with ISPEnv.schema - Outgoing mails are now send "single file", instead of "all at once" - Restructured a good deal of the code - Support for shared addresses (queryfilter matching more then one entry) - Blockfile reading/writing may now be completly surpressed - Blockfile file permission may now be set in configfile - A standard footer may now be forced on outgoing mail, as well a header - Which headers may contain receiving addresses is now configureable - Sending/Receiving addresses may now be passed via commandline - Outputformat of damnit now freely configureable - LDAP protocol version selectable - Support for characterset conversion ############# # Upgrading # ############# - Backward compatibility Gnarwl v3 maintains data backward compatibility to earlier versions, with one exception: The "\n" macro does no longer exist, it was redundant anyway. Also note, that the former behaviour of gnarwl was to ignore searches, matching more than one LDAP entry. This limitation finally dropped. - Building/Installing It is no longer required to edit a Makefile. Configuring is now done convienently using the configure script. Please note, that the Makefile no longer contains the "uninstall" target. So if you need this functionality, you should build the program as RPM package. - Configuration Every configuration directive was renamed, while moving from v2 to v3. The reason for this is, that before, I tried to group config directives by giving them prefixes. This however made the keywords both long and less rememberable. So this concept was finally dropped. - A word on LDAP schema Former versions of gnarwl shipped with a schema file called "billiton.schema". Unfortunatly, that file proved to be be both, poorly designed and broken in a number of ways, that would severly limit it's useability. These facts made a complete redesign unavoidable, and the continueing use of this file disadviseable. "ISPEnv.schema", which is now included with gnarwl, derived from the broken "billiton.schema", by redefining most attributes and objectclasses. Unfortunatly, this too proves to be a dilemma, as the openldap documentation is rather sketchy on whether or not changing declarations may corrupt the data in the database. So, if you have been using "billiton.schema", I recommend the following upgrade procedure (just to be on the safe side): 1. Export your entire database to LDIF 2. Stop the LDAP server 3. Delete the binary files storing the database on disk 4. Replace "billiton.schema" with ISPEnv.schema 5. Start the LDAP server and re-import the LDIF snapshot gnarwl-3.6/doc/example.ldif0000644000175100037440000000104510215047235015045 0ustar koboldadmin# # This is an example ldap entry for gnarwl # dn: uid=babs,ou=people,o=my_org objectClass: top objectClass: mailAccount objectClass: account objectClass: Vacation uid: babs userPassword: {crypt}kj8HsGwUBBMQA maildropPlace: /var/mail/babs mail: B.Jennings@my_org.com description: This is an example mailAccount vacationActive: TRUE vacationInfo:: SGksCkknbSBjdXJyZW50bHkgb24gdmFjYXRpb24gKHNpbmNlICRiZWdpbikuIE kgd29uJ3QgCmF0dGVuZCBteSBtYWlsYm94IHRpbGwgJGVuZC4= vacationStart: christmas vacationEnd: new years eve vacationForward: J.Doe@my_org.com gnarwl-3.6/doc/damnit.man0000644000175100037440000000557010215047235014532 0ustar koboldadmin.TH DAMNIT _MANSEC_ .SH NAME damnit \- DAtabase MaNagement InTerface .SH SYNOPSIS .B damnit [\-h] [\-d\ \ ] [\-a\ \ ] [\-f\ ] [\-l\ ] .SH DESCRIPTION .B damnit is the database management tool for .B gnarwl(_MANSEC_) . It allows systemadministrators to list and/or manipulate .B gnarwl's database files. It is not intented to be employed by the average user, who should use LDAP as the only interface to .B gnarwl(_MANSEC_) . .SH OPTIONS .IP -h Print usage information .IP "-f " Select output format for database listing (only meaningful with -l). is the template for what the output should look like. The following macros are recognized: %entry, %time, %tstamp, \\en and \\et. Translating to the entry itself, the entrytime (in human readable form), the entrytime (as timestamp), a newline character, and a tab character. The default format is: "%time -> %entry\\en". Don't forget the trailing newline. .IP "-d []" Delete from . If is omited, damnit will read from stdin (one per line), until either EOF or an empty line is detected. .IP "-a []" Add to . If is already stored in , damnit will only update the timestamp. If is omited, damnit will read from stdin (one per line), until either EOF or an emtpy line is detected. .IP "-l " List database file specified by . .SH DATABASE FILES .B gnarwl uses hashfiles for storing information on disk. Meaning, all datasets consist of key and value pairs. The key is always a NULL terminated character string, while the value contains the timestamp, when the key was entered (last time) into the file. This timestamp is of type time_t (as returned by time(2)) and therefore, .B gnarwl's database files are not copyable between different system architectures. .SH AUTHOR Patrick Ahlbrecht .SH SEE ALSO .BR gnarwl(_MANSEC_) .SH FILES .I _HOMEDIR_/block/* .RS Every file in this directory represents an emailaddress, .B gnarwl (already) received a mail for. Every time, gnarwl sends out an autorreply for an address, the recepient of that mail is locked into the according file. .B gnarwl will not send any further autoreplies for this sender/receiver combo, until the timeout specified in gnarwl.cfg expires. .RE .P .I _HOMEDIR_/blacklist.db .RS Emailaddresses listed as keys in this file are not subject to autoresponding (the addresses of root, postmaster, webmaster and the like should be put herin). Note: The complete mailaddress, as it would appear in an email, must be specified here, as .B gnarwl checks these "as-is". .RE .P .I _HOMEDIR_/badheaders.db .RS Each entry in this file represent a line that may not occur in the header of a received email. That is, .B gnarwl won't reply to any mail, it is able to match a headerline with an entry in this file. .RE gnarwl-3.6/doc/gnarwl.man0000644000175100037440000002047610215047235014552 0ustar koboldadmin.TH GNARWL _MANSEC_ .SH NAME gnarwl \- GNU Neat Autoreply With LDAP .SH SYNOPSIS .B gnarwl [\-h] [\-c\ ] [\-a\
] [\-s\
] .SH DESCRIPTION .B gnarwl is an email autoresponder, intended to be a successor to the old vaction(1) program. Since a modern mailserver, usually serves hundreds (or even thousands) of mailaccounts, it is not sensible to give (untrusted) users shell access so they may create/maintain the .forward file, required by .B vacation(1). .P With .B gnarwl , all user-suplied data is stored within an LDAP database, so there are no per user ".forward" files (or even homedirs) needed. Configuration is conveniently done via one systemwide configfile. .P Like the old .B vacation(1) program, gnarwl accepts incomming mail through stdin, and will send outgoing mail via an external MTA (it even maintains basic commandline compatibility, so it may be used as a drop in replacement). .P Several gdbm databases are maintained, in order to make sure, a) mail does not bounce back and force between gnarwl and another automated MUA, b) mailing lists will not be bothered and c) specifc local addresses may never produce automatic replies. All these database files may be managed using the .B damnit(_MANSEC_) program. .P .SH OPTIONS .IP "-c " Use a different configfile than the one, compiled in. .IP "-a " Force
as receiving address. .IP "-s
" Force
as sending address. .IP -h Print usage information. .SH CONFIGURATION .B gnarwl typically uses one global configurationfile, but a per user setup is also possible using the -c commandline switch. The following keywords are recognized in the configfile: .IP "map_sender " Binds a macroname (case insensitive), refering to the sender of an incomming email. Defaults to "$sender". .IP "map_receiver " Binds a macroname (case insensitive), refering to the receiver(s) of an incomming email. Defaults to "$receiver". .IP "map_subject " Binds a macroname (case insensitive), refering to the subject of an incomming email. Defaults to "$subject". .IP "map_field " Binds a macroname (case insensitive), refering to a field in the resultset, returned by the database. There are no defaults for this directive. .IP "server
" Address of the databaseserver to query. Defaults to localhost. .IP "port " Port, the LDAP server listens on. Defaults to 389. .IP "scope " The scope used for searching the database. Default is "sub". .IP "login " Destinguished name to bind with to the LDAP database. Default is to bind anonymously. .IP "password " Password to use for binding to the LDAP database. If a password is required to access the server, then the configfile should belong to the gnarwl user and have file permission 0400. .IP "base " Entrypoint of the search. There is no default for this directive, it must be supplied by the administrator. .IP "protocol <0|2|3> Select protocol to bind to the ldapserver. The default is 0, which means "autodetect". .IP "queryfilter " Search pattern to match against the database. Defaults to: "(&(mail=$recepient)(vacationActive=TRUE)". .IP "result " The name of the attribute, that is to be taken as the emailbody. The content of this field will be pasted in between the data found via forceheader and forcefooter directives. Afterwards all remaining macros are expanded in the order of declaration, and the result will be piped through to the MTA. .IP "blockfiles " The directory, where gnarwl stores it's blockfiles. These files are required to keep track on who was sent an automatic reply. Default is: "_HOMEDIR_/block/". .IP "umask What permission to give newly generated database files. The default is 0600. .IP "blockexpire " How long (in hours) to block a certain sender/recepient combo. Default is 48 hours. Setting to 0 disables the feature (not recommended). No blockfiles are read/written in this case. .IP "maxreceivers " Ignore incomming email, specifying too many receiving addresses. It does not matter, whether these are local or not, as .B gnarwl doesn't know domains. Default is 256. .IP "maxheader " Ignore incomming email with more than this number of header lines. Lines are counted before unfolding them, so a folded line really counts as at least two lines. Default is 256. .IP "badheaders " Path to a database file, containing matching patterns for the mailheader. If an entry stored in this file matches a line in the header exactly, then this mail will be ignored by .B gnarwl . (useful to avoid sending automatic replies to mailing lists). This feature is deactivated by default. .IP "blacklist " Pointer to a database file, containing emailaddresses, .B gnarwl is not allowed to generate automatic replies for (useful to prevent automatic replies from addresses, which are shared by several people). This feature is deactivated by default. .IP "forceheader " Path to a text file, containing a standardized header, that is to be pasted in front of every outgoing mail. This file should end with a single empty line. Otherwise it is assumed, that the users are allowed to continue the header and will provide the separating empty line themselves. Default is not to force anything (that is: The user has to supply the header in the "result" attribute). .IP "forcefooter " Path to a text file, containing a standardized footer, that is to be appended at the end of every generated mail. Default is to not to force anything. .IP "mta []" Specify MTA for sending mail. It must be able to accept mail on STDIN. Default is "/usr/sbin/sendmail". .IP "charset " LDAP stores text in unicode, which is ok, as long as outgoing mail doesn't contain any non ASCII characters. However, locale specific characters (like german umlaute) end up as strange glyphs. With the "charset" directive, gnarwl tries to convert these to the correct symbols. The argument must contain a string recognized by iconv(3). Default is not to try to convert anything (assume US-ASCII charset / MIME encoded mail). .IP "recvheader " A whitespace separated list of headers (case does not matter), which may contain receiving addresses. Defaults to: "To Cc". .IP "loglevel <0|1|2|3>" Specifies what to send to the syslog. A higher loglevel automatically includes all lower loglevels (see section syslog for more information). .SH SYSLOG Since .B gnarwl is not meant to be invoked by anything but the mailsystem, it'll never print out messages to the systemconsole, but logs them via syslog(3), using the facility "mail". A log line is always of the following format: .P / .P The field indicates the severity of the message, it corresponds to the "loglevel" config directive. Possible values are: .P .IP "CRIT (loglevel 0)" Critical messages. .B gnarwl cannot continue and will die with a non-zero exit code. This usually causes the mailsystem to bounce mail. .IP "WARN (loglevel 1)" A warning. .B gnarwl can will continue, but not with the full/intended functionality. .IP "INFO (loglevel 2)" Status information. A message in the INFO loglevel indicates normal behaviour. .IP "DEBUG (loglevel 3)" Debugging information. .B gnarwl will log a lot of information on how mail is processed. .P The field gives a short hint about what caused the log entry in question, while contains a short description of what actually happened. .SH AUTHOR Patrick Ahlbrecht .SH SEE ALSO .BR vacation (1), .BR postfix (1), .BR iconv (1), .BR damnit (_MANSEC_), .BR rfc822 .SH FILES .I _CONFDIR_/gnarwl.cfg .RS main configuration file. .RE .P .I _HOMEDIR_/.forward .RS forward file for the mailsystem. .RE .P .I _HOMEDIR_/blacklist.db .RS .B gnarwl won't send an autoreply for anyone whose emailaddress is listed herin. .RE .P .I _HOMEDIR_/badheaders.db .RS .B gnarwl will ignore mail, it is able to match a headerline with an entry in this file. Case is significant, no wildcards are expanded. .RE .P .I _HOMEDIR_/header.txt .RS Standard header to paste in front of every outgoing mail. .RE .P .I _HOMEDIR_/footer.txt .RS Standard footer to append to every outgoing mail. .RE .P .I _HOMEDIR_/block/* .RS block files. .RE .P gnarwl-3.6/doc/Makefile0000644000175100037440000000213210215047235014210 0ustar koboldadmincatch: $(MAKE) -C .. all all: clean manpage clean: rm -f *~ $(BIN).$(MAN_SEC)* $(SBIN).$(MAN_SEC)* DEADJOE manpage: @echo Generating manpage... @sed "s\\_CONFDIR_\\$(CONFDIR)\\g ; s\\_HOMEDIR_\\$(HOMEDIR)\\g ; s\\_MANSEC_\\$(MAN_SEC)\\g" < $(BIN).man | groff -man -Tascii > $(BIN).$(MAN_SEC) @sed "s\\_CONFDIR_\\$(CONFDIR)\\g ; s\\_HOMEDIR_\\$(HOMEDIR)\\g ; s\\_MANSEC_\\$(MAN_SEC)\\g" < $(SBIN).man | groff -man -Tascii > $(SBIN).$(MAN_SEC) install: mkdir -m 755 -p $(DOCDIR) $(MANDIR)/man$(MAN_SEC) install -m 644 $(BIN).$(MAN_SEC) $(MANDIR)/man$(MAN_SEC) install -m 644 $(SBIN).$(MAN_SEC) $(MANDIR)/man$(MAN_SEC) install -m 644 FAQ $(DOCDIR) install -m 644 LICENSE $(DOCDIR) install -m 644 AUTHORS $(DOCDIR) install -m 644 INSTALL $(DOCDIR) install -m 644 ISPEnv.schema $(DOCDIR) install -m 644 ISPEnv2.schema $(DOCDIR) install -m 644 example.ldif $(DOCDIR) install -m 644 HISTORY $(DOCDIR) install -m 644 README $(DOCDIR) gzip -f -9 $(DOCDIR)/FAQ gzip -f -9 $(DOCDIR)/HISTORY gzip -f -9 $(MANDIR)/man$(MAN_SEC)/$(BIN).$(MAN_SEC) gzip -f -9 $(MANDIR)/man$(MAN_SEC)/$(SBIN).$(MAN_SEC) gnarwl-3.6/doc/README0000644000175100037440000000207611023460617013440 0ustar koboldadmin GNARWL Gnu Neat Auto Reply With LDAP ... And also the sound I issued many times implementing email autoresponding. What is GNARWL -------------- Gnarwl is a email autoreply/vacation agent, intented to be used on mailservers, where users may not (nescessarily) have systemaccoounts, but accountinformation is stored within an LDAP database. What are the features of gnarwl ? --------------------------------- - User information is stored in LDAP, no shellaccounts required. - Configurable via single systemwide configuration file. - Per user locking of sent email (to prevent mail loops). - No more messing around with individual .forward files, all userdata is kept in LDAP. - Configureable header matching (to avoid sending mail to mailing lists). - Blacklisting of addresses, that may not use the autoresponder. - Forceable header/footer on outgoing mail. - Status reports via syslog. - Not bound to a particular MTA (though postfix is recommended). gnarwl-3.6/doc/FAQ0000644000175100037440000002376211070155352013116 0ustar koboldadminQ: Does gnarwl need root access? A: No, gnarwl does not require any extended priveleges at all, but of course it needs access to it's own files and should therefore be installed under it's own UID. Keep in mind, that gnarwl.cfg as well as gnarwl's homedirectory (may) contain sensible data. So care should be taken concerning file owner- ship and permission. ----- Q: What is this blacklist stuff good for? A: The whole point of employing LDAP for data storage instead of flat text files, is to keep all datarecords, belonging to a single user in a single place. Unfortunatly this proves to be futile for gnarwl, as soon as users either begin to share emailaddresses, or - even worse - get systemmail (e.g. root, webmaster, postmaster, etc.). You certainly don't want to generate automatic replies, stating that "sales@bigbiz.com" is currently gone fishing. On the other hand, you can't dissallow the user in question to use the autoresponder either. And thats what that blacklist is good for: An address listed in this database will never produce an automatic reply, even if the LDAP data says otherwise. ----- Q: What is this badheaders and blockfile stuff good for? A: They are used to prevent mail bouncing happily back and forth between gnarwl and another automated MUA (which can really generate a lot of network traffic and fill disks very fast). With the blockfiles, gnarwl keeps track on who already got an automatic reply, and makes sure s/he doesn't get another one too soon. The badheaders may be used to prevent gnarwl from replying to a mailing list. ----- Q: Someone mailed me back an emailbounce, saying gnarwl failed. A: This happens whenever gnarwl exits with EXIT_FAILURE. Normally this should not happen, or better said: A user is not able to provoke this him-/herself by simply sending a (garbled) mail, so you should check your maillog. Probable causes: Gnarwl could not ... - access lock or configfile - contact the LDAP server - invoke your MTA If none of this is the case you probably discovered a bug ;-). ----- Q: The header of the mail, gnarwl sent out seems to be somehow garbled. A: Gnarwl won't generate a mailheader itself, you have to provide one yourself. You have the choice of either putting a complete mail (header and body) in the field, refered to by "result", or you can force a unified standard header upon your users, by putting it in the file refered to by forceheader (NOTE: header and body must be separated by a single empty line, so don't forget to put such a line at the end of this file, if you forget to do so, it is assumed, that the user may continue the header and will supply the empty line him/herself). ----- Q: Wouldn't it be nice if a user only had to supply a vacationStart and a vactionEnd date and gnarwl would automatically de/activate itself in this period? A: Sure, that would be nice, but it won't be included in gnarwl for a simple reason: What format would that date be? - 13.01.01 - 01.13.01 - 01.13.2002 - 26.25.1234 - 01/01/03 - 14. Jun, 2004 - July the 14th - Montag - Tomorow - Christmas Just to name a few variants. As you see, there are numerous ways to (mis)spell a date, bring in a locale or make unprecise (even wrong) statements. Trying to deal with these would open a can of worms regarding syntax and semantic check. It would also remove a great deal of gnarwls flexibility. Therefore I'm afraid you have to either provide this feature by using add-on software (some script, that runs from CRON and toggle "vactionActive), or adapt the search filter in some way. ----- Q: Does gnarwl expand macros inside of macros? It seems to do so only sometimes? A: Gnarwl expands macros in the same order, they are declared in the configfile. So the earlier ones may contain all the later ones, but not vice versa. Let's regard this to be a feature ;-). ----- Q: I mapped $somemacro to someattribute, using the map_field directive. This ldapattribute now contains more than one value, but gnarwl only sees the first one, how do I refer to the second, third,... A: You don't gnarwl is not able to deal with multivalued attributes, so it always picks the first one it gets. ----- Q: Which conditions must be fullfilled, in order for gnarwl to send out an autoreply? 1. The incomming mail must not contain a headerline, matching a line in the badheaders database. 2. The mailheader must specify a sender and at least one recepient (naturally). 3. The header must not contain more than "maxheader" lines. 4. The mail may not specify more then "maxreceivers" addresses in the according header(s). 5. Last action for a sender/recepient pair was at least "expire" hours ago. 6. The receiving emailaddress must not be in the blacklist database. Points one to four refer the complete mail, that is, if one condition is not met, the complete mail is ignored. Points five and six refer to a single receiving address specified in the mail, that is, if one condition is not met, only this emailaddress is ignored, if the mail specified multiple recepients, they'll all get their chance. ----- Q: Is it save to delete files in blockdir? A: Yes, it is as long as gnarwl is not accessing them. Gnarwl simply creates a new lockfile if the old one is missing (of course, the old content is lost, so deleting a blockfile "resets" the according emailaddress). ----- Q: I plan to migrate the mailsystem to a different architecture, can I simply copy gnarwl's database files? A: No, this cannot be done. Gnarwl stores values of type time_t in those files. They cannot be recognized on architectures with a different endianess or sizeof(time_t). You have to employ the damnit program for doing so. ----- Q: It seems that gnarwl processes some mails over and over again?! A: This happens whenever an email specifies more than one recepient local to your site and your mailsystem is configured to pipe any received email through gnarwl, using the .forward mechanism. In this case, the mail in question is naturally processed (local recepient)^2 times. If this is a performance issue to your site, you could try to configure gnarwl and your mailsystem to make use of the "Delivered-To:" header. ----- Q: Will gnarwl answer to a BCC (blind carbon copy) mail? A: Not in the default configuration, as it is difficult to extract information that does not exist in the mail in the first place. If you want to be able to answer to BCC's, you could try going for the "Delivered-To:" header. ----- Q: I wrote this little perl (bash,python,...) script as an add-on for gnarwl. It is quite handy, but I don't feel like maintaining my own downloadsite. Would it be possible to bundle it with gnarwl? A: Yes, it is possible. That's, what the contrib/ branch is good for. But please keep in mind: You program must be properly coded (no backdoors, obvious security holes, etc.), well documented and of course not be specific to your site. ----- Q: The email, gnarwl sent out contains strange glyphs everywhere. A: This happens wherever the mail contains non ASCII characters (german umlaute for example), as these are stored unicode encoded within LDAP. You have two choices here: 1. Make sure, any non ASCII character is MIME encoded. This is the proper way to do it, but may require some user discipline. 2. Use the "charset" configdirective, to translate unicode into your locale. Conversion is done using the iconv(3) routine, and therefore limited, to the encodings, it knows about. NOTE: iconv may not be available on every platform, in this case, the "charset" directive simply does nothing. In both cases you should adjust the header.txt file accordingly. ----- Q: What does "DEBUG/MAIL Code: MessageID: " in the maillog main? A: This line is produced by the mailparser and gives status information on every processed mail. "MessageID" is - of course - the content of the "Message-ID:" header, while code results from ORing the MAIL_* macros in mailhandler.h in the mail_status bitfield. ----- Q: I run a heavy loaded Mailserver. Any tips on tuning gnarwl? A: Several: - Strip down your configfile. Comments and empty lines are waste, as well as config directives specifying default values. - Set the loglevel low, once your setup works. - Creating blockfiles takes gnarwl a considerable amount of IO resources. You might want to pre-create them using damnit. - Make sure, to index all the attributes from the querystring in your LDAP database. Otherwise lookups may by very slow. Use anonymous binding and don't set the protocol to autodetect. Keep your entire database in RAM if possible. - Compile gnarwl with a smaller line input buffer (--with-maxline=NUMBER). The default is set very high (2.1kb), to make sure, no lines are truncated. Unless someone sends mail using a really broken MUA, 256 bytes should still do the trick. - Try to avoid retrieving emailaddresses from "To:" and "Cc:" headers (even though it is the default), as these headers may contain more than one entry. This results in a number of useless and/or redundant database queries. ------ Q: There are some persons, I don't want to sent automatic replies to, how do I do that? A: This may be a bit tricky/messy, as you have to find an attribute for storing the unwelcome remote address first. In case you don't feel like extending LDAP schema (and updating all objects in the database), I suggest, you simply (ab)use the vacationForward attribute for this. Then adapt the queryfilter to something like: "( &(&(mail=$receiver)(vacationActive=TRUE))(!(vacationForward=$sender)) )" ------ Q: Gnarwl may produce quite a lot of LDAP queries, wouldn't it be better to cache them in order to gain more performance? A: Nope. The problem is simply, that gnarwl does not run as a daemon, but is invoked once per mail, so there is no way to provide a in-memory cache, while a on-disk cache would probably have the opposite effect. ------ Q: There are two versions of the ISPEnv.schema, which one should I take? A: The old version is included for legacy reasons only and should not be used for new installations, as it will not work with recent openLDAP servers. Beware if you plan to upgrade your schema, the two versions are slightly incompatible.gnarwl-3.6/doc/AUTHORS0000644000175100037440000000050011023460406013612 0ustar koboldadminMain author: - Patrick Ahlbrecht Bugfixes: - Thomas Stinner - Ole Dalgaard - "Jean-Paul" If I have forgotten to give someone credits, please let me know New versions of gnarwl may be found at http://www.onyxbits.de/gnarwl gnarwl-3.6/doc/HISTORY0000644000175100037440000002670011070155402013637 0ustar koboldadminThe versioning scheme of gnarwl consists of a major and a minor version number. An increase in the former means a new feature was added, while an increase in the later is to document a maintainance fix. 1.0: First public release. 1.1: - Added a retrycounter and random sleep call to dbstuff.dbLock(). This should fix an infinite loop problem of 1.0 where to instances of gnarwl would try to access the same .db file over and over again, blocking each other. - Updated documentation - Added this file - added README.pitfalls - Renamed SECURITY README.security - Updated Makefile (simplified it a bit) - Removed hardcoded "sendmail" from execl call in gnarwl.doReply(), replaced it with the result of basename(cfg.mta). - openlog is now called once in main(), instead of immediatly before every syslog() call (what made me waste resources like this?). - Removed exit(0) call in main(), return 0; schould do as well. - Updated gnarwl.printUsage(): Added version number, uses a single printf now. - replaced exit(1) and exit(0) with exit(EXIT_FAILURE) and exit(EXIT_SUCCESS). Code should be more portable this way. - gnarwl.addAddr() now checks first against cfg.maxmail before doing anything else. - gnarwl.addAddr() now strips emailaddresses with angle brackets, e.g.: John Doe becomes john@doe.org - Added new config switch "log_verbose", since -v cannot be specified in .forward files. - closed some memory leaks 1.2 - Added a newline character to gnarwl.c (gcc 2.96 complained about it) - Updates docs * fixed some typos * added a warning about openldap2.0.23 to INSTALL * added a manpage (bouyah!). - Updated Makefile: * $(VER) is now computed from the directory basename, instead of being hardcoded * added new variable $(CONFDIR) * The macros CFGFILE and VERSION are now defined via compiler switch - Changed gnarwl.printUsage(): * now also prints out default configfilename * versioninformation is taken from VERSION macro (instead of being hardcoded in the source). 2.0 - Renamed this file from CHANGES to HISTORY - moved src/dbstuff.c to dbaccess.c - killed dbaccess.dbExpired() ; integrated it's logic directly into dbCheck() - added new management utility, damnit (yes, that's it's name). - Splitted gnarwl.h -> every module has now it's own header - Updates Makefile: Everything is now installed under /usr/local per default - Changed gnarw.doReply() return type from int to void (since doReply always returned TRUE are bailed out itself if something went wrong). - Reformulated most program messages - More logging - Base64 support. Actually it seems as if it was supported all the time, but I didn't know of it #-) (So much for the documentation of openldap ;-). Why does ldapsearch return base64 encoded data, but ldap_get_first_entry() not ?!). - Changed return type of dbaccess.dbLock() from int to void. This method will now exit(EXIT_FAILURE) directly if locking was unsucesfull. - Fixed a bug in dbaccess.dbLock(): The do-while loop lacked the correct break condition, so it always looped 10 times. - Replaced util.ewe(char*) with util.oom(). - Removed default away message (waste of space and didn't look pretty anyway). - Added more filechecking to dbaccess.dbCheck(). It was rather weak before (would fail, if another process had the db file open for writing). - Added flexible deny rules for mail. - The blacklist is now stored in a gdbm file. - Renamed bl_file to mail_blacklist - Updated installation process - Updated docs - gnarwl.readLDAP() now uses ldap_init() instead of ldap_open() - Added new version of billiton.schema - Found a "nice feature": you may not free(2) the argument of basename(3). Fixed gnarwl.doReply accordingly. On the second thought: using basename was a stupid idea in the first place -> removed it completely. - gnarwl is no longer bound to sendmail as MTA; MTA is now completly configureable (with parameters). - renamed cfg.v_message to cfg.result - added README.upgrade - Updated manpage - Disallowed autoreply for shared addresses. - Renamed mail_limit to mail_limit_receivers, added mail_limit_header - Merged README.pitfalls and README.security into FAQ - Only the attributes specified in the config file will be queried - Reworked gnarwl.readLDAP() - added free(rep) after a call to gnarwl.doReply - Removed v_begin and v_end, gnarwl now uses flexible macros - Removed docs/USING - gnarwl.readLDAP() now uses ldap_search_st instead of ldap_search_s - Renamed config directive log_verbose to log_level. - Eliminated "-v" commandlineswitch - Added additional loglevels. - Found a hefty bug in gnarwl.readHeader -> reimplemented it along with gnarwl.addAddr and ganrwl.main (they looked ugly anyway). - added new function: dbaccess.dbOpen - Moved declaration of "verbose" and "cfg" from gnarwl.c to conf.c, so damnit may link against the other objectfiles. - Cleaned up the mess in the headerfiles: * Moved config structure from gnarwl.h to conf.h * All functions are now documentated in the corresponding headerfiles * gnarwl.h no longer includes all the other headers - Added "contrib" branch for add-on software. 2.1 - Fixed a minor bug in dbaccess.dbCheck() and dbaccess.dbLock(): Both routines would ommit the trailing \0 of the key value. This was not critical, as both did so, but it was incompatible with damnit. - Fixed a memory leak in damnit.listFile() (key.dptr and val.dptr are now freed). - "make uninstall" will now also remove the system account of gnarwl (if present). - Added a new macro "USERADD_ARG" to the Makefile. - Updated docs - Gnarwl.readHeader() would call util.cleanAddress without testing whether the result was NULL or not (and therefore could segfault if one supplied illegal from/to/cc or reply-to addresses) -> Added a test for NULL after every cleanAddress call. - Changed places of main.doReply() and dbaccess.dbLock in gnarwl.main. Locking is now done right after (not before) mail is sent. 2.2 - Updated Docs - Fixed a bug in conf.putEntry(): Gnarwl did segfault whenever the key value was NULL (that is: a line containing only a whitespace character was encountered in gnarwl.cfg). - util.cleanAddress() will now also convert the emailaddress to lowercase -> No more mixed case database lock files. - doc/config.template contained a line with lot's of trailing whitespaces (probably a copy and paste error), which would garble the resulting gnarwl.cfg file. This was not critically, but didn't look pretty either. - Fixed a serious bug in gnarwl.readHeader(): malloc did reserve one byte to few, causing a segfault, whenever the subject contained folded lines. - Fixed a memory leak in dbAccess.dbCheck(): data.dptr was not freed before returning. 2.3 - Added a check for NULL to util.cleanAddress(). Otherwise gnarwl would segfault trying to convert NULL to lowercase ;-). - Removed the obsolete "-v" switch from the SYNOPSIS section in doc/gnarwl.man 3.0 - Added GNU autoconf configure script - Added RPM specfile - Fixed a bug in the makefile: Replaced "make" with "$(MAKE)" - Updated gnarwl.cfg/config.tmpl - Moved config defaults from gnarwl.h to conf.h - addAddr() will no longer accept the same address twice - Added module "mailhandler", which does now handling of all mail related stuff (removed the according functions from gnarwl.c). - Added util.cpyStr - Renamed module "conf" to "config", included "conf.h" configuration header - renamed "reply_header" config directive to "forceheader" - Gnarwl will now complain about unknown config directives (instead of silently ignoring them). - config.putEntry lacked a "return" in the "ldap_map" block -> fixed. - config.putEntry "map_subject" keyword had a typo -> fixed. - Replaced billiton.schema with ISPEnv.schema - Added wait() call to mailhandler.sendMail(), so that gnarwl will send mail sequentially instead of "all at once". - Documented config structure in config.h (why didn't I do that earlier?!?) - Better status report for incomming mail (in debug level). - Renamed files/config_directives - Fixed syslog calls - Removed gnarwl.readLDAP and put the functionality in dbaccess. - One persistend LDAP connection is now used (instead of one connection/query). - Gnarwl no longer expands "\n". - Support for shared addresses (=ldapfilter matching more than one entry). - optimized several string copy operations. - damnit.printHelp() lacked a "\" in the text -> fixed. - dbAccess.dbCheck() and dbaccess.dbLock() will now return immediatly, if cfg.db_exp==0 - Updated manpages - Cleaned up doc dir (moved stuff to data dir) - Renamed doc/replyheader.txt to header.txt - Restructured half of the Makefile stuff. - File creation mask is now configureable - Added "-a" commandline switch - Added "forcefooter" config directive. - Added "recvheader" config directive - Added "umask" config directive - Added "protocol" config directive - If "blockexpire" is set to "0", now blockfiles will be accessed. - Changed binding of macronames, now the macroname always comes first - $(BIN) and $(SBIN) will now be created in src dir - Removed "uninstall:" target from Makefile, if you want to be able to remove gnarwl, then make it an RPM package. - Delegated "install:" target from top Makefile - moved config.tmpl from doc to data dir - Reworked "-f" switch of damnit -> Format is now completly configureable. - Added "-s" commandline switch - Renamed DEFAULT_DBEXP to DEFAULT_EXPIRE - Renamed DEFAULT_DBDIR to BLOCKDIR, and put it in the CFGLAGS - Added description of "-l" parameter to damnit manpage - Added troubleshooting section to doc/INSTALL - added characterset conversion routines. - cleaned up doc/AUTHORS 3.1 - Added "-ldl -lresolv" to the LFLAGS again, some distros seem to have a problem without. - Fixed segfault bug triggered by "From: <>" headers - Fixed segfault bug in mailhander.readFromSTDIN(): A buffer was freed to early. 3.2 - Some updates to the docs - Fixed some compiler warnings - Added horde plugin to the contrib branch. - Added ISPEnv2.schema 3.3 - Cosmetical fix in util.translateString(): It said "*out='\0'" changed it to a more portable: "*out=(char)NULL" - Fixed a bug in mailhandler.readFromSTDIN(): Added dummy instruction to completely empty stdin. Previous versions would have only read the mailheader (for performance sake), but it seems, this may SIGPIPE some delivery agents when trying to pass very big mails. - Removed the commented out section in mailhandler.readFromSTDIN() (it would have clashed with the previous fix, uncommented). - Added another way to make gnarwl work with postfix to doc/INSTALL (thanx Thomas). - Rewrote the Troubleshooting section in doc/INSTALL. 3.4 - Fixed RFC 2822 compliance bug. Gnarwl now honors the "Sender:" header, if set. That is, gnarwl now first looks for "Sender:", then "Reply-To:" and lastly "From:" when trying to determine where to send an answer to. - Minor fix to Makefile.in, so configure will not complain about it not honoring @datarootdir@ - Updated contact information. - Fixed a lot of compilerwarnings concerning string comparisons (the terminating null char was encoded awkwardly). - Added -DLDAP_DEPRECATED to CFLAGS to suppress compiler warnings about implicitly declared functions (it's better to use deprecated functions, then to break compability with older systems). 3.5 - Fixed a bug that would make gnarwl segfault if no footer is forced via the forcefooter directive. - Corrected doc/INSTALL regarding invocation syntax and removed the "always_bcc" reference as this directive does not seem to work any longer. - Minor FAQ updates.gnarwl-3.6/doc/INSTALL0000644000175100037440000001202611057072754013615 0ustar koboldadminPrerequisites ------------- In order to get gnarwl compiled and working, you need the following: - gcc (v2.95.3) - libgdbm (v1.8.0) - openldap2 (v2.0.23) - MTA (postfix recommended) - GNU make, groff, gzip - Linux (v2.4.18) Of course it may work with a different setup, but this is what gnarwl was developed/tested with. If you (don't) get it to work on an alternative platform, please contact me. Feedback is always welcome. Building and installing GNARWL ------------------------------ Starting with version 3.0, there are two ways of getting gnarwl installed. * Installing from source * tar -zxf gnarwl-.tgz cd gnarwl-.tgz ./configure make make install make perm This will install the program under /usr/local (NOTE: "make perm" is optional, but strongly recommended, as it creates a systemaccount for gnarwl and chowns the according files). * Using RPM * Building RPM packages requires a little more work, but is well worth it. It starts the same way as installing from source: tar -zxf gnarwl-.tgz cd gnarwl-.tgz ./configure make This will create the specfile in the data directory, as well as verify, that your system is able to build gnarwl at all. Now locate your rpm base dir (usually somewhere under /usr/src), and copy the the specfile to $RPMBASE/SPECS and the original gnarwl tarball to $RPMBASE/SOURCES. The command to build the package is "rpm -ba ". And the resulting package may be installed using "rpm -i package.rpm". * Configuring * No matter which installation method you choose, you still have to edit the gnarwl.cfg file afterwards (at least the searchbase must be set) and should check, that the blacklist is filled proberly (you should put all the addresses of systemaccoutns herin, as well as any emailaddress, that is shared by several users). Configuring LDAP ---------------- To cope with vacations, LDAP requires the respective objectclasses. It is recommended to install the included ISPEnv.schema file. In case you are using OpenLDAP version 2, just copy it from the docs directory to wherever your other *.schema files are located. Add the corresponding "include" line to your slapd.conf and restart the LDAP server. In case this is not an option for you: Gnarwl does not depend on a certain schema, as it doesn't use any hardcoded attribute names. You may (ab)use any other schema you like. Configuring the Mailserver --------------------------- A complete guide to configuring your mailsystem is beyond the scope of this document (refer to the manuals of your MTA), so this section will only describe what has to be done, in order to integrate gnarwl in an an already working mailsystem. It is assumed, you did not skip the "make perm" step, that is, a local account named "gnarwl" does exist. The basic idea is to get your MTA to pipe a copy of every received mail (well, at least those, that could be subject to autoresponding) through to gnarwl. There are several ways to do this (largely depending on which MTA you use): * Platform independant solution * Edit your alias/virtual lookup table, so each mailaddress contains a forward to the local user "gnarwl". The ~gnarwl/.forward file, generated by "make install" will then take care of piping the mail through to gnarwl. Another way is to utilize gnarwl in the same fashion as vacation(1), but this of course requires homedirectories, and therefore somehow beats the whole idea. * Postfix * 1. Define a new transport: /etc/postfix/transports autoreply.domain.com gnarwl: 2. Create transport.db file and include in postfix config: /etc/postfix/main.cf transport_maps= hash:/etc/postfix/transport 3. Add to /etc/postfix/master.cf: gnarwl unix - n n - - pipe flags=F user=gnarwl argv=/usr/local/bin/gnarwl -s $sender -a $recipient 4. Restart postfix 5. Define an alias for every user, who may use the autoresponder: user1@domain.com -> user1@domain.com user1@autoreply.domain.com * Sendmail * Sorry, no info available at this time. * Exim * Sorry, no info available at this time. * Qmail * Sorry, no info available at this time. Troubleshooting ---------------- Ok, you followed the instructions in this file, but somehow it didn't work out, right? Ok, first things first, this sections deals with setting gnarwl up, not with compiling. If the later is your problem and you can't figure it out (even if you can), you should contact me, so I can fix the source. Well, there are numerous ways, to goof up, installing gnarwl (even happens to me, and I worte that stuff ;-) ). First you should su(1) to the user, gnarwl is supposed to run as (default is usually "gnarwl"). Now check, if gnarwl would be able to access it's own config and database files. If the file permissions are set up correctly, set the loglevel to 3 (debug) in gnarwl.cfg, call gnarwl using the -a and -s commandline switches (use meaningfull emailaddresses here). Check your maillog for "CRIT" and "WARN" messages. If none show up, try using ldapsearch, to see if there are actually entries in your database, that could be used for autoresponding. gnarwl-3.6/doc/LICENSE0000644000175100037440000004313110215047235013561 0ustar koboldadmin GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.