ample-0.5.7.orig/0040755000550600055060000000000007760623725012664 5ustar tonontononample-0.5.7.orig/src/0040755000550600055060000000000007760624011013440 5ustar tonontononample-0.5.7.orig/src/Makefile.in0100644000550600055060000000441107570413147015507 0ustar tonontonon# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ datadir = @datadir@ exec_prefix = @exec_prefix@ includedir = @includedir@ infodir = @infodir@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @SET_MAKE@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ EXTRACPPFLAGS = -I$(top_srcdir) DEFS = @DEFS@ -DDEF_LOGFILE=\"$(logfile)\" -DDEF_CONFFILE=\"$(conffile)\" -DDEF_PATH=\"$(mp3path)\" -DDEF_HTMLFILE=\"$(htmlfile)\" LIBS = @LIBS@ LDFLAGS = @LDFLAGS@ LIBTOOL = $(CC) INSTALL = @INSTALL@ conffile = $(sysconfdir)/ample.conf htmlfile = $(sysconfdir)/ample.html logdir = $(localstatedir)/log logfile = $(logdir)/ample.log mp3path = $(datadir)/mp3 PROGRAMS = ample SOURCES = ample.c client.c entries.c configuration.c helper.c base64.c OBJECTS = ample.o client.o entries.o configuration.o helper.o base64.o COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) $(EXTRACPPFLAGS) $(DEFS) LINK = $(LIBTOOL) $(LDFLAGS) all: ample ample: $(OBJECTS) $(LINK) $(OBJECTS) $(LIBS) -o $@ .c.o: $(COMPILE) -c $< install: @$(INSTALL) -d $(bindir) @for i in $(PROGRAMS); do \ echo "Installing $$i ..."; \ $(INSTALL) -s $$i $(bindir); \ done @$(INSTALL) -d $(logdir) uninstall: @for i in $(PROGRAMS); do \ echo "Removing $$i ..."; \ rm -f $(bindir)/$$i; \ done clean: rm -f *.o $(PROGRAMS) maint-clean: rm -f *.o *~ Makefile ample dist-clean: rm -f *.o *~ Makefile ample rm -rf CVS .PHONY: all install clean maint-clean dist-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ample-0.5.7.orig/src/ample.c0100644000550600055060000003071707760620330014707 0ustar tonontonon/* * Ample - An MP3 lender * * (c) Copyright - David Härdeman - 2001 * */ /* * This file is part of Ample. * * Ample 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. * * Ample 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 Ample; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * $Id: ample.c,v 1.50 2003/11/25 09:28:27 alphix Exp $ * * This file contains functions to do initial setup (set up sockets, * daemonize, prepare log files etc). The main server process (that * forks off children to deal with clients) should be executing within * this file most of the time. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_SYSLOG_H #include #endif #ifdef HAVE_LIBWRAP #include int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING; #endif #include "ample.h" #include "entries.h" #include "client.h" #include "configuration.h" #include "helper.h" /* Number of clients currently connected only main proc should change this */ static volatile int num_clients = 0; /* Global configuration data */ struct global_config gconf; /* Used for error checking */ extern int errno; /* Used to keep track of child status */ struct childstat *childarray; /* * Creates a socket and sets it to listen on TCP port defined in gconf.port. * * Arguments: none * * Returns: the socket that was created */ static int opentcpconn() { struct sockaddr_in address; int opt = 1; int sock; if ((sock = socket(PF_INET,SOCK_STREAM, 0)) < 0) die("failed to open tcp socket\n"); setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)); address.sin_family = AF_INET; address.sin_port = htons((uint16_t)gconf.port); memset(&(address.sin_addr), 0, sizeof(address.sin_addr)); if(bind(sock, (struct sockaddr *)&address, sizeof(struct sockaddr_in))) die("failed to bind tcp socket\n"); if(listen(sock,5)) die("failed to listen to tcp socket\n"); debug(1, "Opened TCP socket, port %d\n", gconf.port); return sock; } /* * Creates a UDP socket that is used for status messages from clients * to server. * * Arguments: none * * Returns: the socket that was created */ static int openudpconn() { struct sockaddr_in address; int sock; int socklen = sizeof(struct sockaddr_in); if ((sock = socket(PF_INET,SOCK_DGRAM, 0)) < 0) die("failed to open udp socket\n"); memset(&(address.sin_addr), 0, sizeof(address.sin_addr)); address.sin_family = AF_INET; address.sin_port = 0; /* any port */ address.sin_addr.s_addr = htonl(INADDR_LOOPBACK); if(bind(sock, (struct sockaddr *)&address, socklen)) logmsg("failed to bind udp socket\n"); if(getsockname(sock, (struct sockaddr *)&address, &socklen) < 0 ) logmsg("failed to get name of udp socket\n"); if(connect(sock, (struct sockaddr *)&address, socklen)) logmsg("failed to connect udp socket\n"); debug(1, "Opened UDP socket, port %d\n", ntohs(address.sin_port)); return sock; } /* * Get's the UDP status message from client. * * Arguments: udpsocket - the socket to recieve on * * Returns: void */ static void getudpmessage(int udpsock) { char buffer[1024]; char *tmp; int childpid; int i; /* Make sure buffer is NULL terminated */ memset(buffer, '\0', sizeof(buffer)); if(recv(udpsock, buffer, sizeof(buffer) - 1, 0) < 0) { debug(1, "recv failed\n"); return; } tmp = buffer; while(*tmp != '\0' && *tmp != ':') tmp++; if(*tmp == '\0') { debug(1, "Erroneous status message from client!\n"); return; } *tmp = '\0'; tmp++; childpid = strtol(buffer, NULL, 10); if(childpid < 1) { debug(1, "Erroneous status message from client!\n"); return; } for(i = 0; i < gconf.max_clients; i++) { if(childarray[i].childpid == childpid) { if(childarray[i].status) free(childarray[i].status); childarray[i].status = strdup(tmp); debug(1, "Status message from %i: %s\n", childpid, tmp); break; } } } /* * Reaps the exit status of any child process (subservers), and changes * client count. * * Arguments: signal - the signal that called this function (SIGCHLD) * * Returns: void */ static void sigchild_handler(int signal) { int i; pid_t pid; num_clients--; pid = wait(&i); for(i = 0; childarray[i].childpid != pid; i++); childarray[i].childpid = 0; if(childarray[i].status) free(childarray[i].status); if(childarray[i].client) free(childarray[i].client); debug(1, "child with pid %u exited, currently %d/%d client(s)\n", pid, num_clients, gconf.max_clients); for(i = 0; i < gconf.max_clients; i++) if(childarray[i].childpid != 0) debug(1, "I have child %u alive with status %s\n", childarray[i].childpid, childarray[i].status); } /* * Deals with SIGHUP by reopening possible log files. * * Arguments: signal - the signal that called this function (SIGHUP) * * Returns: void */ static void sighup_handler(int signal) { #ifndef HAVE_SYSLOG_H freopen("/dev/null", "r", stdin); freopen(gconf.logfile, "a", stdout); freopen(gconf.logfile, "a", stderr); #endif return; } /* * Checks if a file descriptor is a socket. * * Arguments: fd - the file descriptor to check * * Returns: TRUE if fd is a socket, FALSE otherwise */ static bool issocket(int fd) { int v; socklen_t l; l = sizeof(int); return(getsockopt(fd, SOL_SOCKET, SO_TYPE, (void *)&v, &l) == 0); } /* * Deamonizes the process by the classical method of double fork, also * does some other things which are expected by a nice daemon. * NOTE: It does *not* chdir("/"), that must be done later for relative * paths to work. * * Returns: void */ static void daemonize() { int i; pid_t pid; umask(022); if(gconf.trace || gconf.inetd) return; if((pid = fork()) > 0) exit(EXIT_SUCCESS); else if(pid < 0) die("fork"); setsid(); if((pid = fork()) > 0) exit(EXIT_SUCCESS); else if(pid < 0) die("fork"); } /* * Prepares the proper way for ample to log messages. * * Returns: void */ static void preparelog() { #ifdef HAVE_SYSLOG_H signal(SIGHUP, SIG_IGN); if(!gconf.trace) { openlog("ample", LOG_CONS | LOG_PID, LOG_FACILITY); fclose(stdout); fclose(stderr); } #else struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = sighup_handler; sigaction(SIGHUP, &sa, NULL); if(!gconf.trace) { if(freopen(gconf.logfile, "a", stdout) == NULL || freopen(gconf.logfile, "a", stderr) == NULL) { /* We must fall back to no logging at all */ fclose(stdout); fclose(stderr); } } #endif if(!gconf.inetd) { fclose(stdin); } return; } /* * Checks if the client is allowed to access the server. * * Arguments: conn - the file descriptor of the socket to check * address - the address struct for the client * * Returns: TRUE if client is allowed, otherwise FALSE is returned and the * socket is closed. */ static bool check_access(int conn, struct sockaddr_in *address) { #ifdef HAVE_LIBWRAP /* Is the client allowed by TCP Wrappers? */ struct request_info request; request_init(&request, RQ_DAEMON, "ample", RQ_CLIENT_SIN, address, NULL); fromhost(&request); if (!hosts_access(&request)) { logmsg("Connection from %s:%d denied by TCP wrappers\n", inet_ntoa(address->sin_addr), address->sin_port); close(conn); return FALSE; } #endif /* Not too many clients? */ if(!gconf.inetd && num_clients >= gconf.max_clients) { logmsg("Connection from %s:%d denied, max clients exceeded\n", inet_ntoa(address->sin_addr), address->sin_port); close(conn); return FALSE; } /* Everything seems OK */ if(gconf.inetd) logmsg("Connection from %s:%d accepted\n", inet_ntoa(address->sin_addr), address->sin_port); else logmsg("Connection from %s:%d accepted, currently %d/%d clients\n", inet_ntoa(address->sin_addr), address->sin_port, num_clients + 1, gconf.max_clients); return TRUE; } /* * Blocks until a new incoming connection is available. * * Arguments: address - pointer to address structure to fill in with client info * tcpsock - the TCP socket to watch for incoming connections * udpsock - the UDP socket to watch for incoming messages * * Returns: the fd of the newly created socket */ static int accept_connection(struct sockaddr_in *address, int tcpsock, int udpsock) { fd_set readfds; int conn; int addrlen = sizeof(struct sockaddr_in); if(address == NULL || tcpsock < 0) return FALSE; while(TRUE) { if(!gconf.inetd) { FD_ZERO(&readfds); FD_SET(tcpsock, &readfds); FD_SET(udpsock, &readfds); conn = select(max(tcpsock, udpsock) + 1, &readfds, NULL, NULL, NULL); if(conn < 0 && errno == EINTR) continue; else if(conn < 0) die("select()\n"); if(FD_ISSET(udpsock, &readfds)) getudpmessage(udpsock); if(!FD_ISSET(tcpsock, &readfds)) continue; if((conn = accept(tcpsock, (struct sockaddr *)address, &addrlen)) < 0) { if(errno == EINTR) continue; else die("accept"); } break; } else { conn = 0; getpeername(0, (struct sockaddr *)address, &addrlen); break; } } return conn; } /* * The big schlong. * Waits for new client connections and forks a new child to handle * each connection. */ int main(int argc, char *argv[]) { struct sockaddr_in address; int i, conn, tcpsock, udpsock; pid_t pid; struct sigaction sa; sigset_t chld; /* Initial setup */ checkopt(argc, argv); gconf.inetd = issocket(0); daemonize(); preparelog(); if(!gconf.inetd) logmsg("Ample/%s started\n", AMPLE_VERSION); /* Prepare child status array */ childarray = (struct childstat *) malloc(gconf.max_clients * sizeof(struct childstat)); for(i = 0; i < gconf.max_clients; i++) { childarray[i].childpid = 0; childarray[i].status = NULL; childarray[i].client = NULL; } /* Prepare the virtual file tree of MP3's then we can chdir */ indexpaths(gconf.pathlist); if(!countentries(root)) die("No files found\n"); if(chdir("/") < 0) die("chdir()\n"); /* Some debug information */ debug(1, "Indexed %i file(s)\n", countentries(root)); showtree(0,root); /* Set up signal stuff */ memset(&sa, 0, sizeof(sa)); sa.sa_handler = sigchild_handler; sigaction(SIGCHLD, &sa, NULL); sigemptyset(&chld); sigaddset(&chld, SIGCHLD); /* * Open, and prepare * UDP socket for status reports * TCP socket for incoming connections */ if(!gconf.inetd) { udpsock = openudpconn(); tcpsock = opentcpconn(); } else { udpsock = -1; tcpsock = 0; } restart: /* Accept connection */ conn = accept_connection(&address, tcpsock, udpsock); /* Connection is now set up, check if it's allowed */ if(!check_access(conn, &address)) goto restart; /* Connection allowed, handle it */ sigprocmask(SIG_BLOCK, &chld, NULL); num_clients++; /* Check for special cases */ if(gconf.trace || gconf.inetd) { debug(1, "No-fork/inetd mode: connection from %s:%d\n", inet_ntoa(address.sin_addr), address.sin_port); handleclient(conn, udpsock); num_clients--; sigprocmask(SIG_UNBLOCK, &chld, NULL); return(EXIT_SUCCESS); } /* This is the regular case, let's fork */ if((pid = fork()) < 0) die("fork()\n"); if(pid > 0) { /* Parent process */ debug(1, "Connection from %s:%d handled by child with pid %u\n", inet_ntoa(address.sin_addr), address.sin_port, pid); for(i = 0; childarray[i].childpid != 0; i++); /* Max length = "255.255.255.255:65536" = 22 */ if((childarray[i].client = malloc(22)) == NULL) die("malloc"); snprintf(childarray[i].client, 22, "%s:%d", inet_ntoa(address.sin_addr), address.sin_port); childarray[i].status = strdup("Starting"); childarray[i].childpid = pid; sigprocmask(SIG_UNBLOCK, &chld, NULL); close(conn); goto restart; } else { /* Child process */ close(tcpsock); return(handleclient(conn, udpsock)); } /* Time to say goodbye */ if(!tcpsock) close(tcpsock); return(EXIT_SUCCESS); } ample-0.5.7.orig/src/ample.h0100644000550600055060000000221207570413147014706 0ustar tonontonon#undef TRUE #define TRUE 1 #undef FALSE #define FALSE 0 /* NOTE: This is signed since it's used somewhat different than common * in some conditions: * < 0 - undefined * > 0 - TRUE * = 0 - FALSE */ #undef bool #define bool signed short int #define min(x,y) ((x) < (y) ? (x) : (y)) #define max(x,y) ((x) > (y) ? (x) : (y)) struct global_config { int port; bool inetd; bool order; bool trace; bool recursive; int debuglevel; int max_clients; char * username; char * password; char **pathlist; char * program_name; char * logfile; char * conffile; char * htmlfile; char * htmlheader; char * htmlmiddle; char * htmlfooter; char * servername; char * serveraddress; char * filter; }; struct childstat { pid_t childpid; char *client; char *status; }; #define MODE_INDEX 0x01 #define MODE_METADATA 0x02 #define MODE_SINGLE 0x04 #define MODE_M3U 0x08 #define MODE_RM3U 0x10 #define MODE_PARTIAL 0x20 #define MODE_BASIC 0x40 #define MODE_INFO 0x80 #define MODE_SET(x) do { cconf->mode |= x; } while(0) #define MODE_ISSET(x) (cconf->mode & x) extern struct global_config gconf; extern struct childstat *childarray; ample-0.5.7.orig/src/entries.c0100644000550600055060000005200307574651332015263 0ustar tonontonon/* * This file is part of Ample. * * Ample 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. * * Ample 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 Ample; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * $Id: entries.c,v 1.33 2002/12/08 14:10:34 alphix Exp $ * * This file contains all functions related to inserting, removing, * debugging, searching etc. the filetree that Ample builds of all MP3 * files it can find. Also functions for getting entries from directories, * M3U files etc. */ #include #include #include #include #include #include #include #include #include #include #if HAVE_LIMITS_H #include #endif #if HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) #else # define dirent direct # define NAMLEN(dirent) (dirent)->d_namlen # if HAVE_SYS_NDIR_H # include # endif # if HAVE_SYS_DIR_H # include # endif # if HAVE_NDIR_H # include # endif #endif #include "ample.h" #include "entries.h" #include "client.h" #include "helper.h" /* The root of the virtual filetree where we store all available MP3 files */ mp3entry *root = NULL; /* * Given a virtual path, finds the corresponding mp3entry. * * Arguments: base - where to start the search (only entries below or adjacent * to this one will be searched) * name - the path to search for * * Returns: the mp3entry if found, else NULL */ mp3entry * findentrybypath(mp3entry *base, char *name) { char *namec = strdup(name); char *token; mp3entry *tmp = base; token = strtok(namec, "/"); if(token == NULL) { free(namec); return tmp; } while(token != NULL && tmp != NULL) { while(tmp && strcmp(tmp->name, token)) tmp = tmp->sibling; token = strtok(NULL, "/"); if(tmp && !token) { debug(3, "Find: found the last part with %s\n", tmp->name); break; } else if(tmp) { debug(3, "Find: found the part with %s\n", tmp->name); tmp = tmp->child; } } free(namec); if(tmp != NULL && tmp->child) return tmp->child; else return tmp; } /* * Given an mp3entry, finds the virtual path. * * Arguments: base - where to start the search (only entries below or adjacent * to this one will be searched) * tofind - the entry to look for * path - the base path to add to the beginning of the path to the * file, most functions would set this argument to "" * * Returns: a path stored in malloc:ed memory or NULL if entry wasn't found */ char * findpathbyentry(mp3entry *base, mp3entry *tofind, char *path) { mp3entry *tmp = base; char *subpath; char *pathc; while(tmp != NULL && tmp != tofind) { if(tmp->child) { pathc = malloc(strlen(path) + strlen(tmp->name) + 2); sprintf(pathc, "%s/%s", path, tmp->name); subpath = findpathbyentry(tmp->child, tofind, pathc); free(pathc); if(subpath) return subpath; } tmp = tmp->sibling; } if(tmp == tofind) { subpath = malloc(strlen(path) + strlen(tmp->name) + 2); sprintf(subpath, "%s/%s", path, tmp->name); return subpath; } else { return NULL; } } /* * Finds the index of a given entry. Index is based on a depth-first * search where only files are given a number. * * Arguments: base - where to start the search (only entries below or adjacent * to this one will be searched) * tofind - the entry to look for * index - a pointer to the integer which will hold the result * * Returns: TRUE if the index was found, else FALSE and value of index is * undefined */ bool findindexbyentry(mp3entry *base, mp3entry *tofind, int *index) { mp3entry *tmp = base; int count = 0; if(!tofind) return FALSE; while(tmp != NULL) { if(IS_FILE(tmp)) (*index)++; if(tmp == tofind) return TRUE; tmp = tmp->sibling; } tmp = base; while(tmp != NULL) { if(IS_DIR(tmp) && findindexbyentry(tmp->child, tofind, index)) return TRUE; tmp = tmp->sibling; } return FALSE; } /* * Finds en entry given an index. Index is based on a depth-first search * where only files are given a number. * * Arguments: base - where to start the search (only entries below or adjacent * index - a pointer to the index for the entry * (*FIXME* the index shouldn't be modified) * * Returns: the entry if found, else NULL, index is always undefined */ mp3entry * findentrybyindex(mp3entry *base, int *index) { mp3entry *tmp = base; mp3entry *result = NULL; if(*index == 0 || base == NULL) return NULL; while(tmp != NULL) { if(IS_FILE(tmp)) (*index)--; if((*index) == 0) return tmp; else tmp = tmp->sibling; } tmp = base; while(tmp != NULL) { if(IS_DIR(tmp) && (result = findentrybyindex(tmp->child, index))) return result; tmp = tmp->sibling; } return NULL; } /* * Utility function to find the first file (not dir) in a breadth-first * search of the filetree. * * Arguments: base - where to start the search (only entries below or adjacent * to this one will be searched) * recursive - should subdirs be searched as well? * result - a pointer to an mp3entry pointer which is set to * the first file if it is found, else NULL * * Returns: void */ static void findfirstfile(mp3entry *base, bool recursive, mp3entry **result) { mp3entry *tmp = base; if(tmp == NULL) return; while(tmp != NULL && *result == NULL) { if(IS_FILE(tmp)) { *result = tmp; return; } tmp = tmp->sibling; } if(recursive) { tmp = base; while(tmp != NULL && *result == NULL) { if(IS_DIR(tmp)) findfirstfile(tmp->child, recursive, result); tmp = tmp->sibling; } } } /* * Utility function to find the last file (not dir) in a breadth-first * search of the filetree. * * Arguments: base - where to start the search (only entries below or adjacent * to this one will be searched) * recursive - should subdirs be searched as well? * result - a pointer to an mp3entry pointer which is set to * the last file if it is found, else NULL * * Returns: void */ static void findlastfile(mp3entry *base, bool recursive, mp3entry **result) { mp3entry *tmp = base; if(tmp == NULL) return; while(tmp != NULL) { if(IS_FILE(tmp)) *result = tmp; tmp = tmp->sibling; } if(recursive) { tmp = base; while(tmp != NULL) { if(IS_DIR(tmp) && recursive) findlastfile(tmp->child, recursive, result); tmp = tmp->sibling; } } } /* * Given a base, finds the index of the first and last playable files below * or adjacent to that file. Good for playing all the files in a subdirectory * for instance since you know all files min -> max are valid. * * Arguments: base - where to start the search (only entries below or adjacent * to this one will be searched) * recursive - should subdirs be searched as well? * min - a pointer to an integer which will be filled in with the * value of the lowest index * max - a pointer to an integer which will be filled in with the * value of the highest index * * Returns: TRUE if the operation was successful, else FALSE */ bool getrange(mp3entry *base, bool recursive, int *min, int *max) { mp3entry *tmp; *min = 0; *max = 0; tmp = NULL; findfirstfile(base, recursive, &tmp); findindexbyentry(root, tmp, min); tmp = NULL; findlastfile(base, recursive, &tmp); findindexbyentry(root, tmp, max); if(max == 0 || min == 0) return FALSE; else return TRUE; } /* * Pretty-print the virtual filetree, mostly useful for debugging purposes. * * Arguments: indent - how much to indent the printout, used for recursing * purposes, other functions should generally set this * to 0 * entry - where to start the printing (entries below or adjacent * to this one will be printed) * * Returns: void */ void showtree(int indent, mp3entry *entry) { char *start; int i; if(!entry) return; start = malloc(4 * indent + 1); *start = 0; for(i = 0; i < indent; i++) sprintf((start + 4 * i), "| "); if(IS_DIR(entry)) { debug(1, "%s|---<%s>\n", start, entry->name); showtree(indent + 1, entry->child); } else { debug(1, "%s|-%s [%i:%02i-%d-%d-%i]\n", start, entry->name, entry->length / 60, entry->length % 60, HASID3V1(entry), HASID3V2(entry), entry->length); } free(start); showtree(indent, entry->sibling); } /* * Frees an entry and all dynamic memory referenced by it. * * Arguments: tofree - the entry to free * * Returns: void */ static void freeentry(mp3entry *tofree) { if(!tofree) return; if(tofree->name) free(tofree->name); if(tofree->path) free(tofree->path); if(tofree->title) free(tofree->title); free(tofree); } /* * Adds an entry to the virtual filetree. If an old entry with the same name * exists in the tree an error message is printed and the new entry is freed. * * Arguments: baseptr - where to add the new entry, it is added as a sibling * to this entry * toadd - the entry to add * * Returns: void */ void addentry(mp3entry **baseptr, mp3entry * toadd) { mp3entry *tmp; mp3entry **prevptr; int status; /* logmsg("going to add entry:\n"); dumpentry(toadd); */ prevptr = baseptr; tmp = *baseptr; while(tmp != NULL) { if(toadd->type > tmp->type) status = 1; else status = strcmp(toadd->name, tmp->name); if(status < 0) { /*logmsg("I think it should be added to this file:\n");*/ /* dumpentry(tmp); showtree(0, root);*/ break; } else if(status == 0) { /* logmsg("addentry: two items with the same name (%s)\n", tmp->name);*/ freeentry(toadd); return; } else { prevptr = &(tmp->sibling); tmp = tmp->sibling; } } *prevptr = toadd; toadd->sibling = tmp; } /* * Removes and frees an entry from the virtual filetree. * * Arguments: baseptr - where to start looking for the entry * toremove - the entry to remove * * Returns: TRUE if an entry was removed, else FALSE */ bool removeentry(mp3entry **baseptr, mp3entry *toremove) { bool result = FALSE; mp3entry *tmp; mp3entry **prevptr; prevptr = baseptr; tmp = *baseptr; while(tmp != NULL && tmp != toremove) { result = removeentry(&(tmp->child), toremove); prevptr = &(tmp->sibling); tmp = tmp->sibling; } if(!tmp) return result; while(tmp->child) removeentry(&(tmp->child), tmp->child); debug(3, "Removing %s\n", tmp->name); *prevptr = tmp->sibling; freeentry(tmp); return TRUE; } /* * Clears and frees the entire virtual tree of files. * * Arguments: rootentry - where to start * * Returns: void */ void cleartree(mp3entry **rootentry) { while(*rootentry != NULL) removeentry(rootentry, *rootentry); } /* * Writes out the entire tree to a specific memory location and * changes all pointers accordingly. No checking of the size of * the memory area is done so make sure it's big enough * (as big as spaceneeded() says). * * Arguments: basedest - the destination to write to * baseentry - where to start * * Returns: the number of bytes written */ int writetree(void *basedest, mp3entry *baseentry) { void *tmp = basedest; mp3entry *from = baseentry; mp3entry *to; int towrite; int written = 0; while(from) { to = tmp; memcpy(to, from, sizeof(mp3entry)); written += sizeof(mp3entry); tmp += sizeof(mp3entry); if(from->name) { to->name = tmp; towrite = strlen(from->name) + 1; memcpy(to->name, from->name, towrite); written += towrite; tmp += towrite; } if(from->path) { to->path = tmp; towrite = strlen(from->path) + 1; memcpy(to->path, from->path, towrite); written += towrite; tmp += towrite; } if(from->title) { to->title = tmp; towrite = strlen(from->title) + 1; memcpy(to->title, from->title, towrite); written += towrite; tmp += towrite; } if(from->child) { to->child = tmp; towrite = writetree(to->child, from->child); written += towrite; tmp += towrite; } if(from->sibling) to->sibling = tmp; from = from->sibling; } return written; } /* * Counts the amount of files in the virtual tree. * * Arguments: baseentry - where to start * * Returns: the amount of files */ int countentries(mp3entry *baseentry) { mp3entry *tmp = baseentry; int count = 0; while(tmp != NULL) { if(IS_FILE(tmp)) count++; count += countentries(tmp->child); tmp = tmp->sibling; } return count; } /* * Calculates the amount of memory that the virtual filetree uses. * * Arguments: baseentry - where to start * * Returns: the amount of memory used */ int spaceneeded(mp3entry *baseentry) { mp3entry *tmp = baseentry; int count = 0; while(tmp != NULL) { count += sizeof(mp3entry); if(tmp->name) count += strlen(tmp->name) + 1; if(tmp->path) count += strlen(tmp->path) + 1; if(tmp->title) count += strlen(tmp->title) + 1; count += spaceneeded(tmp->child); tmp = tmp->sibling; } return count; } /* * Prints all information about a specific entry, good for debugging. * * Arguments: entry - the entry to analyze * * Returns: void */ void dumpentry(mp3entry *entry) { if(entry == NULL) { debug(1,"\n"); return; } debug(1,"\n", entry); debug(1, "|->type: %i\n", entry->type); if(entry->path) debug(1,"|->path: %p - %s\n", entry->path, entry->path); else debug(1,"|->path: NULL\n"); if(entry->name) debug(1,"|->name: %p - %s\n", entry->name, entry->name); else debug(1,"|->name: NULL\n"); debug(1,"|->filesize: %i\n", entry->filesize); debug(1,"|->id3v1len: %i\n", entry->id3v1len); debug(1,"|->id3v2len: %i\n", entry->id3v2len); if(entry->title) debug(1,"|->title: %p - %s\n", entry->title, entry->title); else debug(1,"|->title: NULL\n"); if(entry->sibling) debug(1,"|->sibling: %p\n", entry->sibling); else debug(1,"|->sibling: NULL\n"); if(entry->child) debug(1,"|->child: %p\n", entry->child); else debug(1,"|->child: NULL\n"); } /* * Checks which type of file/dir path points to. Can be dir/mp3/m3u, also does * some sanity checks on these files so if this function says they're ok they * should be. buf is filled in if the path is valid. Is there no end * to the advances of modern technology!? :-) * * Arguments: path - the path to examine, can be both relative and absolute * buf - filled in with info about the path * * Returns: the type of the path (as defined in the header file) */ static int checkpathtype(char *path, mp3entry **buf) { struct stat statbuf; char *dirc, *basec, *bname, *dname; char *owd, *cwd; int retval = TYPE_INVALID; if(stat(path, &statbuf)) { /* * This *should* protect against symlink loops since that * would give ELOOP */ logmsg("Error, unable to stat path - %s (reason: %s)\n", path, strerror(errno)); *buf = NULL; return TYPE_INVALID; } dirc = strdup(path); basec = strdup(path); dname = dirname(dirc); bname = basename(basec); if(bname[0] == '.') { /* File/dir shouldn't begin with . */ debug(2, "Ignoring %s, starts with .\n", path); } else if(S_ISDIR(statbuf.st_mode)) { /* Is it a dir? */ debug(2, "Valid dir %s\n", path); *buf = (mp3entry *)malloc(sizeof(mp3entry)); memset(*buf,0,sizeof(mp3entry)); (*buf)->name = strdup(bname); (*buf)->type = TYPE_DIR; retval = TYPE_DIR; } else if(!S_ISREG(statbuf.st_mode)) { /* If not a dir, it must be a regular file */ debug(2, "Ignoring %s, not a dir and not a regular file\n", path); } else if(strlen(bname) < 5) { /* Filename must be at least as long as x.mp3 or x.m3u */ debug(2, "Ignoring %s, too short filename\n", path); } else if(statbuf.st_size == 0) { /* File size must be > 0 */ debug(2, "Ignoring %s, zero size\n", path); } else if(!strcasecmp((bname + strlen(bname) - 4),".mp3")) { /* Does the filename end with .mp3 (case insensitive)? */ debug(2, "Valid mp3 file %s\n", path); *buf = (mp3entry *)malloc(sizeof(mp3entry)); memset(*buf,0,sizeof(mp3entry)); if(!strcmp(dname, ".")) { cwd = mgetcwd(); (*buf)->path = (char *)malloc(strlen(cwd) + strlen(bname) + 2); sprintf((*buf)->path, "%s/%s", cwd, bname); free(cwd); } else { owd = mgetcwd(); chdir(dname); cwd = mgetcwd(); (*buf)->path = (char *)malloc(strlen(cwd) + strlen(bname) + 2); sprintf((*buf)->path, "%s/%s", cwd, bname); chdir(owd); free(owd); free(cwd); } (*buf)->name = strdup(bname); (*buf)->type = TYPE_MP3; (*buf)->filesize = statbuf.st_size; checkmp3info((*buf)); retval = TYPE_MP3; } else if(!strcasecmp((bname + strlen(bname) - 4),".m3u")) { /* Does the filename end with .m3u (case insensitive)? */ debug(2, "Valid m3u file %s\n", path); *buf = (mp3entry *)malloc(sizeof(mp3entry)); memset(*buf,0,sizeof(mp3entry)); (*buf)->name = strdup(bname); (*buf)->type = TYPE_DIR; retval = TYPE_M3U; } else { /* Odd filename */ debug(2, "Ignoring %s, weird filename\n", path); } if(retval == TYPE_INVALID) *buf = NULL; free(dirc); free(basec); return retval; } /* * Reads the contents of a directory, adds all valid MP3 files to virtual * filetree and (depending on configuration options) recursively scans * all subdirs. * * Arguments: path - the basepath in the virtual file tree * baseptr - where to add files in the virtual file tree * * Returns: void */ static void parsedir(char *path, mp3entry **baseptr) { DIR *dir; struct dirent *dirent; char *cwd,*owd; char *dname,*bname; mp3entry *filebuf; owd = mgetcwd(); if(chdir(path)) { logmsg("Incorrect path for mp3 files - %s\n", path); free(owd); return; } else { cwd = mgetcwd(); } if (!(dir = opendir("."))) die("opendir()\n"); while((dirent = readdir(dir))) { switch(checkpathtype(dirent->d_name, &filebuf)) { case TYPE_MP3: addentry(baseptr, filebuf); break; case TYPE_DIR: if(gconf.recursive) { addentry(baseptr, filebuf); parsedir(dirent->d_name, &(filebuf->child)); } else { freeentry(filebuf); } break; case TYPE_M3U: freeentry(filebuf); /* fall trough */ default: /* This includes TYPE_INVALID */ continue; } errno = 0; } if (errno) die("readdir()\n"); chdir(owd); free(owd); free(cwd); closedir(dir); } /* * Parses an M3U file and tries to add all files listed in it to the * virtual file tree. * * Arguments: baseptr - where to add the files * path - path to the M3U file * * Returns: void */ static void parsem3u(mp3entry **baseptr, char *path) { FILE *m3u; mp3entry *mp3buf; char line[1000]; char *start,*end; char *tmp; char *dirc, *basec, *bname, *dname; char *owd; if(!(m3u = fopen(path, "r"))) { logmsg("Unable to open .m3u file %s\n", path); return; } dirc = strdup(path); basec = strdup(path); dname = dirname(dirc); bname = basename(basec); owd = mgetcwd(); chdir(dname); while((fgets(line, 1000, m3u)) != NULL) { for(start = line; start != NULL && isspace(*start); start++); if(!start || *start == '#' || *start == '\0' || strlen(start) < 1) continue; for(end = start + strlen(start); *end == '\0' || isspace(*end) || *end == '\n'; end--); end++; *end = '\0'; tmp = malloc(strlen(start) + 1); snprintf(tmp, strlen(start) + 1, "%s", start); switch(checkpathtype(tmp, &mp3buf)) { case TYPE_MP3: addentry(baseptr, mp3buf); break; case TYPE_INVALID: continue; default: /* Includes TYPE_M3U and TYPE_DIR */ freeentry(mp3buf); break; } free(tmp); } chdir(owd); free(owd); free(dirc); free(basec); fclose(m3u); } /* * Iterates trough the array of paths to M3U/MP3 files and directories * and takes appropriate actions on each entry. * * Arguments: patharray - the array of paths to file/dirs to add * * Returns: void */ void indexpaths(char **patharray) { int i; mp3entry *mp3buf; /* Prepare the virtual file tree of MP3's */ if(!patharray) return; for(i = 0; patharray[i] != NULL; i++) { debug(1, "Checking path for mp3 files - %s\n", patharray[i]); switch(checkpathtype(patharray[i], &mp3buf)) { case TYPE_INVALID: continue; case TYPE_MP3: addentry(&root, mp3buf); break; case TYPE_M3U: freeentry(mp3buf); parsem3u(&root, patharray[i]); break; case TYPE_DIR: freeentry(mp3buf); parsedir(patharray[i], &root); break; default: logmsg("Indexpaths: we should never end up here\n"); break; } } } ample-0.5.7.orig/src/entries.h0100644000550600055060000000522607570413150015263 0ustar tonontonon#ifndef PATH_MAX # if defined (_POSIX_PATH_MAX) # define PATH_MAX _POSIX_PATH_MAX # elif defined (MAXPATHLEN) # define PATH_MAX MAXPATHLEN # elif defined (_PC_PATH_MAX) # define PATH_MAX _PC_PATH_MAX # else # define PATH_MAX 1024 # endif #endif /* Holds all needed info about a MP3 file */ typedef struct node { int type; char * name; /* Name of file/dir */ char * path; /* Absolute path to the MP3 file */ off_t filesize; int id3v1len; int id3v2len; int length; char *title; struct node *sibling; /* Linked list of other entries in same dir */ struct node *child; /* Pointer to first entry below this dir */ } mp3entry; /* These numbers matter, they are the order which the items should appear */ #define TYPE_DIR 0 #define TYPE_MP3 1 /* These are used somewhere but should *never* exist in filetree */ #define TYPE_M3U 2 #define TYPE_INVALID -1 #define IS_DIR(entry) ((entry)->type == TYPE_DIR) #define IS_FILE(entry) ((entry)->type == TYPE_MP3) #define HASID3V2(entry) entry->id3v2len > 0 #define HASID3V1(entry) entry->id3v1len > 0 /* Root entry in our file tree */ extern mp3entry * root; /* Finds an entry in the filetree */ extern mp3entry *findentrybypath(mp3entry *base, char *name); /* Finds the path of an entry in the filetree */ extern char *findpathbyentry(mp3entry *base, mp3entry *tofind, char *path); /* Finds the index of an entry (must be file) in the filetree */ extern bool findindexbyentry(mp3entry *base, mp3entry *tofind, int *index); /* Finds the entry by index in the filetree */ extern mp3entry *findentrybyindex(mp3entry *base, int *index); /* Finds the range of files that exist below base */ extern bool getrange(mp3entry *base, bool recursive, int *min, int *max); /* Dumps the entire tree to stdout, for debugging */ extern void showtree(int indent, mp3entry *entry); /* Adds an entry in the filetree */ extern void addentry(mp3entry **baseptr, mp3entry *toadd); /* Removes an entry from the list pointed to by rootentry */ extern bool removeentry(mp3entry **baseptr, mp3entry *toremove); /* Clears and frees a tree of MP3 files */ extern void cleartree(mp3entry **rootentry); /* Writes the virtual tree to a memory location */ extern int writetree(void *basedest, mp3entry *baseentry); /* Counts the entries in the list pointed to by rootentry */ extern int countentries(mp3entry *rootentry); /* Calculates the space needed for the entire tree */ extern int spaceneeded(mp3entry *baseentry); /* Dumps info about one entry, useful for debugging */ extern void dumpentry(mp3entry *entry); /* Examines all paths in patharray and (depending on kind of path) adds to file list */ void indexpaths(char **patharray); ample-0.5.7.orig/src/base64.c0100644000550600055060000000706507760620330014675 0ustar tonontonon/* * $Id: base64.c,v 1.7 2003/11/25 09:28:27 alphix Exp $ * * This file is part of Ample. * * Ample 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. * * Ample 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 Ample; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #ifdef HAVE_SYS_TYPES_H #include #endif #include "ample.h" #include "base64.h" static int valof(char c) { char *alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; char *tmp = alphabet; int i = 0; if (c == '\0') return -1; while(TRUE) { if (*tmp == '\0') return -1; if (*tmp == c) return i; i++; tmp++; } } bool isbase64(char c) { if(valof(c) >= 0) return(TRUE); else return(FALSE); } static void nextchunk(char ** c, char * chunk) { int i; int b64val[4]; for(i=0; i < 4; i++) { if(**c != '\0') { b64val[i] = valof(**c); (*c)++; } else { b64val[i] = '\0'; } } *(chunk + 0) = CHAR1(b64val[0],b64val[1]); *(chunk + 1) = CHAR2(b64val[1],b64val[2]); *(chunk + 2) = CHAR3(b64val[2],b64val[3]); } char * b64dec(char * msg) { char * tmp = msg; char * buffer; char chunk[4]; if(*tmp == '\0') return NULL; memset(chunk,0,sizeof(chunk)); buffer = (char *)malloc(strlen(msg) + 1); *buffer = '\0'; while(*tmp != '\0') { nextchunk(&tmp,chunk); strcat(buffer,chunk); } return buffer; } /* I stored this here for now, might be useful later - David */ /* * Sends a sequence of digital silence that is at least as long as duration * and probably shorter than duration + max length of a frame * (which is something like 26.126 milliseconds) */ /* static bool sendsilence(float duration, FILE *to, int *metaflag) { int i = 0; */ /* FrameSize = 144 * BitRate / (SampleRate + Padding) */ /*double framesize = (144 * 128*1000) / (44.1*1000 + 0);*/ /* Frames = Time * SampleRate / (FrameSize * 8) */ /* int max = (int)ceil(((double)duration * 128*1000) / (framesize * 8));*/ /* How much have we drifted from FrameSize bytes / frame */ /* double diff = 0; char framebody[410]; char firstheaders[2][8] = {{0xFF,0xFB,0x92,0x04,0x00,0x00,0x00,0x00}, {0xFF,0xFB,0x92,0x04,0xBF,0x00,0x07,0xE8}}; char shortheader[8] = {0xFF,0xFB,0x90,0x04,0xFF,0x80,0x0B,0xE8}; char longheader[8] = {0xFF,0xFB,0x92,0x04,0xFF,0x80,0x0B,0xF0}; char framebegin[28] = {0x00,0x69,0x00,0x00,0x00,0x00,0x00,0x00, 0x0D,0x20,0x00,0x00,0x00,0x00,0x00,0x01, 0xA4,0x00,0x00,0x00,0x00,0x00,0x00,0x34, 0x80,0x00,0x00,0x00}; memset(framebody, 0xFF, 410); memcpy(framebody, framebegin, 28); debug(3, "sending %i frames of digital silence", max); while(i < max) { diff += 418 - framesize; if(i < 2) { senddata(to, firstheaders[i], 8, metaflag); senddata(to, framebody, 410, metaflag); } else if(diff < 1) { senddata(to, longheader, 8, metaflag); senddata(to, framebody, 410, metaflag); } else { diff--; senddata(to, shortheader, 8, metaflag); senddata(to, shortheader, 409, metaflag); } i++; } return(TRUE); } */ ample-0.5.7.orig/src/base64.h0100644000550600055060000000056007570413147014700 0ustar tonontonon#define HIGHBITS 0x30 /* 00110000 */ #define MIDBITS 0x0C /* 00001100 */ #define LOWBITS 0x03 /* 00000011 */ #define CHAR1(x,y) ((x << 2) | ((y & HIGHBITS) >> 4)) #define CHAR2(x,y) (((x & (MIDBITS | LOWBITS)) << 4) | ((y & (HIGHBITS | MIDBITS)) >> 2)) #define CHAR3(x,y) (((x & LOWBITS) << 6) | y) extern bool isbase64(char c); extern char * b64dec(char * msg); ample-0.5.7.orig/src/configuration.c0100644000550600055060000004265007574651332016470 0ustar tonontonon/* * $Id: configuration.c,v 1.24 2002/12/08 14:10:34 alphix Exp $ * * This file is part of Ample. * * Ample 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. * * Ample 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 Ample; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * $Id: configuration.c,v 1.24 2002/12/08 14:10:34 alphix Exp $ * * This file parses and prepares configuration data (command line, config * file, HTML template, default options etc) and also reading and parsing * requests from clients. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #if HAVE_GETOPT_H #include #endif #if HAVE_NETDB_H #include #endif #include "ample.h" #include "base64.h" #include "entries.h" #include "client.h" #include "configuration.h" #include "helper.h" /* used in readrequest to see if the request timed out before completion */ volatile int timeout; /* * Resizes an array and adds an element to it. * * Arguments: arrayptr - pointer to the array ptr * element - the element to add * * Returns: void */ static void addtoarray(char ***arrayptr, char *element) { int i; if(*arrayptr == NULL) { *arrayptr = malloc(sizeof(char *)); if(!(*arrayptr)) die("malloc()\n"); (*arrayptr)[0] = NULL; } for(i = 0; (*arrayptr)[i] != NULL; i++); (*arrayptr) = realloc((*arrayptr), (i + 2) * sizeof(char *)); if(!(*arrayptr)) die("realloc()\n"); (*arrayptr)[i] = element; (*arrayptr)[i+1] = NULL; } /* * This function will deal with leading / and also * illegal characters according to RFC 1738: * ' ',',','<','>','"','#','%','{','}','|','\','^','~','[',']' and '`' * These should be (but aren't always) encoded as % * would become %3Chi%3E * * Arguments: url - the string to decode * * Returns: a decoded string stored in malloc:ed memory */ static char * decodeurl(char *url) { char *current = url; char *ret = (char *)malloc(strlen(url) + 1); char *pos = ret; int hexval; char hexbuf[3]; hexbuf[2] = '\0'; if(*current != '/') { *pos == '/'; pos++; } while(*current != '\0') { if(*current != '%') { *pos = *current; pos++; current++; } else { if(((hexbuf[0] = *(current + 1)) == '\0') || ((hexbuf[1] = *(current + 2)) == '\0')) { strncpy(pos, current, 3); pos = pos + 2; break; } else if ((hexval = (int)strtol(hexbuf, NULL, 16)) == 0) { strncpy(pos, current, 3); pos = pos + 3; } else { *pos = (char)hexval; pos++; } current = current + 3; } } *pos = '\0'; debug(2, "Decodeurl parses %s as %s\n", url, ret); return ret; } /* * Signal handler for timeout when reading the request from the client. * * Arguments: signal - the signal that called this function (SIGALRM) * * Returns: void */ static void conntimeout(int signal) { timeout = TRUE; } /* * Reads the request from the client and sets configuration options to * reflect what the user requested. * * Arguments: stream - the stream to read client requests from * * Returns: TRUE if a succesful request was made, FALSE otherwise */ bool readrequest(struct client_config *cconf) { char line[LINELENGTH]; int start,end; char *tmp, *tmp2; struct sigaction sa; timeout = FALSE; memset(&sa, 0, sizeof(sa)); sa.sa_handler = conntimeout; sigaction(SIGALRM, &sa, NULL); alarm(CONN_TIMEOUT); while((fgets(line, LINELENGTH, cconf->stream)) != NULL && timeout != TRUE) { if(!strcmp(line, "\r\n")) { /* End of request from client */ break; } else if(!strncasecmp(line, "GET", strlen("GET"))) { /* Found the GET request */ debug(3, "GET request was %s\n", line); if(strlen(line) < 14) continue; /* If no spaces or just one space is found, continue */ if(strchr(line, ' ') == NULL || strchr(line, ' ') == strrchr(line, ' ')) continue; /* * Set start and end indexes so that the URL * is enclosed between them */ for(start = strlen("GET"); isspace(line[start]); start++); for(end = (strrchr(line, ' ') - line); !isspace(line[end]); end--); line[end] = '\0'; /* Decode the URL and set it in the config options */ cconf->requestpath = decodeurl(&line[start]); /* Was index.html requested? */ if((tmp = strrchr(cconf->requestpath, 'i')) != NULL && (!strcasecmp(tmp, "index.html") || !strcasecmp(tmp, "index.htm"))) { MODE_SET(MODE_INDEX); *tmp = '\0'; } /* Was info.html requested? */ if((tmp = strrchr(cconf->requestpath, 'i')) != NULL && (!strcasecmp(tmp, "info.html") || !strcasecmp(tmp, "info.htm"))) { MODE_SET(MODE_INFO); *tmp = '\0'; } /* Was (r)index.m3u requested? */ if((tmp = strrchr(cconf->requestpath, 'i')) != NULL && (!strcasecmp(tmp, "index.m3u")) ) { *tmp = '\0'; tmp--; if(strlen(cconf->requestpath) > 1 && *tmp == 'r') { MODE_SET(MODE_RM3U); gconf.recursive = TRUE; *tmp = '\0'; } else { MODE_SET(MODE_M3U); } } /* Was a single MP3 file requested? */ if((tmp = strrchr(cconf->requestpath, '.')) == NULL) continue; if(!strcasecmp(tmp, ".mp3")) { MODE_SET(MODE_SINGLE); } } else if(!strncasecmp(line, "Icy-MetaData:", strlen("Icy-MetaData:"))) { /* Metadata was requested */ start = strlen("Icy-MetaData:"); if(line[start] == '\0' || !(strtol(&line[start], NULL, 10) > 0)) { debug(2, "Metadata was requested, but request wasn't valid\n"); } else if(MODE_ISSET(MODE_SINGLE)) { debug(2, "Metadata was requested, but ignored since we are in single mode\n"); } else { MODE_SET(MODE_METADATA); debug(2, "Metadata was requested\n"); } } else if (!strncasecmp(line, "Authorization:", strlen("Authorization:"))) { /* The user seems to have provided a username and password */ start = strlen("Authorization:"); while(isspace(line[start])) start++; if(line[start] == '\0' || strncasecmp(&line[start], "Basic", strlen("Basic"))) { debug(2, "Authorization was requested, but request wasn't valid\n"); continue; } start += strlen("Basic"); while(isspace(line[start])) start++; tmp = &line[start]; while(isbase64(*tmp)) tmp++; *tmp = '\0'; tmp2 = b64dec(&line[start]); if(tmp2 == NULL || strlen(tmp2) < 1 || index(tmp2, ':') == NULL) { debug(2, "Authorization was requested, but request wasn't valid\n"); if(tmp2 != NULL) free(tmp2); continue; } tmp = index(tmp2, ':'); *tmp = '\0'; tmp++; if(tmp == '\0' || strlen(tmp) < 1) { debug(2, "Authorization was requested, but request wasn't valid\n"); free(tmp2); continue; } cconf->username = strdup(tmp2); cconf->password = strdup(tmp); free(tmp2); } else if (!strncasecmp(line, "Range:", strlen("Range:"))) { /* A part of a file was requested */ if(!MODE_ISSET(MODE_SINGLE)) { debug(2, "Range was requested, but ignored since we aren't in single mode\n"); continue; } debug(3, "Range request was %s\n", line); for(start = strlen("Range:"); isspace(line[start]); start++); if(strncasecmp(&line[start], "bytes", strlen("bytes"))) { debug(2, "Range was requested, but request wasn't valid (1)\n"); continue; } start += strlen("bytes"); for(; isspace(line[start]); start++); if(line[start] != '=') { debug(2, "Range was requested, but request wasn't valid (2)\n"); continue; } start++; for(; isspace(line[start]); start++); if(isdigit(line[start])) { cconf->startpos = strtol(&line[start], &tmp, 10); } else if(line[start] == '-') { cconf->startpos = 0; tmp = &line[start]; } else { debug(2, "Range was requested, but request wasn't valid (3)\n"); continue; } if(*tmp != '-') { debug(2, "Range was requested, but request wasn't valid (4)\n"); continue; } else { tmp++; } if(isdigit(*tmp)) { cconf->endpos = strtol(tmp, NULL, 10); } else { cconf->endpos = 0; } MODE_SET(MODE_PARTIAL); } else { debug(3, "Client sent line %s\n", line); } } sa.sa_handler = SIG_IGN; sigaction(SIGALRM, &sa, NULL); if(timeout) { logmsg("Connection timed out\n"); return(FALSE); } else { alarm(0); } /* Strip trailing slash */ if(strlen(cconf->requestpath) > 1) { tmp = cconf->requestpath; tmp += strlen(cconf->requestpath); tmp--; if(*tmp == '/') *tmp = '\0'; } return(TRUE); } /* * Checks if an HTML template file can be found. If so, it is split into * three parts (header, middle and footer) and read into memory. If * no file is found, standard header, middle and footer contents is * placed in memory. * * Arguments: none * * Returns: void */ static void preparehtml() { char line[LINELENGTH]; FILE *file; int i; char *tmp; int tmpsize = 2 * LINELENGTH; int tmpwritten = 0; const struct confoption delimiters[] = { {"@BEGIN@", 0, &gconf.htmlheader}, {"@END@", 0, &gconf.htmlmiddle}, {NULL, 0, &gconf.htmlfooter}, {NULL, 0, NULL} }; if((file = fopen(gconf.htmlfile, "r")) != NULL) { debug(2, "Using %s as configfile\n", gconf.htmlfile); } else { debug(2, "No HTML template found\n"); gconf.htmlheader = strdup(DEF_HTMLHEADER); gconf.htmlmiddle = strdup(DEF_HTMLMIDDLE); gconf.htmlfooter = strdup(DEF_HTMLFOOTER); return; } for(i = 0; delimiters[i].value != NULL; i++) { tmp = malloc(tmpsize); *tmp = '\0'; while(fgets(line, LINELENGTH, file) != NULL) { debug(9, "Template line is %s\n", line); if(delimiters[i].name && !strncmp(line, delimiters[i].name, strlen(delimiters[i].name))) break; tmpwritten += strlen(line); strcat(tmp, line); if((tmpsize - tmpwritten) < LINELENGTH) { tmpsize += LINELENGTH; realloc(tmp, tmpsize); } } realloc(tmp, strlen(tmp) + 1); *((char **)delimiters[i].value) = tmp; } } /* * Prints a usage message and exits. * * Arguments: error - did we end up here because the user made a mistake * (like starting Ample with incorrect cmd line options) * * Returns: void */ static void usage(bool error) { if(error) { fprintf(stderr, "Try `%s --help' for more information.\n", gconf.program_name); exit(1); } else { /* This is several printf's to please ISO C89 */ printf(USAGE1, gconf.program_name); printf(USAGE2, DEF_PORT, DEF_MAX_CLIENTS); exit(0); } } /* * Sets default option values for those who hasn't been set by command * line options or config file options. * * Arguments: argc - hopefully no explaination needed? * argv - ditto * * Returns: void */ static void setdefopt(int argc, char * argv[]) { if(gconf.port == 0) { #ifdef HAVE_NETDB_H struct servent *servent = getservbyname("ample", "tcp"); gconf.port = (servent ? ntohs(servent->s_port) : DEF_PORT); #else gconf.port = DEF_PORT; #endif } if(gconf.port >= 64*1024) die("port number out of range\n"); if(gconf.order == -1) gconf.order = FALSE; if(gconf.max_clients == 0) gconf.max_clients = DEF_MAX_CLIENTS; if(gconf.recursive == -1) gconf.recursive = TRUE; if(gconf.pathlist == NULL) addtoarray(&gconf.pathlist, strdup(DEF_PATH)); if(gconf.logfile == NULL) gconf.logfile = strdup(DEF_LOGFILE); if(gconf.servername == NULL) gconf.servername = strdup(DEF_SERVERNAME); if(gconf.serveraddress == NULL && !(gconf.serveraddress = getservername())) gconf.serveraddress = strdup(DEF_SERVERADDRESS); if(gconf.htmlfile == NULL) gconf.htmlfile = strdup(DEF_HTMLFILE); } /* * Takes one line from the config file, parses it and changes * configuration values accordingly. * * Arguments: tmp - the line to parse * value - a pointer to the value to set * * Returns: void */ static void parseconfopt(char *tmp, void *value, int type) { int i; float f; char *end; char *retval; while(isspace(*tmp)) tmp++; if(*tmp != '=') return; else tmp++; while(isspace(*tmp)) tmp++; switch(type) { case OPT_INT: if((i = (int)strtol(tmp, NULL, 10)) > 0) *((int *)value) = i; break; case OPT_FLOAT: if((f = (float)strtod(tmp, NULL)) > 0) *((float *)value) = f; break; case OPT_BOOL: if(!strncasecmp("yes",tmp,strlen("yes")) || !strncasecmp("true",tmp,strlen("true"))) *((bool *)value) = TRUE; else if(!strncasecmp("no",tmp,strlen("no")) || !strncasecmp("false",tmp,strlen("false"))) *((bool *)value) = FALSE; break; case OPT_STRING: end = tmp; while(*end != '\n' && *end != '\0' && *end != '#') end++; if(end == tmp) break; retval = malloc(end - tmp + 1); if(!retval) die("malloc"); snprintf(retval, (end - tmp + 1), "%.*s", (end - tmp), tmp); *(char **)value = retval; break; case OPT_MULTISTRING: end = tmp; while(*end != '\n' && *end != '\0' && *end != '#' && !isspace(*end)) end++; if(end == tmp) break; retval = malloc(end - tmp + 1); if(!retval) die("malloc"); snprintf(retval, (end - tmp + 1), "%.*s", (end - tmp), tmp); addtoarray((char ***)value, retval); break; default: /* We should never end up here */ debug(2, "Incorrect type passed to parseconfopt()\n"); break; } } /* * Opens the config file, reads it line by line and sends interesting * lines to parseconfopt. * * Arguments: argc - hopefully no explaination needed? * argv - ditto * * Returns: void */ static void setconfopt(int argc, char * argv[]) { char line[LINELENGTH]; FILE *file; int i,j; const struct confoption options[] = { {"clients", OPT_INT, &gconf.max_clients}, {"filter", OPT_STRING, &gconf.filter}, {"htmlfile", OPT_STRING, &gconf.htmlfile}, {"logfile", OPT_STRING, &gconf.logfile}, {"mp3path", OPT_MULTISTRING, &gconf.pathlist}, {"order", OPT_BOOL, &gconf.order}, {"password", OPT_STRING, &gconf.password}, {"port", OPT_INT, &gconf.port}, {"recursive", OPT_BOOL, &gconf.recursive}, {"servername", OPT_STRING, &gconf.servername}, {"serveraddress", OPT_STRING, &gconf.serveraddress}, {"username", OPT_STRING, &gconf.username}, {NULL, 0, NULL} }; if(gconf.conffile == NULL) file = fopen(DEF_CONFFILE, "r"); else file = fopen(gconf.conffile, "r"); if (file == NULL) return; while((fgets(line, LINELENGTH, file)) != NULL) { if(line[0] == '#') continue; for(i = 0; isspace(line[i]); i++); for(j = 0; options[j].name != NULL; j++) { if(!strncasecmp(&line[i], options[j].name, strlen(options[j].name))) { i += strlen(options[j].name); parseconfopt(&line[i], options[j].value, options[j].type); break; } } } } /* * Parses command line options and changes configuration accordingly. * * Arguments: argc - hopefully no explaination needed? * argv - ditto * * Returns: void */ static void setcmdopt(int argc, char * argv[]) { int c,i; #ifdef HAVE_GETOPT_H const struct option longopts[] = { {"port", required_argument, NULL, 'p'}, {"order", no_argument, NULL, 'o'}, {"clients", required_argument, NULL, 'c'}, {"norecursive", no_argument, NULL, 'n'}, {"conffile", required_argument, NULL, 'f'}, {"htmlfile", required_argument, NULL, 'm'}, {"help", no_argument, NULL, 'h'}, {"debug", optional_argument, NULL, 'd'}, {"trace", no_argument, NULL, 't'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; while((c = getopt_long(argc, argv, "p:oc:nf:m:hd::tv", longopts, &i)) != -1) { #else while((c = getopt(argc, argv, "p:oc:nf:m:hd::tv")) != -1) { #endif switch(c) { case 'p': if(strtol(optarg, NULL, 10) > 0) gconf.port = (int)strtol(optarg, NULL, 10); break; case 'o': gconf.order = TRUE; break; case 'c': if(strtol(optarg, NULL, 10) > 0) gconf.max_clients = strtol(optarg, NULL, 10); break; case 'n': gconf.recursive = FALSE; break; case 'f': gconf.conffile = strdup(optarg); break; case 'm': gconf.htmlfile = strdup(optarg); break; case 'h': usage(FALSE); break; case 'd': if(optarg == NULL || strtol(optarg, NULL, 10) < 0) gconf.debuglevel = 1; else gconf.debuglevel = strtol(optarg, NULL, 10); break; case 't': gconf.trace = TRUE; break; case 'v': printf("Ample version %s\n", AMPLE_VERSION); exit(0); default: usage(TRUE); } } i = optind; while(i < argc) { addtoarray(&gconf.pathlist, strdup(argv[i])); i++; } } /* * Prepares the configuration structure and fills it with information from * (in order of relevance) command line, config file and default values. * Also prepares the user specified/default HTML template for use. * * Arguments: argc - hopefully no explaination needed? * argv - ditto * * Returns: void */ void checkopt(int argc, char * argv[]) { memset(&gconf, 0, sizeof(struct global_config)); gconf.order = -1; gconf.recursive = -1; gconf.program_name = argv[0]; setcmdopt(argc, argv); setconfopt(argc, argv); setdefopt(argc, argv); preparehtml(); } ample-0.5.7.orig/src/configuration.h0100644000550600055060000001141207570413150016453 0ustar tonontonon/* Default path */ #ifndef DEF_PATH #define DEF_PATH "/usr/local/shared/mp3" #endif /* Default logfile */ #ifndef DEF_LOGFILE #define DEF_LOGFILE "/usr/local/var/log/ample" #endif /* Default configfile */ #ifndef DEF_CONFFILE #define DEF_CONFFILE "/usr/local/etc/ample.conf" #endif /* Default HTMLtemplate */ #ifndef DEF_HTMLFILE #define DEF_HTMLFILE "/usr/local/etc/ample.html" #endif #define DEF_PORT 1234 /* Port to listen to */ #define DEF_MAX_CLIENTS 5 /* Max simultaneous clients */ #define DEF_SERVERNAME "Ample" /* Default server name */ #define DEF_SERVERADDRESS "127.0.0.1" /* Default address if gethostbyname fails */ #define LINELENGTH 400 /* Size of buffer used with fgets() */ #define DEF_HTMLHEADER "\n\ \n\ @SERVERNAME@\n\
\n\

@SERVERNAME@

\n\

Tracks currently available in @PATH@

\n\

 

[ playlist for this dir | recursive playlist ]

\n\

[ Up one level ]

\n\
\n\ \n\n" #define DEF_HTMLMIDDLE "\n" #define DEF_HTMLFOOTER "
TYPEURL
@TYPE@@NAME@
\n\

powered by Ample, for more information, see the\n\ project homepage

\n
\r\n" /* Config file option types */ #define OPT_BOOL 1 /* Boolean option */ #define OPT_INT 2 /* Integer option */ #define OPT_STRING 3 /* String option */ #define OPT_MULTISTRING 4 /* String option with > 1 strings */ #define OPT_FLOAT 5 /* Float option */ #define CONN_TIMEOUT 60 /* The time a client has to complete the http request */ #define USAGE1 "Usage: %s [OPTION(S)]... [PATH]\n\ \n\ AMPLE - An MP3 LEnder\n\ recursively indexes all MP3 files it finds below PATH and then listens\n\ to a TCP port for incoming connections. Once a connection is made AMPLE will\n\ start sending randomly chosen MP3's. If called from the command line or a\n\ script AMPLE will go into daemon mode (unlike when called from inetd or with\n\ the option -t).\n\ \n" #if HAVE_GETOPT_H #define USAGE2 "\ -p, --port=NUMBER which port to listen to, default %d\n\ -o, --order play MP3 files in alphabetical order\n\ -c, --clients=NUMBER how many clients are allowed to be connected\n\ default %d\n\ -n, --norecursive don't index MP3 files in subdirs of the given dir\n\ -f, --conffile=FILENAME alternative file to read for config options\n\ -m, --htmlfile=FILENAME file to use as template for HTML output\n\ -h, --help display this help and exit\n\ -d, --debug[=NUMBER] debug messages will be printed\n\ higher number means more detail\n\ -t, --trace no forking, no backgrounding\n\ helpful when debugging\n\ -v, --version output version information and exit\n\ \n\ Report bugs to \n" #else #define USAGE2 "\ -p=NUMBER which port to listen to, default %d\n\ -o play MP3 files in alphabetical order\n\ -c=NUMBER how many clients are allowed to be connected,\n\ default %d\n\ -n don't index MP3 files in subdirs of the given dir\n\ -f=FILENAME alternative file to read for config options\n\ -m=FILENAME file to use as template for HTML output\n\ -h display this help and exit\n\ -d[=NUMBER] debug messages will be printed,\n\ higher number means more detail\n\ -t no forking, no backgrounding,\n\ helpful when debugging)\n\ -v output version information and exit\n\ \n\ Report bugs to \n" #endif /* Reads and parses client http request */ extern bool readrequest (struct client_config *cconf); /* Checks command line, config file and default options then set conf */ extern void checkopt(int argc, char * argv[]); /* Struct used when parsing config files */ struct confoption { char *name; unsigned short int type; void *value; }; ample-0.5.7.orig/src/client.c0100644000550600055060000003603207570413147015070 0ustar tonontonon/* * This file is part of Ample. * * Ample 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. * * Ample 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 Ample; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * $Id: client.c,v 1.27 2002/11/21 14:36:27 alphix Exp $ * * This file contains most of the functions that are used by the child * processes to interact with clients (read request, parse request * and act accordingly). */ #include #include #include #include #include #include #include #include #include #include #include #include #include "ample.h" #include "entries.h" #include "client.h" #include "helper.h" #include "configuration.h" /* How many bytes to send before it's time for to send ShoutCast metadata */ static int bytestometa = BYTESBETWEENMETA; /* * Prepares data to be sent to the client. * * Arguments: buf - the buffer of size NETBUFFSIZE to write data to * end - the position in the stream which is considered EOF * from - the stream to read data from * * Returns: the amount of data which has been written to buf */ static int preparedata(char *buf, long end, FILE *from) { long current; int diff; int amount; if(end > 0) { current = ftell(from); if(current < 0) die("ftell()\n"); diff = (int)(end - current); if(current == end) return(0); } else { diff = NETBUFFSIZE; } if(feof(from)) return 0; amount = fread(buf, sizeof(char), min(diff, NETBUFFSIZE), from); if(ferror(from)) die("read()\n"); return amount; } /* * Sends data to the client while inserting ShoutCast type metadata at the * proper places. * * Arguments: cconf - session information * buf - buffer to read data from * amount - amount of data to read from buf * playing - the file that is currently playing * * Returns: void */ static void senddata(struct client_config *cconf, char *buf, int amount, mp3entry *playing) { int towrite; int written = 0; if(!MODE_ISSET(MODE_METADATA)) { if(fwrite(buf, sizeof(char), amount, cconf->stream) != amount) die("Error writing to client\n"); } else { while(written < amount) { towrite = min(amount - written, bytestometa); if(fwrite((buf + written), sizeof(char), towrite, cconf->stream) != towrite) die("Error writing to client\n"); bytestometa -= towrite; written += towrite; if(bytestometa == 0) { if(writemetadata(cconf->stream, playing, &cconf->metadata)) bytestometa = BYTESBETWEENMETA; else die("Error writing to client\n"); } } } } /* * Positions the stream at the correct start and decides where to stop. * * Arguments: cconf - session information * stream - the stream to position * entry - the file that is about to be played * * Returns: the offset where to stop */ static long setoffsets(struct client_config *cconf, FILE *stream, mp3entry *entry) { long start; long end; if(cconf->startpos > 0 && cconf->startpos < entry->filesize) start = cconf->startpos; else if(!MODE_ISSET(MODE_SINGLE) && entry->id3v2len) start = entry->id3v2len; else start = 0; fseek(stream, start, SEEK_SET); if(cconf->endpos > 0 && cconf->endpos < entry->filesize) end = cconf->endpos; else if(HASID3V1(entry) && end > entry->id3v1len) end = entry->filesize - entry->id3v1len; else end = entry->filesize; debug(4, "Start offset is %li, end offset is %li\n", start, end); return end; } /* * Plays a file to the client, including metadata if that is reqested. * * Arguments: cconf - session information * entry - the entry to play * * Returns: void */ static void playfile(struct client_config *cconf, mp3entry *entry) { FILE *file; char buf[NETBUFFSIZE]; int amount; long end; cconf->metadata = TRUE; debug(1, "Playing file %s\n", entry->path); sendstatusmsg(cconf->statussock, "%d:Playing file %s", getpid(), entry->path); if(gconf.filter != NULL) { if((file = popen(replacevariables(gconf.filter, cconf, NULL), "r")) == NULL) die("popen()\n"); end = -1; } else { if ((file = fopen(entry->path,"r")) == NULL) die("fopen()\n"); end = setoffsets(cconf, file, entry); } while((amount = preparedata(buf, end, file))) senddata(cconf, buf, amount, entry); if(gconf.filter != NULL) pclose(file); else fclose(file); } /* * Plays a range of different files to the client. * * Arguments: cconf - session information * min - the lowest allowed index in the filetree of the range * of files to play * max - the highest allowed index in the filetree of the range * of files to play * order - should the files be played in order or randomly? * * Returns: void */ static void playrange(struct client_config *cconf, int min, int max, bool order) { int i; int toplay; mp3entry *current; int offset; int numentries; int numplayed; char *played = NULL; /* bitpattern */ int playedsize; if(order) { toplay = max; } else { numplayed = 0; numentries = max - min + 1; playedsize = numentries/8 + 1; srand((unsigned int)time(NULL) + (unsigned int)getpid()); if((played = malloc(playedsize)) == NULL) die("malloc\n"); memset(played, 0, playedsize); } debug(1, "In playrange with range %i - %i and order %i\n", min, max, order); while(TRUE) { if(order) { toplay == max ? toplay = min : toplay++; } else { /* Check if all songs have been played */ if(numentries - numplayed == 0) { numplayed = 0; memset(played, 0, playedsize); } /* Get random offset within songs */ offset = (int)((float)(numentries - numplayed) * rand() / (RAND_MAX+1.0)); /* Loop till we find an unplayed song at that offset */ for(i = 0; i < numentries; i++) { if(((played[i/8] >> i%8) & 1) == 0) offset--; if(offset < 0) { played[i/8] |= (1 << i%8); break; } } numplayed++; toplay = min + i; for(i = 0; i < playedsize; i++) debug(5, "Offset %i: %x\n", i*8, (unsigned int)played[i]); } /* HACK: findentrybyindex shouldn't modify second argument */ i = toplay; current = findentrybyindex(root, &i); if(!current) die("Couldn't find entry with index %i\n", toplay); else debug(1, "Going to play %s - index %i - order %i\n", current->name, toplay, order); playfile(cconf, current); } if(played) free(played); } /* * Creates a HTML page listing the available files and directories and sends * it to the client. * * Arguments: cconf - session information * base - the base where to start the list from, this file and * all below it will be listed * * Returns: void */ static void createhtml(struct client_config *cconf, mp3entry *base) { int i = 0; mp3entry * tmp = base; if(tmp == NULL || cconf->stream == NULL){ debug(3, "createhtml: base or output stream NULL - exiting"); return; } fprintf(cconf->stream, "%s", replacevariables(gconf.htmlheader, cconf, NULL)); while(tmp != NULL) { fprintf(cconf->stream, "%s", replacevariables(gconf.htmlmiddle, cconf, tmp)); tmp = tmp->sibling; } fprintf(cconf->stream, "%s", replacevariables(gconf.htmlfooter, cconf, NULL)); } /* * Creates a HTML page listing interesting info to the client * * Arguments: cconf - session information * * Returns: void */ static void createinfohtml(struct client_config *cconf) { int i; int clientno = 0; if(cconf->stream == NULL){ debug(3, "createinfohtml: output stream NULL - exiting"); return; } fprintf(cconf->stream, INFOHEADER, gconf.servername, gconf.servername); fprintf(cconf->stream, "SERVER STATUS\n"); fprintf(cconf->stream, "Name%s\n", gconf.servername); fprintf(cconf->stream, "Address%s\n", gconf.serveraddress); fprintf(cconf->stream, "Port%d\n", gconf.port); fprintf(cconf->stream, "Max clients%i\n", gconf.max_clients); fprintf(cconf->stream, "CLIENT STATUS\n"); if(gconf.inetd) { fprintf(cconf->stream, "In inetd mode, no status available\n"); } else if(gconf.trace) { fprintf(cconf->stream, "In trace mode, no status available\n"); } else { for(i = 0; i < gconf.max_clients; i++) { if(childarray[i].childpid == 0) continue; clientno++; fprintf(cconf->stream, "%i - %s%s\n", clientno, childarray[i].client, childarray[i].status); } if(clientno == 0) fprintf(cconf->stream, "None\n"); } fprintf(cconf->stream, INFOFOOTER); } /* * Creates a M3U (playlist) file and sends it to the client. * * Arguments: cconf - session information * base - the base where to start the list from, this file and * all below it will be listed * recursive - should all subdirs be included as well? * * Returns: void */ static void createm3u(struct client_config *cconf, mp3entry *base, bool recursive) { mp3entry * tmp = base; char *dir = findpathbyentry(root, base, ""); char *vpath; if(dir == NULL || tmp == NULL || cconf->stream == NULL) return; dir = dirname(dir); while(tmp != NULL) { if(IS_DIR(tmp)) { if(recursive && tmp->child) createm3u(cconf, tmp->child, recursive); } else if(vpath = findpathbyentry(root, tmp, "")) { fprintf(cconf->stream, "#EXTINF:%i,%s\n", tmp->length, tmp->title); fprintf(cconf->stream, "http://%s:%d%s\n", gconf.serveraddress, gconf.port, vpath); free(vpath); } tmp = tmp->sibling; } } /* * Checks if authentication is needed and if username/password is correct * * Arguments: cconf - Client configuration * * Returns: TRUE if client is allowed to connect, FALSE otherwise */ static bool check_authentication(struct client_config *cconf) { if(gconf.username == NULL || gconf.password == NULL) return(TRUE); if(cconf->username == NULL || cconf->password == NULL || strcmp(cconf->username, gconf.username) || strcmp(cconf->password, gconf.password)) { /* No user/pass or wrong user/pass given */ fprintf(cconf->stream, AUTHMSG, gconf.servername); fflush(cconf->stream); return(FALSE); } else { return(TRUE); } } /* * Reads the client request and acts accordingly. * * Arguments: conn - the file descriptor of the socket which the client * connected to * udpsock - the socket to send status messages to * * Returns: the status that the client should exit with * (i.e. EXIT_SUCCESS or EXIT_FAILURE) */ int handleclient(int conn, int udpsock) { int min; int max; /* Client and session configuration */ struct client_config *cconf = NULL; /* Prepare configuration struct */ cconf = malloc(sizeof(struct client_config)); if(cconf == NULL) die("Malloc failed\n"); memset(cconf, 0, sizeof(struct client_config)); cconf->statussock = udpsock; /* Send initial status message to main server */ sendstatusmsg(cconf->statussock, "%d:connecting", getpid()); /* Read and parse client request */ if ((cconf->stream = fdopen(conn, "r+")) == NULL || !readrequest(cconf)) { debug(1, "Error while reading client request\n"); fclose(cconf->stream); free(cconf); return(EXIT_FAILURE); } debug(1, "Requested path %s\n", cconf->requestpath); cconf->mp3base = findentrybypath(root, cconf->requestpath); /* FIXME: Should give a 403 instead */ if(cconf->mp3base == NULL) die("Incorrect file/dir requested\n"); if(!check_authentication(cconf)) die("Incorrect or no credentials specified\n"); if(MODE_ISSET(MODE_INDEX)) { debug(1, "Entering HTML mode\n"); sendstatusmsg(cconf->statussock, "%d:Sending HTML data", getpid()); fprintf(cconf->stream, HTTPSERVMSG, AMPLE_VERSION); fflush(cconf->stream); createhtml(cconf, cconf->mp3base); } else if(MODE_ISSET(MODE_RM3U)) { debug(1, "Entering recursive M3U mode\n"); sendstatusmsg(cconf->statussock, "%d:Sending recursive M3U data", getpid()); fprintf(cconf->stream, M3USERVMSG, AMPLE_VERSION); fflush(cconf->stream); fprintf(cconf->stream, "#EXTM3U\n"); createm3u(cconf, cconf->mp3base, TRUE); } else if(MODE_ISSET(MODE_M3U)) { debug(1, "Entering non-recursive M3U mode\n"); sendstatusmsg(cconf->statussock, "%d:Sending non-recursive M3U data", getpid()); fprintf(cconf->stream, M3USERVMSG, AMPLE_VERSION); fflush(cconf->stream); fprintf(cconf->stream, "#EXTM3U\n"); createm3u(cconf, cconf->mp3base, FALSE); } else if(MODE_ISSET(MODE_PARTIAL)) { debug(1, "Entering MP3-Partial mode\n"); sendstatusmsg(cconf->statussock, "%d:Sending partial MP3", getpid()); if(cconf->endpos = 0 || cconf->endpos > cconf->mp3base->filesize) fprintf(cconf->stream, PARTIALSERVMSG, AMPLE_VERSION, cconf->startpos, cconf->mp3base->filesize, cconf->mp3base->filesize); else fprintf(cconf->stream, PARTIALSERVMSG, AMPLE_VERSION, cconf->startpos, cconf->endpos, cconf->mp3base->filesize); fflush(cconf->stream); playfile(cconf, cconf->mp3base); } else if(MODE_ISSET(MODE_SINGLE)) { debug(1, "Entering MP3-Single mode\n"); sendstatusmsg(cconf->statussock, "%d:Sending single MP3", getpid()); fprintf(cconf->stream, SINGLESERVMSG, AMPLE_VERSION, cconf->mp3base->filesize); fflush(cconf->stream); playfile(cconf, cconf->mp3base); } else if (MODE_ISSET(MODE_METADATA)) { getrange(cconf->mp3base, gconf.recursive, &min, &max); debug(1, "Entering MP3-Metadata mode (range %i - %i)\n", min, max); sendstatusmsg(cconf->statussock, "%d:Sending MP3's and metadata", getpid()); fprintf(cconf->stream, SHOUTSERVMSG, AMPLE_VERSION, gconf.servername, BYTESBETWEENMETA); fflush(cconf->stream); playrange(cconf, min, max, gconf.order); } else if(MODE_ISSET(MODE_INFO)) { debug(1, "Entering INFO mode\n"); sendstatusmsg(cconf->statussock, "%d:Sending INFO data", getpid()); fprintf(cconf->stream, HTTPSERVMSG, AMPLE_VERSION); fflush(cconf->stream); createinfohtml(cconf); } else { getrange(cconf->mp3base, gconf.recursive, &min, &max); debug(1, "Entering MP3-Basic mode (range %i - %i)\n", min, max); sendstatusmsg(cconf->statussock, "%d:Sending MP3's", getpid()); MODE_SET(MODE_BASIC); fprintf(cconf->stream, BASICSERVMSG, AMPLE_VERSION); fflush(cconf->stream); playrange(cconf, min, max, gconf.order); } fclose(cconf->stream); free(cconf); cleartree(&root); return(EXIT_SUCCESS); } ample-0.5.7.orig/src/client.h0100644000550600055060000000521707570413147015076 0ustar tonontonon#define BYTESBETWEENMETA 16000 #define NETBUFFSIZE 4000 struct client_config { unsigned short int mode; char * username; char * password; char * requestpath; long startpos; long endpos; FILE *stream; int statussock; mp3entry *mp3base; bool metadata; }; extern struct client_config *cconf; /********************************************************* REMOVED from config - global? ********************************************************* int port; bool inetd; bool order; bool trace; int debuglevel; int max_clients; char * username; char * password; char **pathlist; char * logfile; char * conffile; char * htmlfile; char * htmlheader; char * htmlmiddle; char * htmlfooter; char * servername; char * serveraddress; **********************************************************/ #define SHOUTSERVMSG "ICY 200 OK\r\n\ icy-notice1:This stream is served using Ample/%s\r\n\ icy-notice2:AMPLE - An MP3 LEnder - http://ample.sf.net/\r\n\ icy-name:%s\r\n\ icy-genre:Mixed\r\n\ icy-url:http://ample.sf.net/\r\n\ icy-pub:1\r\n\ icy-metaint:%d\r\n\ icy-br:128\r\n\ \r\n" #define SINGLESERVMSG "HTTP/1.1 200 OK\r\n\ Server: Ample/%s\r\n\ Accept-Range: bytes\r\n\ Content-Type: audio/mpeg\r\n\ Content-Length: %lu\r\n\ Connection: close\r\n\ \r\n" #define PARTIALSERVMSG "HTTP/1.1 206 Partial Content\r\n\ Server: Ample/%s\r\n\ Accept-Range: bytes\r\n\ Content-Type: audio/mpeg\r\n\ Content-Range: bytes %lu-%lu/%lu\r\n\ Connection: close\r\n\ \r\n" #define BASICSERVMSG "HTTP/1.1 200 OK\r\n\ Server: Ample/%s\r\n\ Accept-Range: none\r\n\ Content-Type: audio/mpeg\r\n\ Connection: close\r\n\ \r\n" #define HTTPSERVMSG "HTTP/1.1 200 OK\r\n\ Server: Ample/%s\r\n\ Accept-Range: none\r\n\ Content-Type: text/html\r\n\ Connection: close\r\n\ \r\n" #define M3USERVMSG "HTTP/1.1 200 OK\r\n\ Server: Ample/%s\r\n\ Accept-Range: none\r\n\ Content-Type: audio/x-mpegurl\r\n\ Connection: close\r\n\ \r\n" #define AUTHMSG "HTTP/1.1 401 Unauthorized\r\n\ WWW-authenticate: Basic realm=\"%s\"\r\n\ \r\n" #define INFOHEADER "\n\ \n\ %s\n\
\n\

%s

\n\

Information page

\n\

 

\n\
" #define INFOFOOTER "
\n\

powered by Ample, for more information, see the\n\ project homepage

\n\
" extern int handleclient(int conn, int udpsock); ample-0.5.7.orig/src/helper.c0100644000550600055060000005656307574651332015110 0ustar tonontonon/* * $Id: helper.c,v 1.29 2002/12/08 14:10:34 alphix Exp $ * * This file is part of Ample. * * Ample 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. * * Ample 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 Ample; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #ifdef HAVE_SYSLOG_H #include #endif #ifdef HAVE_STDINT_H #include #endif #include #include #include #include #include #include #include "ample.h" #include "entries.h" #include "client.h" #include "helper.h" /* Used to signal errors in hostname lookups */ extern int h_errno; /* Some utility macros used in getsonglength() */ #define CHECKSYNC(x) (((x >> 21) & 0x07FF) == 0x7FF) #define BYTE0(x) ((x >> 24) & 0xFF) #define BYTE1(x) ((x >> 16) & 0xFF) #define BYTE2(x) ((x >> 8) & 0xFF) #define BYTE3(x) ((x >> 0) & 0xFF) /* Table of bitrates for MP3 files, all values in kilo. * Indexed by version, layer and value of bit 15-12 in header. */ const int bitrate_table[2][3][16] = { { {0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,0}, {0,32,48,56, 64,80, 96, 112,128,160,192,224,256,320,384,0}, {0,32,40,48, 56,64, 80, 96, 112,128,160,192,224,256,320,0} }, { {0,32,48,56,64,80,96,112,128,144,160,176,192,224,256,0}, {0, 8,16,24,32,40,48, 56, 64, 80, 96,112,128,144,160,0}, {0, 8,16,24,32,40,48, 56, 64, 80, 96,112,128,144,160,0} } }; /* Table of samples per frame for MP3 files. * Indexed by layer. */ const int bs[4] = {0, 384, 1152, 1152}; /* Table of sample frequency for MP3 files. * Indexed by version and layer. */ const int freqtab[2][4] = { {44100, 48000, 32000, 0}, {22050, 24000, 16000, 0}, }; /* * Allows children to send status reports to the parent process. * * Argument: to - the udp socket to send the message to * fmt - the format string of the message * argp - the list of arguments to complement the format string * * Returns: void */ void sendstatusmsg(int to, char *fmt, ...) { char buffer[1000]; int length; va_list argp; if(to >= 0) { va_start(argp, fmt); length = vsnprintf(buffer, 1000, fmt, argp); sprintf(&buffer[992], ""); send(to, buffer, strlen(buffer) + 1, 0); va_end(argp); } } /* * Generic function to deal with log, debug and death messages. * * Argument: type - the type of the message (see header) * fmt - the format string of the message * argp - the list of arguments to complement the format string * * Returns: void */ static void printlogmsg(int type, char *fmt, va_list argp) { char buffer[1000]; int length; length = vsnprintf(buffer, 1000, fmt, argp); sprintf(&buffer[992], ""); #ifdef HAVE_SYSLOG_H if(!gconf.trace) { if(type == TYPE_LOG) { syslog(LOG_INFO, "%s", buffer); } else if(type == TYPE_DEBUG) { syslog(LOG_DEBUG, "%s", buffer); } else if(type == TYPE_DIE) { if(errno != 0) syslog(LOG_ERR, "died - %s, errno: %s", buffer, strerror(errno)); else syslog(LOG_ERR, "died - %s", buffer); exit(EXIT_FAILURE); } return; } #endif if(type == TYPE_LOG) { printf("LOG[%d]: %s", getpid(), buffer); } else if(type == TYPE_DEBUG) { printf("DBG[%d]: %s", getpid(), buffer); } else if(type == TYPE_DIE) { if(errno != 0) printf("DIE[%d]: (errno: %s) %s", getpid(), strerror(errno), buffer); else printf("DIE[%d]: %s", getpid(), buffer); exit(EXIT_FAILURE); } fflush(stdout); } /* * Wrapper function to printlogmsg that is used to print ordinary log messages. * * Arguments: fmt - the format string of the message * ... - the variables to complement the format string * * Returns: void */ void logmsg(char *fmt, ...) { va_list argp; va_start(argp, fmt); printlogmsg(TYPE_LOG, fmt, argp); va_end(argp); } /* * Wrapper function to printlogmsg that is used to print debug messages if * the debug level config option is high enough. * * Arguments: priority - the level of the debug message, higher number * generally means more verbose debugging, if this * number is higher than the debuglevel config option, * nothing is printed * fmt - the format string of the message * ... - the variables to complement the format string * * Returns: void */ void debug(int priority, char *fmt, ...) { va_list argp; if(priority > gconf.debuglevel) return; va_start(argp, fmt); printlogmsg(TYPE_DEBUG, fmt, argp); va_end(argp); } /* * Wrapper function to printlogmsg that is used to print death messages * and then exit. * * Arguments: fmt - the format string of the message * ... - the variables to complement the format string * * Returns: void */ void die(char *fmt, ...) { va_list argp; va_start(argp, fmt); printlogmsg(TYPE_DIE, fmt, argp); va_end(argp); } static void expandmalloc(void **old, size_t *size, int line) { *size = ((*size) * 2); debug(4, "called from %i, gonna realloc with size %i and old %p\n", line, *size, *old); *old = realloc(*old, *size); if(*old == NULL) die("realloc failed\n"); } /* * Implements the behaviour of GNU getcwd using standard getcwd * (GNU cwd auto-malloc's a buffer to hold the result) * * Argument: none * * Returns: A pointer to the newly allocated buffer */ char * mgetcwd() { size_t size = 100; char *buffer = (char *)malloc(size); while (TRUE) { if(getcwd (buffer, size) == buffer) return buffer; if(errno != ERANGE) die("getcwd"); expandmalloc((void **)&buffer, &size, __LINE__); } } /* * The opposite of atoi, converts an integer to an ASCII string. * * Arguments: integer - the integer to convert * * Returns: an ASCII string stored in malloc:ed memory */ char * itoa(int integer) { int tmp = integer; int size; char *result; if(integer == 0) size = 2; else if(integer < 0) size = 2; else if(integer > 0) size = 1; while(tmp) { tmp /= 10; size++; } result = malloc(size); snprintf(result, size, "%i", integer); return result; } /* * Encode function common for both HTML and URL encodings. * * Arguments: toencode - string to convert * url - if TRUE, urlencode the string, otherwise htmlencode it * * Returns: an encoded ASCII string stored in malloc:ed memory */ static char * commonencode(char *toencode, bool url) { char *validchars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; char *urlprefix = "%"; char *htmlprefix = "&#x"; char *urlsuffix = ""; char *htmlsuffix = ";"; char *prefix; char *suffix; char *tmp; char *tmp2; char *retval; char buffer[3]; size_t size = 100; size_t used = 1; if(url) { prefix = urlprefix; suffix = urlsuffix; } else { prefix = htmlprefix; suffix = htmlsuffix; } retval = malloc(size); if(retval == NULL) die("malloc failed\n"); *retval = '\0'; for(tmp = toencode; *tmp != '\0'; tmp++) { if((size - used) < (strlen(prefix) + 2 + strlen(suffix))) expandmalloc((void **)&retval, &size, __LINE__); for(tmp2 = validchars; *tmp2 != '\0'; tmp2++) { if((*tmp) == (*tmp2)) break; } if(*tmp2 != '\0') { buffer[0] = *tmp2; buffer[1] = '\0'; strcat(retval, buffer); used++; } else { snprintf(buffer, 3, "%.2x", (int)(unsigned char)*tmp); strcat(retval, prefix); strcat(retval, buffer); strcat(retval, suffix); used += (strlen(prefix) + 2 + strlen(suffix)); } } return(retval); } /* * urlencodes a string. * * Arguments: toencode - string to convert * * Returns: an encoded ASCII string stored in malloc:ed memory */ char * urlencode(char *toencode) { return(commonencode(toencode, TRUE)); } /* * htmlencodes a string. * * Arguments: toencode - string to convert * * Returns: an encoded ASCII string stored in malloc:ed memory */ char * htmlencode(char *toencode) { return(commonencode(toencode, FALSE)); } /* * Takes a string and replaces variables with their values, then returns * the adress of the new string to the client. This string will be * valid until replacevariables is called again and doesn't need to * be free:d. Used to create dynamic HTML pages. * * Arguments: input - the line to use as a base for the conversion * cconf - session information * entry - an (optional) entry to retrieve some of the * variable values from * * Returns: void */ char * replacevariables(char *input, struct client_config *cconf, mp3entry *entry) { static char *result = NULL; char *str_nbsp = " "; char *str_err = "Variable not allowed here"; char *str_dir = "DIR"; char *str_file = "FILE"; char *str_sep = "@"; char *start = input; char *end; char *variable; char *encvariable; /* * VARIABLES USED: * * Static: (Can be used anywhere) * @SERVERNAME@ * @PORT@ * @PATH@ * * Non-Static: (Can only be used if tmp defined) * FILE: DIR: * ===== ==== * @NAME@ = tmp->name tmp->name * @URL@ = tmp->name tmp->name + /index.html * @LENGTH@ = tmp->length " " * @TITLE@ = tmp->title "DIR" * @SIZE@ = tmp->filesize " " * @TYPE@ = "FILE" "DIR" * @FPATH@ = tmp->path " " */ char *variables[][2] = { {"@SERVERNAME@", gconf.servername}, {"@PORT@", NULL}, {"@PATH@", cconf->requestpath}, {"@NAME@", str_err}, {"@URL@", str_err}, {"@LENGTH@", str_err}, {"@TITLE@", str_err}, {"@SIZE@", str_err}, {"@TYPE@", str_err}, {"@FPATH@", str_err}, {NULL, NULL} }; int i; size_t size = 100; int used = 1; /* Clean up after earlier invocations */ if(result != NULL) { free(result); result = NULL; } result = malloc(size); if(result == NULL) die("malloc failed\n"); *result = '\0'; variables[1][1] = itoa(gconf.port); if(!entry) { /* Do nothing */ } else if(IS_DIR(entry)) { variables[3][1] = entry->name; variables[4][1] = malloc(strlen(entry->name) + strlen("/index.html") + 1); sprintf(variables[4][1], "%s/index.html", entry->name); variables[5][1] = str_nbsp; variables[6][1] = str_dir; variables[7][1] = str_nbsp; variables[8][1] = str_dir; variables[9][1] = str_nbsp; } else { variables[3][1] = entry->name; variables[4][1] = entry->name; variables[5][1] = itoa(entry->length); variables[6][1] = entry->title; variables[7][1] = itoa(entry->filesize); variables[8][1] = str_file; variables[9][1] = entry->path; } while((end = strchr(start, '@')) != NULL) { debug(1, "end is %s\n", end); debug(1, "end is %p, start is %p, diff %i, used is %i, size is %i\n", end, start, (int)(end - start), used, size); while((used + end - start) > size) { expandmalloc((void **)&result, &size, __LINE__); } strncat(result, start, (end - start)); used += (end - start); variable = NULL; for(i = 0; variables[i][0] != NULL; i++) { if(!strncmp(end, variables[i][0], strlen(variables[i][0]))) { start = end + strlen(variables[i][0]); variable = variables[i][1]; if(!strncmp(variables[i][0], "@URL@", strlen(variables[i][0]))) encvariable = urlencode(variable); else encvariable = htmlencode(variable); } } if(!variable) { start = end + 1; variable = str_sep; encvariable = str_sep; } while((used + strlen(encvariable)) > size) expandmalloc((void **)&result, &size, __LINE__); strcat(result, encvariable); used += strlen(encvariable); if(encvariable != str_sep) free(encvariable); } while((used + strlen(start)) > size) expandmalloc((void **)&result, &size, __LINE__); strcat(result, start); used += strlen(start); free(variables[1][1]); if(!entry) { /* Do nothing */ } else if(IS_DIR(entry)) { free(variables[4][1]); } else { free(variables[5][1]); free(variables[7][1]); } return(result); } /* * Given a hostentry, finds the FQDN (Fully Qualified Domain Name) * * Arguments: host - the hostentry to base the search on * * Returns: the FQDN as a string stored in malloc:ed memory */ static char * findfqdn(struct hostent *host) { int i; if (strchr(host->h_name, '.')) return strdup(host->h_name); for (i=0; host->h_aliases[i] != NULL; i++) { if (!strchr(host->h_aliases[i], '.')) continue; else if (!strncasecmp(host->h_aliases[i], host->h_name, strlen(host->h_name))) return strdup(host->h_aliases[i]); } return NULL; } /* * Finds the name (or address) which clients should use when connecting to * the server. * * Arguments: none * * Returns: the name or address as a string stored in malloc:ed memory */ char * getservername() { #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 #endif char buf[MAXHOSTNAMELEN + 1]; char *hostname = NULL; struct hostent *host; if (gethostname(buf, sizeof(buf) - 1) == 0) { buf[sizeof(buf) - 1] = '\0'; if ((host = gethostbyname(buf)) && (hostname = findfqdn(host))) { return hostname; } if (host && host->h_addr_list[0] != NULL) return strdup(inet_ntoa(*(struct in_addr *)host->h_addr_list[0])); } logmsg("Failed to get hostname, please set serveraddress in configfile\n"); return NULL; } /* * Writes ShoutCast type metadata to the client (for format information, see * the developer docs at the Ample homepage). * * Arguments: to - the stream to write the data to * entry - the entry that is currently playing * metaflag - has information about this particular entry * been written before? * * Returns: TRUE if the operation was successful, else FALSE */ bool writemetadata(FILE *to, mp3entry *entry, bool *metaflag) { int msglen; int padding; int towrite; int written; char *buf; if(*metaflag) { *metaflag = FALSE; msglen = strlen(entry->title) + 28; padding = 16 - msglen % 16; towrite = msglen + padding + 1; buf = malloc(towrite); memset(buf, 0, towrite); sprintf(buf, "%cStreamTitle='%s';StreamUrl='';", (msglen + padding)/16, entry->title); } else { towrite = 1; buf = malloc(towrite); memset(buf, 0, towrite); } written = fwrite(buf, sizeof(char), towrite, to); free(buf); if(written == towrite) return(TRUE); else return(FALSE); } /* * Removes trailing spaces from a string. * * Arguments: buffer - the string to process * * Returns: void */ static void stripspaces(char *buffer) { int i = 0; while(*(buffer + i) != '\0') i++; for(;i >= 0; i--) { if(*(buffer + i) == ' ') *(buffer + i) = '\0'; else if(*(buffer + i) == '\0') continue; else break; } } /* * Sets the title of an MP3 entry based on its ID3v1 tag. * * Arguments: file - the MP3 file to scen for a ID3v1 tag * entry - the entry to set the title in * * Returns: TRUE if a title was found and created, else FALSE */ static bool setid3v1title(FILE *file, mp3entry *entry) { char buffer[31]; int offsets[3] = {-95,-65,-125}; int i; char *result; result = (char *)malloc(3*30 + 2*3 + 1); *result = '\0'; for(i=0;i<3;i++) { if(fseek(file, offsets[i], SEEK_END) != 0) { free(result); return FALSE; } fgets(buffer, 31, file); stripspaces(buffer); if(buffer[0] != '\0' && *result != '\0') strcat(result, " - "); strcat(result, buffer); } if(*result == '\0') { free(result); return(FALSE); } else { entry->title = (char *)realloc(result, strlen(result) + 1); return(TRUE); } } /* * Sets the title of an MP3 entry based on its ID3v2 tag. * * Arguments: file - the MP3 file to scen for a ID3v2 tag * entry - the entry to set the title in * * Returns: TRUE if a title was found and created, else FALSE */ static bool setid3v2title(FILE *file, mp3entry *entry) { char *buffer; int minframesize; int size, readsize = 0, headerlen; char *title = NULL; char *artist = NULL; char header[10]; unsigned short int version; /* 10 = headerlength */ if(entry->id3v2len < 10) return(FALSE); /* Check version */ fseek(file, 0, SEEK_SET); fread(header, sizeof(char), 10, file); version = (unsigned short int)header[3]; /* Read all frames in the tag */ size = entry->id3v2len - 10; buffer = malloc(size + 1); if(size != (int)fread(buffer, sizeof(char), size, file)) { free(buffer); return(FALSE); } *(buffer + size) = '\0'; /* Set minimun frame size according to ID3v2 version */ if(version > 2) minframesize = 12; else minframesize = 8; /* * We must have at least minframesize bytes left for the * remaining frames to be interesting */ while(size - readsize > minframesize) { /* Read frame header and check length */ if(version > 2) { memcpy(header, (buffer + readsize), 10); readsize += 10; headerlen = UNSYNC(header[4], header[5], header[6], header[7]); } else { memcpy(header, (buffer + readsize), 6); readsize += 6; headerlen = (header[3] << 16) + (header[4] << 8) + (header[5]); } if(headerlen < 1) continue; /* Check for certain frame headers */ if(!strncmp(header, "TPE1", strlen("TPE1")) || !strncmp(header, "TP1", strlen("TP1"))) { readsize++; headerlen--; if(headerlen > (size - readsize)) headerlen = (size - readsize); artist = malloc(headerlen + 1); snprintf(artist, headerlen + 1, "%s", (buffer + readsize)); readsize += headerlen; } else if(!strncmp(header, "TIT2", strlen("TIT2")) || !strncmp(header, "TT2", strlen("TT2"))) { readsize++; headerlen--; if(headerlen > (size - readsize)) headerlen = (size - readsize); title = malloc(headerlen + 1); snprintf(title, headerlen + 1, "%s", (buffer + readsize)); readsize += headerlen; } } /* Done, let's clean up */ if(artist && title) { entry->title = malloc(strlen(artist) + strlen(title) + 4); snprintf(entry->title, strlen(artist) + strlen(title) + 4, "%s - %s", artist, title); free(artist); free(title); } else if(artist) { entry->title = artist; } else if(title) { entry->title = title; } free(buffer); return(entry->title != NULL); } /* * Calculates the size of the ID3v2 tag. * * Arguments: file - the file to search for a tag. * * Returns: the size of the tag or 0 if none was found */ static int getid3v2len(FILE *file) { char buf[6]; int offset; /* Make sure file has a ID3 tag */ if((fseek(file, 0, SEEK_SET) != 0) || (fread(buf, sizeof(char), 6, file) != 6) || (strncmp(buf, "ID3", strlen("ID3")) != 0)) offset = 0; /* Now check what the ID3v2 size field says */ else if(fread(buf, sizeof(char), 4, file) != 4) offset = 0; else offset = UNSYNC(buf[0], buf[1], buf[2], buf[3]) + 10; return(offset); } /* * Calculates the size of the ID3v1 tag. * * Arguments: file - the file to search for a tag. * * Returns: the size of the tag or 0 if none was found */ static int getid3v1len(FILE *file) { char buf[3]; int offset; /* Check if we find "TAG" 128 bytes from EOF */ if((fseek(file, -128, SEEK_END) != 0) || (fread(buf, sizeof(char), 3, file) != 3) || (strncmp(buf, "TAG", 3) != 0)) offset = 0; else offset = 128; return offset; } /* * Calculates the length (in seconds) of an MP3 file. Currently this code * doesn't care about VBR (Variable BitRate) files since it would have to * scan through the entire file but this should become a config option * in the future. * * Arguments: file - the file to calculate the length upon * entry - the entry to update with the length * * Returns: the song length in seconds, * -1 means that it couldn't be calculated */ static int getsonglength(FILE *file, mp3entry *entry) { #ifdef HAVE_STDINT_H uint32_t header; #else long header; #endif int version; int layer; int bitindex; int bitrate; int freqindex; int frequency; double bpf; double tpf; int i; /* Start searching after ID3v2 header */ if(fseek(file, entry->id3v2len, SEEK_SET)) return -1; /* Fill up header with first 24 bits */ for(version = 0; version < 3; version++) { header <<= 8; if(!fread(&header, 1, 1, file)) return -1; } /* Loop trough file until we find a frame header */ restart: do { header <<= 8; if(!fread(&header, 1, 1, file)) return -1; } while(!CHECKSYNC(header)); /* * Some files are filled with garbage in the beginning, * if the bitrate index of the header is binary 1111 * that is a good indicator */ if((header & 0xF000) == 0xF000) goto restart; debug(5, "We found %x-%x-%x-%x and checksync %i and test %x\n", BYTE0(header), BYTE1(header), BYTE2(header), BYTE3(header), CHECKSYNC(header), (header & 0xF000) == 0xF000); /* MPEG Audio Version */ switch((header & 0x180000) >> 19) { case 2: version = 2; break; case 3: version = 1; break; default: return -1; } /* Layer */ switch((header & 0x060000) >> 17) { case 1: layer = 3; break; case 2: layer = 2; break; case 3: layer = 1; break; default: return -1; } /* Bitrate */ bitindex = (header & 0xF000) >> 12; bitrate = bitrate_table[version-1][layer-1][bitindex]; if(bitrate == 0) return -1; /* Sampling frequency */ freqindex = (header & 0x0C00) >> 10; frequency = freqtab[version-1][freqindex]; if(frequency == 0) return -1; debug(2, "Version %i, lay %i, biti %i, bitr %i, freqi %i, freq %i\n", version, layer, bitindex, bitrate, freqindex, frequency); /* Calculate bytes per frame, calculation depends on layer */ switch(layer) { case 1: bpf = bitrate_table[version - 1][layer - 1][bitindex]; bpf *= 12000.0 * 4.0; bpf /= freqtab[version-1][freqindex] << (version - 1); break; case 2: case 3: bpf = bitrate_table[version - 1][layer - 1][bitindex]; bpf *= 144000; bpf /= freqtab[version-1][freqindex] << (version - 1); break; default: bpf = 1.0; } /* Calculate time per frame */ tpf = bs[layer]; tpf /= freqtab[version-1][freqindex] << (version - 1); debug(3, "BitRate is %i, FileLength is %i, TPF is %f and BPF is %f, we have %f frames in one second\n", bitrate, entry->filesize, tpf, bpf, 1/tpf); /* * Now song length is * ((filesize)/(bytes per frame))*(time per frame) */ return (int)(((float)entry->filesize/bpf)*tpf); } /* * Checks all relevant information (such as ID3v1 tag, ID3v2 tag, length etc) * about an MP3 file and updates it's entry accordingly. * * Arguments: entry - the entry to check and update with the new information * * Returns: void */ void checkmp3info(mp3entry *entry) { FILE *file; char *copy; char *title; if((file = fopen(entry->path, "r")) == NULL) return; entry->id3v2len = getid3v2len(file); entry->id3v1len = getid3v1len(file); entry->length = getsonglength(file, entry); entry->title = NULL; if(HASID3V2(entry)) setid3v2title(file, entry); if(HASID3V1(entry) && !entry->title) setid3v1title(file, entry); if(!entry->title) { copy = strdup(entry->path); title = basename(copy); entry->title = malloc(strlen(title) - 3); snprintf(entry->title, strlen(title) - 3, "%s", title); free(copy); } fclose(file); } ample-0.5.7.orig/src/helper.h0100644000550600055060000000245107570413150015066 0ustar tonontonon#define ID3V2_ID "ID3" #define ID3V2_HEADER_LEN 21 #define ID3V2_MAJOR_VERS 0x04 #define ID3V2_MINOR_VERS 0x00 #define ID3V2_HEADER_FLAGS 0x00 #define ID3V2_FRAME_ID "TIT2" #define ID3V2_FRAME_FLAGS1 0x00 #define ID3V2_FRAME_FLAGS2 0x00 #define ID3V2_FRAME_ENC 0x00 #define SYNCBYTE1(value) ((value >> (3*7)) & 0x7F) #define SYNCBYTE2(value) ((value >> (2*7)) & 0x7F) #define SYNCBYTE3(value) ((value >> (1*7)) & 0x7F) #define SYNCBYTE4(value) ((value >> (0*7)) & 0x7F) #define UNSYNC(b1,b2,b3,b4) (((b1 & 0x7F) << (3*7)) + \ ((b2 & 0x7F) << (2*7)) + \ ((b3 & 0x7F) << (1*7)) + \ ((b4 & 0x7F) << (0*7))) #define TYPE_LOG 0 #define TYPE_DEBUG 1 #define TYPE_DIE 2 char *getservername(); extern void sendstatusmsg(int to, char *fmt, ...); extern void logmsg(char *fmt, ...); extern void debug(int priority, char *fmt, ...); extern void die(char *fmt, ...); extern char *mgetcwd(); extern char *itoa(int integer); extern char *urlencode(char *toencode); extern char *htmlencode(char *toencode); extern char *replacevariables(char *input, struct client_config *cconf, mp3entry *entry); extern char *getservername(); extern bool writemetadata(FILE *to, mp3entry *entry, bool *metaflag); extern void checkmp3info(mp3entry *entry); ample-0.5.7.orig/TODO0100644000550600055060000000056707760620327013354 0ustar tonontononAMPLE TODO list: * Signal-controllable: To allow you to skip tracks etc by sending the right signal to Ample from a shell. * Custom song titles Like XMMS can be configured what to show * Many clients, same stream Has been requested by some people, probably far into the future though * Better i18n Support locales when reading file names and create UTF-8 webpages ample-0.5.7.orig/docs/0040755000550600055060000000000007760623031013602 5ustar tonontononample-0.5.7.orig/docs/ample.html.5.in0100644000550600055060000001113107432337620016332 0ustar tonontonon.\" $Id: ample.html.5.in,v 1.1 2002/02/07 01:02:47 alphix Exp $ .\" .\" This file is part of Ample. .\" .\" Ample 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. .\" .\" Ample 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 Ample; if not, write to the Free Software .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA .\" .\" .\" Process this file with something like .\" groff -man -Tascii foo.1 .\" .TH AMPLE.HTML 5 "JANUARY 2002" Ample "User Manual" .SH NAME ample.html \- html template for Ample .SH DESCRIPTION This file, by default .IR "@sysconfdir@/ample.html" "," is read by Ample at startup and used as a base for it's HTML pages. These pages are rendered whenever a webbrowser connects and requests a list of available songs and directories (typically done by connecting to .BR "http://server:port/index.html" ")." .P The file is divided into three sections, the header, the middle and the footer. The header and the footer are the same on each page generated while the \*(lqmiddle\*(rq is copied into the final HTML document once for each file or directory that is going to be listed. Although this may sound confusing, it will probably become much more evident once you look at the example below. .P Variables are written in uppercase and enclosed within \*(lqat\*(rq signs (example: .BR "@NAME@" ")" and are replaced dynamically when the page is constructed. Some variables can exist anywhere in the document and some can only exist in the \*(lqmiddle\*(rq section, see the information about each variable for details. .SH EXAMPLE .IP "" 0 .nf .RB "" "@SERVERNAME@" ""
.RB "

" "@SERVERNAME@" "

" .RB "

Tracks currently available in " "@PATH@" "

"

[ playlist for this dir | recursive playlist ]

[ Up one level ]

.P .B @BEGIN@ .P .P .B @END@ .P
TYPE URL
.B @TYPE@ .RB "" "@NAME@" ""

powered by Ample, for more information, see the project homepage

.SH SUMMARY OF VARIABLES .P .IP "" 0 .nf .B SPECIAL - Only used once BEGIN END .P .IP "" 0 .nf .B GLOBAL - Can be used anywhere SERVERNAME PORT PATH .P .IP "" 0 .nf .B NON-GLOBAL - Can only be used in the \*(rqmiddle\*(lq section NAME URL LENGTH TITLE SIZE TYPE .SH SPECIAL VARIABLES These can only be used once. .TP .B BEGIN This variable (when placed in the beginning of a new line) marks the end of the header section and the start of the \*(rqmiddle\*(lq section. .TP .B END This variable (when placed in the beginning of a new line) marks the end of the \*(rqmiddle\*(lq section and the start of the footer section. .SH GLOBAL VARIABLES These can be used anywhere. .TP .B SERVERNAME The name of the server as given in .BR "ample.conf" "(5)." .TP .B PORT The port that the server is listening to. .TP .B PATH The current path the user is viewing. .SH NON-GLOBAL VARIABLES These can only be used in the \*(lqmiddle\*(rq section. .TP .B NAME The name of the song or directory. .TP .B URL The URL of the song or directory. .TP .B LENGTH The song length (in seconds) or blank if it is a directory. .TP .B TITLE The title of the song or \*(lqDIR\*(rq if it is a directory. .TP .B SIZE The file size or blank if it is a directory. .TP .B TYPE \*(lqFILE\*(rq if it is a file or \*(lqDIR\*(rq if it is a directory. .SH AUTHOR David Härdeman .SH "SEE ALSO" .BR "ample" "(1), " "ample.conf" "(5)" ample-0.5.7.orig/docs/ample.conf.5.in0100644000550600055060000001121607570413147016321 0ustar tonontonon.\" $Id: ample.conf.5.in,v 1.2 2002/10/25 20:35:10 alphix Exp $ .\" .\" This file is part of Ample. .\" .\" Ample 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. .\" .\" Ample 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 Ample; if not, write to the Free Software .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA .\" .\" .\" Process this file with something like .\" groff -man -Tascii foo.1 .\" .TH AMPLE.CONF 5 "JANUARY 2002" Ample "User Manual" .SH NAME ample.conf \- configuration file for Ample .SH DESCRIPTION This file, by default .IR "@sysconfdir@/ample.conf" "," is read by Ample at startup. There are three categories of values than can be defined: strings, numbers and boolean values. Valid boolean values are (case insensitive) yes, no, true and false. Lines that start with # are considered to be comments and ignored. .SH EXAMPLE .IP .nf # An example of a Ample config file # # Port number to use port = 1234 # Should files be ordered when playing a mixed stream? order = true # Amount of simultaneous clients allowed clients = 5 # Path to logfile if syslog isn't used logfile = /var/log/ample # Path(s) to MP3 dir/file or M3U file mp3path = /home/mp3 mp3path = /home/moremp3/zztop.mp3 mp3path = /home/favourites.m3u # Path to the HTML file to use as a template htmlfile = /etc/ample.html # Should the MP3 dir(s) be recursively scanned? recursive = true # Name of the server # (displayed to clients here and there) servername = Ample # Address of the server # (only if your server can't be resolved) serveraddress = 192.168.0.1 # Username and password, if these are specified, Ample # will automatically ask for username/password username = MusicLover password = Pekaboo # Filter to pass each music file through # (before they are sent to the client) filter = /usr/bin/lame -b64 --quiet "@FPATH@" - # The end .SH OPTIONS .TP .BI "port=" "NUM" Listen to TCP port .IR "NUM" ", default is 1234." .TP .BI "order=" "BOOL" When a list of files is requested, and this option is .BR "TRUE" "," play them in alphabetical order. .TP .BI "clients=" "NUM" Allow a maximum of .I NUM clients to be connected at the same time. .TP .BI "logfile=" "FILE" Use .I FILE as logfile if .BR syslogd (8) isn't used. .TP .BI "mp3path=" "PATH" These are path(s) to files or directories that Ample can use to populate it's list of MP3's. If .I PATH is a directory, all files (possibly recursively, see the .B -n option above) will be added. If .I PATH is a regular file ending with .mp3 it will be added and if it is a regular file ending with .m3u (MP3 playlist) the files listed in it will be added. You can specify several paths by adding several .BI "mp3path=" "PATH" lines to this config file. .TP .BI "htmlfile=" "FILE" This is the path to the file which Ample should use as it's base for creating HTML pages. See .BR "ample.html" "(5)" for more information. .TP .BI "recursive=" "BOOL" If .BR "TRUE" "," all directories that Ample index:es will be scanned recursively (meaning that all subdirs will be checked for files as well) .TP .BI "servername=" "STRING" The name of the server will be set to .I STRING instead of "Ample" (the servername is displayed to clients in various places). .TP .BI "serveraddress=" "STRING" .I STRING should be the IP address of the server where Ample is run. This is only needed if DNS resolving your server, for some reason, doesn't work. .TP .BI "username=" "STRING" If both username and password is specified in the config file, HTTP authentication will be enabled. This means that if a client wants to connect to ample, it must do so with a username and password in order to be granted acccess. If username or password is missing, HTTP authentication will be disabled. .TP .BI "password=" "STRING" See the description of username above. .TP .BI "filter=" "STRING" Specifies an optional filter to run each file through before it is sent to the client. As an example, this could be used to downgrade the bitrate of a music file if you have a lousy net connection but lots of CPU cycles to spare. If .I STRING contains the word @FPATH@ it will be replaced with the absolute path of the file. .SH AUTHOR David Härdeman .SH "SEE ALSO" .BR "ample" "(1), " "ample.html" "(5)" ample-0.5.7.orig/docs/Makefile.in0100644000550600055060000000334607432337620015654 0ustar tonontonon# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ sysconfdir = @sysconfdir@ mandir = @mandir@ MANFILES = $(MAN1FILES) $(MAN5FILES) MAN1FILES = ample.1 MAN1PATH = ${mandir}/man1 MAN5FILES = ample.conf.5 ample.html.5 MAN5PATH = ${mandir}/man5 INSTALL = @INSTALL@ all: @for i in $(MANFILES); do \ echo "Creating man page $$i ..."; \ cat $${i}.in | sed 's,@sysconfdir\@,$(sysconfdir),g' > $$i; \ done clean: rm -f $(MANFILES) install: $(INSTALL) -d $(MAN1PATH) $(MAN5PATH); @for i in $(MAN1FILES); do \ echo "Installing man page $$i ..."; \ $(INSTALL) -m 644 $$i $(MAN1PATH); \ done @for i in $(MAN5FILES); do \ echo "Installing $$i ..."; \ $(INSTALL) -m 644 $$i $(MAN5PATH); \ done uninstall: @for i in $(MAN1FILES); do \ echo "Removing $$i ..."; \ rm -f $(MAN1PATH)/$$i; \ done @for i in $(MAN5FILES); do \ echo "Removing $$i ..."; \ rm -f $(MAN5PATH)/$$i; \ done maint-clean: rm -f Makefile *~ $(MANFILES) dist-clean: rm -rf CVS Makefile *~ $(MANFILES) .PHONY: all clean install dist-clean maint-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ample-0.5.7.orig/docs/ample.1.in0100644000550600055060000000665507432337620015402 0ustar tonontonon.\" $Id: ample.1.in,v 1.1 2002/02/07 01:02:47 alphix Exp $ .\" .\" This file is part of Ample. .\" .\" Ample 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. .\" .\" Ample 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 Ample; if not, write to the Free Software .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA .\" .\" .\" Process this file with something like .\" groff -man -Tascii foo.1 .\" .TH AMPLE 1 "JANUARY 2002" Ample "User Manual" .SH NAME ample \- Ample MP3 server .SH SYNOPSIS .B ample .RI "[" "OPTION" "] [" "PATH" "...]" .SH DESCRIPTION .B ample Ample is an MP3 server that allows you to listen to your music that can be stored locally or remotely. It does not intend to support mixing, radio shows etc. It's just an easy way to listen to your MP3's everywhere using the "open location" features already present in XMMS, WinAmp and Media Player. After installing, configuring and starting ample, try connecting to .B http://server:1234/ with the "open location" feature of your favourite MP3 player or .B http://server:1234/index.html with your favourite web browser. .SH OPTIONS .TP .BI "-p " "NUM " "--port=" "NUM" Listen to TCP port .IR "NUM" ", default is 1234." .TP .B -o --order When a list of files is requested, play them in alphabetical order. .TP .BI "-c " "NUM " "--clients=" "NUM" Allow a maximum of .I NUM clients to be connected at the same time. .TP .B -n --norecursive Don't automatically index files in subdirs of the directories being indexed .TP .BI "-f " "FILE " "--conffile=" "FILE" Use .I FILE as config file instead of the default .IR "@sysconfdir@/ample.conf" "." .RI "See " "ample.conf" "(5) for details." .TP .BI "-m " "FILE " "--htmlfile=" "FILE" Use .I FILE as HTML template instead of the default .IR "@sysconfdir@/ample.html" "." .RI "See " "ample.html" "(5) for details." .TP .B -h --help Display help message and exit. .TP .BI "-d [" "NUM" "] --debug[=" "NUM" "]" Print debug messages, a higher value of .I NUM means more detail. .TP .B -t --trace Disables forking and backgrounding, useful for debugging. .TP .B -v --version Display version information and exit. .TP .BI "[" "PATH" "...]" These are path(s) to files or directories that Ample can use to populate it's list of MP3's. If .I PATH is a directory, all files (possibly recursively, see the .B -n option above) will be added. If .I PATH is a regular file ending with .mp3 it will be added and if it is a regular file ending with .m3u (MP3 playlist) the files listed in it will be added. .SH FILES .I @sysconfdir@/ample.conf .RS The default config file (another file may be used, see the .B -f option above). See .BR ample.conf (5) for further details. .P .RE .I @sysconfdir@/ample.html .RS The default HTML template file (another file may be used, see the .B -m option above). See .BR ample.html (5) for further details. .SH BUGS Of course totally bugfree or your money back :-) .SH AUTHOR David Härdeman .SH "SEE ALSO" .BR "ample.conf" "(5), " "ample.html" "(5)" ample-0.5.7.orig/aclocal.m40100644000550600055060000001173407432337620014517 0ustar tonontonondnl Renamed to AC_TYPE_SOCKLEN_T and some tweaks - David H - 2001-12-12 dnl dnl @synopsis TYPE_SOCKLEN_T dnl dnl Check whether sys/socket.h defines type socklen_t. Please note dnl that some systems require sys/types.h to be included before dnl sys/socket.h can be compiled. dnl dnl @version $Id: aclocal.m4,v 1.3 2001/12/16 01:35:44 alphix Exp $ dnl @author Lars Brinkhoff dnl AC_DEFUN([AC_TYPE_SOCKLEN_T], [ AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, [ AC_TRY_COMPILE([ #include #include ], [ socklen_t len = 42; return 0; ], ac_cv_type_socklen_t="yes", ac_cv_type_socklen_t="no") ]) if test "x$ac_cv_type_socklen_t" = "xno"; then AC_DEFINE(socklen_t, int, [the type of the last argument to getsockopt etc]) fi ]) dnl end of AC_TYPE_SOCKLEN_T dnl Renamed to AC_CHECK_SOCKET_LIBS and partially rewritten - David H - 2001-12-12 dnl dnl @synopsis ETR_SOCKET_NSL dnl dnl This macro figures out what libraries are required on this platform dnl to link sockets programs. It's usually -lsocket and/or -lnsl or dnl neither. We test for all three combinations. dnl dnl @version $Id: aclocal.m4,v 1.3 2001/12/16 01:35:44 alphix Exp $ dnl @author Warren Young dnl AC_DEFUN([AC_CHECK_SOCKET_LIBS], [ AC_CACHE_CHECK([for extra libraries needed for socket functions], ac_cv_socket_libs, [ oLIBS=$LIBS AC_TRY_LINK([ #include #include #include #include ], [ struct in_addr add; int sd = socket(AF_INET, SOCK_STREAM, 0); inet_ntoa(add); ], ac_cv_socket_libs="none", ac_cv_socket_libs=no) if test "x$ac_cv_socket_libs" = "xno" then LIBS="$oLIBS -lsocket" AC_TRY_LINK([ #include #include #include #include ], [ struct in_addr add; int sd = socket(AF_INET, SOCK_STREAM, 0); inet_ntoa(add); ], ac_cv_socket_libs=-lsocket, ac_cv_socket_libs=no) fi if test "x$ac_cv_socket_libs" = "xno" then LIBS="$oLIBS -lsocket -lnsl" AC_TRY_LINK([ #include #include #include #include ], [ struct in_addr add; int sd = socket(AF_INET, SOCK_STREAM, 0); inet_ntoa(add); ], ac_cv_socket_libs="-lsocket -lnsl", ac_cv_socket_libs=no) fi ]) if test "x$ac_cv_socket_libs" = "xno" then AC_MSG_ERROR([cannot find socket libraries]) fi ]) dnl AC_CHECK_SOCKET_LIBS dnl Written by me - David H - 2001-12-12 dnl dnl @synopsis AC_LIB_WRAP dnl dnl This macro makes sure that libwrap is found and also checks if dnl libnsl is needed for libwrap to function correctly. dnl dnl @author David Härdeman dnl AC_DEFUN([AC_LIB_WRAP], [ AC_CACHE_VAL(ac_cv_libwrap_libs, [ oLIBS=$LIBS AC_CHECK_HEADER([tcpd.h],,AC_MSG_ERROR([cannot find tcpd.h]),) AC_MSG_CHECKING([for libwrap libraries]) LIBS="$oLIBS -lwrap" AC_TRY_LINK([ #include #include int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING; ], [ struct request_info request; hosts_access(&request); ], ac_cv_libwrap_libs=-lwrap, ac_cv_libwrap_libs=no) if test "x$ac_cv_libwrap_libs" = "xno" then LIBS="$oLIBS -lwrap -lnsl" AC_TRY_LINK([ #include #include int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING; ], [ struct request_info request; hosts_access(&request); ], ac_cv_libwrap_libs="-lwrap -lnsl", ac_cv_libwrap_libs=no) fi ]) if test "x$ac_cv_libwrap_libs" = "xno" then AC_MSG_ERROR([cannot find libraries]) else AC_MSG_RESULT($ac_cv_libwrap_libs) fi ]) dnl AC_LIB_WRAP ample-0.5.7.orig/README0100644000550600055060000000611707445173665013551 0ustar tonontononAMPLE README: 1. License ---------- See COPYING in the same dir as this file 2. Installation --------------- ./configure make make install This should compile and move the binary to a suitable dir (/usr/local/bin). Create a config file (see ample.conf manual page for all available options) and move it to a suitable dir (/usr/local/etc). Then start the server with: /ample or (if you put the config file in a different place): /ample -f/usr/local/somewhere/ample.conf for example: /usr/local/bin/ample -f/usr/local/somewhere/ample.conf This will start AMPLE, and make it a background process. Alternatively if you want to use AMPLE trough inetd, add a line like this: "stream" "tcp" "nowait" for example: 1234 stream tcp nowait david /home/david/cvs/ample/src/ample ample For more details, read the ample, ample.conf and ample.html man pages that were installed at the same time as the program itself (they can also be found in the docs dir of the source directory). 3. Options ---------- -p, --port=NUMBER which port to listen to, default 1234 -o, --order play MP3 files in alphabetical order -c, --clients=NUMBER how many clients are allowed to be connected default 5 -n, --norecursive don't index MP3 files in subdirs of the given dir -f, --conffile=FILENAME alternative file to read for config options -m, --htmlfile=FILENAME file to use as template for HTML output -h, --help display this help and exit -d, --debug[=NUMBER] debug messages will be printed higher number means more detail -t, --trace no forking, no backgrounding helpful when debugging -v, --version output version information and exit 4. Notes -------- AMPLE can use three kinds of paths to build it's index of MP3 files: o Directories Will be scanned (possibly recursively) for MP3 files. o MP3 files The single file will be added. o M3U (playlist) files All MP3 files listed in the playlist (that are found) are added. You can connect with a web browser to an URL ending with index.html and (if it exists) Ample will generate a listing of available files. You can also connect with a web browser to an URL ending with info.html and Ample will generate a status page. All default paths (for log files, config files, etc) can be set using command line options to the "configure" script. For clients that support it, AMPLE now sends ShoutCast-type metadata (songtitles that is), this is tested and should work on (at least) XMMS and WinAmp. To enable ShoutCast-type metadata in XMMS, make sure the following setting is checked: Options->Preferences->MPEG Layer 1/2/3 Player->Configure-> Streaming->Enable SHOUT/Icecast streaming If not, you will only see something like http://localhost:1234 in the song title window. 5. Bugs ------- Quite a few probably, too radical changes right now. 6. Other -------- For other info, see http://ample.sf.net/ ample-0.5.7.orig/configure0100755000550600055060000061562407760620330014573 0ustar tonontonon#! /bin/sh # From configure.ac . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.58 for Ample AMPLE_VERSION. # # Report bugs to . # # Copyright (C) 2003 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 Bourne compatible 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+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH 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 fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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'` # PATH needs CR, and LINENO needs CR and PATH. # 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 as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') 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=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # 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 before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, 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 # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi 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$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # 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'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # 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` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='Ample' PACKAGE_TARNAME='ample' PACKAGE_VERSION='AMPLE_VERSION' PACKAGE_STRING='Ample AMPLE_VERSION' PACKAGE_BUGREPORT='david@2gen.com' ac_unique_file="src/ample.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" 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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' # 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. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= 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 ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -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 | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$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" ;; -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'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac 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 ;; -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 ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) 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 ;; -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'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac 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; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` 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 paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac 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 # 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 its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $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 if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # 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 Ample AMPLE_VERSION 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 \`..'] _ACEOF cat <<_ACEOF 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] --datadir=DIR read-only architecture-independent data [PREFIX/share] --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] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Ample AMPLE_VERSION:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-libwrap Use tcpd wrappers --disable-syslog Disable the use of syslog --enable-facility=ARG Syslog to ARG instead of LOG_DAEMON 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 CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style 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 elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd "$ac_popdir" done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Ample configure AMPLE_VERSION generated by GNU Autoconf 2.58 Copyright (C) 2003 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 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Ample $as_me AMPLE_VERSION, which was generated by GNU Autoconf 2.58. Invocation command line was $ $0 $@ _ACEOF { 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` hostinfo = `(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 } >&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_sep= 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_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; 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: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. 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, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf 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 -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >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 -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; 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 `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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 ($Id: configure,v 1.28 2003/11/25 09:28:27 alphix Exp $) ac_config_headers="$ac_config_headers config.h" PACKAGE=ample AMPLE_MAJOR_VERSION=0 AMPLE_MINOR_VERSION=5 AMPLE_MICRO_VERSION=7 AMPLE_VERSION=\"$AMPLE_MAJOR_VERSION.$AMPLE_MINOR_VERSION.$AMPLE_MICRO_VERSION\" cat >>confdefs.h <<_ACEOF #define AMPLE_VERSION $AMPLE_VERSION _ACEOF 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 $as_executable_p "$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 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 $as_executable_p "$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 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 CC=$ac_ct_CC 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 $as_executable_p "$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 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 "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_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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done 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 CC=$ac_ct_CC else CC="$ac_cv_prog_CC" 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done 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 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 $as_executable_p "$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 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 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 $as_executable_p "$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 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 CC=$ac_ct_CC 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` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&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[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else 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 echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check 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' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&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 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; 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 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 CFLAGS="-g" 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 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext 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 ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=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 -std1 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 -std1. */ int osf4_cc_array ['\x00' == 0 ? 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 # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking for extra libraries needed for socket functions" >&5 echo $ECHO_N "checking for extra libraries needed for socket functions... $ECHO_C" >&6 if test "${ac_cv_socket_libs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else oLIBS=$LIBS 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 int main () { struct in_addr add; int sd = socket(AF_INET, SOCK_STREAM, 0); inet_ntoa(add); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_socket_libs="none" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_socket_libs=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "x$ac_cv_socket_libs" = "xno" then LIBS="$oLIBS -lsocket" 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 int main () { struct in_addr add; int sd = socket(AF_INET, SOCK_STREAM, 0); inet_ntoa(add); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_socket_libs=-lsocket else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_socket_libs=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "x$ac_cv_socket_libs" = "xno" then LIBS="$oLIBS -lsocket -lnsl" 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 int main () { struct in_addr add; int sd = socket(AF_INET, SOCK_STREAM, 0); inet_ntoa(add); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_socket_libs="-lsocket -lnsl" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_socket_libs=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_socket_libs" >&5 echo "${ECHO_T}$ac_cv_socket_libs" >&6 if test "x$ac_cv_socket_libs" = "xno" then { { echo "$as_me:$LINENO: error: cannot find socket libraries" >&5 echo "$as_me: error: cannot find socket libraries" >&2;} { (exit 1); exit 1; }; } fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+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. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in dir; do LIBS="-l$ac_lib $ac_func_search_save_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 gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi else echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in x; do LIBS="-l$ac_lib $ac_func_search_save_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 gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi 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 echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&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 echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+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. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+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. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+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. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in arpa/inet.h errno.h fcntl.h limits.h netinet/in.h stdlib.h \ string.h sys/socket.h unistd.h getopt.h signal.h stdint.h \ netdb.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------- ## ## Report this to david@2gen.com ## ## ----------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+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 () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+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. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+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. */ $ac_includes_default int main () { if ((off_t *) 0) return 0; if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long _ACEOF fi echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+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. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+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. */ #include #include #ifdef signal # undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 if test "${ac_cv_type_socklen_t+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. */ #include #include int main () { socklen_t len = 42; return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_socklen_t="yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_socklen_t="no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 if test "x$ac_cv_type_socklen_t" = "xno"; then cat >>confdefs.h <<\_ACEOF #define socklen_t int _ACEOF fi for ac_func in vprintf 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 eval "test \"\${$as_ac_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 gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ 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 #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF echo "$as_me:$LINENO: checking for _doprnt" >&5 echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 if test "${ac_cv_func__doprnt+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 _doprnt to an innocuous variant, in case declares _doprnt. For example, HP-UX 11i declares gettimeofday. */ #define _doprnt innocuous__doprnt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef _doprnt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt (); /* 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__doprnt) || defined (__stub____doprnt) choke me #else char (*f) () = _doprnt; #endif #ifdef __cplusplus } #endif int main () { return f != _doprnt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func__doprnt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 echo "${ECHO_T}$ac_cv_func__doprnt" >&6 if test $ac_cv_func__doprnt = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DOPRNT 1 _ACEOF fi fi done for ac_func in getcwd inet_ntoa memset socket strcasecmp alarm strchr strdup strerror strncasecmp strrchr strtol 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 eval "test \"\${$as_ac_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 gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ 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 #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&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_header in unistd.h vfork.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------- ## ## Report this to david@2gen.com ## ## ----------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in fork vfork 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 eval "test \"\${$as_ac_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 gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ 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 #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&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 if test "x$ac_cv_func_fork" = xyes; then echo "$as_me:$LINENO: checking for working fork" >&5 echo $ECHO_N "checking for working fork... $ECHO_C" >&6 if test "${ac_cv_func_fork_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_fork_works=cross else cat >conftest.$ac_ext <<_ACEOF /* By Ruediger Kuhlmann. */ #include #if HAVE_UNISTD_H # include #endif /* Some systems only have a dummy stub for fork() */ int main () { if (fork() < 0) exit (1); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_fork_works=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_fork_works=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5 echo "${ECHO_T}$ac_cv_func_fork_works" >&6 else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then echo "$as_me:$LINENO: checking for working vfork" >&5 echo $ECHO_N "checking for working vfork... $ECHO_C" >&6 if test "${ac_cv_func_vfork_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_vfork_works=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ #include #include #include #include #include #if HAVE_UNISTD_H # include #endif #if HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; exit( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_vfork_works=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_vfork_works=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5 echo "${ECHO_T}$ac_cv_func_vfork_works" >&6 fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WORKING_VFORK 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define vfork fork _ACEOF fi if test "x$ac_cv_func_fork_works" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WORKING_FORK 1 _ACEOF fi for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------- ## ## Report this to david@2gen.com ## ## ----------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if STDC_HEADERS || HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { exit (malloc (0) ? 0 : 1); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_malloc_0_nonnull=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 0 _ACEOF case $LIBOBJS in "malloc.$ac_objext" | \ *" malloc.$ac_objext" | \ "malloc.$ac_objext "* | \ *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi # Check whether --enable-libwrap or --disable-libwrap was given. if test "${enable_libwrap+set}" = set; then enableval="$enable_libwrap" fi; # Check whether --enable-syslog or --disable-syslog was given. if test "${enable_syslog+set}" = set; then enableval="$enable_syslog" fi; echo "$as_me:$LINENO: checking libwrap/sysconf interoperability" >&5 echo $ECHO_N "checking libwrap/sysconf interoperability... $ECHO_C" >&6 if test "x$enable_libwrap" = "xyes" -a "x$enable_syslog" = "xno" ; then { { echo "$as_me:$LINENO: error: you can't enable libwrap and disable syslog" >&5 echo "$as_me: error: you can't enable libwrap and disable syslog" >&2;} { (exit 1); exit 1; }; } elif test "x$enable_libwrap" = "xyes" ; then echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 for ac_header in syslog.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------- ## ## Report this to david@2gen.com ## ## ----------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: syslog enabled but syslog header not found" >&5 echo "$as_me: error: syslog enabled but syslog header not found" >&2;} { (exit 1); exit 1; }; } fi done if test "${ac_cv_libwrap_libs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else oLIBS=$LIBS if test "${ac_cv_header_tcpd_h+set}" = set; then echo "$as_me:$LINENO: checking for tcpd.h" >&5 echo $ECHO_N "checking for tcpd.h... $ECHO_C" >&6 if test "${ac_cv_header_tcpd_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_tcpd_h" >&5 echo "${ECHO_T}$ac_cv_header_tcpd_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking tcpd.h usability" >&5 echo $ECHO_N "checking tcpd.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking tcpd.h presence" >&5 echo $ECHO_N "checking tcpd.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: tcpd.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: tcpd.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: tcpd.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: tcpd.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: tcpd.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: tcpd.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: tcpd.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: tcpd.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: tcpd.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: tcpd.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: tcpd.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: tcpd.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: tcpd.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: tcpd.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: tcpd.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: tcpd.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------- ## ## Report this to david@2gen.com ## ## ----------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for tcpd.h" >&5 echo $ECHO_N "checking for tcpd.h... $ECHO_C" >&6 if test "${ac_cv_header_tcpd_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_tcpd_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_tcpd_h" >&5 echo "${ECHO_T}$ac_cv_header_tcpd_h" >&6 fi if test $ac_cv_header_tcpd_h = yes; then : else { { echo "$as_me:$LINENO: error: cannot find tcpd.h" >&5 echo "$as_me: error: cannot find tcpd.h" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: checking for libwrap libraries" >&5 echo $ECHO_N "checking for libwrap libraries... $ECHO_C" >&6 LIBS="$oLIBS -lwrap" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING; int main () { struct request_info request; hosts_access(&request); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_libwrap_libs=-lwrap else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_libwrap_libs=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "x$ac_cv_libwrap_libs" = "xno" then LIBS="$oLIBS -lwrap -lnsl" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING; int main () { struct request_info request; hosts_access(&request); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_libwrap_libs="-lwrap -lnsl" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_libwrap_libs=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi fi if test "x$ac_cv_libwrap_libs" = "xno" then { { echo "$as_me:$LINENO: error: cannot find libraries" >&5 echo "$as_me: error: cannot find libraries" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: $ac_cv_libwrap_libs" >&5 echo "${ECHO_T}$ac_cv_libwrap_libs" >&6 fi elif test "x$enable_syslog" != "xno" ; then echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 for ac_header in syslog.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------- ## ## Report this to david@2gen.com ## ## ----------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: syslog enabled but syslog header not found" >&5 echo "$as_me: error: syslog enabled but syslog header not found" >&2;} { (exit 1); exit 1; }; } fi done else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking log facility" >&5 echo $ECHO_N "checking log facility... $ECHO_C" >&6 # Check whether --enable-facility or --disable-facility was given. if test "${enable_facility+set}" = set; then enableval="$enable_facility" fi; if test "x$enable_facility" = "xyes" ; then { { echo "$as_me:$LINENO: error: you have to give an option to --enable-facility" >&5 echo "$as_me: error: you have to give an option to --enable-facility" >&2;} { (exit 1); exit 1; }; } elif test "x$enable_facility" = "xno" -o "x$enable_facility" = "x"; then cat >>confdefs.h <<_ACEOF #define LOG_FACILITY LOG_DAEMON _ACEOF else cat >>confdefs.h <<_ACEOF #define LOG_FACILITY $enable_facility _ACEOF fi echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 echo echo "Creating files" ac_config_files="$ac_config_files Makefile src/Makefile docs/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # 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. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *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 \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!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 "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" 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}' # 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 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_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $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 Bourne compatible 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+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH 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 fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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'` # PATH needs CR, and LINENO needs CR and PATH. # 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 as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') 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=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # 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 before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, 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 # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi 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$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # 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'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by Ample $as_me AMPLE_VERSION, which was generated by GNU Autoconf 2.58. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi 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, 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="\\ Ample config.status AMPLE_VERSION configured by $0, generated by GNU Autoconf 2.58, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _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 ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 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 0 ;; --debug | --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;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 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" ;; 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 $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "docs/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { 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 to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $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 -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # 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 # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $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'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $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'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # 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. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF 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,@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,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #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. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # 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. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then 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 ac_dir=`(dirname "$ac_file") 2>/dev/null || $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'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $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'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (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 echo echo "+----------------------------------------+" echo "| SUCCESS |" echo "+----------------------------------------+" echo " Ample has been configured, you should" echo " now type 'make' to compile Ample." echo echo "+----------------------------------------+" echo "| YOUR CONFIGURATION |" echo "+----------------------------------------+" echo " Version: $AMPLE_MAJOR_VERSION.$AMPLE_MINOR_VERSION.$AMPLE_MICRO_VERSION" if test "x$enable_syslog" = "xno" ; then echo " Syslog: disabled" echo " Libwrap: disabled" elif test "x$enable_libwrap" = "xyes" ; then echo " Syslog: enabled" echo " Libwrap: enabled" else echo " Syslog: enabled" echo " Libwrap: disabled" fi if test "x$enable_facility" != "xno" -a "x$enable_facility" != "x"; then echo " Log facility: $enable_facility" fi echo ample-0.5.7.orig/configure.ac0100644000550600055060000000741307760621405015145 0ustar tonontonondnl Process this file with autoconf to produce a configure script. dnl Some intro checks and defines AC_INIT(Ample,AMPLE_VERSION,david@2gen.com) AC_REVISION ($Id: configure.ac,v 1.14 2003/11/25 09:28:27 alphix Exp $) AC_PREREQ(2.50) AC_CONFIG_SRCDIR(src/ample.c) AC_CONFIG_HEADER(config.h) PACKAGE=ample AMPLE_MAJOR_VERSION=0 AMPLE_MINOR_VERSION=5 AMPLE_MICRO_VERSION=7 AMPLE_VERSION=\"$AMPLE_MAJOR_VERSION.$AMPLE_MINOR_VERSION.$AMPLE_MICRO_VERSION\" AC_DEFINE_UNQUOTED(AMPLE_VERSION,$AMPLE_VERSION,[Define program version]) dnl Checks for programs. AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_INSTALL dnl Checks for libraries. dnl from aclocal.m4 AC_CHECK_SOCKET_LIBS dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([arpa/inet.h errno.h fcntl.h limits.h netinet/in.h stdlib.h \ string.h sys/socket.h unistd.h getopt.h signal.h stdint.h \ netdb.h]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIGNAL dnl from aclocal.m4 AC_TYPE_SOCKLEN_T dnl Checks for library functions. AC_FUNC_VPRINTF AC_CHECK_FUNCS([getcwd inet_ntoa memset socket strcasecmp alarm strchr strdup strerror strncasecmp strrchr strtol]) AC_FUNC_FORK AC_FUNC_MALLOC dnl Checks for conditionals dnl Does the combination of tcpwrappers and syslog options make sense? AC_ARG_ENABLE(libwrap, AC_HELP_STRING([--enable-libwrap],[Use tcpd wrappers])) AC_ARG_ENABLE(syslog, AC_HELP_STRING([--disable-syslog],[Disable the use of syslog])) AC_MSG_CHECKING([libwrap/sysconf interoperability]) if test "x$enable_libwrap" = "xyes" -a "x$enable_syslog" = "xno" ; then dnl syslog disabled, libwrap enabled AC_MSG_ERROR([you can't enable libwrap and disable syslog]) elif test "x$enable_libwrap" = "xyes" ; then dnl syslog enabled, libwrap enabled AC_MSG_RESULT([ok]) AC_CHECK_HEADERS([syslog.h],,[AC_MSG_ERROR([syslog enabled but syslog header not found])]) dnl from aclocal.m4 AC_LIB_WRAP elif test "x$enable_syslog" != "xno" ; then dnl syslog enabled, libwrap disabled AC_MSG_RESULT([ok]) AC_CHECK_HEADERS([syslog.h],,AC_MSG_ERROR([syslog enabled but syslog header not found])) else dnl syslog disabled, libwrap disabled AC_MSG_RESULT([ok]) fi dnl Do we want to log to a special facility? AC_MSG_CHECKING([log facility]) AC_ARG_ENABLE(facility, AC_HELP_STRING([--enable-facility=ARG],[Syslog to ARG instead of LOG_DAEMON])) if test "x$enable_facility" = "xyes" ; then AC_MSG_ERROR([you have to give an option to --enable-facility]) elif test "x$enable_facility" = "xno" -o "x$enable_facility" = "x"; then AC_DEFINE_UNQUOTED(LOG_FACILITY, LOG_DAEMON, [Log facility to use with syslog]) else AC_DEFINE_UNQUOTED(LOG_FACILITY, $enable_facility, [Log facility to use with syslog]) fi AC_MSG_RESULT([ok]) dnl Done echo echo "Creating files" AC_OUTPUT([Makefile src/Makefile docs/Makefile]) echo dnl Pretty-print status message echo "+----------------------------------------+" echo "| SUCCESS |" echo "+----------------------------------------+" echo " Ample has been configured, you should" echo " now type 'make' to compile Ample." echo echo "+----------------------------------------+" echo "| YOUR CONFIGURATION |" echo "+----------------------------------------+" echo " Version: $AMPLE_MAJOR_VERSION.$AMPLE_MINOR_VERSION.$AMPLE_MICRO_VERSION" if test "x$enable_syslog" = "xno" ; then echo " Syslog: disabled" echo " Libwrap: disabled" elif test "x$enable_libwrap" = "xyes" ; then echo " Syslog: enabled" echo " Libwrap: enabled" else echo " Syslog: enabled" echo " Libwrap: disabled" fi if test "x$enable_facility" != "xno" -a "x$enable_facility" != "x"; then echo " Log facility: $enable_facility" fi echo ample-0.5.7.orig/install-sh0100755000550600055060000001267107432337620014664 0ustar tonontonon#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then : else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else : fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else : fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else : fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else : fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 ample-0.5.7.orig/Makefile.in0100644000550600055060000000511407432337620014717 0ustar tonontonon# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ datadir = @datadir@ exec_prefix = @exec_prefix@ includedir = @includedir@ infodir = @infodir@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @SET_MAKE@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ DEFS = @DEFS@ -DDEF_LOGFILE=\"$(logfile)\" -DDEF_CONFFILE=\"$(conffile)\" -DDEF_PATH=\"$(mp3path)\" LIBS = @LIBS@ LDFLAGS = @LDFLAGS@ INSTALL = @INSTALL@ conffile = $(sysconfdir)/ample.conf logdir = $(localstatedir)/log logfile = $(logdir)/ample.conf mp3path = $(datadir)/mp3 SUBDIRS = src docs MDEFS = 'SHELL=$(SHELL)' 'prefix=$(prefix)' 'exec_prefix=$(exec_prefix)' \ 'bindir=$(bindir)' 'MAKE=$(MAKE)' 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' \ 'DEFS=$(DEFS)' 'LIBS=$(LIBS)' 'LDFLAGS=$(LDFLAGS)' \ 'CPPFLAGS=$(CPPFLAGS)' 'INSTALL=$(INSTALL)' all: @for i in $(SUBDIRS); do \ echo "Making all in $$i ..."; \ cd $$i; $(MAKE) $(MDEFS) all; \ cd ..; \ done clean: @for i in $(SUBDIRS); do \ echo "Making clean in $$i ..."; \ cd $$i; $(MAKE) clean; \ cd ..; \ done install: @for i in $(SUBDIRS); do \ echo "Making install in $$i ..."; \ cd $$i; $(MAKE) install; \ cd ..; \ done uninstall: @for i in $(SUBDIRS); do \ echo "Making uninstall in $$i ..."; \ cd $$i; $(MAKE) uninstall; \ cd ..; \ done maint-clean: @for i in $(SUBDIRS); do \ echo "Making maint-clean in $$i ..."; \ cd $$i; $(MAKE) maint-clean; \ cd ..; \ done rm -f config.cache config.h config.log config.status *~ Makefile dist-clean: @for i in $(SUBDIRS); do \ echo "Making dist-clean in $$i ..."; \ cd $$i; $(MAKE) dist-clean; \ cd ..; \ done rm -f config.cache config.h config.log config.status *~ Makefile rm -rf CVS .PHONY: all clean install dist-clean maint-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ample-0.5.7.orig/config.h.in0100644000550600055060000001135407570413147014702 0ustar tonontonon/* config.h.in. Generated from configure.ac by autoheader. */ /* Define program version */ #undef AMPLE_VERSION /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `inet_ntoa' function. */ #undef HAVE_INET_NTOA /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if your system has a working `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Log facility to use with syslog */ #undef LOG_FACILITY /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `long' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned' if does not define. */ #undef size_t /* the type of the last argument to getsockopt etc */ #undef socklen_t /* Define as `fork' if `vfork' does not work. */ #undef vfork ample-0.5.7.orig/ChangeLog0100644000550600055060000002016307760621516014431 0ustar tonontononAMPLE ChangeLog: 2003-11-25 10:04 - David Härdeman - Version 0.5.7 * Fixed a locally exploitable buffer overflow in ample.c (reported by Dan Carpeter) * Fixed a compilation error on Solaris (reported by Alan Needham) 2002-12-08 15:29 - David Härdeman - Version 0.5.6 * Fixes for running Ample in (x)inetd mode, it wasn't working before, hopefully fixed now * Fixed bug in urlencode that broke some relative paths * Fixed two segfault problems (off-by-one mistakes) that had approx 1% chance of biting you for each file that Ample served * Removed some excessive debugging output 2002-10-25 20:00 - David Härdeman - Version 0.5.5 * Added username and password capability (see ample.conf man page for details) * Added the ability to run each song trough a filter before sending it to a client (see ample.conf man page for details) * Changed the HTML output so that special characters are URL/HTML encoded * Removed some debug printf's that shouldn't have been committed * Improved the random play function to only play each song once (patch from Daniel Stenberg ) * Some code cleanup's 2002-03-17 21:13 - David Härdeman - Version 0.5.4 * SysV IPC (SHM) was removed due to too many bug reports and too little gain, should improve stability. * Info page support was added, try connecting to http://server:port/info.html with a web browser. * Some bug fixes all over, the status page addition will probably upset the stability somewhat though. * This version is considered "feature complete" with regards to 0.6.X (stable). The work that remains is to clean up and stabilize it. 2002-02-13 02:28 - David Härdeman - Version 0.5.3 * SysV IPC (SHM) is now used to store the file information, this should save some physical memory. It is only used if the relevant headers are found and it isn't disabled by the configuration script. * All functions now commented and code converted to 80 chars width. * Some memory leaks fixed, there are some more though, but we can afford some sloppiness in subservers since they don't stay around for long. * Added man pages for ample, ample.conf and ample.html. (along with Makefiles for it) * Added HTML template support. (preliminary patches thanks to Abe Othman ) * Fixed a small bug in cmdline option reading. 2002-01-30 00:33 - David Härdeman - Version 0.5.2 * Rearranged/rewrote a lot of code in entries.c, should make it easier to read and extend. * Added song length parsing code. M3U files now include song length for all non-corrupt MP3 files (I think). * Changed the generated HTML page somewhat (should be ok with W3C validator) * Added M3U files as possible sources of playable files. (idea and preliminary patch by Perry Clarke ) * The one most people have been bugging me about: Multiple dirs/MP3 files/M3U files can be specified on the command prompt or in the config file and all will be added to Ample's list of files. * Squashed a few bugs along the way :) 2002-01-24 16:19 - David Härdeman - Version 0.5.1 * First stab at building a "virtual tree" of files which in the future should allow multiple dirs etc. This means heavy changes and probably introduced quite a lot of bugs. * Some more advanced HTTP request stuff - Content-Length and Range is supported. AFAIK only WinAmp can use it yet though. (See http://bugs.xmms.org/show_bug.cgi?id=311 for XMMS status) * HTML pages shows dirs and files separately (thanks to the "virtual tree" above, inspiration from Abe Othman ) * Added m3u playlist generation. (based on a patch from Ben Ford ) * Made all ID3vX and related parsing happen once at start (Speeds up things a lot, should help against clients who doesn't wait very long for Ample to send data) * Probably other changes that I can't remember, been too long between versions. 2001-12-16 03:07 - David Härdeman - Version 0.5.0 * Identical to 0.4.0 2001-12-16 03:07 - David Härdeman - Version 0.4.0 * Yes, I bumped the number to 0.4.0 (that's because I plan to do like many other projects and have a devel version that has an odd minor version and a stable version with an even minor version) * Make ID3v2 code understand versions 2.2.0 -> 2.4.0 (all currently existing versions) * Reformat HTML output somewhat * Fix search-and-replace error in libwrap code * Made servername a config option * Renamed -r to -n (NON-recursive) * Changed the DEF_LOGFILE (it pointed to ample.conf instead of ample.log) * Much work on autoconf stuff, should work much better now * Some more testing on other architectures (I've compiled it on everything from Tru64 to Linux to *BSD) 2001-12-08 20:54 - David Härdeman - Version 0.3.0pre1 * Tested (and verified) with mpg123, XMMS, Windows Media Player and WinAmp (which included resolving a bug with song titles which some people have reported) * This is hopefully the last test release prior to 0.3.0 * Change generated HTML so that it links to the files * Added -r/--norecursive option to avoid the recursive search for MP3 files * Some fixes which should help Windows Media Player and MPG123 * Fixed so that it supports "single mode" where a specific MP3 file is requested (instead of an entire dir of MP3's) * Add autoconf checks for socklen_t (which should check for socklen_t == size_t as well but I'm too lazy) * Makes dirscan code use mp3entry directly in it's sorting array (should give a small performance boost in indexing large MP3 dirs) * Remove all fopen/fclose madness, everything is trough streams now * Added "Content-Length" header in single MP3 mode (so that WinAmp and Media Player can give "progress bars") 2001-11-26 22:33 - David Härdeman - Version 0.2.9 * This will be a test release due to the amount of new features * In total these changes should close almost all TODO items (except the last three items) * rearranged some files * made ample less "chatty" * speeded up all the ID3vx parsing code * added ID3v2 parsing support * removed buggy ID3v2 tagging support (now "pure" ShoutCast mode) * inetd support, "automatically" selects daemon or non daemon mode * Some basic config file support, see ample.conf.example for ideas * Made debug level a config option * Ample now daemonizes itself * Ample now logs via syslog (or /var/log/ample if no syslog headers are found) * Fixed an error which broke index.html support * Added libwrap (tcpd) support (./configure --with-libwrap to use) * Made number of clients a run-time option (ample -c NUMBER) 2001-11-12 17:05 - David Härdeman - Version 0.2.1 * Lots of work on reading/understanding ID3v1/ID3v2 tags (ID3v2 currently incomplete) * Support sending song titles (using either ID3v2 or ShoutCast metadata) * Lots of cleanups * Compiles with -Wall -pedantic without warnings * Strips "not wanted" ID3vX tags (which could case unsync and skipping in the sound) 2001-10-02 22:44 - David Härdeman - Version 0.2.0 * make install target * Some index.html capabilities (try connecting to http://server:port/index.html) * Security fix (doesn't care about ../ in paths) 2001-08-09 08:59 - David Härdeman - Version 0.1.1 * Compile fix for Alpha * Add this, and some other, docs 2001-08-07 07:14 - David Härdeman - Version 0.1.0 * implemented fork, which means > 1 client supported (if you change the #define at the start of ample.c) * implemented sorting of files, start with -o to have them sorted * code cleanups 2001-07-30 14:45 - David Härdeman - Version 0.0.2 * Start using autoconf * Portability fixes/cleanups 2001-07-30 00:00 - David Härdeman - Version 0.0.1 * Just the most basic functionality * Select a directory at startup * Only one client * The connected client would get all files randomized ample-0.5.7.orig/COPYING0100644000550600055060000004310507432337616013714 0ustar tonontonon 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) 19yy 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) 19yy 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.