weborf-1.4/0000775000175000017500000000000014647273516006424 5weborf-1.4/utils.h0000664000175000017500000000217514634465635007663 /* Weborf Copyright (C) 2007 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #ifndef WEBORF_UTILS_H #define WEBORF_UTILS_H #include "types.h" #include "options.h" int list_dir(connection_t *connection_prop, char *html, unsigned int bufsize, bool parent); void help(); void version(); void moo(); void print_start_disclaimer(int argc, char *argv[]); bool get_param_value(char *http_param, char *parameter, char *buf, ssize_t size,ssize_t param_len); void daemonize(); void print_capabilities(); #endif weborf-1.4/mynet.h0000664000175000017500000000167514634465635007663 /* Weborf Copyright (C) 2010 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #ifndef WEBORF_MYNET_H #define WEBORF_MYNET_H #include "types.h" #include "options.h" int net_create_server_socket(); void net_bind_and_listen(int s); void net_getpeername(int,char*); #ifdef IPV6 char* ip4to6(char*); #endif #endif weborf-1.4/options.h.in0000664000175000017500000001233014634465635010615 /* Weborf Copyright (C) 2007-2019 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #include "config.h" #include //Needed because it defines the _POSIX_IPV6 #ifndef WEBORF_OPTIONS_H #define WEBORF_OPTIONS_H #define NAME PACKAGE //#define VERSION PACKAGE_VERSION #define SIGNATURE NAME "/" VERSION " (GNU/Linux)" //----------System #define ROOTUID 0 //Uid for superuser #define ROOTGID 0 //----------Network #define MAXQ 40 //Queue for connect requests #define PORT "8080" //Default port #ifdef _POSIX_IPV6 //Enables ipv6 if supported //Delete the following line to use IPv4 instead. #define IPV6 #endif #ifdef IPV6 #define IPVERSION '6' #else #define IPVERSION '4' #endif //-----------Threads #define MAXTHREAD 300 //Max threads #define INITIALTHREAD 6 //Thread started when free threads are low and when starting #define LOWTHREAD 3 //Minimum number of free threads, before starting new ones #define MAXFREETHREAD 6 //Maximum number of free threads, before starting to slowly close them #define THREADCONTROL 10 //Polling frequence in seconds //------------Server #define INDEX "index.html" //Default index file that weborf will search #define BASEDIR "/srv/www" //Default basedir #define READ_TIMEOUT 5000 //Timeout before closing inactive keep-alive connections, in milliseconds //------------Buffers #define INBUFFER 1024 //Size for buffer with the HTTP request #define FILEBUF 4096 //Size of reads #define MAXSCRIPTOUT 512000 //Maximum size for a page generated by a script or internally #define HEADBUF 1024 //Buffer for headers #define PWDLIMIT 300 //Max size for password #define INDEXMAXLEN 30 #define NBUFFER 15 //Buffer to contain the string representation of an integer #define RBUFFER 128 //Buffer to contain a range #define BUFFERED_READER_SIZE 2048 #define DATEBUFFER 50 //Buffer for text date #define URI_LEN 256 #define ESCAPED_FNAME_LEN 256 * 3 //To contain escaped filenames, d_name size is 256 on linux #define PATH_LEN 1024 #define MIMETYPELEN 15 //Size of mimetype string //Number of index pages allowed to search #define MAXINDEXCOUNT 10 //-------------LIMITS #define POST_MAX_SIZE 2000000 //Maximum allowed size for POST data //-------------HTML #define HTMLHEAD "\n" \ "" \ "" NAME "" \ "" \ "

" NAME "

" #define HTMLFOOT "
" SIGNATURE "
" #define HTMLLIGHT "white" #define HTMLDARK "#EAEAEA" #define HTMLPARENT "#DFDFDF" //-------------SCRIPTS #define SCRPT_TIMEOUT 30 //Timeout for the scripts, in seconds #define HIDE_CGI_ERRORS //Hides all the errors. #define CGI_PHP "/usr/lib/cgi-bin/php" #define CGI_PY "" //-------------COMPRESSING PAGES //#define __COMPRESSION //enables support for compressing pages, comment to disable #ifdef __COMPRESSION #define SIZE_COMPRESS_MIN 512 #define SIZE_COMPRESS_MAX 4000000000 #define GZIPNICE 4 //Nice value for gzip process #endif //The following header can be disabled to increase a little the speed //#define SEND_LAST_MODIFIED_HEADER #ifdef HAVE_LIBMAGIC #define SEND_MIMETYPES //Enables support to sending the mimetype to the client #endif //-------------RANGE #define __RANGE //Enables support to range (partial download) //-------------WEBDAV #define WEBDAV //Enables webdav support #ifdef WEBDAV #define MAXPROPCOUNT 40 //Number of supported properties #define HIDE_HIDDEN_FILES //Hides hidden files #endif //-------------Logging options //#define THREADDBG //#define SOCKETDBG //#define SENDINGDBG #define SERVERDBG #define REQUESTDBG #endif weborf-1.4/Credits0000664000175000017500000000064014634465635007665 Angelo Puglisi, for fixing a warning and founding and fixing a buffer overflow Simone Veneziano, for improving performaces of a string function Prof. Giuseppe Pappalardo for the Synchronized queue Salvo Rinaldi for handling non pipelined connections and sending content length David Paleino and Enrico Zini for sponsoring the debian package and helping improving it David Paleino (once again) for the autotool stuff weborf-1.4/weborf.10000664000175000017500000001424214634465635007716 .TH Weborf 1 "May 09, 2024" "Minimal webserver" .SH NAME weborf \- Minimal webserver .SH SYNOPSIS weborf [options] .SH DESCRIPTION Weborf is a minimal webserver. Also has a limited support for webdav. .BR This manual page documents \fBWeborf\fP's command-line parameters. .BR \fBWeborf\fP is released under the GNU General Public License version 3. .SH OPTIONS .SS .SS Options: .TP .B \-b, \-\-basedir Must be followed by a valid directory. Weborf will use this directory as root directory, and won't send files located in parent dirs. But it is still possible for server\-side scripts to read contents located anywhere on the filesystem. Links are also a workaround to exit from the base directory. Defaults to /srv/www. .TP .B \-a, \-\-auth Must be followed by a unix socket listened by a program who will handle authentication. See the website for more details. .TP .B \-c, \-\-cgi Must be followed by a list (separated with commas and without spaces) of CGI formats and the binary to execute that format. For example: .php,/usr/bin/php-cgi,.sh,/usr/bin/sh-cgi In /etc/weborf.conf there is a 'cgi' directive, corresponding to this option. It is used when launching weborf as SystemV daemon. .TP .B \-C, \-\-cache Must be followed by a directory that will be used to store cached files. To flush the cache (empty that directory) you must delete the files in the directory. .TP .B \-T, \-\-inetd Must be specified when using weborf with inetd or xinetd. It will be still necessary to specify the used port, to pass the correct value to the CGI scripts. The \-u directive will be ignored. Daemon \-d mode should not be used. .TP .B \-t, \-\-tar If used, instead of sending directory listing when requesting a directory, weborf will send a tar.gz file with the content of that directory. It is used mainly to share files and preserving their permissions. It cannot be used together with https. .TP .B \-Y, \-\-yesexec When used, weborf will enable CGI. .TP .B \-m, \-\-mime When used, weborf will send the Content-Type header. It is strongly advised to use it when using weborf as production server because some browsers rely on this field. This value will not affect the CGI pages. .TP .B \-i, \-\-ip Must be followed by a valid IP address (v6 or v4, depending on how weborf was compiled. Run weborf \-h to know it), and weborf will accept only connections directed to that specific IP. If the IP address provided isn't used by a network device on the host, weborf will terminate. By default weborf listens to all IP addresses on the local host. .TP .B \-k, \-\-caps Shows some compile-time options in a machine-readable format. .TP .B \-p, \-\-port Must be followed by a valid port number (between 1 and 65535), and weborf will listen to incoming connection on the specified port. If the port is already used weborf will terminate. To use low port numbers (less than 1024) it is necessary to execute the process as root. Thus it isn't a good idea to run a webserver with root privileges, so it is possible to specify another user. .TP .B \-S, \-\-cert Path to the SSL certificate. Enables https. Requires a key to be passed as well. .TP .B \-K, \-\-key Path to the SSL key. Enables https. Requires a certificate to be passed as well. .TP .B \-V, \-\-virtual Enables weborf to use virtualhosts. The basedir supplied with \-b will be the default one (will be used if the requested host is unknown). Every virtualhost must be in the form host[:port]=basedir. The port must be specified if the port used is different than 80. And the basedir must end with a /. To separate many virtualhosts, use a comma, and avoid spaces. To make weborf use different virtualhosts on different ports, it will be necessary to launch many weborf's processes. This can now be achieved easily by creating multiple configuration files and using the systemd units like weborf@cfgfile.conf .TP .B \-I, \-\-index Must be followed by a list (separated with commas and without spaces) of index files. Weborf will try to load an index file following the order they're listed, and if none is found it will list the content of the directory. In /etc/weborf.conf there is an 'indexes' directive, corresponding to this option. It is used when launching weborf as SystemV daemon. .TP .B \-u, \-\-uid Must be followed by a valid uid, different from 0. Weborf will use this user to do his work, but will bind to the network port with the previous user. This mechanism is meant to let users execute it as root and use port 80, and then let it run without root privileges. .TP .B \-g, \-\-gid Must be followed by a valid gid, different from 0. Weborf will use this user to do his work, but will bind to the network port before changing. .TP .B \-d Runs weborf as a daemon. It will not terminate when its father process terminates, and it will leave the shell free to receive commands. .SS .SH SCRIPTING Weborf is able to send dynamically generated pages using php-cgi (if installed). When a filename ends with ".php", weborf will use php to execute this file before sending it to the client. The \-c switch will override the default behavior. .BR It is also possible to create scripts or binaries in other languages, just read rfc3875 to know how to handle parameters. .SH RETURN VALUE .TP .B 0 Normal termination occurred after a signal, a daemonization or a print version and exit or so on... .TP .B 1 Basedir is not a directory .TP .B 2 Invalid IP address .TP .B 3 Port already in use .TP .B 4 Invalid port number .TP .B 5 Authentication socket doesn't exist or is not a unix socket .TP .B 6 Too many indexes provided as parameter to \-I or to \-c. Increasing MAXINDEXCOUNT in the file options.h and recompiling can solve the problem. But providing a reasonable amount of index file names would be a better solution. .TP .B 7 Unable to allocate memory .TP .B 9 Unable to change UID .TP .B 10 Error with cache directory .TP .B 19 Invalid parameters on command line .SS .SH "SIGNALS" .TP .B SIGUSR1 Prints the internal status of the socket's queue and threads on the standard output .SS .SH "SEE ALSO" .BR weborf.conf(5), php (1) .SH VERSION .BR Weborf 0.13 .SH WEB .BR https://ltworf.codeberg.page/weborf/ .SH AUTHORS .nf Salvo "LtWorf" Tomaselli Salvo Rinaldi .br weborf-1.4/listener.h0000664000175000017500000000203214634465635010340 /* Weborf Copyright (C) 2007 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli @author Giuseppe Pappalardo */ #ifndef WEBORF_LISTENER_H #define WEBORF_LISTENER_H #define NOMEM 7 void init_threads(unsigned int count); void quit(); void print_queue_status(); void set_authsocket(char *); void chn_thread_count(int val); void set_new_uid(int uid); void set_new_gid(int gid); #endif weborf-1.4/webdav.c0000664000175000017500000004147014634465635007767 /* Weborf Copyright (C) 2009-2020 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #include "options.h" #ifdef WEBDAV #include #include #include #include #include #include #include #include #include #include #include #include #include #include "webdav.h" #include "instance.h" #include "mime.h" #include "myio.h" #include "mystring.h" #include "utils.h" #include "cachedir.h" typedef struct { bool getetag :1; bool getcontentlength :1; bool resourcetype :1; bool getlastmodified :1; bool getcontenttype :1; bool deep :1; unsigned type :2; } t_dav_details; typedef union { unsigned int int_version; t_dav_details dav_details; } u_dav_details; extern weborf_configuration_t weborf_conf; extern pthread_key_t thread_key; //key for pthread_setspecific /** This function will create a copy of the source URI into the dest buffer %-escaping it. dest_size specifies the size of the dest buffer */ static inline void escape_uri(char *source, char *dest, int dest_size) { int i; //dest_size must have at least 4 bytes to contain %00\0 for (i=0; source[i]!=0 && dest_size>=4; i++) { //The or with the space changes it to lower case, so there is no need to compare with two ranges if (((source[i] | ' ')>='a' && (source[i] | ' ')<='z' ) || (source[i]>='-' && source[i]<='9')) { dest[0]=source[i]; dest[1]='\0'; dest++; dest_size--; } else { //Prints % followed by 2 digits hex code of the character sprintf(dest,"%%%02x",source[i]); dest+=3; dest_size-=3; } } } /** This function will use the result param prop to return the required props and the value of the Depth header Properties are in the form If something unexpected happens during the xml parsing, ERR_NODATA will be returned. RFC-1518 requires that the xml must be validated and an error MUST be returned to the client if the xml is not valid. This is not the case in this funcion. It will accept many forms of invalid xml. The original string post_param->data will be modified. */ static inline int get_props(connection_t* connection_prop,string_t* post_param,u_dav_details *props) { { //Determining if it is deep or not //props.deep=false; commented because redoundant char a[4]; //Buffer for field's value //Gets the value of content-length header bool r=get_param_value(connection_prop->http_param,"Depth", a,sizeof(a),strlen("Depth")); if (r) { props->dav_details.deep=(a[0]=='1'); } } char *sprops[MAXPROPCOUNT]; //List of pointers to properties if (post_param->len==0) {//No specific prop request, sending everything props->dav_details.getetag=true; props->dav_details.getcontentlength=true; props->dav_details.resourcetype=true; props->dav_details.getlastmodified=true; // props->getcontenttype=false; Commented because redoundant return 0; } //Locates the starting prop tag char*data=strstr(post_param->data,"data,""); if (data==NULL) data=strstr(post_param->data,"data,""); if (data==NULL) { return ERR_NODATA; } data+=6; //Eliminates the 1st useless tag { //Locates the ending prop tag char*end=strstr(data,""); if (end==NULL) end=strstr(data,""); if (end==NULL) { return ERR_NODATA; } end[0]=0; } int i; char *temp, *p_temp; for (i=0; (sprops[i]=strstr(data,"<"))!=NULL; i++,data=temp+1) { if (i==MAXPROPCOUNT-1) {//Reached limit sprops[i]=NULL; break; } sprops[i]+=1; //Removes the < stuff //Removes the /> temp=strstr(sprops[i],"/>"); if (temp==NULL) return ERR_NODATA; temp[0]=0; //Removing if there are parameters to the node p_temp=strstr(sprops[i]," "); if (p_temp!=NULL) { p_temp[0]=0; } } for (i=0; sprops[i]!=NULL; i++) { if (strstr(sprops[i],"getetag")!=NULL) { props->dav_details.getetag=true; } else if (strstr(sprops[i],"getcontentlength")!=NULL) { props->dav_details.getcontentlength=true; } else if (strstr(sprops[i],"resourcetype")!=NULL) { props->dav_details.resourcetype=true; } else if (strstr(sprops[i],"getlastmodified")!=NULL) { //Sends Date props->dav_details.getlastmodified=true; #ifdef SEND_MIMETYPES } else if(strstr(sprops[i],"getcontenttype")!=NULL) { //Sends MIME type props->dav_details.getcontenttype=true; #endif } } return 0; } /** This function sends a xml property to the client. It can be called only by funcions aware of this xml, because it sends only partial xml. If the file can't be opened in readonly mode, this function does nothing. */ static inline int printprops(fd_t sock, char *page, u_dav_details props,char* file,char*filename,bool parent) { struct stat stat_s; char escaped_filename[URI_LEN]; char escaped_page[URI_LEN]; int file_fd = open(file, O_RDONLY); if (file_fd == -1) return 0; fstat(file_fd, &stat_s); escape_uri(filename,escaped_filename,URI_LEN); escape_uri(page,escaped_page,URI_LEN); char* xml = malloc(MAXSCRIPTOUT); int pagesize=0; //Written bytes on the page int maxsize = MAXSCRIPTOUT - 1; //String's max size int printf_s; printf_s = snprintf(xml + pagesize, maxsize, "\n"); maxsize -= printf_s; pagesize += printf_s; { //Sends href of the resource if (parent) { printf_s = snprintf(xml + pagesize, maxsize, "%s", escaped_filename); } else { printf_s = snprintf(xml + pagesize, maxsize, "%s%s", escaped_page, escaped_filename); } maxsize -= printf_s; pagesize += printf_s; } printf_s = snprintf(xml + pagesize, maxsize, ""); maxsize -= printf_s; pagesize += printf_s; if (props.dav_details.getetag) { printf_s = snprintf(xml + pagesize, maxsize, "%lld\n", (long long int)stat_s.st_mtime); maxsize -= printf_s; pagesize += printf_s; } if (props.dav_details.getcontentlength) { printf_s = snprintf(xml + pagesize, maxsize, "%lld\n", (long long int)stat_s.st_size); maxsize -= printf_s; pagesize += printf_s; } if (props.dav_details.resourcetype) {//Directory or normal file const char* type; if (S_ISDIR(stat_s.st_mode)) { type = ""; } else { type = " "; } printf_s = snprintf(xml + pagesize, maxsize, "%s\n", type); maxsize -= printf_s; pagesize += printf_s; } if (props.dav_details.getlastmodified) { //Sends Date struct tm ts; localtime_r(&stat_s.st_mtime,&ts); char prop_buffer[URI_LEN]; strftime(prop_buffer, URI_LEN, "%a, %d %b %Y %H:%M:%S GMT", &ts); printf_s = snprintf(xml + pagesize, maxsize, "%s\n", prop_buffer); maxsize -= printf_s; pagesize += printf_s; } #ifdef SEND_MIMETYPES if(props.dav_details.getcontenttype) { //Sends MIME type thread_prop_t *thread_prop = pthread_getspecific(thread_key); const char* t = mime_get_fd(thread_prop->mime_token, file_fd, &stat_s); printf_s = snprintf(xml + pagesize, maxsize, "%s\n", t); maxsize -= printf_s; pagesize += printf_s; } #endif printf_s = snprintf(xml + pagesize, maxsize, "HTTP/1.1 200 OK" ""); // maxsize -= printf_s; pagesize += printf_s; myio_write(sock, xml, pagesize); free(xml); close(file_fd); return 0; } /** This function serves a PROPFIND request. Can serve both depth and non-depth requests. This funcion works only if authentication is enabled. */ int propfind(connection_t* connection_prop, string_t *post_param) { //Forbids the method if no authentication is in use if (weborf_conf.authsock == NULL) { return ERR_FORBIDDEN; } { //This redirects directory without ending / to directory with the ending / int stat_r=stat(connection_prop->strfile, &connection_prop->strfile_stat); if (stat_r!=0) { return ERR_FILENOTFOUND; } if (S_ISDIR(connection_prop->strfile_stat.st_mode) && !endsWith(connection_prop->strfile,"/",connection_prop->strfile_len,1)) {//Putting the ending / and redirect char head[URI_LEN+12];//12 is the size for the location header snprintf(head,URI_LEN+12,"Location: %s/\r\n",connection_prop->page); send_http_header(301, NULL, head, true, -1, connection_prop); return 0; } } // End redirection u_dav_details props = {0}; props.dav_details.type = 1; //I need to avoid the struct to be fully 0 in each case fd_t dest_fd = connection_prop->sock; const bool has_cache = cache_is_enabled(); int retval=get_props(connection_prop,post_param,&props);//splitting props if (retval!=0) { return retval; } //Sets keep alive to false (have no clue about how big is the generated xml) and sends a multistatus header code connection_prop->keep_alive=false; send_http_header(207, NULL, "Content-Type: text/xml; charset=\"utf-8\"\r\n", false, -1, connection_prop); //Check if exists in cache if (has_cache) { int cache_fd; if ((cache_fd = cache_get_item_fd(props.int_version,connection_prop)) != -1) { //Sends the item stored in the cache struct stat sb; fstat(cache_fd, &sb); fd_copy(fd2fd_t(cache_fd), connection_prop->sock, sb.st_size); close(cache_fd); return 0; } else { //Prepares for storing the item in cache, will be sent afterwards //Get file descriptor of cache file cache_fd = cache_get_item_fd_wr(props.int_version, connection_prop); //If we obtained that descriptor, replace socket with it if (cache_fd != -1) { dest_fd = fd2fd_t(cache_fd); } } } //Sends header of xml response myio_write( dest_fd, "" "", 69); //sends props about the requested file printprops(dest_fd, connection_prop->page, props, connection_prop->strfile, connection_prop->page, true); if (props.dav_details.deep) {//Send children files DIR *dp = opendir(connection_prop->strfile); //Open dir char file[URI_LEN]; struct dirent *entry; if (dp == NULL) {//Error, unable to send because header was already sent if (myio_getfd(connection_prop->sock) != myio_getfd(dest_fd)) close(myio_getfd(dest_fd)); close(myio_getfd(connection_prop->sock)); return 0; } while ((entry=readdir(dp)) != NULL) { //Cycles trough dir's elements #ifdef HIDE_HIDDEN_FILES if (entry->d_name[0]=='.') //doesn't list hidden files continue; #else //Avoids dir . and .. but not all hidden files if (entry->d_name[0]=='.' && (entry->d_name[1]==0 || (entry->d_name[1]=='.' && entry->d_name[2]==0))) continue; #endif snprintf(file, URI_LEN, "%s%s", connection_prop->strfile, entry->d_name); //Sends details about a file printprops(dest_fd, connection_prop->page, props, file, entry->d_name, false); } closedir(dp); } //ends multistatus myio_write(dest_fd, "", 16); /* * If we were able to get a file descriptor for the cache file, and cache is enabled, * at this point the XML has been saved into the cache but not sent to the client, * so now we read from cache and send to the client */ if (has_cache && myio_getfd(dest_fd) != myio_getfd(connection_prop->sock)) { off_t prev_pos = lseek(myio_getfd(dest_fd), 0, SEEK_CUR); //Get size of the file lseek(myio_getfd(dest_fd), 0, SEEK_SET); //Set cursor to the beginning fd_copy(dest_fd, connection_prop->sock, prev_pos); //Send the cache file close(myio_getfd(dest_fd)); } return 0; } /** This funcion should be named mkdir. But standards writers are weird people. */ int mkcol(connection_t* connection_prop) { if (weborf_conf.authsock==NULL) { return ERR_FORBIDDEN; } int res=mkdir(connection_prop->strfile,S_IRWXU | S_IRWXG | S_IRWXO); if (res==0) {//Directory created return OK_CREATED; } //Error switch (errno) { case EACCES: case EFAULT: case ELOOP: case ENAMETOOLONG: return ERR_FORBIDDEN; case ENOMEM: return ERR_SERVICE_UNAVAILABLE; case ENOENT: return ERR_CONFLICT; case EEXIST: case ENOTDIR: return ERR_NOT_ALLOWED; case ENOSPC: case EROFS: case EPERM: return ERR_INSUFFICIENT_STORAGE; } return ERR_SERVICE_UNAVAILABLE; //Make gcc happy } /** Webdav method copy. */ int copy_move(connection_t* connection_prop) { struct stat f_prop; //File's property bool check_exists=false; int retval=0; bool exists; char* host=malloc(3*PATH_LEN+12); if (host==NULL) { return ERR_NOMEM; } char* dest=host+PATH_LEN; char* overwrite=dest+PATH_LEN; char* destination=overwrite+2; //If the file has the same date, there is no need of sending it again bool host_b=get_param_value(connection_prop->http_param,"Host",host,PATH_LEN,strlen("Host")); bool dest_b=get_param_value(connection_prop->http_param,"Destination",dest,PATH_LEN,strlen("Destination")); bool overwrite_b=get_param_value(connection_prop->http_param,"Overwrite",overwrite,PATH_LEN,strlen("Overwrite")); if (host_b && dest_b == false) { //Some important header is missing retval=ERR_NOTHTTP; goto escape; } // Overwrite can only be "T" or "F" if (overwrite_b && (!(overwrite[0] == 'T' || overwrite[0] == 'F') || overwrite[1] != '\0')) { retval = ERR_NOTHTTP; goto escape; } /*Sets if there is overwrite or not. ovewrite header is a boolean where F is false. */ if (overwrite_b) { check_exists=(overwrite[0]!='F'); } //Destination might be like http://localhost/destination or just /destination if (dest[0] != '/') { dest=strstr(dest, host); if (dest == NULL) {//Something is wrong here retval = ERR_NOTHTTP; goto escape; } dest += strlen(host); } //Local path for destination file snprintf(destination,PATH_LEN,"%s%s",connection_prop->basedir,dest); if (strcmp(connection_prop->strfile,destination)==0) {//same retval=ERR_FORBIDDEN; goto escape; } exists=file_exists(destination); //Checks if the file already exists if (check_exists && exists) { retval=ERR_PRECONDITION_FAILED; goto escape; } stat(connection_prop->strfile, &f_prop); if (S_ISDIR(f_prop.st_mode)) { //Directory if (connection_prop->method_id==COPY) { retval=dir_copy(connection_prop->strfile,destination); } else {//Move retval=dir_move(connection_prop->strfile,destination); } } else { //Normal file if (connection_prop->method_id==COPY) { retval=file_copy(connection_prop->strfile,destination); } else {//Move retval=file_move(connection_prop->strfile,destination); } } if (retval==0) { retval=exists?OK_NOCONTENT:OK_CREATED; } escape: free(host); return retval; } #endif weborf-1.4/Makefile.am0000664000175000017500000000414114634622237010372 #SUBDIRS = bin_PROGRAMS = weborf weborf_SOURCES = \ auth.c \ base64.c \ buffered_reader.c \ cachedir.c \ cgi.c \ configuration.c \ instance.c \ listener.c \ mime.c \ myio.c \ mynet.c \ mystring.c \ queue.c \ utils.c \ webdav.c EXTRA_DIST = \ auth.h \ buffered_reader.h \ cgi.h \ configuration.h \ instance.h \ mime.h \ mynet.h \ types.h \ webdav.h \ base64.h \ cachedir.h \ embedded_auth.h \ listener.h \ myio.h \ mystring.h \ queue.h \ utils.h \ examples \ daemon \ weborf.conf \ testsuite/* \ qweborf/qweborf/__init__.py \ qweborf/qweborf/main.ui \ qweborf/qweborf/nhelper.py \ qweborf/qweborf/whelper.py \ qweborf/qweborf/qweborf.py \ qweborf/qweborf/qweborf \ qweborf/man/qweborf.1 \ qweborf/integration/qweborf.png \ qweborf/integration/qweborf.desktop \ qweborf/integration/qweborf_servicemenu.desktop \ qweborf/integration/qweborf.metainfo.xml \ qweborf/setup.py \ qweborf/Makefile dist-hook: rm -rf `find $(distdir)/ -name .git` install-data-local: install -d echo $(DESTDIR)/etc/weborf.d ln -s ../weborf.conf $(DESTDIR)/etc/weborf.d/weborf.conf install -D -m644 daemon/weborf.service $(DESTDIR)/usr/lib/systemd/system/weborf.service install -D -m644 daemon/weborf@.service $(DESTDIR)/usr/lib/systemd/system/weborf@.service install -D daemon/weborf-generator $(DESTDIR)/usr/lib/systemd/system-generators/weborf-generator install-data-hook: chmod a+x $(DESTDIR)$(datadir)/weborf/weborf_launcher dist_man_MANS = weborf.1 weborf.conf.5 init_SCRIPTS = daemon/weborf pkgdata_DATA = daemon/weborf_launcher sysconf_DATA = weborf.conf dist_doc_DATA = \ CHANGELOG \ Credits \ README.md \ TODOlist TESTS = \ testsuite/version_and_help \ testsuite/site1http \ testsuite/site1https \ testsuite/ip_listener \ testsuite/etag \ testsuite/index_file \ testsuite/range \ testsuite/cgi \ testsuite/cachedir \ testsuite/site1mimetype \ testsuite/vhost \ testsuite/functions.sh weborf-1.4/README.md0000664000175000017500000000130614634465635007624 User friendly webserver qweborf ======= Provides a GUI to share local files. It can do NAT traversal to share files outside of the local network. Can enable authentication and sending directories as `.tar.gz` files. weborf ====== The web server used by qweborf. Can be used from inetd, supports WebDAV, caching, CGI, virtual hosts. Compile ======= These are the steps to compile weborf. ``` autoreconf -f -i # Only if you cloned from git make clean ./configure make ``` To compile qweborf. ``` pyuic5 qweborf/main.ui > qweborf/main.py ``` Run === ``` ./weborf ``` qweborf: will look for weborf in the PATH. ``` python3 -m qweborf ``` Donate ====== [Donate](https://liberapay.com/ltworf/donate) weborf-1.4/buffered_reader.h0000664000175000017500000000262214634465635011624 /* Weborf Copyright (C) 2009-2018 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #ifndef BUFFERED_READER_H #define BUFFERED_READER_H #include #include #include "types.h" typedef struct { char *buffer; //Buffer where the reader stores the read data char *start; //Pointer to non-consumed data char *end; //Pointer to 1st byte after end of the data. A read must continue after end. int size; //Size of the buffer } buffered_read_t; void buffer_reset (buffered_read_t * buf); int buffer_init(buffered_read_t * buf, ssize_t size); void buffer_free(buffered_read_t * buf); ssize_t buffer_read(fd_t fd, void *b, ssize_t count, buffered_read_t * buf); size_t buffer_strstr(fd_t fd, buffered_read_t * buf, char * needle); #endif weborf-1.4/configure0000775000175000017500000064445614647273511010271 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for weborf 1.4. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: tiposchi@tiscali.it about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='weborf' PACKAGE_TARNAME='weborf' PACKAGE_VERSION='1.4' PACKAGE_STRING='weborf 1.4' PACKAGE_BUGREPORT='tiposchi@tiscali.it' PACKAGE_URL='' ac_unique_file="queue.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_func_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS host_os host_vendor host_cpu host build_os build_vendor build_cpu build EGREP GREP CPP initdir cgibindir am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_dependency_tracking enable_largefile ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures weborf 1.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/weborf] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of weborf 1.4:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-largefile omit support for large files Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor 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 ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF weborf configure 1.4 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by weborf $as_me 1.4, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*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 do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' // Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" as_fn_append ac_header_c_list " vfork.h vfork_h HAVE_VFORK_H" as_fn_append ac_func_c_list " fork HAVE_FORK" as_fn_append ac_func_c_list " vfork HAVE_VFORK" # Auxiliary files required by this configure script. ac_aux_files="config.guess config.sub compile missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}/build-aux" # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else $as_nop if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$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' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='weborf' VERSION='1.4' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test ${enable_maintainer_mode+y} then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else $as_nop USE_MAINTAINER_MODE=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ac_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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; 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 ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 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 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi cgibindir=${libdir}/cgi-bin initdir=${sysconfdir}/init.d ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" if test "x$ac_cv_header_arpa_inet_h" = xyes then : printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" if test "x$ac_cv_header_fcntl_h" = xyes then : printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" if test "x$ac_cv_header_netdb_h" = xyes then : printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" if test "x$ac_cv_header_netinet_in_h" = xyes then : printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes then : printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes then : printf "%s\n" "#define HAVE_STRING_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default" if test "x$ac_cv_header_strings_h" = xyes then : printf "%s\n" "#define HAVE_STRINGS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" if test "x$ac_cv_header_sys_file_h" = xyes then : printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" if test "x$ac_cv_header_sys_socket_h" = xyes then : printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default" if test "x$ac_cv_header_syslog_h" = xyes then : printf "%s\n" "#define HAVE_SYSLOG_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes then : printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "alarm" "ac_cv_func_alarm" if test "x$ac_cv_func_alarm" = xyes then : printf "%s\n" "#define HAVE_ALARM 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "inet_ntoa" "ac_cv_func_inet_ntoa" if test "x$ac_cv_func_inet_ntoa" = xyes then : printf "%s\n" "#define HAVE_INET_NTOA 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r" if test "x$ac_cv_func_localtime_r" = xyes then : printf "%s\n" "#define HAVE_LOCALTIME_R 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" if test "x$ac_cv_func_memmove" = xyes then : printf "%s\n" "#define HAVE_MEMMOVE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" if test "x$ac_cv_func_memset" = xyes then : printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "mkdir" "ac_cv_func_mkdir" if test "x$ac_cv_func_mkdir" = xyes then : printf "%s\n" "#define HAVE_MKDIR 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "putenv" "ac_cv_func_putenv" if test "x$ac_cv_func_putenv" = xyes then : printf "%s\n" "#define HAVE_PUTENV 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "rmdir" "ac_cv_func_rmdir" if test "x$ac_cv_func_rmdir" = xyes then : printf "%s\n" "#define HAVE_RMDIR 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv" if test "x$ac_cv_func_setenv" = xyes then : printf "%s\n" "#define HAVE_SETENV 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" if test "x$ac_cv_func_socket" = xyes then : printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strstr" "ac_cv_func_strstr" if test "x$ac_cv_func_strstr" = xyes then : printf "%s\n" "#define HAVE_STRSTR 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" if test "x$ac_cv_func_strtol" = xyes then : printf "%s\n" "#define HAVE_STRTOL 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul" if test "x$ac_cv_func_strtoul" = xyes then : printf "%s\n" "#define HAVE_STRTOUL 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate" if test "x$ac_cv_func_ftruncate" = xyes then : printf "%s\n" "#define HAVE_FTRUNCATE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strrchr" "ac_cv_func_strrchr" if test "x$ac_cv_func_strrchr" = xyes then : printf "%s\n" "#define HAVE_STRRCHR 1" >>confdefs.h fi # Check whether --enable-largefile was given. if test ${enable_largefile+y} then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 printf %s "checking for special C compiler options needed for large files... " >&6; } if test ${ac_cv_sys_largefile_CC+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : break fi rm -f core conftest.err conftest.$ac_objext conftest.beam CC="$CC -n32" if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if test ${ac_cv_sys_file_offset_bits+y} then : printf %s "(cached) " >&6 else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } if test ${ac_cv_sys_large_files+y} then : printf %s "(cached) " >&6 else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 printf "%s\n" "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h ;; esac rm -rf conftest* fi fi ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes then : printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 printf %s "checking for stdbool.h that conforms to C99... " >&6; } if test ${ac_cv_header_stdbool_h+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef __bool_true_false_are_defined #error "__bool_true_false_are_defined is not defined" #endif char a[__bool_true_false_are_defined == 1 ? 1 : -1]; /* Regardless of whether this is C++ or "_Bool" is a valid type name, "true" and "false" should be usable in #if expressions and integer constant expressions, and "bool" should be a valid type name. */ #if !true #error "'true' is not true" #endif #if true != 1 #error "'true' is not equal to 1" #endif char b[true == 1 ? 1 : -1]; char c[true]; #if false #error "'false' is not false" #endif #if false != 0 #error "'false' is not equal to 0" #endif char d[false == 0 ? 1 : -1]; enum { e = false, f = true, g = false * true, h = true * 256 }; char i[(bool) 0.5 == true ? 1 : -1]; char j[(bool) 0.0 == false ? 1 : -1]; char k[sizeof (bool) > 0 ? 1 : -1]; struct sb { bool s: 1; bool t; } s; char l[sizeof s.t > 0 ? 1 : -1]; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ bool m[h]; char n[sizeof m == h * sizeof m[0] ? 1 : -1]; char o[-1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ bool p = true; bool *pp = &p; /* C 1999 specifies that bool, true, and false are to be macros, but C++ 2011 and later overrule this. */ #if __cplusplus < 201103 #ifndef bool #error "bool is not defined" #endif #ifndef false #error "false is not defined" #endif #ifndef true #error "true is not defined" #endif #endif /* If _Bool is available, repeat with it all the tests above that used bool. */ #ifdef HAVE__BOOL struct sB { _Bool s: 1; _Bool t; } t; char q[(_Bool) 0.5 == true ? 1 : -1]; char r[(_Bool) 0.0 == false ? 1 : -1]; char u[sizeof (_Bool) > 0 ? 1 : -1]; char v[sizeof t.t > 0 ? 1 : -1]; _Bool w[h]; char x[sizeof m == h * sizeof m[0] ? 1 : -1]; char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; _Bool z = true; _Bool *pz = &p; #endif int main (void) { bool ps = &s; *pp |= p; *pp |= ! p; #ifdef HAVE__BOOL _Bool pt = &t; *pz |= z; *pz |= ! z; #endif /* Refer to every declared value, so they cannot be discarded as unused. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + !l + !m + !n + !o + !p + !pp + !ps #ifdef HAVE__BOOL + !q + !r + !u + !v + !w + !x + !y + !z + !pt #endif ); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_stdbool_h=yes else $as_nop ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } if test $ac_cv_header_stdbool_h = yes; then printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes then : else $as_nop printf "%s\n" "#define off_t long int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : else $as_nop printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes then : else $as_nop printf "%s\n" "#define ssize_t int" >>confdefs.h 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 else $as_nop # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" 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. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else $as_nop # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else $as_nop # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 printf "%s\n" "$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. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else $as_nop # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else $as_nop # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 printf %s "checking for uid_t in sys/types.h... " >&6; } if test ${ac_cv_type_uid_t+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1 then : ac_cv_type_uid_t=yes else $as_nop ac_cv_type_uid_t=no fi rm -rf conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 printf "%s\n" "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then printf "%s\n" "#define uid_t int" >>confdefs.h printf "%s\n" "#define gid_t int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default " if test "x$ac_cv_type_pid_t" = xyes then : else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _WIN64 && !defined __CYGWIN__ LLP64 #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_pid_type='int' else $as_nop ac_pid_type='__int64' fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h fi ac_func= for ac_item in $ac_func_c_list do if test $ac_func; then ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then echo "#define $ac_item 1" >> confdefs.h fi ac_func= else ac_func=$ac_item fi done if test "x$ac_cv_func_fork" = xyes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 printf %s "checking for working fork... " >&6; } if test ${ac_cv_func_fork_works+y} then : printf %s "(cached) " >&6 else $as_nop if test "$cross_compiling" = yes then : ac_cv_func_fork_works=cross else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main (void) { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_fork_works=yes else $as_nop ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 printf %s "checking for working vfork... " >&6; } if test ${ac_cv_func_vfork_works+y} then : printf %s "(cached) " >&6 else $as_nop if test "$cross_compiling" = yes then : ac_cv_func_vfork_works=cross else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #include #ifdef HAVE_VFORK_H # include #endif static void do_nothing (int sig) { (void) sig; } /* 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 sparc_address_test (int arg) { 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 (void) { pid_t parent = getpid (); pid_t child; sparc_address_test (0); /* On Solaris 2.4, changes by the child to the signal handler also munge signal handlers in the parent. To detect this, start by putting the parent's handler in a known state. */ signal (SIGTERM, SIG_DFL); 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); /* Alter the child's signal handler. */ if (signal (SIGTERM, do_nothing) != SIG_DFL) _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) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child munge the parent's signal handler? */ || signal (SIGTERM, SIG_DFL) != SIG_DFL /* 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 if ac_fn_c_try_run "$LINENO" then : ac_cv_func_vfork_works=yes else $as_nop ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 printf "%s\n" "$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 printf "%s\n" "#define HAVE_WORKING_VFORK 1" >>confdefs.h else printf "%s\n" "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then printf "%s\n" "#define HAVE_WORKING_FORK 1" >>confdefs.h fi # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 printf %s "checking for GNU libc compatible malloc... " >&6; } if test ${ac_cv_func_malloc_0_nonnull+y} then : printf %s "(cached) " >&6 else $as_nop if test "$cross_compiling" = yes then : case "$host_os" in # (( # Guess yes on platforms where we know the result. *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ | hpux* | solaris* | cygwin* | mingw* | msys* ) ac_cv_func_malloc_0_nonnull=yes ;; # If we don't know, assume the worst. *) ac_cv_func_malloc_0_nonnull=no ;; esac else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { void *p = malloc (0); int result = !p; free (p); return result; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_malloc_0_nonnull=yes else $as_nop ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes then : printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h else $as_nop printf "%s\n" "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac printf "%s\n" "#define malloc rpl_malloc" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 printf %s "checking for inline... " >&6; } if test ${ac_cv_c_inline+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo (void) {return 0; } $ac_kw foo_t foo (void) {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 printf "%s\n" "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 printf %s "checking for pthread_create in -lpthread... " >&6; } if test ${ac_cv_lib_pthread_pthread_create+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char pthread_create (); int main (void) { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_pthread_pthread_create=yes else $as_nop ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 printf "%s\n" "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes then : printf "%s\n" "#define HAVE_LIBPTHREAD 1" >>confdefs.h LIBS="-lpthread $LIBS" else $as_nop \ as_fn_error $? "libpthread is needed" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for magic_load in -lmagic" >&5 printf %s "checking for magic_load in -lmagic... " >&6; } if test ${ac_cv_lib_magic_magic_load+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lmagic $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char magic_load (); int main (void) { return magic_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_magic_magic_load=yes else $as_nop ac_cv_lib_magic_magic_load=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_magic_magic_load" >&5 printf "%s\n" "$ac_cv_lib_magic_magic_load" >&6; } if test "x$ac_cv_lib_magic_magic_load" = xyes then : printf "%s\n" "#define HAVE_LIBMAGIC 1" >>confdefs.h LIBS="-lmagic $LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for RAND_add in -lcrypto" >&5 printf %s "checking for RAND_add in -lcrypto... " >&6; } if test ${ac_cv_lib_crypto_RAND_add+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char RAND_add (); int main (void) { return RAND_add (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_crypto_RAND_add=yes else $as_nop ac_cv_lib_crypto_RAND_add=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_RAND_add" >&5 printf "%s\n" "$ac_cv_lib_crypto_RAND_add" >&6; } if test "x$ac_cv_lib_crypto_RAND_add" = xyes then : printf "%s\n" "#define HAVE_LIBCRYPTO 1" >>confdefs.h LIBS="-lcrypto $LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl" >&5 printf %s "checking for SSL_new in -lssl... " >&6; } if test ${ac_cv_lib_ssl_SSL_new+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char SSL_new (); int main (void) { return SSL_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ssl_SSL_new=yes else $as_nop ac_cv_lib_ssl_SSL_new=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_new" >&5 printf "%s\n" "$ac_cv_lib_ssl_SSL_new" >&6; } if test "x$ac_cv_lib_ssl_SSL_new" = xyes then : printf "%s\n" "#define HAVE_LIBSSL 1" >>confdefs.h LIBS="-lssl $LIBS" fi #AC_CONFIG_HEADERS([config.h options.h]) ac_config_files="$ac_config_files Makefile options.h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by weborf $as_me 1.4, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ weborf config.status 1.4 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "options.h") CONFIG_FILES="$CONFIG_FILES options.h" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi weborf-1.4/weborf.conf0000664000175000017500000000223714634465635010504 # /etc/weborf.conf - configuration file for weborf(1) # see weborf.conf(5) for details on this file # #Index files. This list is ordered by priority. If not set, the default value will be index.html. #indexes=index.html,index.php # Comment this to not start this unit automatically. # Only works with systemd start=auto # Base directory. basedir=/srv/www/ # Enables or disables use of CGI support use-cgi=false #Enable weborf to send Content-Type header use-mime=true # Tells weborf which binary it has to use to execute a certain dynamic page # default value: .php,/usr/lib/cgi-bin/php5,.py, #cgi=.php,/usr/lib/cgi-bin/php5,.py,/usr/lib/cgi-bin/weborf_py_wrapper,.cgi, # Authentication #auth-socket=/var/run/weborf.auth # User that will be used to run the process. user=www-data group=www-data # Directory that will be used for the cached files cachedir=/var/cache/weborf # Port used to listen port=80 # SSL cert. Change port to 443 when using ssl #key=/path/to/key #cert=/path/to/cert # Virtualhosts. Read manpage for more details. # Examples # This line will enable two hosts named "localhost" and "serverq.com" #virtual=localhost=/var/www/,serverq.com=/var/www-alt/ weborf-1.4/cachedir.h0000664000175000017500000000226014634465635010260 /* Weborf Copyright (C) 2010-2020 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #ifndef WEBORF_CACHEDIR_H #define WEBORF_CACHEDIR_H #include "types.h" bool cache_send_item(unsigned int uprefix,connection_t* connection_prop); int cache_get_item_fd(unsigned int uprefix,connection_t* connection_prop); int cache_get_item_fd_wr(unsigned int uprefix,connection_t *connection_prop); void cache_store_item(unsigned int uprefix,connection_t* connection_prop, char *content, size_t content_len); void cache_init(char *dir); bool cache_is_enabled(); #endif weborf-1.4/CHANGELOG0000664000175000017500000002653714647273321007565 1.4 * Update qweborf to use pyqt6 1.3 * Move qweborf in /usr/bin/ 1.2 - Move /lib to /usr/lib - Drop NoNewPrivileges from the .service file 1.1 - Move to codeberg 1.0 - I declare weborf is now stable! - Fix a security bug where the path for CGI scripts was not null-terminated in certain configurations (CVE-2023-46586) 0.20 - restyle qweborf to fit on a mobile screen - ignore Content-Type header in PUT requests, instead of failing 0.19 - qweborf can store the default settings 0.18 - Wait for weborf to create socket in testsuite - Add an icon for qweborf (copied from Oxygen) - Appstream metainfo file for qweborf 0.17 - Fix MOVE and COPY methods to support relative URI - Fix parsing issues in the daemon startup script - Test suite added - Add github workflows to run tests - Improve compatibility with range requests - Set conent length for redirection responses - Partially fix deadlock possibility while running a CGI page - Pass CGI filename as parameter - Fix error where responses with size 0 would cause timeouts 0.16 - qweborf has a normal makefile - Authentication example comes with a systemd file - CGI wrappers eliminated - CGI disabled by default - Default basedir to /srv/www - Bug: webdav reported wrong file size on certain architectures 0.15 - Finally support https - Support systemd. It's now easy to run several weborf instances. - Can set certificate with qweborf - Various bugfixes 0.14 - Use one less thread - Use smaller thread pool - Detaches when connections can be accepted (can now use Type=forking in systemd) - Log some cases of bad request - Bug: fixes issue with authentication request causing further requests on the same connection to fail - Reduced memory footprint for webdav requests - Bug: memory corruption error, only triggered with some gcc flags 0.13.5 - Added --gid option to change gid - Improved handling of reserved characters in URI - ContentType in directory listing - Improved code to create the socket 0.13.4 - Workaround API breaking in PyQt - Improvements in directory listing - Convert things to string before showing them in qweborf 0.13.3 - Better desktop integration for qweborf 0.13.2 - Fix base64 decoding bug 0.13.1 - Port qweborf to Python3 and Qt5 0.13 - Shows last modified column in directory listing (Rev 419) - Webdav module can send mimetype - Bug: fixes denial of service in case of malformed header range (Rev 429) - Bug: ported fix from 0.12.2 - Faster listing of directories with several hidden files - PROPFIND now gives %-escaped URIs (Rev 444) - Improved handling of Connection header in responses - Sends reason phrase in HTTP response - Directory listing can be cached on disk - Can support large files - Added GiB measure in directory listing - Ported fix from 0.12.3 (Rev. 465) - Reduced number of params for functions - Uses pthread calls for TLS instead of relying on __thread that doesn't work on OsX - Dav's PROPFIND with different required properties can be cached on disk - Can send Content-Type - Can be used with inetd/xinetd - Fixes crash on invalid request (Rev 492) - Will no longer terminate on failed accept - Heavy code refactory - Webdav method MOVE is now faster on directories - Support for embedded authentication policy - Support for If-Range header (Rev 516) - Migrated to GNU autotools - Now logs HTTP status code for each request - Ships qweborf: QT GUI for simple file sharing - Truncates files on PUT - Can send directories as tar.gz files 0.12.5 - Fixes DoS occurring with malformed fields in HTTP request 0.12.4 - Fixes DoS occurring on malformed HTTP request, backported from trunk 0.12.3 - Fixes directory traversal vulnerability 0.12.2 - Fixes DoS occurring when wide chars are used in some headers 0.12.1 - Fixes DoS occurring on malformed Range header, backported from trunk 0.12 - Fixed bug: now threads are closed again (Rev 305) - Using keep-alive with CGI only in case of small pages (Rev 306) - Reduced maximum size of generated pages (Rev 307) - Adjusted size of the buffers (Rev 307) - ETag headers are now sent only if the resource is static (Rev 308) - "Moved permanently" code is returned instead of "see other" when client requests directory without ending / (Rev 209) - Added wrapper for CGI python, which replaces the previous one (Rev 312) - Support for custom CGI formats - LSB tags added to the init script (Rev 323) - Support to PUT,DELETE,OPTIONS methods - Fixed bug: some file descriptors caused thread's termination (Rev 341) - Added wrapper for executables CGIs - Stub for webdav - Implemented MKCOL, COPY, MOVE methods - Bug: socket were closed randomly on non GET/POST methods - Bug: tamed buffers do not affect subsequent connections on the same thread - Daemon is able to start authentication server too, reading about it from weborf.conf (Rev 359) - Better and more resistant xml parsing of PROPFIND requests (Rev 363) - Bug: addresses are properly converted into strings (Rev 373) - CGI does chdir into script's directory (Rev 374) - Enables logging - Uses reentrant version of readdir (Rev 381) - Added more controls on memory allocation - Bug: buffer size corrected in queue.c - Logs insufficient memory - Can compile on OpenSolaris (manual edit of Makefile is needed) - Edited instance.h to workarond OpenSolaris bug #6775831 - Can use SIGUSR1 to print internal status on stdout - Edited daemon script to pass the new lintian's test - Attempt to resolve race-condition by refactoring - Changed astyle parameters to use the new version - Sorts content of directories when generating html index - Bug: replaced unsafe sprintf with snprintf (Rev 415) 0.11 - Support for ETag header - Support for If-None-Match header. Weborf will not re-send files that are cached into the browser - Cleaned up some send_header functions - Fixed bug: malformed range header was able to cause segfault (Rev 251) - Support for Last-Modified header (Rev 252) - Introduced optimizations in parsing request and sending an header - Code refactory to reduce amount of passed parameters - Will now send connection header if an old client is using keep-alive - Corrected sending post data to cgi-bin - Fixed REQUEST_URI header which was broken some revisions ago - Doesn't send CGI errors and warning to the client anymore - Shows CGI errors on standard error, but an option in options.h can hide them - Optimizations in CGI - Reduced system calls number - Reduced number of strlen and strstr - Fixed warnings in manpages 0.10 - Pipe with scripts are now closed - Support for cgi-php - Fixed some possibilities of buffer overflow - Enlarged default head's buffer, necessary for script generated headers - When the script is terminated for timeout, error 500 is sent to the client - Fixed error in cgi wrapper that didn't allow to use \r\n\r\n sequence in output - Compile on MacOsX without needing to edit the code - Embedded support for cgi - Support for list of index files - List of index files changable in weborf.conf - Refactory of code to send/execute pages and generate dir listing - Changed default optimizations - Support for virtualhost - Support for virtualhost in weborf.conf - Support for gzip encoding, when supported by client - Support for enabling/disabling cgi from weborf.conf - Heavy optimization in finding the end of the header - Added a buffered reader to reduce the overall amount of read syscalls - Replaced deprecated inet_ntoa with its replacement inet_ntop - POST can read binary data, with 0 bytes in the stream - Correct passing POST data to script. It brokes php since it has a bug, reported as #47825 - Added support to timeout - Addresses are converted in strings in threads instead of main thread. - Added manpage for weborf.conf - Queue does less operations on memory (rev 231) - Changed authentication from child process to unix socket (rev 232) - Partial (but enough) support for range headers (rev 235) - Solved problem which caused 100% cpu usage (Salvo Rinaldi) - Solved problem which caused partial resending of files - Removed redoundant conditions to free memory (Angelo Puglisi) 0.9 - Bug: fixed size hadling of NBUFFER - Reduced standard size of NBUFFER - Make install installs weborf as a daemon executable by init - Switch to compile using ipv4 or ipv6 - Memory leak fixed - Bug: can now handle firefox's post requests - Bug: no more segmentation fault on post requests issued by squid - Handles pipelined and not-pipelined requests - Timeout for scripts (not auth scripts) - Bug: buffer for requests is now reset after every request - Increased speed for identify request - Bug: unsigned value used when signed was needed - Bug: parameters within HTTP requests are now read correctly - Changed buffer allocation for string IP addresses in IPv4 mode - Possibility to use scripts as normal files - Exit codes now have a meaning (documented in manpage) 0.8 - Improved file listing - Added support for large files - Bug: Now authentication works even with spaces within file or directory's names - Prepared handling for content-length - Bug: POST works again - Maximum size for POST requests 0.7 - Escape sequences in POST requests are now correctly handled - Daemon mode added - Memory leak removed - Support for Basic authentication - Parsing program arguments with getopt - IPv6 support - Improved file listing - Changed thread policy: Now the MAXTHREAD number can be reached, because the last group of threads can be smaller - Some small changes to make it faster - Improved handling several requests on the same connection. It SHOULD work better now. 0.6 - Added comments - Improved speed on string operations - Memory leak corrected in script execution and page sending - Added control on non http messages - Reduced the use of mutex during thread creation - Improved signal handling - Reduced malloc's total number, this will increase speed - Uses printf's return value instead of strlen() - Corrected directory listing. Now doesn't show link to parent if already in parent directory. - Directory listing doesn't show link to self anymore. - Cleaned up logging. It will hide many informations by default - Now threads are aware of client's IP address 0.5 - Bug: active thread's counter was not reduced on thread's termination - Logs dropped connections due to not enough threads - Handles escape's sequences in url - Fixed a warning occurred in amd64 architecture - Improved list's generation for directories without index - Bug: directories without the ending / are now listed correctly - Added stub (not working) for authentication request - HTTP's request parameters are passed as enviromentals vars to the scripts - Added experimental support to POST method, and use of enviromental vars 0.4 - Bug: Relative paths can't be used, so the client can't go outside the basedir - Support for files with spaces in the name - Bug: Added checks on memory allocation failures, and in this case send an error to the client - Changed error's sending system - Threads are detached - Added a thread to monitor how many free threads there are, to stop some if there are too much - manpage added - Added make install, to copy the binary in /usr/local/bin and install manpage - It is possible to start weborf as root to use a low port number and then change the user 0.3 - Only a few threads are created when started. More are started when there are too few free ones - Index page is loaded automatically, even when not specified in the URL - When index file is missing, a list of file is dinamically generated, showing all regular files and directories (FIFO, devices and sockets aren't shown) - Handles command line parameters weborf-1.4/buffered_reader.c0000664000175000017500000001045214634465635011617 /* Weborf Copyright (C) 2009-2018 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #include "options.h" #include #include #include #include #include "buffered_reader.h" #include "myio.h" /** This funcion inits the struct allocating a buffer of the specified size. It will return 0 on success and 1 on fail. */ int buffer_init(buffered_read_t* buf, ssize_t size) { buf->buffer = malloc(sizeof(char) * size); buf->size = size; buffer_reset(buf); return (buf->buffer == NULL) ? 1 : 0; } /** Resets the pointers, so the buffer is ready for new reads on new file descriptor */ void buffer_reset (buffered_read_t * buf) { buf->end = buf->start = buf->buffer; } /** This function will free the memory allocated by the buffer used in the struct. */ void buffer_free(buffered_read_t * buf) { free(buf->buffer); } static ssize_t buffer_fill(fd_t fd, buffered_read_t * buf) { ssize_t r; buf->start = buf->buffer; //Timeout implementation struct pollfd monitor[1]; monitor[0].fd = myio_getfd(fd); //File descriptor to monitor monitor[0].events = POLLIN; //Monitor on input events //Waits the timeout or reads the data. //If timeout is reached and no input is available //will behave like the stream is closed. if (poll(monitor, 1, READ_TIMEOUT) == 0) { r = 0; } else { r = myio_read(fd, buf->buffer, buf->size); } if (r <= 0) { //End of the stream buf->end = buf->start; } else { buf->end = buf->start + r; } return r; } /** This function is designed to be similar to a normal read, but it uses an internal buffer. When the buffer is empty, it will try to fill it. An important difference from the normal read is that this function will wait until the requested amount of bytes are available, or until the timeout occurs. Timeout duration is defined with the READ_TIMEOUT define. On some special cases, the read data could be less than the requested one. For example if end of file is reached and it is impossible to do further reads. */ ssize_t buffer_read(fd_t fd, void *b, ssize_t count, buffered_read_t * buf) { ssize_t wrote = 0; //Count of written bytes ssize_t available, needed; //Available bytes in buffer, and requested bytes remaining while (wrote < count) { available = buf->end - buf->start; needed = count - wrote; if (needed <= available) { //More data in buffer than needed memcpy(b, buf->start, needed); buf->start += needed; return wrote + needed; } else { //Requesting more data than available if (available > 0) {//Empty the remaining data in the buffer memcpy(b, buf->start, available); b += available; wrote += available; } //Filing the buffer again if (buffer_fill(fd,buf) <= 0) { //End of the stream return wrote; } } } /*while */ return wrote; } /** * This function returns how many bytes must be read in order to * read enough data for it to end with the string needle. * strlen(needle) must be added to the returned value to include the * needle string in the result of the read. * * If the string needle is not in the buffer then the entire size * of the data present in cache will be return. * */ size_t buffer_strstr(fd_t fd, buffered_read_t * buf, char * needle) { if (buf->end - buf->start==0) { buffer_fill(fd,buf); } buf->end[0]=0; char *r=strstr(buf->start,needle); if (r==NULL) { return buf->end - buf->start; } else { return r-buf->start; } } weborf-1.4/build-aux/0000775000175000017500000000000014647273516010316 5weborf-1.4/build-aux/compile0000755000175000017500000001635014647273512011613 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: weborf-1.4/build-aux/install-sh0000755000175000017500000003577614647273512012256 #!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: weborf-1.4/build-aux/config.sub0000755000175000017500000010511614647273512012217 #! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-01-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 basic_os=$field2 ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 basic_os= ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; convex-c1) basic_machine=c1-convex basic_os=bsd ;; convex-c2) basic_machine=c2-convex basic_os=bsd ;; convex-c32) basic_machine=c32-convex basic_os=bsd ;; convex-c34) basic_machine=c34-convex basic_os=bsd ;; convex-c38) basic_machine=c38-convex basic_os=bsd ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next case $basic_os in openstep*) ;; nextstep*) ;; ns2*) basic_os=nextstep2 ;; *) basic_os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x$basic_os != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ | linux-musl* | linux-relibc* | linux-uclibc* ) ;; uclinux-uclibc* ) ;; -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 exit 1 ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) ;; nto-qnx*) ;; os2-emx) ;; *-eabi* | *-gnueabi*) ;; -*) # Blank kernel with real OS is always fine. ;; *-*) echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos*) vendor=sun ;; *-cnk* | *-aix*) vendor=ibm ;; *-beos*) vendor=be ;; *-hpux*) vendor=hp ;; *-mpeix*) vendor=hp ;; *-hiux*) vendor=hitachi ;; *-unos*) vendor=crds ;; *-dgux*) vendor=dg ;; *-luna*) vendor=omron ;; *-genix*) vendor=ns ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) vendor=ibm ;; *-ptx*) vendor=sequent ;; *-tpf*) vendor=ibm ;; *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; *-aux*) vendor=apple ;; *-hms*) vendor=hitachi ;; *-mpw* | *-macos*) vendor=apple ;; *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; *-vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: weborf-1.4/build-aux/config.guess0000755000175000017500000014051214647273512012553 #! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # Just in case it came from the environment. GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case $UNAME_VERSION in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if test "$HP_ARCH" = hppa2.0w then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null then LIBCABI=${LIBC}x32 fi fi GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. GUESS=i386-sequent-sysv4 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; x86_64:Haiku:*:*) GUESS=x86_64-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "${cputype-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: weborf-1.4/build-aux/missing0000755000175000017500000001533614647273512011637 #! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: weborf-1.4/build-aux/test-driver0000755000175000017500000001141714647273512012432 #! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2018-03-07.03; # UTC # Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <"$log_file" "$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: weborf-1.4/build-aux/depcomp0000755000175000017500000005602014647273512011610 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: weborf-1.4/configuration.c0000664000175000017500000002474414634465635011373 /* Weborf Copyright (C) 2010-2019 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #include "options.h" #include #include #include #include #include #include #include #ifdef HAVE_LIBSSL #include #include #endif #include "configuration.h" #include "types.h" #include "utils.h" #include "cachedir.h" #include "auth.h" weborf_configuration_t weborf_conf = { .tar_directory=false, .is_inetd=false, .virtual_host = false, .exec_script = false, .ip = NULL, .port = PORT, .basedir=BASEDIR, .uid = ROOTUID, .gid = ROOTGID, .daemonize = false, #ifdef HAVE_LIBSSL .sslctx = NULL, #endif #ifdef SEND_MIMETYPES .send_content_type = false, #endif }; /** * Enables sending mime types in response to GET requests * or prints an error and exits if the support was not * compiled * */ static void configuration_enable_sending_mime() { #ifdef SEND_MIMETYPES weborf_conf.send_content_type=true; #else fprintf(stderr, "Support for MIME is not available\n"); syslog(LOG_ERR, "Support for MIME is not available\n"); exit(19); #endif } /** Sets the base dir, making sure that it is really a directory. */ static void configuration_set_basedir(char * bd) { struct stat stat_buf; stat(bd, &stat_buf); if (!S_ISDIR(stat_buf.st_mode)) { //Not a directory fprintf(stderr, "%s must be a directory\n", bd); syslog(LOG_ERR, "%s must be a directory\n", bd); exit(1); } weborf_conf.basedir = bd; } /** * Sets default CGI configuration, * run .php and .py as CGI * */ static void configuration_set_default_CGI() { weborf_conf.cgi_paths.len = 4; weborf_conf.cgi_paths.data[0] = ".php"; weborf_conf.cgi_paths.data[1] = CGI_PHP; weborf_conf.cgi_paths.data[2] = ".py"; weborf_conf.cgi_paths.data[3] = CGI_PY; weborf_conf.cgi_paths.data_l[0] = strlen(".php"); weborf_conf.cgi_paths.data_l[1] = strlen(CGI_PHP); weborf_conf.cgi_paths.data_l[2] = strlen(".py"); weborf_conf.cgi_paths.data_l[3] = strlen(CGI_PY); } /** * Sets the default index file * */ static void configuration_set_default_index() { weborf_conf.indexes[0] = INDEX; weborf_conf.indexes_l = 1; } static void configuration_set_cgi(char *optarg) { if (!optarg || strlen(optarg) == 0) { weborf_conf.cgi_paths.len = 0; //count of indexes return; } int i = 0; weborf_conf.cgi_paths.len = 1; //count of indexes weborf_conf.cgi_paths.data[0] = optarg; //1st one points to begin of param while (optarg[++i] != 0) { //Reads the string if (optarg[i] == ',') { optarg[i] = 0; //Nulling the comma //Increasing counter and making next item point to char after the comma weborf_conf.cgi_paths.data[weborf_conf.cgi_paths.len++] = &optarg[i + 1]; if (weborf_conf.cgi_paths.len == MAXINDEXCOUNT) { fprintf(stderr, "Too many cgis, change MAXINDEXCOUNT in options.h to allow more\n"); syslog(LOG_ERR, "Too many cgis, change MAXINDEXCOUNT in options.h to allow more\n"); exit(6); } } } if (weborf_conf.cgi_paths.len % 2 == 1) { fprintf(stderr, "--cgi components must be an even number\n"); syslog(LOG_ERR, "--cgi components must be an even number\n"); exit(6); } for (i=0; i. @author Salvo "LtWorf" Tomaselli */ #include "options.h" #include #include #include #include #include #include #include #include #include #include "instance.h" #include "types.h" #include "myio.h" #ifdef HAVE_LIBSSL /* * Does a write to an fd_t * * If there is an ssl object attached, it will do an ssl write, * otherwise it will do a normal write. */ int myio_write(fd_t fd, const void *buf, size_t count) { if (fd.ssl) return SSL_write(fd.ssl, buf, count); return write(fd.fd, buf, count); } /** * Does a read from an fd_t. * * If there is an ssl object attached, it will do an ssl read, * otherwise it will do a normal read. */ int myio_read(fd_t fd, void *buf, size_t count) { if (fd.ssl) return SSL_read(fd.ssl, buf, count); return read(fd.fd, buf, count); } #endif /** Copies count bytes from the file descriptor "from" to the file descriptor "to". It is possible to use lseek on the descriptors before calling this function. Will not close any descriptor */ int fd_copy(fd_t from, fd_t to, off_t count) { char *buf=malloc(FILEBUF);//Buffer to read from file int reads,wrote; if (buf==NULL) { #ifdef SERVERDBG syslog(LOG_CRIT,"Not enough memory to allocate buffers"); #endif return ERR_NOMEM; //If no memory is available } //Sends file while (count>0 && (reads=myio_read(from, buf, FILEBUF 0) { if (reads == 0) { // Descriptor is over return ERR_NODATA; } count -= reads; wrote = myio_write(to, buf, reads); if (wrote != reads) { //Error writing to the descriptor #ifdef SOCKETDBG syslog(LOG_ERR, "error writing to the file descriptor"); #endif break; } } free(buf); return 0; } /** Returns true if the specified file exists */ bool file_exists(char *file) { return access(file, R_OK) == 0; } /** Deletes a directory and its content. This function is something like rm -rf dir is the directory to delete file is a buffer. Allocated outside because it will be reused by every recoursive call. Its size is file_s Returns 0 on success */ int dir_remove(char * dir) { /* If it is a file, removes it Otherwise list the directory's content, then do a recoursive call and do rmdir on self */ if (unlink(dir)==0) return 0; DIR *dp = opendir(dir); //Open dir struct dirent *entry; if (dp == NULL) { return 1; } char*file=malloc(PATH_LEN);//Buffer for path if (file==NULL) return ERR_NOMEM; //Cycles trough dir's elements while ((entry=readdir(dp)) != NULL) { //Cycles trough dir's elements //skips dir . and .. but not all hidden files if (entry->d_name[0]=='.' && (entry->d_name[1]==0 || (entry->d_name[1]=='.' && entry->d_name[2]==0))) continue; snprintf(file, PATH_LEN, "%s/%s", dir, entry->d_name); dir_remove(file); } closedir(dp); free(file); return rmdir(dir); } #ifdef WEBDAV /** Moves a file. If it is on the same partition it will create a new link and delete the previous link. Otherwise it will create a new copy and delete the old one. Returns 0 on success. */ int file_move(char* source, char* dest) { int retval=rename(source,dest); //Not the same device, doing a normal copy if (retval==-1 && errno==EXDEV) { retval=file_copy(source,dest); if (retval==0) unlink(source); } return retval; } /** Copies a file into another file Returns 0 on success */ int file_copy(char* source, char* dest) { int fd_from=-1; int fd_to=-1; ssize_t read_,write_; int retval=0; char *buf=NULL; //Open destination file if ((fd_to=open(dest,O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR))<0) { retval=ERR_FORBIDDEN; goto escape; } if ((fd_from=open(source,O_RDONLY | O_LARGEFILE))<0) { retval = ERR_FILENOTFOUND; goto escape; } buf=malloc(FILEBUF);//Buffer to read from file if (buf==NULL) { retval= ERR_NOMEM; goto escape; } while ((read_=read(fd_from,buf,FILEBUF))>0) { write_=write(fd_to,buf,read_); if (write_!=read_) { retval= ERR_BRKPIPE; break; } } escape: free(buf); if (fd_from>=0) close(fd_from); if (fd_to>=0) close(fd_to); return retval; } /**This function copies a directory. The destination directory will be created and will be filled with the same content of the source directory Returns 0 on success */ int dir_copy (char* source, char* dest) { return dir_move_copy(source,dest,COPY); } /**This function moves a directory. The destination directory will be created and will be filled with the same content of the source directory. Then, the source directory will be deleted. Returns 0 on success */ int dir_move(char* source, char* dest) { int retval; if ((retval=rename(source,dest))==0) { return 0; } else if (retval==-1 && errno==EXDEV) { return dir_move_copy(source,dest,MOVE); } else { return 1; } } /** Moves or copies a directory, depending on the method used Returns 0 on success */ int dir_move_copy (char* source, char* dest,int method) { struct stat f_prop; //File's property int retval=0; if (mkdir(dest,S_IRWXU | S_IRWXG | S_IRWXO)!=0) {//Attemps to create destination directory return ERR_FORBIDDEN; } DIR *dp = opendir(source); //Open dir struct dirent *entry; int return_code; if (dp == NULL) { return ERR_FILENOTFOUND; } char*src_file=malloc(PATH_LEN*2);//Buffer for path if (src_file==NULL) return ERR_NOMEM; char* dest_file=src_file+PATH_LEN; //Cycles trough dir's elements while ((entry=readdir(dp)) != NULL) { //skips dir . and .. but not all hidden files if (entry->d_name[0]=='.' && (entry->d_name[1]==0 || (entry->d_name[1]=='.' && entry->d_name[2]==0))) continue; snprintf(src_file,PATH_LEN,"%s/%s",source, entry->d_name); snprintf(dest_file,PATH_LEN,"%s/%s",dest, entry->d_name); stat(src_file, &f_prop); if (S_ISDIR(f_prop.st_mode)) {//Directory retval=dir_move_copy(src_file,dest_file,method); } else {//File if (method==MOVE) { retval=file_move(src_file,dest_file); } else { retval=file_copy(src_file,dest_file); } } if (retval!=0) goto escape; } escape: closedir(dp); free(src_file); //Removing directory after that its content has been moved if (retval==0 && method==MOVE) { return rmdir(source); } return retval; } #endif weborf-1.4/mime.h0000664000175000017500000000166214634465635007452 /* Weborf Copyright (C) 2010 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #ifndef WEBORF_MIME_H #define WEBORF_MIME_H #include "options.h" #include "types.h" int mime_init(magic_t *token); void mime_release(magic_t token); const char* mime_get_fd (magic_t token,int fd,struct stat *sb); #endifweborf-1.4/instance.h0000664000175000017500000000443314634465635010326 /* Weborf Copyright (C) 2007-2020 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli @author Salvo Rinaldi */ #ifndef WEBORF_INSTANCE_H #define WEBORF_INSTANCE_H #ifndef O_LARGEFILE //Needed to compile on Mac, where this doesn't exist #define O_LARGEFILE 0 #endif #include "types.h" #include "buffered_reader.h" #ifdef WEBDAV #include "webdav.h" #endif //Request #define INVALID -1 #define GET 0 #define POST 1 #define PUT 2 #define DELETE 3 #define OPTIONS 8 #ifdef WEBDAV #define PROPFIND 4 #define COPY 5 #define MOVE 6 #define MKCOL 7 #endif #define NO_ACTION -120 //Errors #define ERR_RANGE_NOT_SATISFIABLE -15 #define ERR_PRECONDITION_FAILED -14 #define ERR_NOT_ALLOWED -13 #define ERR_INSUFFICIENT_STORAGE -12 #define ERR_CONFLICT -11 #define ERR_SERVICE_UNAVAILABLE -10 #define ERR_FORBIDDEN -9 #define ERR_NOTIMPLEMENTED -8 #define ERR_NODATA -7 #define ERR_NOTHTTP -6 #define ERR_NOAUTH -5 #define ERR_SOCKWRITE -4 #define ERR_NOMEM -3 #define ERR_FILENOTFOUND -2 #define ERR_BRKPIPE -1 //Ok #define OK_CREATED 1 #define OK_NOCONTENT 2 //Protocol version #define HTTP_0_9 57 #define HTTP_1_0 48 #define HTTP_1_1 2 void inetd(); void *instance(void *); int write_file(connection_t * connection_prop); int send_err(connection_t *connection_prop,int err,char* descr); string_t read_post_data(connection_t * connection_prop, buffered_read_t * read_b); char *get_basedir(char *http_param); int send_http_header(int code, unsigned long long int *size, char *headers, bool content, time_t timestamp, connection_t * connection_prop); int delete_file(connection_t* connection_prop); int read_file(connection_t* connection_prop,buffered_read_t* read_b); #endif weborf-1.4/TODOlist0000664000175000017500000000032014634465635007724 - Allow external script for modurl, must have the headers... - use openSSL (instead of using read and write, use wrappers so openssl or direct accesso to socket can be used) - Create a Doxyfile to use doxygenweborf-1.4/daemon/0000775000175000017500000000000014634622237007661 5weborf-1.4/daemon/weborf@.service0000664000175000017500000000114614634622237012551 [Install] WantedBy=multi-user.target [Unit] Description=Weborf webserver with %I AssertPathExists=/etc/weborf.d/%i PartOf=weborf.service ReloadPropagatedFrom=weborf.service Before=weborf.service Documentation=man:weborf.conf(5) [Service] PrivateTmp=true User=root Type=forking Restart=always ExecStart=/usr/share/weborf/weborf_launcher /etc/weborf.d/%i -d StandardOutput=null StandardError=null SyslogIdentifier=weborf-%i # Some security tuning SystemCallArchitectures=native PrivateDevices=yes PrivateTmp=yes ProtectHome=read-only ProtectKernelTunables=true ProtectKernelModules=true ProtectControlGroups=true weborf-1.4/daemon/weborf_launcher0000775000175000017500000000712214634465635012705 #!/bin/sh # Copyright (C) 2018-2020 Salvo "LtWorf" Tomaselli # # Weborf is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # author Salvo "LtWorf" Tomaselli CONFFILE="$1" if ! [ -e "$CONFFILE" ]; then logger --id=$$ -s -perror "File $CONFFILE does not exist" exit 1 fi logger --id=$$ -perror "Starting weborf using $CONFFILE" VIRTUALS=`cat "$CONFFILE" | egrep "^virtual=" | cut -c 9-` USERNAME=`cat "$CONFFILE" | egrep "^user=" | cut -d= -f2` GROUPNAME=`cat "$CONFFILE" | egrep "^group=" | cut -d= -f2` BASEDIR=`cat "$CONFFILE" | egrep "^basedir=" | cut -d= -f2` INDEXES=`cat "$CONFFILE" | egrep "^indexes=" | cut -d= -f2` USE_CGI=`cat "$CONFFILE" | egrep "^use-cgi=" | cut -d= -f2` USE_MIME=`cat "$CONFFILE" | egrep "^use-mime=" | cut -d= -f2` CGI_BIN=`cat "$CONFFILE" | egrep "^cgi=" | cut -d= -f2` CACHE_DIR=`cat "$CONFFILE" | egrep "^cachedir=" | cut -d= -f2` PORT=`cat "$CONFFILE" | egrep "^port=" | cut -d= -f2` AUTH_SOCKET=`cat "$CONFFILE" | grep "^auth-socket=" | cut -d= -f2` KEY=`cat "$CONFFILE" | grep "^key=" | cut -d= -f2` CERT=`cat "$CONFFILE" | grep "^cert=" | cut -d= -f2` # Include defaults if available if [ -f /etc/default/weborf ] ; then . /etc/default/weborf fi if [ -z "$USERNAME" ] || [ -z "$GROUPNAME" ]; then logger --id=$$ -s -perror "User or group not set" fi if test "$USERNAME" = "root" then logger --id=$$ -s -perror "You are trying to run weborf as root!" exit 0 #LSB requires 0 termination in each case fi USERID=`cat /etc/passwd | grep "^${USERNAME}:" | cut -d: -f3` #Gets the userid GROUPID=$(grep "^${GROUPNAME}:" < /etc/group | cut -d: -f3) if [ -z "$GROUPID" ]; then logger --id=$$ -perror -s "Unable to find group $GROUPNAME" exit 1 fi if [ -z "$USERID" ]; then logger --id=$$ -s -perror "Unable to find user $USERNAME" exit 1 fi if test -n "$CACHE_DIR" then if ! test -d $CACHE_DIR then #Does not exist or it is not a directory logger --id=$$ -s "Creating cachedir for weborf: $CACHE_DIR" rm -rf $CACHE_DIR mkdir -m700 $CACHE_DIR fi chown $USERNAME $CACHE_DIR CACHE_DIR="-C $CACHE_DIR" fi if test -n "$AUTH_SOCKET" then AUTH_SOCKET="-a $AUTH_SOCKET" fi if test -n "$INDEXES" then INDEXES="-I $INDEXES" fi if [ -n "$CERT" ]; then CERT="--cert $CERT --key $KEY" elif [ -n "$KEY" ] && [ -z "$CERT" ]; then logger --id=$$ -s "Key set but certificate is not" exit 1 fi if test -n "$PORT" then PORT="-p $PORT" else PORT="-p 80" fi if test -n "$VIRTUALS" then VIRTUALS="-V $VIRTUALS" fi if test -n "$CGI_BIN" then CGI_BIN=-c $CGI_BIN fi if test $USE_CGI = "true" then CGI="-Y" fi if test $USE_MIME = "true" then MIME="-m" fi logger --id=$$ -s "weborf $2 $DAEMON_OPTS $VIRTUALS $CERT $CACHE_DIR $AUTH_SOCKET $MIME $CGI $CGI_BIN $PORT -u $USERID -g $GROUPID -b $BASEDIR $INDEXES" exec weborf $2 $DAEMON_OPTS $VIRTUALS $CERT $CACHE_DIR $AUTH_SOCKET $MIME $CGI $CGI_BIN $PORT -u $USERID -g $GROUPID -b $BASEDIR $INDEXES weborf-1.4/daemon/weborf0000775000175000017500000000761014634622237011017 #!/bin/bash # Copyright (C) 2008-2024 Salvo "LtWorf" Tomaselli # # Weborf is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # author Salvo "LtWorf" Tomaselli ### BEGIN INIT INFO # Provides: weborf # Required-Start: $network $local_fs $syslog $remote_fs # Required-Stop: $remote_fs # Should-Start: $named # Should-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Fast and small webserver # Description: Weborf is a configurationless webserver mainly meant to allow users # to easily share their directories over the web. # It also supports php5-cgi. ### END INIT INFO function clear_cache { CDIR=`cat /etc/weborf.conf | egrep "^cachedir=" | cut -d= -f2` rm -rf $CDIR/* } function status { if ! test -e $PIDFILE then echo "Weborf doesn't appear to be running" else echo "Weborf appears to be running" fi } function stopWeborf { #Stops all the running weborf servers (the ones started with init) if ! test -e $PIDFILE then echo "Weborf is not running or it was not started by init" exit 0 fi echo -n "Stopping weborf " for i in `cat $PIDFILE` do echo -n .. kill $i done echo "done" rm -f $PIDFILE } function startWeborf { #This function will start all the needed processes for weborf if test -e $PIDFILE then logger -s -perror "Weborf already running, if you're sure it is not running, delete $PIDFILE" exit 2 fi logger -s "Starting weborf" nohup /usr/share/weborf/weborf_launcher /etc/weborf.conf >/dev/null 2> /dev/null & echo ${!} >> $PIDFILE # Writes PID so weborf can be terminated } PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/bin/weborf # Introduce the server's location here NAME=weborf # Introduce the short server's name here PIDFILE=/var/run/$NAME.pid test -x $DAEMON || exit 0 . /usr/lib/lsb/init-functions # Default options, these can be overriden by the information # at /etc/default/$NAME DAEMON_OPTS="" # Additional options given to the server DIETIME=3 # Time to wait for the server to die, in seconds # If this value is set too low you might not # let some servers to die gracefully and # 'restart' will not work #STARTTIME=2 # Time to wait for the server to start, in seconds # If this value is set each time the server is # started (on start or restart) the script will # stall to try to determine if it is running # If it is not set and the server takes time # to setup a pid file the log message might # be a false positive (says it did not start # when it actually did) case $1 in start) startWeborf;; stop) stopWeborf;; restart) stopWeborf startWeborf;; force-reload) stopWeborf startWeborf;; status) status;; clearcache) clear_cache;; * ) echo "Usage: $0 {start|stop|restart|force-reload|status|clearcache}";; esac weborf-1.4/daemon/weborf.service0000664000175000017500000000055714634465635012465 # systemd service for managing all weborf instances on the system. This # service is actually a systemd target, but we are using a service since # targets cannot be reloaded. [Unit] Description=Weborf webserver Documentation=man:weborf.conf(5) [Service] Type=oneshot ExecStart=/bin/true ExecReload=/bin/true RemainAfterExit=on [Install] WantedBy=multi-user.target weborf-1.4/daemon/weborf-generator0000775000175000017500000000122114634622237012773 #!/bin/sh # This systemd generator creates dependency symlinks that make all weborf # instances with start=auto configuration file be started/stopped/reloaded # when weborf.service is started/stopped/reloaded. set -eu gendir="$1" wantdir="$1/weborf.service.wants" instance="/usr/lib/systemd/system/weborf@.service" mkdir -p "$wantdir" for conf in /etc/weborf.d/*.conf; do # abort loop if glob was not expanded (but accept dead symlinks) if ! test -e "$conf" && ! test -L "$conf"; then continue; fi if ! grep "^start=auto$" < $conf > /dev/null; then continue fi ln -s "$instance" "$wantdir/weborf@`basename $conf`.service" done exit 0 weborf-1.4/config.h.in0000664000175000017500000001210314647273511010357 /* config.h.in. Generated from configure.ac by autoheader. */ /* 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. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `ftruncate' function. */ #undef HAVE_FTRUNCATE /* 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 `crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO /* Define to 1 if you have the `magic' library (-lmagic). */ #undef HAVE_LIBMAGIC /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD /* Define to 1 if you have the `ssl' library (-lssl). */ #undef HAVE_LIBSSL /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* 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 `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the `rmdir' function. */ #undef HAVE_RMDIR /* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* 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 `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_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 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 `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Name of package */ #undef PACKAGE /* 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 home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `long int' if does not define. */ #undef off_t /* Define as a signed integer type capable of holding a process identifier. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if does not define. */ #undef ssize_t /* Define to `int' if doesn't define. */ #undef uid_t /* Define as `fork' if `vfork' does not work. */ #undef vfork weborf-1.4/testsuite/0000775000175000017500000000000014647273516010455 5weborf-1.4/testsuite/etag0000775000175000017500000000134314634465635011245 #!/bin/bash . testsuite/functions.sh run_weborf -b site1 -p 12349 # ETag header is there curl -sv http://127.0.0.1:12349/robots.txt |& grep ETag ETAG=$(curl -sv http://127.0.0.1:12349/robots.txt |& grep ETag | cut -d\ -f3 | tr -d '\r') CACHED=$(curl -vs -H "If-None-Match: $ETAG" http://localhost:12349/robots.txt) [[ $(printf $CACHED | wc -c) = 0 ]] NON_CACHED=$(curl -vs -H 'If-None-Match: "aaaa"' http://localhost:12349/robots.txt) [[ "$NON_CACHED" = $(cat site1/robots.txt) ]] CACHED=$(curl -vs -H "If-Range: $ETAG" --range 0-3 http://localhost:12349/robots.txt) [[ $(printf $CACHED | wc -c) = 4 ]] CACHED=$(curl -vs -H 'If-Range: "qwe"' --range 0-3 http://localhost:12349/robots.txt) [[ $(printf $CACHED | wc -c) != 4 ]] weborf-1.4/testsuite/cgi0000775000175000017500000000056414634465635011073 #!/bin/bash . testsuite/functions.sh run_weborf -b site1 -p 12350 --yesexec --cgi .py,/usr/bin/python3 curl -vs http://localhost:12350/cgi.py curl -vs -H 'If-None-Match: "1545650587"' http://localhost:12350/cgi.py | grep 1545650587 curl -vs http://localhost:12350/cgi.py\?ciccio | grep ciccio curl -vs --data "lallallero" http://localhost:12350/cgi.py | grep lallallero weborf-1.4/testsuite/cert/0000775000175000017500000000000014634465635011413 5weborf-1.4/testsuite/cert/certificate.pem0000664000175000017500000000302214634465635014315 -----BEGIN CERTIFICATE----- MIIETzCCAzegAwIBAgIUZ9/1lFZ0G8yxdd+kgTkvQvLY6aowDQYJKoZIhvcNAQEL BQAwgbYxCzAJBgNVBAYTAklUMQ8wDQYDVQQIDAZTaWNpbHkxEDAOBgNVBAcMB0Nh dGFuaWExGzAZBgNVBAoMElNhbGxvcCBDb3Jwb3JhdGlvbjEvMC0GA1UECwwmRGVw YXJ0bWVudCBvZiBkZXBhcnRtZW50YWwgZGVwYXJ0bWVudHMxEjAQBgNVBAMMCWxv Y2FsaG9zdDEiMCAGCSqGSIb3DQEJARYTdGlwb3NjaGlAdGlzY2FsaS5pdDAeFw0y MDEyMjAyMzUxMTFaFw0yMTEyMjAyMzUxMTFaMIG2MQswCQYDVQQGEwJJVDEPMA0G A1UECAwGU2ljaWx5MRAwDgYDVQQHDAdDYXRhbmlhMRswGQYDVQQKDBJTYWxsb3Ag Q29ycG9yYXRpb24xLzAtBgNVBAsMJkRlcGFydG1lbnQgb2YgZGVwYXJ0bWVudGFs IGRlcGFydG1lbnRzMRIwEAYDVQQDDAlsb2NhbGhvc3QxIjAgBgkqhkiG9w0BCQEW E3RpcG9zY2hpQHRpc2NhbGkuaXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK AoIBAQDoQ+PidmP30luSANOS0XMfrFTP2rfo+D8Ed+RX/WlMNY05i0vpbk9OvKHi w80LQwDC+PUrpQE07MzIhoOXhmW9y1u4xeyyUORsQX2FgH8wz4mczjQQc5vlMoOM hJ0Hri2DDKN4Zt+YErgS3taRr75KS/mgsj6/X9nXIShFanpnae2fuL1xYxdsVf8u xT1zyJ7n4AoFiGxd++HtNlSxpAWfgpozpgNcpBXIUWlIMM5BM+YQNaAtHVAz446N dOGG6jCL6OJGtHUnY/p1NbQ5hnNuTDVgXwMwutI0u0Au6wtbSaUWc1PHPhIpLvWX IN7CEpoMn3Mp+wEKH/PBn57nCxOnAgMBAAGjUzBRMB0GA1UdDgQWBBT9SIAVbzyI DDbVQryS9kma23d0ejAfBgNVHSMEGDAWgBT9SIAVbzyIDDbVQryS9kma23d0ejAP BgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQDOPYNeXt3B/nJcnFRq s825fPiNPwyRw0fhm4+As8RL7JFPgnlszE0GzlxH+cdcfBUtJXT8IE8WCKNU1Sqb 4kN84xX0OJaL2TbbaZqzmW8jEh0ds2Z/dDTeKLNxhdBWviZfJxHTa3s5r5LW81E0 iJyR/im/x630gKIUBlyKxJAn1kw4T4PK/7gvoMRfpbfLkN7Ms2gTEXwps6IwZjNz 8Pz0XF6Yct4kTanQcChH+cKSL8yYn72EW9/qtzGXc0JPSlBwjoFoV46oOdpPDX6F RMdDbpa9CCUUA0L6woJdmgUkh8wRdeZnT2h73jCVK8mr2BCkeXMAaoLmG3Z+XPJc iDAE -----END CERTIFICATE----- weborf-1.4/testsuite/cert/key.pem0000664000175000017500000000325414634465635012632 -----BEGIN PRIVATE KEY----- MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDoQ+PidmP30luS ANOS0XMfrFTP2rfo+D8Ed+RX/WlMNY05i0vpbk9OvKHiw80LQwDC+PUrpQE07MzI hoOXhmW9y1u4xeyyUORsQX2FgH8wz4mczjQQc5vlMoOMhJ0Hri2DDKN4Zt+YErgS 3taRr75KS/mgsj6/X9nXIShFanpnae2fuL1xYxdsVf8uxT1zyJ7n4AoFiGxd++Ht NlSxpAWfgpozpgNcpBXIUWlIMM5BM+YQNaAtHVAz446NdOGG6jCL6OJGtHUnY/p1 NbQ5hnNuTDVgXwMwutI0u0Au6wtbSaUWc1PHPhIpLvWXIN7CEpoMn3Mp+wEKH/PB n57nCxOnAgMBAAECggEBAM6mIKoLlbQXh/tmGtfk3F3Q0QDB46E2xbKvDQ2wXLA+ cTFCmz7MM2mlcQ82EEe1zIasRE4Zl/JDwYukCo6VOA5eUXQbPRYF3MXomspd4kxG SnSmDjKY+Zo5kEtEbgY4VSvk4citFsDR3s6DTzr9tvuZjzcHf8Z7fHDoglEIhHFe XnKdADbQAYYyQKg87GRfiYiDKnY3/n557R2Eu1AJg+AZpX/+BkU7Y8JUIgBUDFAC AuC3JBAvSHQuOEhvhA6tBtb/jBM4b63H8BUgBhWT2DBWBgVLUFJZ2BxawY+wwI+e wGMxqFNVSgAGZH9Ynhzsy3edF7LyxKHxLEqWFAPQ84kCgYEA/8ncRwiTSNDQMq9+ OLpxgwQMmNpB11937V4WolfGgEZmNoU0tNBzku5qRloz5X+wOaMmPkFM2WqGtxcf yc4s9Dn9JIDR+L/jmclEd3qrqaV8wL9J80DqOO/QnfGUd6t6CucbU9AR9tNhhtDX U2XYx86qXOAifdeD4e+RQeKTdoUCgYEA6HUNAyqjZqsQzvMCoXpFvszN0o0GqdQ4 iexLENnghjk1O2arnncJvDIKapDZhi2ObRddHZVGCCRZzkvtJvAcT9pQ2PoY94ce Uq3dZ6i5EinvFj0SYsNg+941Qf7hAnR6SJbsBAAWJP8/k5W4Wys3WQVtsKej6JUH uKTLN+EmpzsCgYEA9tXKXzX0Q6FWOINHz+CDp8XhjiOYxAiZx5MzTmhb4u+MtXIo IZDC5vhx0AA98msdGRHK1urXCTwWUlrbTzhKA0huc6podZ5fOcmS66WSQHy0/Z/a 8gYjwNwTukclWbI9bIYGxgOVQlZL1/hywkUXRAG4PzX/sualmwM/bpACc60CgYBl uhOftyEa5PHOHvqfv+qVvPq1kZHA8GZttUKEdVSUaKSrAhtIlb9k5GE6kXkgBv+1 LexJ7fFfzsieRwvZZmp9Z4TJ72jNqgvTEtM5cdTL5h4DFWbeYbInhu63mtrNQDvj WGigt4j5V9pys6qh+x+VjZKbJEHOnqlqXHOyWI2Z0QKBgQCxHqLJlG4SmQIi9EyH 4tz+crRLWIUTQnVp3rTkv3B6TqJvgmJEeidCTsyWnV1jqzGPYXJLx/mbQRxcLHj3 NqejvlUpHfn8Ya/HIc8+Ar5gAVf/OxhNgRd0/yPgV+kl7PgjF5JVeuvszSUaXKRy +mtHIB6/uneWb/xEk5hAiD0W6w== -----END PRIVATE KEY----- weborf-1.4/testsuite/site2/0000775000175000017500000000000014634465635011504 5weborf-1.4/testsuite/site2/site2.txt0000664000175000017500000000000614634465635013207 site2 weborf-1.4/testsuite/site1mimetype0000775000175000017500000000033214634465635013121 #!/bin/bash . testsuite/functions.sh run_weborf -b site1 -p 12347 --mime function cleanup () { kill -9 $WEBORF_PID } trap cleanup EXIT curl -v http://127.0.0.1:12347/robots.txt |& grep Content-Type | grep text/ weborf-1.4/testsuite/vhost0000775000175000017500000000040614634465635011467 #!/bin/bash . testsuite/functions.sh run_weborf -p 12342 --virtual localhost:12342=site1,127.0.0.1:12342=site2 -b site1 # ETag header is there curl -vs http://localhost:12342/robots.txt | grep User-agent curl -vs http://127.0.0.1:12342/site2.txt | grep site2 weborf-1.4/testsuite/functions.sh0000775000175000017500000000076514634465635012755 # Helper script, does nothing. set -mex cd $(dirname $0) if [ -n "$AUTOPKGTEST_TMP" ]; then # Run system weborf in autopkgtest BINNAME=weborf else BINNAME=../weborf fi function cleanup () { if [[ -n "$WEBORF_PID" ]]; then kill -9 "$WEBORF_PID" fi } trap cleanup EXIT function run_weborf () { "$BINNAME" $@ & WEBORF_PID=$(jobs -p) sleep 0.2 # Wait for it to be ready if [[ $(ls /proc/$WEBORF_PID/fd/ | wc -l) -lt 4 ]]; then sleep 2 fi } weborf-1.4/testsuite/site1https0000775000175000017500000000032714634465635012436 #!/bin/bash . testsuite/functions.sh run_weborf -b site1 -p 12346 --cert cert/certificate.pem --key cert/key.pem ROBOTS=$(curl -s -k https://127.0.0.1:12346/robots.txt) [[ "$ROBOTS" = $(cat site1/robots.txt) ]] weborf-1.4/testsuite/site1/0000775000175000017500000000000014634465635011503 5weborf-1.4/testsuite/site1/robots.txt0000664000175000017500000000003214634465635013467 User-agent: * Disallow: / weborf-1.4/testsuite/site1/sub1/0000775000175000017500000000000014634465635012355 5weborf-1.4/testsuite/site1/sub1/index.dat0000664000175000017500000000001014634465635014065 pappero weborf-1.4/testsuite/site1/sub1/index.txt0000664000175000017500000000001314634465635014137 lollellero weborf-1.4/testsuite/site1/cgi.py0000775000175000017500000000051014634465635012536 #!/usr/bin/python3 import os print('X-Extra: Ciao\r\n', end='') print('Content-Type: text/plain\r\n', end='') print('\r\n', end='') for k,v in os.environ.items(): print(f'{k}\t{v}') if 'CONTENT_LENGTH' in os.environ: print('============= POST') data = os.read(0, int(os.environ['CONTENT_LENGTH'])) print(data) weborf-1.4/testsuite/site1/sub2/0000775000175000017500000000000014634465635012356 5weborf-1.4/testsuite/site1/sub2/index.dat0000664000175000017500000000000714634465635014074 qbetto weborf-1.4/testsuite/site1/empty0000664000175000017500000000000014634465635012472 weborf-1.4/testsuite/ip_listener0000775000175000017500000000027714634465635012647 #!/bin/bash . testsuite/functions.sh run_weborf -b site1 -p 12340 --ip 127.0.0.2 if curl -s http://127.0.0.1:12340/robots.txt; then exit 1 fi curl -s http://127.0.0.2:12340/robots.txt weborf-1.4/testsuite/index_file0000775000175000017500000000062714634465635012437 #!/bin/bash . testsuite/functions.sh run_weborf -b site1 -p 12351 --index index.txt,index.dat [[ $(curl -Lvs http://localhost:12351/sub1/) = $(cat site1/sub1/index.txt) ]] [[ $(curl -Lvs http://localhost:12351/sub2/) = $(cat site1/sub2/index.dat) ]] [[ $(curl -Lvs http://localhost:12351/sub1) = $(cat site1/sub1/index.txt) ]] [[ $(curl -Lvs http://localhost:12351/sub2) = $(cat site1/sub2/index.dat) ]] weborf-1.4/testsuite/range0000775000175000017500000000132014634465635011414 #!/bin/bash . testsuite/functions.sh run_weborf -b site1 -p 12348 # ETag header is there curl -sv http://127.0.0.1:12348/robots.txt |& grep Content-Length CONTENT_LENGTH=$(curl -sv http://127.0.0.1:12348/robots.txt |& grep Content-Length | cut -d\ -f3 | tr -d '\r') ROBOTS="$( curl -s -r0-5 http://127.0.0.1:12348/robots.txt; curl -s -r6-10 http://127.0.0.1:12348/robots.txt; curl -s -r11- http://127.0.0.1:12348/robots.txt)" curl -s -r0-$(($CONTENT_LENGTH - 1)) http://127.0.0.1:12348/robots.txt if curl -s --fail -r0-$CONTENT_LENGTH http://127.0.0.1:12348/robots.txt; then exit 1 fi [[ $(curl -s -r0-0 http://127.0.0.1:12348/robots.txt | wc -c) = 1 ]] [[ "$ROBOTS" = $(cat site1/robots.txt) ]] weborf-1.4/testsuite/site1http0000775000175000017500000000044114634465635012250 #!/bin/bash . testsuite/functions.sh run_weborf -b site1 -p 12345 ROBOTS=$(curl -s http://127.0.0.1:12345/robots.txt) [[ "$ROBOTS" = $(cat site1/robots.txt) ]] ROBOTS=$(curl -s http://127.0.0.1:12345/empty) [[ "$ROBOTS" = '' ]] curl -s http://127.0.0.1:12345/cgi.py | grep "import os" weborf-1.4/testsuite/version_and_help0000775000175000017500000000013314634465635013640 #!/bin/bash . testsuite/functions.sh "$BINNAME" --help "$BINNAME" --version "$BINNAME" -k weborf-1.4/testsuite/cachedir0000775000175000017500000000146014634465635012067 #!/bin/bash . testsuite/functions.sh # Test that it fails with a non existing cache directory if "$BINNAME" -db site1 -p 12352 --cache "/tmp/fakecachedir" --index nonexisting; then exit 1 fi CACHE_DIR=$(mktemp -d) "$BINNAME" -b site1 -p 12352 --cache $CACHE_DIR --index nonexisting & WEBORF_PID=$(jobs -p) function cleanup () { kill -9 $WEBORF_PID ls "$CACHE_DIR" rm -rf "$CACHE_DIR" rm -f site1/cachedir.test } trap cleanup EXIT curl -s http://localhost:12352/ [[ "$(ls $CACHE_DIR | wc -l)" = 1 ]] curl -s http://localhost:12352/ | diff - $CACHE_DIR/* touch site1/cachedir.test sleep 1.1 curl -s http://localhost:12352/ | grep cachedir.test rm site1/cachedir.test sleep 1.1 if curl -s http://localhost:12352/ | grep cachedir.test; then exit 1 fi [[ "$(ls $CACHE_DIR | wc -l)" = 3 ]] weborf-1.4/mime.c0000664000175000017500000000555414634465635007451 /* Weborf Copyright (C) 2010 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #include "options.h" #include #include #include "mime.h" #ifdef SEND_MIMETYPES #include #endif /** Returns a token for the libmagic. buffer must NOT be shared amongst threads. The size of buffer is assumed to be at least MIMETYPELEN */ int mime_init(magic_t *token) { #ifdef SEND_MIMETYPES *token=magic_open(MAGIC_SYMLINK | MAGIC_MIME_TYPE); if (*token==NULL) return 1; return magic_load(*token,NULL); //Load the database #else *token=NULL; return 0; #endif } /** Releases the token for libmagic If the token is null, it will do nothing. */ void mime_release(magic_t token) { if (token==NULL) return; #ifdef SEND_MIMETYPES magic_close(token); #endif } /** returns mimetype of an opened file descriptor the cursor can be located at any position fd is the descriptor to an open file sb is the stat to the same file */ const char* mime_get_fd (magic_t token,int fd,struct stat *sb) { #ifdef SEND_MIMETYPES if (token==NULL) return NULL; /*If fd is a directory, send the mimetype without attempting to read it*/ if (sb->st_mode & S_IFREG) { /* * Seek file to 0 and read its header to know its mime type * then seek again to the previous position */ char buf[64]; //Get the current cursor position off_t prev_pos=lseek(fd,0,SEEK_CUR); //Set the cursor to the beginning of the file lseek(fd,0,SEEK_SET); //Reads 64 bytes to determine the type int r=read(fd,&buf,64); //Reset the position lseek(fd,prev_pos,SEEK_SET); const char* mime=magic_buffer(token,&buf,r); return mime; } else if (sb->st_mode & S_IFDIR) return "application/x-directory"; else if (sb->st_mode & S_IFSOCK) return "application/x-socket"; else if (sb->st_mode & S_IFLNK) return "application/x-symlink"; else if (sb->st_mode & S_IFBLK) return "application/x-block-device"; else if (sb->st_mode & S_IFCHR) return "application/x-character-device"; //else if (sb->st_mode & S_IFIFO) return "application/x-fifo"; #else return NULL; #endif } weborf-1.4/mystring.h0000664000175000017500000000210114634465635010364 /* Weborf Copyright (C) 2007 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #ifndef WEBORF_MYSTRING_H #define WEBORF_MYSTRING_H #include "types.h" void split_get_params(connection_t* connection_prop); bool endsWith(char *str, char *end, size_t len_str, size_t len_end); void delChar(char *string, int pos, int n); void strReplace(char *string, char *substr, char with); void replaceEscape(char *string); void strToUpper(char *str); #endif weborf-1.4/COPYING0000664000175000017500000000255114634465635007403 Copyright © 2007-2018 Salvo "LtWorf" Tomaselli , Copyright © 2007 Salvo Rinaldi 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 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License can be found in the /usr/share/common-licenses/GPL-3 file. Additional permission under GNU GPL version 3 section 7 If you modify this Program, or any covered work, by linking or combining it with OpenSSL (or a modified version of that library), containing parts covered by the terms of OpenSSL License, the licensors of this Program grant you additional permission to convey the resulting work. Corresponding Source for a non-source form of such a combination shall include the source code for the parts of OpenSSL used as well as that of the covered work. weborf-1.4/weborf.conf.50000664000175000017500000000677114634465635010656 .TH Weborf 5 "May 09, 2024" "Minimal webserver" .SH NAME .B weborf.conf \- configuration file for weborf daemon .SH SYNOPSIS /etc/weborf.conf .br /etc/weborf.d/*.conf .SH DESCRIPTION Weborf is a minimal webserver. Also has a limited support for webdav. .br Can be started as stand-alone or as system daemon. This manual page documents Weborf's configuration file, used only when it is started as daemon. .br .SH DESCRIPTION Options are case sensitive. Immediately followed by the equal = sign, without any space between name and value. Lines beginning with # will be ignored and treated as comments. .P When systemd is in use, every .conf file in /etc/weborf.d/ is used to start a different instance of weborf, with a different configuration. Otherwise the file /etc/weborf.conf is used to start a single instance of weborf. .SS .TP .B indexes By default weborf searches for index.html. Anyway it is possible to specify a different index file and also many index files. Name of the pages must be separated by a comma and between them there aren't spaces. .TP .B basedir Default base directory used by the webserver. The default means that this will be used also when virtual hosts are enabled, if the requested host is unknown. Of course the user used for the webserver will need to have access to this directory. .TP .B use-cgi Can be true or false. If false weborf will handle all files as normal files. Otherwise it will use the CGI protocol to execute some files. Defaults to false. .TP .B use-mime Can be true or false. If true weborf will send the Content-Type header to the clients. Turning it off will increase speed but might cause problems with some old clients. .TP .B cgi List of extensions to consider as dynamic pages and binaries to execute them. It takes a file format and a path, comma separated, and the list can include more formats and paths. Eg: cgi=.php,/bin/phpexecutor,.sh,/bin/shellexecutor .TP .B auth-socket Path of the unix socket that weborf will use to connect to the authentication server. When this is enabled, for every HTTP request weborf opens a connection to this socket, forwards the request, and the authentication daemon is in charge of deciding whether to accept or deny the request. Examples are provided in /usr/share/doc/weborf/examples. .TP .B cachedir Will set the path of the directory used for caching. When this is enabled, weborf will cache PROPFIND and directory listing requests, making them faster. .TP .B user Username of the user that will run the webserver. On Debian this is usually www-data. .TP .B group Groupname of the group that will run the webserver. On Debian this is usually www-data. .TP .B port The port to use. .TP .B key Absolute path to the SSL key file. It must be used with the cert option. .br When set, weborf will use HTTPS instead of HTTP. .TP .B cert Absolute path to the SSL certificate file. It must be used with the key option. .br When set, weborf will use HTTPS instead of HTTP. .TP .B virtual This directive is used to enable virtualhosts. The format is: virtual=localhost=/var/www/,serverq.com=/var/www-alt/ .br To run on multiple ports, more instances are needed. .TP .B start If this is set to auto, when systemd is in use, the instance using this configuration file is considered as part of the weborf service and started/stopped along with it. It does nothing with other init systems. .SS .SH "SEE ALSO" .BR weborf (1) .SH WEB .BR https://ltworf.codeberg.page/weborf/ .SH AUTHORS .nf Salvo "LtWorf" Tomaselli Salvo Rinaldi .br weborf-1.4/myio.h0000664000175000017500000000311214634465635007470 /* Weborf Copyright (C) 2010-2018 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #ifndef WEBORF_MYIO_H #define WEBORF_MYIO_H #include "types.h" #include "options.h" #ifdef HAVE_LIBSSL int myio_write(fd_t fd, const void *buf, size_t count); int myio_read(fd_t fd, void *buf, size_t count); static inline int myio_getfd(fd_t fd) { return fd.fd; } static inline fd_t fd2fd_t(int fd) { fd_t r; r.ssl = NULL; r.fd = fd; return r; } #else #define myio_read read #define myio_write write static inline int myio_getfd(fd_t fd) { return fd; } static inline fd_t fd2fd_t(int fd) { return fd; } #endif int fd_copy(fd_t from, fd_t to, off_t count); int dir_remove(char * dir); bool file_exists(char *file); #ifdef WEBDAV int dir_move_copy (char* source, char* dest,int method); int file_copy(char* source, char* dest); int file_move(char* source, char* dest); int dir_move (char* source, char* dest); int dir_copy (char* source, char* dest); #endif #endif weborf-1.4/auth.h0000664000175000017500000000161414634465635007461 /* Weborf Copyright (C) 2010 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #ifndef WEBORF_AUTH_H #define WEBORF_AUTH_H #include "types.h" #include "options.h" void auth_set_socket(char *u_socket); int auth_check_request(connection_t* connection_prop); #endifweborf-1.4/embedded_auth.h0000664000175000017500000000572314634465635011277 /* Weborf Copyright (C) 2010 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ /** * This file contains user defined embedded autentication * to avoid the usage of an external daemon for authentication. * The use of this, will make things faster and parallel, at the cost * of needing to define it at compile time * * Everything in this file should be between the "#ifdef EMBEDDED_AUTH" * and its "#endif" to avoid the compilation of unused methods * */ //#define EMBEDDED_AUTH #ifdef EMBEDDED_AUTH /** * This function is just example code, can be changed or deleted */ static int emb_check_password(char *username, char *password) { char *user="gentoo"; char *pass="lalalala"; if (strncmp(username,user,strlen(user))==0 && strncmp(password,pass,strlen(pass))==0) return 0; return -1; } /** * This function will be used if EMBEDDED_AUTH is defined, do not modify its signature! * * page: URI of requested page * ip_addr: IP address of the client (it can be an IPv6, depending how weborf is compiled) * method: HTTP method of the request * username: Username, if provided, null otherwise * password: Password, if provided, null otherwise * http_param: Headers of the request * * RETURN VALUE: * Return 0 to allow the request, -1 to deny it. * * NOTES: * The actual content of the function must be regarded as an example, modify it according to your * own needs. * Only use reentrant calls in this function. Weborf is multithreaded. */ static int c_auth(char *page, char *ip_addr, char *method, char *username, char *password, char *http_param) { char *allowed_prefix="::ffff:10."; char *foto = "/foto/"; //Allow anything from 10.* if (strncmp(allowed_prefix,ip_addr,strlen(allowed_prefix))==0) return 0; //Allow PROPFIND and OPTIONS with authentication (to allow read only webdav from anywhere) if ((strncmp(method,"PROPFIND",strlen("PROPFIND"))==0) || (strncmp(method,"OPTIONS",strlen("OPTIONS"))==0)) return emb_check_password(username,password); //Deny all except GET and POST else if (!(strncmp(method,"GET",strlen("GET"))==0 || strncmp(method,"POST",strlen("POST"))==0)) { return -1; } //request authentication for photos if (strncmp(foto,page,strlen(foto))==0) return emb_check_password(username,password); return 0; } #endif weborf-1.4/queue.h0000664000175000017500000000174114634465635007645 /* Weborf Copyright (C) 2007 Giuseppe Pappalardo Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Giuseppe Pappalardo @author Salvo "LtWorf" Tomaselli */ #ifndef WEBORF_QUEUE_H #define WEBORF_QUEUE_H #include "types.h" int q_init(syn_queue_t * q, int size); int q_put(syn_queue_t * q, int val); int q_get(syn_queue_t * q, int *val); void q_free(syn_queue_t * q); #endif weborf-1.4/utils.c0000664000175000017500000003340514634465635007656 /* Weborf Copyright (C) 2007-2020 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #include "options.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "mystring.h" #include "utils.h" #include "embedded_auth.h" /** * This function creates an URI encoded version of the string origin **/ static void uri_encode(char *dest, size_t size, const char *origin) { if (size == 0 || dest == NULL || origin == NULL) return; dest[0] = '\0'; size_t len = strlen(origin); size_t rlen = 0; char *format; for (size_t i = 0; i < len; i++) { //Encode forbidden characters switch (origin[i]) { case '!': case '*': case '\'': case '(': case ')': case ';': case ':': case '@': case '&': case '=': case '+': case '$': case ',': case '/': case '?': case '#': case '[': case ']': case '%': case '>': case '<': case '"': case ' ': case '\\': format = "%%%02x"; break; default: format = "%c"; break; } if (size - rlen <= 2) return; rlen += sprintf(dest + rlen, format, origin[i]); } } /** * This function encodes the characters in 'origin' to &code; form into 'encoded' **/ static void html_encode(char *dest, size_t size, const char *origin) { if (size == 0 || dest == NULL || origin == NULL) return; dest[0] = '\0'; size_t len = 0; char *code; size_t codesize; char ni[2] = "X"; size_t origin_len = strlen(origin); for (size_t i = 0; i < origin_len; i++) { ni[0] = origin[i]; switch (origin[i]) { case '&': code = "&"; codesize = strlen("&"); break; case '<': code = "<"; codesize = strlen("<"); break; case '>': code = ">"; codesize = strlen(">"); break; case ' ': code = " "; codesize = strlen(" "); break; case '"': code = """; codesize = strlen("""); break; default: code = ni; codesize = 1; break; } if (len + codesize >= size) return; strcpy(dest + len, code); len += codesize; } } /** This function reads the directory dir, putting inside the html string an html page with links to all the files within the directory. Buffer for html must be allocated by the calling function. bufsize is the size of the buffer allocated for html parent is true when the dir has a parent dir Returns the size of the HTML. -1: unable to open the file -2: out of memory */ int list_dir(connection_t *connection_prop, char *html, unsigned int bufsize, bool parent) { int pagesize=0; //Written bytes on the page int maxsize = bufsize - 1; //String's max size int printf_s; char *color; //Depending on row count chooses a background color char *measure; //contains measure unit for file's size (B, KiB, MiB) int counter = 0; int errcode = 0; char path[INBUFFER]; //Buffer to contain element's absolute path struct dirent **namelist = NULL; counter = scandir(connection_prop->strfile, &namelist, 0, alphasort); char *name_html = malloc(ESCAPED_FNAME_LEN); char *escaped_dname = malloc(ESCAPED_FNAME_LEN); if (counter <0) { //Open not succesfull errcode = -1; goto escape; } //Specific header table) pagesize=printf_s=snprintf(html+pagesize,maxsize, "%s", HTMLHEAD ""); maxsize-=printf_s; //Cycles trough dir's elements int i; struct tm ts; struct stat f_prop; //File's property char last_modified[URI_LEN]; //Print link to parent directory, if there is any if (parent) { printf_s=snprintf(html+pagesize,maxsize,""); maxsize-=printf_s; pagesize+=printf_s; } for (i=0; i\n", color, escaped_dname, name_html, size, measure,last_modified); maxsize-=printf_s; pagesize+=printf_s; } else if (S_ISDIR(f_mode)) { //Directory entry //Table row for the dir printf_s=snprintf(html+pagesize,maxsize, "\n", escaped_dname, name_html,last_modified); maxsize-=printf_s; pagesize+=printf_s; } free(namelist[i]); if (maxsize <= 0) { errcode = -2; // Out of memory } } escape: free(name_html); free(escaped_dname); free(namelist); if (errcode == 0) { printf_s=snprintf(html+pagesize,maxsize, "%s", "
NameSizeLast Modified
d../--
f%s%llu%s%s
d%s/-%s
" HTMLFOOT); pagesize+=printf_s; return pagesize; } else return errcode; } /** Prints version information */ void version() { printf("Weborf %s\n" "Copyright (C) 2007-2020 Salvo 'LtWorf' Tomaselli.\n" "This is free software. You may redistribute copies of it under the terms of\n" "the GNU General Public License .\n" "There is NO WARRANTY, to the extent permitted by law.\n\n" "Written by Salvo 'LtWorf' Tomaselli and Salvo Rinaldi.\n" "Synchronized queue by Prof. Giuseppe Pappalardo.\n\n" "https://ltworf.codeberg.page/weborf/\n", VERSION); exit(0); } void print_capabilities() { printf("version:" VERSION "\n"); printf("ipv:" #ifdef IPV6 "6" #else "4" #endif "\n" ); printf("webdav:" #ifdef WEBDAV "yes" #else "no" #endif "\n" ); printf("mime:" #ifdef SEND_MIMETYPES "yes" #else "no" #endif "\n" ); printf("embedded_auth:" #ifdef EMBEDDED_AUTH "yes" #else "no" #endif "\n" ); printf("https:" #ifdef HAVE_LIBSSL "yes" #else "no" #endif "\n" ); exit(0); } /** Prints command line help */ void help() { printf("\tUsage: weborf [OPTIONS]\n" "\tStart the weborf webserver\n\n" #ifdef IPV6 "\tCompiled for IPv6\n" #else "\tCompiled for IPv4\n" #endif #ifdef WEBDAV "\tHas webdav support\n" #endif #ifdef SEND_MIMETYPES "\tHas MIME support\n" #endif "Default port is %s\n" "Default base directory %s\n" "Signature used %s\n\n", PORT,BASEDIR,SIGNATURE); printf(" -a, --auth followed by absolute path of the program to handle authentication\n" " -b, --basedir followed by absolute path of basedir\n" " -C, --cache sets the directory to use for cache files\n" " -c, --cgi list of cgi files and binary to execute them comma-separated\n" " -d run as a daemon\n" " -h, --help display this help and exit\n" " -I, --index list of index files, comma-separated\n" " -i, --ip followed by IP address to listen (dotted format)\n" " -k, --caps lists the capabilities of the binary\n" " -m, --mime sends content type header to clients\n" " -p, --port followed by port number to listen\n" " -T --inetd must be specified when using weborf with inetd or xinetd\n" " -t --tar will send the directories as .tar.gz files\n" " -u --uid followed by a valid uid\n" " If started by root weborf will use this user to read files and execute scripts\n" " -g --gid followed by a valid gid\n" " -V, --virtual list of virtualhosts in the form host=basedir, comma-separated\n" " -v, --version print program version\n" " -S, --cert the certificate to use\n" " -K, --key the private key to use with the certificate\n" " -Y, --yesexec enables CGI\n" "\n" "Report bugs here https://bugs.launchpad.net/weborf\n" "or to " PACKAGE_BUGREPORT "\n"); exit(0); } /** Searching for easter eggs within the code isn't fair! */ void moo() { printf(" _____________________________________\n" "< Weborf ha i poteri della supermucca >\n" " -------------------------------------\n" " \\ ^__^\n" " \\ (oo)\\_______\n" " (__)\\ )\\/\\\n" " ||----w |\n" " || ||\n"); exit(0); } /** * This function prints the start disclaimer on stdout. * It wants the command line parameters * */ void print_start_disclaimer(int argc, char *argv[]) { printf("Weborf\n" "This program comes with ABSOLUTELY NO WARRANTY.\n" "This is free software, and you are welcome to redistribute it\n" "under certain conditions.\nFor details see the GPLv3 License.\n" "Run %s --help to see the options\n", argv[0]); } /** * Detaches the process from the shell, * it is re-implemented because it is not * included in POSIX * * It shouldn't be executed after launching * other threads. In that case the effects are * not specified. * */ void daemonize() { if (fork() == 0) signal(SIGHUP, SIG_IGN); else exit(0); } /** This function retrieves the value of an http field within the header http_param is the string containing the header parameter is the searched parameter buf is the buffer where copy the value size, maximum size of the buffer param_len =length of the parameter Returns false if the parameter isn't found, or true otherwise */ bool get_param_value(char *http_param, char *parameter, char *buf, ssize_t size,ssize_t param_len) { char *val = strstr(http_param, parameter); //Locates the requested parameter information if (val == NULL) { //No such field return false; } /* * It is very important for this line to be here, for security reasons. * It moves the pointer forward, assuming "Field: Value\r\n" * If the field is malformed like "Field0\r\n" the subsequent strstr * will fail and the function will return false. * Moving this line after the next strstr would introduce a security * vulnerability. * The strstr will not cause a segfault because at this point the header * string must at least terminate with "\r\n\r", the last '\r' is changed to 0 * so there is enough space to perform the operation * */ val += param_len + 2; //Moves the begin of the string to exclude the name of the field char *field_end = strstr(val, "\r\n"); //Searches the end of the parameter if (field_end==NULL) { return false; } if ((field_end - val + 1) < size) { //If the parameter's length is less than buffer's size memcpy(buf, val, field_end - val); } else { //Parameter string is too long for the buffer return false; } buf[field_end - val] = 0; //Ends the string within the destination buffer return true; } weborf-1.4/listener.c0000664000175000017500000001742114634465635010343 /* Weborf Copyright (C) 2007 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli @author Giuseppe Pappalardo @author Salvo Rinaldi */ #include "options.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "listener.h" #include "instance.h" #include "queue.h" #include "utils.h" #include "mystring.h" #include "types.h" #include "cachedir.h" #include "configuration.h" #include "mynet.h" #define _GNU_SOURCE syn_queue_t queue; //Queue for opened sockets t_thread_info thread_info; extern weborf_configuration_t weborf_conf; pthread_attr_t t_attr; //thread's attributes pthread_key_t thread_key; //key for pthread_setspecific /** Sets t_attr to make detached threads and initializes pthread_keys */ static void init_thread_attr() { pthread_attr_init(&t_attr); pthread_attr_setdetachstate(&t_attr, PTHREAD_CREATE_DETACHED); pthread_key_create(&thread_key,NULL); } /** Starts threads Specify how many threads start. */ void init_threads(unsigned int count) { static long int id = 1; //t_free=MAXTHREAD; int effective=0,i; pthread_t t_id;//Unused var, thread's system id pthread_mutex_lock(&thread_info.mutex); //Check condition within the lock if (thread_info.count + count < MAXTHREAD) { //Start for (i = 1; i <= count; i++) if (pthread_create(&t_id, &t_attr, instance, (void *) (id++))==0) effective++; thread_info.count+=effective; // increases the count of started threads #ifdef THREADDBG syslog(LOG_DEBUG, "There are %d free threads", thread_info.free); #endif #ifdef SERVERDBG if (effective!=count) syslog(LOG_CRIT,"Unable to launch the required threads"); #endif } pthread_mutex_unlock(&thread_info.mutex); } /** This function inits the logger. Will use syslogd */ static void init_logger() { openlog("weborf", LOG_ODELAY, LOG_DAEMON); #ifdef SERVERDBG syslog(LOG_INFO, "Starting server..."); #endif } static void init_thread_info() { //Init thread_info pthread_mutex_init(&thread_info.mutex, NULL); thread_info.count=0; thread_info.free=0; } /** This function, terminates threads if there are too many free threads. It only takes action every THREADCONTROL seconds. */ static void t_shape() { static time_t last_action = 0; if (last_action + 10 > time(NULL)) { return; } last_action = time(NULL); if (thread_info.free > MAXFREETHREAD) { //Too many free threads, terminates one of them //Write the termination order to the queue, the thread who will read it, will terminate q_put(&queue,-1); } } /** * Set quit action on SIGTERM and SIGINT * and prints the internal status on SIGUSR1 * */ static void init_signals() { //Handle SIGINT and SIGTERM signal(SIGINT, quit); signal(SIGTERM, quit); //Prints queue status with this signal signal(SIGUSR1, print_queue_status); } int main(int argc, char *argv[]) { int s, s1; //Socket descriptors init_logger(); init_thread_info(); configuration_load(argc,argv); if (weborf_conf.is_inetd) inetd(); print_start_disclaimer(argc,argv); s = net_create_server_socket(); net_bind_and_listen(s); set_new_gid(weborf_conf.gid); set_new_uid(weborf_conf.uid); if (weborf_conf.daemonize) daemonize(); //init the queue for opened sockets if (q_init(&queue, MAXTHREAD + 1) != 0) exit(NOMEM); //Starts the 1st group of threads init_thread_attr(); init_threads(INITIALTHREAD); init_signals(); struct pollfd poll_fds[1]; poll_fds[0].fd = s; poll_fds[0].events = POLLIN; while (1) { if (poll(poll_fds, 1, 1000 * THREADCONTROL) == -1) { #ifdef SERVERDBG syslog(LOG_ERR, "Error polling server socket: %d", errno); #endif exit(11); } t_shape(); s1 = accept(s, NULL,NULL); if (s1 >= 0 && q_put(&queue, s1)!=0) { //Adds s1 to the queue #ifdef REQUESTDBG syslog(LOG_ERR,"Not enough resources, dropping connection..."); #endif close(s1); } //Start new thread if needed if (thread_info.free <= LOWTHREAD && thread_info.free. @author Salvo "LtWorf" Tomaselli */ #ifndef WEBORF_WEBDAV_H #define WEBORF_WEBDAV_H #include "types.h" int propfind(connection_t* connection_prop,string_t *post_param); int mkcol(connection_t* connection_prop); int copy_move(connection_t* connection_prop); #endif weborf-1.4/auth.c0000664000175000017500000001063514634465635007457 /* Weborf Copyright (C) 2010 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #include "options.h" #include #include #include #include #include #include #include #include #include "types.h" #include "auth.h" #include "instance.h" #include "base64.h" extern weborf_configuration_t weborf_conf; #include "embedded_auth.h" /** Checks that the authentication socket exists and is a unix socket */ void auth_set_socket(char *u_socket) { #ifdef EMBEDDED_AUTH weborf_conf.authsock = "embedded"; #else struct stat sb; if (stat(u_socket, &sb) == -1) { perror("Existing unix socket expected"); #ifdef SERVERDBG syslog(LOG_ERR, "%s doesn't exist", u_socket); #endif exit(5); } if ((sb.st_mode & S_IFMT) != S_IFSOCK) { #ifdef SERVERDBG syslog(LOG_ERR, "%s is not a socket", u_socket); #endif dprintf(2, "Socket expected\n"); exit(5); } weborf_conf.authsock = u_socket; #endif } /** This function checks if the authentication can be granted or not calling the external program. Returns 0 if authorization is granted. */ int auth_check_request(connection_t *connection_prop) { if (weborf_conf.authsock==NULL) return 0; char username[PWDLIMIT*2]; char* password=username; //will be changed if there is a password char* auth=strstr(connection_prop->http_param,"Authorization: Basic ");//Locates the auth information if (auth==NULL) { //No auth informations username[0]=0; //password[0]=0; } else { //Retrieves provided username and password char*auth_end=strstr(auth,"\r\n");//Finds the end of the header if (auth_end==NULL) return -1; char a[PWDLIMIT*2]; auth+=21;//Moves the begin of the string to exclude Authorization: Basic if ((auth_end-auth+1)<(PWDLIMIT*2)) memcpy(&a,auth,auth_end-auth); //Copies the base64 encoded string to a temp buffer else { //Auth string is too long for the buffer #ifdef SERVERDBG syslog(LOG_ERR,"Unable to accept authentication, buffer is too small"); #endif return ERR_NOMEM; } a[auth_end-auth]=0; decode64(username,a);//Decodes the base64 string password=strstr(username,":");//Locates the separator : if (password==NULL) return -1; password[0]=0;//Nulls the separator to split username and password password++;//make password point to the beginning of the password } int result=-1; #ifdef EMBEDDED_AUTH result=c_auth(connection_prop->page, connection_prop->ip_addr, connection_prop->method, username, password, connection_prop->http_param); #else { int s,len; struct sockaddr_un remote; s=socket(AF_UNIX,SOCK_STREAM,0); remote.sun_family = AF_UNIX; strcpy(remote.sun_path, weborf_conf.authsock); len = strlen(remote.sun_path) + sizeof(remote.sun_family); if (connect(s, (struct sockaddr *)&remote, len) == -1) {//Unable to connect return -1; } char* auth_str=malloc(HEADBUF+PWDLIMIT*2); if (auth_str==NULL) { #ifdef SERVERDBG syslog(LOG_CRIT,"Not enough memory to allocate buffers"); #endif return -1; } int auth_str_l=snprintf(auth_str,HEADBUF+PWDLIMIT*2,"%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n",connection_prop->page,connection_prop->ip_addr,connection_prop->method,username,password,connection_prop->http_param); if (write(s,auth_str,auth_str_l)==auth_str_l && read(s,auth_str,1)==0) {//All data written and no output, ok result=0; } close(s); free(auth_str); } #endif return result; } weborf-1.4/queue.c0000664000175000017500000000575714634465635007653 /* Weborf Copyright (C) 2007 Giuseppe Pappalardo Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Giuseppe Pappalardo @author Salvo "LtWorf" Tomaselli @author Salvo Rinaldi */ #include "options.h" #include #include #include #include "queue.h" /** Inits the syncronized queue, allocating memory. Requires the syn_queue_t struct and the size of the queue itself. To deallocate the queue, use the q_free function. */ int q_init(syn_queue_t * q, int size) { q->num = q->head = q->tail = 0; q->size = size; q->data = (int *) malloc(sizeof(int) * size); if (q->data == NULL) { //Error, unable to allocate memory return 1; } pthread_mutex_init(&q->mutex, NULL); pthread_cond_init(&q->for_space, NULL); pthread_cond_init(&q->for_data, NULL); q->n_wait_dt = q->n_wait_sp = 0; return 0; } /** Frees the memory taken by the queue. Requires the pointer to the queue struct */ void q_free(syn_queue_t * q) { free(q->data); } int q_get(syn_queue_t * q, int *val) { pthread_mutex_lock(&q->mutex); while (q->num == 0) { q->n_wait_dt++; pthread_cond_wait(&q->for_data, &q->mutex); } *val = q->data[q->head]; //Sets the value q->head = (q->head + 1) % q->size; //Moves the head q->num--; //Reduces count of the queue /*if ((q->num == q->size) && (q->n_wait_sp > 0)) { q->n_wait_sp--; pthread_cond_signal(&q->for_space); } // unlock also needed after signal*/ pthread_mutex_unlock(&q->mutex); // or threads blocked on wait return 0; // will not proceed } int q_put(syn_queue_t * q, int val) { pthread_mutex_lock(&q->mutex); //Wakes up a sleeping thread if (q->n_wait_dt > 0) { q->n_wait_dt--; pthread_cond_signal(&q->for_data); } // unlock also needed after signal //Fails if queue is full if (q->num == q->size) { pthread_mutex_unlock(&q->mutex); // or threads blocked on wait return 1; // will not proceed //while (q->num == q->size) { //q->n_wait_sp++; //pthread_cond_wait(&q->for_space, &q->mutex); } q->data[q->tail] = val; //Set the data in position q->tail = (q->tail + 1) % q->size; //Moves the tail q->num++; //Increases count of filled positions pthread_mutex_unlock(&q->mutex); // or threads blocked on wait return 0; // will not proceed } weborf-1.4/mystring.c0000664000175000017500000000676114634465635010377 /* Weborf Copyright (C) 2007 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #include "options.h" #include #include #include #include #include "mystring.h" /** This function converts a string to upper case */ void strToUpper(char *str) { int i = -1; while (str[++i]) { str[i] = toupper(str[i]); } } /** This function splits the page name from the GET params. It also sets the value for the page_len field */ void split_get_params(connection_t* connection_prop) { char *separator=strstr(connection_prop->page,"?"); if (separator==NULL) { connection_prop->get_params=NULL; connection_prop->page_len=strlen(connection_prop->page); } else { separator[0]=0; connection_prop->get_params=separator+1; connection_prop->page_len=separator-connection_prop->page; } } /** Replaces escape sequences in the form %HEXCODE with the correct char This is used for URLs, after the transformation the URL will probably represent a file that exists on filesystem. Since after this replace the string will be unchanged or shorter, no additional buffer will be needed. This function is in-place, doesn't create copies but changes the original string. */ void replaceEscape(char *string) { char e_seq[3]; e_seq[2] = 0; if (string == NULL) return; //Parses the string while ((string=strstr(string,"%"))!=NULL) { e_seq[0] = string[1]; e_seq[1] = string[2]; delChar(string, 0, 2); //Deletes 2 chars from the url //Replaces the 3rd character with the char corresponding to the escape string[0] = strtol(e_seq, NULL, 16); string++; } } /** This function replaces, within the string string, the substring substr with the char with. This function is in-place, doesn't create copies but changes the original string. */ void strReplace(char *string, char *substr, char with) { char *pointer; int substrlen = strlen(substr); while ((pointer = strstr(string, substr)) != NULL) { delChar(pointer, 0, substrlen - 1); pointer[0] = with; string=pointer; } } /** This function deletes n chars from the string, starting from the position pos. In case deleting of more chars than the string's len itself, the string will be returned unchanged. This function doesn't create copies but changes the original string. */ void delChar(char *string, int pos, int n) { size_t l = strlen(string + pos); if (l < n) return; l -= n; memmove(string + pos, string + pos + n, l); string[l] = 0; return; } /** Returns true if str ends with end str String to compare end second string size of str size of end If str ends with end, true is returned false otherwise */ bool endsWith(char *str, char *end, size_t len_str, size_t len_end) { return strcmp(str+len_str-len_end,end)==0; } weborf-1.4/aclocal.m40000664000175000017500000012570314647273511010207 # generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file 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. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, [m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file 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. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file 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. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file 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. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file 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 macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file 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. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file 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. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file 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. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file 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. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file 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. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file 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. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file 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. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file 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. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file 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. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file 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. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file 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. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR weborf-1.4/mynet.c0000664000175000017500000001240414634465635007646 /* Weborf Copyright (C) 2010 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #include "options.h" #include #include #include #include #include #include #include #include #include #include #include #include "types.h" #include "mynet.h" extern weborf_configuration_t weborf_conf; /** * Creates the server socket and performs some setsockopt * on it. * */ int net_create_server_socket() { int s; int val; //Creates the socket #ifdef IPV6 s = socket(PF_INET6, SOCK_STREAM, 0); #else s = socket(PF_INET, SOCK_STREAM, 0); #endif /* This futile system call is here just because a debian mantainer decided that the default behavior must be to listen only to IPv6 connections excluding IPv4 ones. So this restores the logic and normal behavior of accepting connections without being racist about the client's address. */ #ifdef IPV6 val=0; setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&val, sizeof(val)); #endif val = 1; //Makes port reusable immediately after termination. if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) { perror("ruseaddr(any)"); syslog(LOG_ERR, "reuseaddr(any)"); #ifdef IPV6 dprintf(2, "If you don't have IPv6 support in kernel, try recompiling weborf, removing the line '#define IPV6' from options.h\n"); #endif return -1; } int flags = fcntl(s, F_GETFL, 0); flags |= O_NONBLOCK | O_CLOEXEC; fcntl(s, F_SETFL, flags); return s; } #ifdef IPV6 /** * Accepts an ip address. * * Returns a new buffer that needs to be freed by the * caller of this function. * * If addr is an ipv6 address, it is just copied into * the returned buffer. * * If addr is an ipv4 address, the string "::ffff:" is * prepended to it, turning it into an ipv6 mapped address. **/ char* net_map_ipv4(char* addr) { size_t len = strlen(addr); char *r; if (strstr(addr, ":")) { r = malloc(len + 1); memcpy(r, addr, len + 1); } else { char * prefix = "::ffff:"; r = malloc(len + strlen(prefix) + 1); memcpy(r, prefix, strlen(prefix)); memcpy(r + strlen(prefix), addr, len + 1); } return r; } #endif void net_bind_and_listen(int s) { // Check port number unsigned int port = strtol(weborf_conf.port, NULL, 0); if (port < 1 || port > 65535) { dprintf(2, "Invalid port number: %u\n", port); exit(4); } // Create socket and set port number #ifdef IPV6 struct sockaddr_in6 locAddr; //Local and remote address memset(&locAddr, 0, sizeof(locAddr)); locAddr.sin6_family = AF_INET6; locAddr.sin6_port = htons(port); #else struct sockaddr_in locAddr; int ipAddrL = sizeof(struct sockaddr_in); locAddr.sin_family = AF_INET; locAddr.sin_port = htons(port); #endif // Set IP address if (weborf_conf.ip) { #ifdef IPV6 char * ip = net_map_ipv4(weborf_conf.ip); int rpt = inet_pton(AF_INET6, ip, &locAddr.sin6_addr); free(ip); #else int rpt = inet_pton(AF_INET, weborf_conf.ip, &locAddr.sin_addr); #endif if (rpt == 0) { dprintf(2, "Invalid IPv%c address: %s\n", IPVERSION, weborf_conf.ip); exit(2); } } else { weborf_conf.ip = "any"; #ifdef IPV6 locAddr.sin6_addr = in6addr_any; #else inet_pton(AF_INET, "0.0.0.0", &locAddr.sin_addr); #endif } syslog(LOG_INFO, "Listening on address: %s:%u", weborf_conf.ip, port); if (bind(s, (struct sockaddr *) &locAddr, sizeof(locAddr)) < 0) { perror("trying to bind"); syslog(LOG_ERR, "Port %u already in use", port); exit(3); } listen(s, MAXQ); //Listen to the socket } void net_getpeername(int socket,char* buffer) { #ifdef IPV6 struct sockaddr_storage t_addr; socklen_t addr_l=sizeof(t_addr); getpeername(socket, (struct sockaddr *)&t_addr, &addr_l); if (t_addr.ss_family==AF_INET) { struct sockaddr_in *addr =(struct sockaddr_in *)&t_addr; char temp_buffer[INET_ADDRSTRLEN]; inet_ntop(AF_INET, &(addr->sin_addr), temp_buffer, INET_ADDRSTRLEN); snprintf(buffer,INET6_ADDRSTRLEN,"::ffff:%s",temp_buffer); } else { struct sockaddr_in6 *addr =(struct sockaddr_in6 *)&t_addr; inet_ntop(AF_INET6, &(addr->sin6_addr), buffer, INET6_ADDRSTRLEN); } #else struct sockaddr_in addr; socklen_t addr_l=sizeof(struct sockaddr_in); getpeername(socket, (struct sockaddr *)&addr,&addr_l); inet_ntop(AF_INET, &addr.sin_addr, buffer, INET_ADDRSTRLEN); #endif } weborf-1.4/base64.h0000664000175000017500000000146714634465635007612 /* Weborf Copyright (C) 2007 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #ifndef WEBORF_BASE64_H #define WEBORF_BASE64_H void decode64(char *result, char *encoded); #endif weborf-1.4/Makefile.in0000664000175000017500000015520414647273512010414 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ #SUBDIRS = VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = weborf$(EXEEXT) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(dist_doc_DATA) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = options.h CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(initdir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \ "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgdatadir)" \ "$(DESTDIR)$(sysconfdir)" PROGRAMS = $(bin_PROGRAMS) am_weborf_OBJECTS = auth.$(OBJEXT) base64.$(OBJEXT) \ buffered_reader.$(OBJEXT) cachedir.$(OBJEXT) cgi.$(OBJEXT) \ configuration.$(OBJEXT) instance.$(OBJEXT) listener.$(OBJEXT) \ mime.$(OBJEXT) myio.$(OBJEXT) mynet.$(OBJEXT) \ mystring.$(OBJEXT) queue.$(OBJEXT) utils.$(OBJEXT) \ webdav.$(OBJEXT) weborf_OBJECTS = $(am_weborf_OBJECTS) weborf_LDADD = $(LDADD) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } SCRIPTS = $(init_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/auth.Po ./$(DEPDIR)/base64.Po \ ./$(DEPDIR)/buffered_reader.Po ./$(DEPDIR)/cachedir.Po \ ./$(DEPDIR)/cgi.Po ./$(DEPDIR)/configuration.Po \ ./$(DEPDIR)/instance.Po ./$(DEPDIR)/listener.Po \ ./$(DEPDIR)/mime.Po ./$(DEPDIR)/myio.Po ./$(DEPDIR)/mynet.Po \ ./$(DEPDIR)/mystring.Po ./$(DEPDIR)/queue.Po \ ./$(DEPDIR)/utils.Po ./$(DEPDIR)/webdav.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(weborf_SOURCES) DIST_SOURCES = $(weborf_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 man5dir = $(mandir)/man5 NROFF = nroff MANS = $(dist_man_MANS) DATA = $(dist_doc_DATA) $(pkgdata_DATA) $(sysconf_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` AM_RECURSIVE_TARGETS = cscope check recheck am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(srcdir)/options.h.in \ $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/missing \ $(top_srcdir)/build-aux/test-driver COPYING README.md \ build-aux/compile build-aux/config.guess build-aux/config.sub \ build-aux/depcomp build-aux/install-sh build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cgibindir = @cgibindir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ initdir = @initdir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ weborf_SOURCES = \ auth.c \ base64.c \ buffered_reader.c \ cachedir.c \ cgi.c \ configuration.c \ instance.c \ listener.c \ mime.c \ myio.c \ mynet.c \ mystring.c \ queue.c \ utils.c \ webdav.c EXTRA_DIST = \ auth.h \ buffered_reader.h \ cgi.h \ configuration.h \ instance.h \ mime.h \ mynet.h \ types.h \ webdav.h \ base64.h \ cachedir.h \ embedded_auth.h \ listener.h \ myio.h \ mystring.h \ queue.h \ utils.h \ examples \ daemon \ weborf.conf \ testsuite/* \ qweborf/qweborf/__init__.py \ qweborf/qweborf/main.ui \ qweborf/qweborf/nhelper.py \ qweborf/qweborf/whelper.py \ qweborf/qweborf/qweborf.py \ qweborf/qweborf/qweborf \ qweborf/man/qweborf.1 \ qweborf/integration/qweborf.png \ qweborf/integration/qweborf.desktop \ qweborf/integration/qweborf_servicemenu.desktop \ qweborf/integration/qweborf.metainfo.xml \ qweborf/setup.py \ qweborf/Makefile dist_man_MANS = weborf.1 weborf.conf.5 init_SCRIPTS = daemon/weborf pkgdata_DATA = daemon/weborf_launcher sysconf_DATA = weborf.conf dist_doc_DATA = \ CHANGELOG \ Credits \ README.md \ TODOlist TESTS = \ testsuite/version_and_help \ testsuite/site1http \ testsuite/site1https \ testsuite/ip_listener \ testsuite/etag \ testsuite/index_file \ testsuite/range \ testsuite/cgi \ testsuite/cachedir \ testsuite/site1mimetype \ testsuite/vhost \ testsuite/functions.sh all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 options.h: $(top_builddir)/config.status $(srcdir)/options.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) weborf$(EXEEXT): $(weborf_OBJECTS) $(weborf_DEPENDENCIES) $(EXTRA_weborf_DEPENDENCIES) @rm -f weborf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(weborf_OBJECTS) $(weborf_LDADD) $(LIBS) install-initSCRIPTS: $(init_SCRIPTS) @$(NORMAL_INSTALL) @list='$(init_SCRIPTS)'; test -n "$(initdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(initdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(initdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(initdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(initdir)$$dir" || exit $$?; \ } \ ; done uninstall-initSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(init_SCRIPTS)'; test -n "$(initdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(initdir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffered_reader.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cachedir.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgi.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/configuration.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/instance.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listener.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/myio.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mynet.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mystring.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/webdav.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-man1: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man5: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.5[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) install-sysconfDATA: $(sysconf_DATA) @$(NORMAL_INSTALL) @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sysconfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \ done uninstall-sysconfDATA: @$(NORMAL_UNINSTALL) @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(sysconfdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? testsuite/version_and_help.log: testsuite/version_and_help @p='testsuite/version_and_help'; \ b='testsuite/version_and_help'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testsuite/site1http.log: testsuite/site1http @p='testsuite/site1http'; \ b='testsuite/site1http'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testsuite/site1https.log: testsuite/site1https @p='testsuite/site1https'; \ b='testsuite/site1https'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testsuite/ip_listener.log: testsuite/ip_listener @p='testsuite/ip_listener'; \ b='testsuite/ip_listener'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testsuite/etag.log: testsuite/etag @p='testsuite/etag'; \ b='testsuite/etag'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testsuite/index_file.log: testsuite/index_file @p='testsuite/index_file'; \ b='testsuite/index_file'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testsuite/range.log: testsuite/range @p='testsuite/range'; \ b='testsuite/range'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testsuite/cgi.log: testsuite/cgi @p='testsuite/cgi'; \ b='testsuite/cgi'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testsuite/cachedir.log: testsuite/cachedir @p='testsuite/cachedir'; \ b='testsuite/cachedir'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testsuite/site1mimetype.log: testsuite/site1mimetype @p='testsuite/site1mimetype'; \ b='testsuite/site1mimetype'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testsuite/vhost.log: testsuite/vhost @p='testsuite/vhost'; \ b='testsuite/vhost'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) testsuite/functions.sh.log: testsuite/functions.sh @p='testsuite/functions.sh'; \ b='testsuite/functions.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) config.h installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(sysconfdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f ./$(DEPDIR)/auth.Po -rm -f ./$(DEPDIR)/base64.Po -rm -f ./$(DEPDIR)/buffered_reader.Po -rm -f ./$(DEPDIR)/cachedir.Po -rm -f ./$(DEPDIR)/cgi.Po -rm -f ./$(DEPDIR)/configuration.Po -rm -f ./$(DEPDIR)/instance.Po -rm -f ./$(DEPDIR)/listener.Po -rm -f ./$(DEPDIR)/mime.Po -rm -f ./$(DEPDIR)/myio.Po -rm -f ./$(DEPDIR)/mynet.Po -rm -f ./$(DEPDIR)/mystring.Po -rm -f ./$(DEPDIR)/queue.Po -rm -f ./$(DEPDIR)/utils.Po -rm -f ./$(DEPDIR)/webdav.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dist_docDATA \ install-initSCRIPTS install-man install-pkgdataDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-sysconfDATA install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-man5 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f ./$(DEPDIR)/auth.Po -rm -f ./$(DEPDIR)/base64.Po -rm -f ./$(DEPDIR)/buffered_reader.Po -rm -f ./$(DEPDIR)/cachedir.Po -rm -f ./$(DEPDIR)/cgi.Po -rm -f ./$(DEPDIR)/configuration.Po -rm -f ./$(DEPDIR)/instance.Po -rm -f ./$(DEPDIR)/listener.Po -rm -f ./$(DEPDIR)/mime.Po -rm -f ./$(DEPDIR)/myio.Po -rm -f ./$(DEPDIR)/mynet.Po -rm -f ./$(DEPDIR)/mystring.Po -rm -f ./$(DEPDIR)/queue.Po -rm -f ./$(DEPDIR)/utils.Po -rm -f ./$(DEPDIR)/webdav.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dist_docDATA \ uninstall-initSCRIPTS uninstall-man uninstall-pkgdataDATA \ uninstall-sysconfDATA uninstall-man: uninstall-man1 uninstall-man5 .MAKE: all check-am install-am install-data-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \ check-TESTS check-am clean clean-binPROGRAMS clean-cscope \ clean-generic cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-data-hook install-data-local install-dist_docDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-initSCRIPTS install-man install-man1 install-man5 \ install-pdf install-pdf-am install-pkgdataDATA install-ps \ install-ps-am install-strip install-sysconfDATA installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \ uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-dist_docDATA uninstall-initSCRIPTS uninstall-man \ uninstall-man1 uninstall-man5 uninstall-pkgdataDATA \ uninstall-sysconfDATA .PRECIOUS: Makefile dist-hook: rm -rf `find $(distdir)/ -name .git` install-data-local: install -d echo $(DESTDIR)/etc/weborf.d ln -s ../weborf.conf $(DESTDIR)/etc/weborf.d/weborf.conf install -D -m644 daemon/weborf.service $(DESTDIR)/usr/lib/systemd/system/weborf.service install -D -m644 daemon/weborf@.service $(DESTDIR)/usr/lib/systemd/system/weborf@.service install -D daemon/weborf-generator $(DESTDIR)/usr/lib/systemd/system-generators/weborf-generator install-data-hook: chmod a+x $(DESTDIR)$(datadir)/weborf/weborf_launcher # 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: weborf-1.4/types.h0000664000175000017500000001054114634465635007663 /* Weborf Copyright (C) 2010-2018 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #ifndef WEBORF_TYPES_H #define WEBORF_TYPES_H #include "options.h" #include //Adds boolean type #include #include #include #include #ifdef HAVE_LIBSSL #include typedef struct { int fd; SSL *ssl; } fd_t; #else typedef int fd_t; #endif #ifdef SEND_MIMETYPES #include #else typedef void* magic_t; #endif typedef struct { long int id; //ID of the thread magic_t mime_token; //Token for libmagic } thread_prop_t; typedef struct { ssize_t len; //length of the array char *data[MAXINDEXCOUNT]; //Array containing pointers int data_l[MAXINDEXCOUNT]; //Array containing len of strings } array_ll; typedef struct { int num, size; //Filled positions in the queue, and its maximum size int head, tail; //pointers to head and tail of the round queue int *data; //Socket with client #ifdef IPV6 struct sockaddr_in6 *addr; //Local and remote address #else struct sockaddr_in *addr; #endif pthread_mutex_t mutex; //mutex to modify the queue pthread_cond_t for_space, for_data; int n_wait_sp, n_wait_dt; } syn_queue_t; typedef struct { fd_t sock; //File and ssl descriptor for the socket #ifdef IPV6 char ip_addr[INET6_ADDRSTRLEN]; //ip address in string format #else char ip_addr[INET_ADDRSTRLEN]; #endif bool keep_alive; //True if we are using pipelining short int protocol_version; //See defines like HTTP_something int method_id; //Index of the http method used (GET, POST) char *method; //String version of the http method used char *http_param; //Param string char *page; //Requested URI ssize_t page_len; //Lengh of the page string char *get_params; //Params in the URI, after the ? char char *strfile; //File on filesystem ssize_t strfile_len; //Length of string strfile struct stat strfile_stat; //Stat of strfile int strfile_fd; //File descriptor for strfile char *basedir; //Basedir for the host unsigned int status_code; //HTTP status code } connection_t; typedef struct { ssize_t len; //length of the string char *data; //Pointer to string } string_t; typedef struct { pthread_mutex_t mutex; //Mutex to access this struct unsigned int free; //Free threads unsigned int count; //thread count } t_thread_info; typedef struct { char *basedir; char* authsock; //Executable that will authenticate uid_t uid; //Uid to use after bind gid_t gid; //gid to use after bind #ifdef SEND_MIMETYPES bool send_content_type; //True if we want to send the content type #endif bool is_inetd; //True if it expects to be executed by inetd array_ll cgi_paths; //Paths to cgi binaries bool virtual_host; //True if must check for virtual hosts bool exec_script; //Enable CGI if false bool tar_directory; //Sends directories compressed into tar-files bool daemonize; //Run daemon() char *ip; //IP addr with default value char *port; //port with default value char *indexes[MAXINDEXCOUNT];//List of pointers to index files int indexes_l; //Count of the list #ifdef HAVE_LIBSSL SSL_CTX *sslctx; //SSL context #endif } weborf_configuration_t; #endif weborf-1.4/qweborf/0000775000175000017500000000000014647273516010071 5weborf-1.4/qweborf/setup.py0000664000175000017500000000053014647273321011513 from setuptools import setup setup( version='1.4', name='qweborf', author="Salvo 'LtWorf' Tomaselli", author_email='tiposchi@tiscali.it', maintainer="Salvo 'LtWorf' Tomaselli", maintainer_email='tiposchi@tiscali.it', url='https://ltworf.codeberg.page/weborf/', license='GPL3', packages=('qweborf',), ) weborf-1.4/qweborf/man/0000775000175000017500000000000014647273516010644 5weborf-1.4/qweborf/man/qweborf.10000664000175000017500000000122414634465635012313 .TH "qweborf" "1" .SH "NAME" qweborf \(em Shares files using the HTTP protocol. .SH "SYNOPSIS" .PP \fBqweborf\fR .SH "DESCRIPTION" .PP Qweborf provides an easy to use interface to share local files using the HTTP protocol. It can enable writing on the server, webdav and authentication. .SH "AUTHOR" .PP This manual page was written by Salvo 'LtWorf' Tomaselli for the \fBDebian GNU/Linux\fP system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License version 3 or any later version published by the Free Software Foundation. weborf-1.4/qweborf/Makefile0000664000175000017500000000317514647273321011451 # Weborf # Copyright (C) 2019-2024 Salvo "LtWorf" Tomaselli # # Weborf is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # author Salvo "LtWorf" Tomaselli qweborf/main.py: qweborf/main.ui pyuic6 qweborf/main.ui > qweborf/main.py .PHONY: clean clean: $(RM) qweborf/main.py $(RM) -r build/ $(RM) -r .mypy_cache/ .PHONY: install install: qweborf/main.py python3 setup.py install --root=$${DESTDIR:-/} --install-layout=deb install -D qweborf/qweborf $${DESTDIR:-/}/usr/bin/qweborf install -D -m644 man/qweborf.1 $${DESTDIR:-/}/usr/share/man/man1/qweborf.1 install -D -m644 integration/qweborf.desktop $${DESTDIR:-/}/usr/share/applications/qweborf.desktop install -D -m644 integration/qweborf_servicemenu.desktop $${DESTDIR:-/}/usr/share/kservices5/ServiceMenus/qweborf_servicemenu.desktop install -D -m644 integration/qweborf.png $${DESTDIR:-/}/usr/share/icons/hicolor/256x256/apps/qweborf.png install -D -m644 integration/qweborf.metainfo.xml $${DESTDIR:-/}/usr/share/metainfo/qweborf.metainfo.xml .PHONY: mypy mypy: mypy --config-file mypy.conf qweborf weborf-1.4/qweborf/qweborf/0000775000175000017500000000000014647273516011536 5weborf-1.4/qweborf/qweborf/nhelper.py0000664000175000017500000002305514634465635013473 # Weborf # Copyright (C) 2011-2020 Salvo "LtWorf" Tomaselli # # Weborf is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # original code http://carnivore.it/2010/07/22/python_-_getifaddrs # edited Salvo "LtWorf" Tomaselli from ctypes import * from socket import AF_INET, AF_INET6, AF_PACKET, inet_ntop from sys import platform import subprocess import re from typing import List, NamedTuple, Optional def getifaddrs(): # getifaddr structs class ifa_ifu_u(Union): _fields_ = [ ("ifu_broadaddr", c_void_p), ("ifu_dstaddr", c_void_p) ] class ifaddrs(Structure): _fields_ = [ ("ifa_next", c_void_p), ("ifa_name", c_char_p), ("ifa_flags", c_uint), ("ifa_addr", c_void_p), ("ifa_netmask", c_void_p), ("ifa_ifu", ifa_ifu_u), ("ifa_data", c_void_p) ] # AF_UNKNOWN / generic class sockaddr(Structure): if platform.startswith("darwin") or platform.startswith("freebsd"): _fields_ = [ ("sa_len", c_uint8), ("sa_family", c_uint8), ("sa_data", (c_uint8 * 14))] else: _fields_ = [ ("sa_family", c_uint16), ("sa_data", (c_uint8 * 14)) ] # AF_INET / IPv4 class in_addr(Union): _fields_ = [ ("s_addr", c_uint32), ] class sockaddr_in(Structure): _fields_ = [ ("sin_family", c_short), ("sin_port", c_ushort), ("sin_addr", in_addr), ("sin_zero", (c_char * 8)), # padding ] # AF_INET6 / IPv6 class in6_u(Union): _fields_ = [ ("u6_addr8", (c_uint8 * 16)), ("u6_addr16", (c_uint16 * 8)), ("u6_addr32", (c_uint32 * 4)) ] class in6_addr(Union): _fields_ = [ ("in6_u", in6_u), ] class sockaddr_in6(Structure): _fields_ = [ ("sin6_family", c_short), ("sin6_port", c_ushort), ("sin6_flowinfo", c_uint32), ("sin6_addr", in6_addr), ("sin6_scope_id", c_uint32), ] # AF_PACKET / Linux class sockaddr_ll(Structure): _fields_ = [ ("sll_family", c_uint16), ("sll_protocol", c_uint16), ("sll_ifindex", c_uint32), ("sll_hatype", c_uint16), ("sll_pktype", c_uint8), ("sll_halen", c_uint8), ("sll_addr", (c_uint8 * 8)) ] # AF_LINK / BSD|OSX class sockaddr_dl(Structure): _fields_ = [ ("sdl_len", c_uint8), ("sdl_family", c_uint8), ("sdl_index", c_uint16), ("sdl_type", c_uint8), ("sdl_nlen", c_uint8), ("sdl_alen", c_uint8), ("sdl_slen", c_uint8), ("sdl_data", (c_uint8 * 46)) ] libc = CDLL("libc.so.6") ptr = c_void_p(None) result = libc.getifaddrs(pointer(ptr)) if result: return None ifa = ifaddrs.from_address(ptr.value) result = {} while True: # name = ifa.ifa_name name = ifa.ifa_name.decode('ascii') # use this for python3 if name not in result: result[name] = {} if ifa.ifa_addr != None: sa = sockaddr.from_address(ifa.ifa_addr) if sa.sa_family not in result[name]: result[name][sa.sa_family] = [] data = {} if sa.sa_family == AF_INET: if ifa.ifa_addr is not None: si = sockaddr_in.from_address(ifa.ifa_addr) data['addr'] = inet_ntop(si.sin_family, si.sin_addr) if ifa.ifa_netmask is not None: si = sockaddr_in.from_address(ifa.ifa_netmask) data['netmask'] = inet_ntop(si.sin_family, si.sin_addr) if sa.sa_family == AF_INET6: if ifa.ifa_addr is not None: si = sockaddr_in6.from_address(ifa.ifa_addr) data['addr'] = inet_ntop(si.sin6_family, si.sin6_addr) if data['addr'].startswith('fe80:'): data['scope'] = si.sin6_scope_id if ifa.ifa_netmask is not None: si = sockaddr_in6.from_address(ifa.ifa_netmask) data['netmask'] = inet_ntop(si.sin6_family, si.sin6_addr) if sa.sa_family == AF_PACKET: if ifa.ifa_addr is not None: si = sockaddr_ll.from_address(ifa.ifa_addr) addr = "" for i in range(si.sll_halen): addr += "%02x:" % si.sll_addr[i] addr = addr[:-1] data['addr'] = addr if len(data) > 0: result[name][sa.sa_family].append(data) if ifa.ifa_next: ifa = ifaddrs.from_address(ifa.ifa_next) else: break libc.freeifaddrs(ptr) return result class Redirection(NamedTuple): '''This class represents a NAT redirection''' lport: int eport: int ip: str proto: str description: str def __str__(self) -> str: return '%s %d->%s:%d\t\'%s\'' % (self.proto, self.eport, self.ip, self.lport, self.description) def create_redirection(self) -> bool: '''Activates the redirection. Returns true if the redirection becomes active''' try: subprocess.check_call( ['upnpc', '-a', self.ip, str(self.lport), str(self.eport), self.proto] ) except: return False for i in get_redirections(): if i == self: return True return False def remove_redirection(self) -> None: subprocess.check_call(['upnpc', '-d', str(self.eport), self.proto]) def getaddrs(ipv6: bool=True) -> List[str]: '''Returns the list of the IP addresses it is possible to bind to ipv6: if true, ONLY ipv6 addresses will be returned (ipv4 will be mapped to ipv6) ''' ifaces = getifaddrs() l_ipv4 = [] l_ipv6 = [] # Cycle the interfaces for iface in ifaces: # Cycle address family for family in ifaces[iface]: # Cycle addresses for addr in ifaces[iface][family]: if 'addr' in addr: if family == AF_INET: l_ipv4.append(str(addr['addr'])) elif family == AF_INET6: l_ipv6.append(str(addr['addr'])) if ipv6 == True: # Transforming ipv4 into ipv6-mapped for i in range(len(l_ipv4)): l_ipv4[i] = '::ffff:%s' % l_ipv4[i] return l_ipv4 + l_ipv6 else: return l_ipv4 def open_nat(port: int) -> Optional[Redirection]: '''Tries to open a port in the nat device directing it to the current host. ''' # Chooses the external port eport = port used_ports = {i.eport for i in get_redirections()} while True: if eport in used_ports: eport += 1 else: break # Chooses the local ip ip = [i for i in getaddrs(False) if re.match( r'^10\..*', i) != None or re.match(r'^192\.168\..*', i) != None][0] r = Redirection(port, eport, ip, "TCP", "weborf") if r.create_redirection(): return r return None def externaladdr() -> Optional[str]: '''Returns the public IP address. none in case of error''' out = subprocess.check_output(['external-ip']).decode('ascii').strip() if re.match(r'[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}', out) == None: return None return out def can_redirect() -> bool: '''Returns true if upnpc is installed and NAT traversal can be attempted''' try: subprocess.call(['upnpc'], stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) return True except: return False def get_redirections() -> List[Redirection]: '''Returns a list of current NAT redirections''' out = subprocess.check_output(['upnpc', '-l']).decode('ascii').strip().split('\n') redirections = [] for i in out: m = re.match( r'[ ]*([0-9]+)[ ]+(UDP|TCP)[ ]+([0-9]+)->([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}):([0-9]+)[ ]+\'(.*)\' \'\'', i) if m is not None: redirect = m.groups() r = Redirection( int(redirect[4]), int(redirect[2]), redirect[3], redirect[1], redirect[5], ) redirections.append(r) return redirections def printifconfig() -> None: ifaces = getifaddrs() for iface in ifaces: print(iface) for family in ifaces[iface]: print("\t%s" % {AF_INET: 'IPv4', AF_INET6: 'IPv6', AF_PACKET: 'HW'}[family]) for addr in ifaces[iface][family]: for i in ['addr', 'netmask', 'scope']: if i in addr: print("\t\t%s %s" % (i, str(addr[i]))) print("") weborf-1.4/qweborf/qweborf/main.ui0000664000175000017500000004630214634465635012747 Form 0 0 313 723 QWeborf 3 3 3 3 QTabWidget::West 0 Path 3 Insert here the absolute path of the directory to share 80 16777215 QDialogButtonBox::Open Send directories as tar.gz Qt::Vertical 20 40 Networking Port spinPort Select the port. It must be free and not blocked by a firewall. 65536 8080 Address cmbAddress Select the IP address to bind. Leave the default value if you don't know what this means. Bind to all Qt::Vertical 20 40 If checked, QWeborf will try to use UPnP to instruct the NAT device to open an external port to allow connections from Internet Share outside LAN Security QFormLayout::ExpandingFieldsGrow WebDav chkDav If checked, clients will be able to mount the shared directory as a DAV share. Enable WebDav Writing chkWrite false If checked, clients will be able to create directories and write file on the server. Write access Authentication false chkEnableAuth Enable Username txtUsername false Insert here the desired username Password txtPassword false Insert here the password QLineEdit::Password SSL Certificate txtCert SSL Key txtKey 3 Insert here the absolute path of the directory to share 80 16777215 QDialogButtonBox::Open 3 Insert here the absolute path of the directory to share 80 16777215 QDialogButtonBox::Open Qt::Vertical 20 40 Settings Use current settings as default Qt::Vertical 20 40 true true 0 Clear log .. About true Stop sharing the directory Stop sharing Start sharing the directory Start sharing true txtPath cmdOpen chkDav chkWrite chkEnableAuth txtUsername txtPassword tabWidget cmdClearLog cmdAbout cmdStart cmdStop txtLog cmdStop clicked() Form stop_sharing() 559 710 457 544 cmdStart clicked() Form start_sharing() 129 710 122 545 cmdOpen clicked(QAbstractButton*) Form select_path() 549 47 528 68 cmdAbout clicked() Form about() 533 662 265 275 cmdClearLog clicked() txtLog clear() 533 622 405 467 chkDav clicked(bool) chkWrite setEnabled(bool) 260 36 260 65 chkEnableAuth clicked(bool) txtPassword setEnabled(bool) 231 94 260 170 chkEnableAuth clicked(bool) txtUsername setEnabled(bool) 231 94 260 132 cmdOpenCert accepted() Form select_cert() 548 211 527 233 cmdOpenKey clicked(QAbstractButton*) Form select_key() 548 253 528 151 cmdSaveSettings clicked() Form save_settings() 415 46 3 528 auth_toggle(int) stop_sharing() start_sharing() select_path() dav_toggle(int) terminate() about() select_cert() select_key() save_settings() weborf-1.4/qweborf/qweborf/whelper.py0000664000175000017500000002567214647273321013504 # Weborf # Copyright (C) 2010-2024 Salvo "LtWorf" Tomaselli # # Weborf is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # author Salvo "LtWorf" Tomaselli import os import subprocess import socket import threading from typing import Optional from PyQt6 import QtCore import qweborf.nhelper as nhelper class weborf_runner(): def __init__(self, logfunction): self.logclass = logfunction self.logclass.logger("Software initialized") self.child: Optional[subprocess.Popen] = None self.socket = None self.listener = None self.waiter: Optional[_Waiter] = None self.methods = set() self.username: Optional[str] = None self.password: Optional[str] = None self.ipv6 = True self._running = False self.version = '' self.webdav = False self.weborf = self._test_weborf() def _test_weborf(self) -> bool: '''Tests if weborf binary is existing. It will return true if everything is OK and false otherwise.''' try: out = subprocess.check_output(["weborf", "-k"]).decode('ascii').strip().split('\n') except Exception as e: self.logclass.logger(f'Unable to check capabilities weborf.\n{e}', self.logclass.DBG_ERROR) return False try: capabilities = {} for i in out: k, v = i.split(':', 1) capabilities[k] = v self.version = capabilities['version'] self.ipv6 = capabilities['ipv'] == '6' self.webdav = capabilities['webdav'] == 'yes' self.https = capabilities.get('https') == 'yes' self.logclass.logger('Weborf version %s found' % self.version, self.logclass.DBG_NOTICE) self.logclass.logger('IPv%s protocol in use' % capabilities['ipv'], self.logclass.DBG_NOTICE) self.logclass.logger('Has webdav support: %s' % capabilities['webdav'], self.logclass.DBG_NOTICE) if capabilities['embedded_auth'] == 'yes': self.logclass.logger('Binary compiled with embedded authentication', self.logclass.DBG_ERROR) return False return True except KeyError as e: self.logclass.logger( 'Capability %s not supported' % e, self.logclass.DBG_ERROR) except Exception as e: self.logclass.logger( 'Unknown exception %s' % e, self.logclass.DBG_ERROR) return False def start(self, options) -> bool: '''Starts weborf, returns True if it is correctly started''' if not self.weborf: self.logclass.logger( 'Unable to start weborf', self.logclass.DBG_ERROR) return False if len(options['path']) == 0: self.logclass.logger('Path not specified', self.logclass.DBG_ERROR) return False self.logclass.logger("Starting weborf...") auth_socket = self.__create_auth_socket() if not self.__start_weborf(options, auth_socket): return False self.__listen_auth_socket(options) self.username = options['username'] self.password = options['password'] # Deciding which HTTP methods will be enabled self.methods = {'GET'} if options['dav']: self.methods.update({'OPTIONS', 'PROPFIND'}) self.logclass.logger( "DAV access enabled", self.logclass.DBG_NOTICE) # If writing is enabled if options['write']: self.methods.update({'PUT', 'DELETE', 'COPY', 'MOVE', 'MKCOL'}) self.logclass.logger( 'Writing access enabled.', self.logclass.DBG_WARNING) return True def __create_auth_socket(self): '''Creates a unix socket and returns the path to it''' self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sockname = "/tmp/weborf_auth_socket%d-%d.socket" % ( os.getuid(), os.getpid()) try: os.remove(sockname) except OSError: pass self.socket.bind(sockname) return sockname def __listen_auth_socket(self, options): self.listener = __listener__(self.socket) self.listener.new_socket.connect(self.socket_cback) self.listener.start() def socket_cback(self, sock): '''Recieves connection requests and decides if they have to be authorized or denied''' data = sock.recv(4096).split(b'\r\n') if len(data) < 5: sock.send(b' ') sock.close() self.logclass.logger("DENIED: Invalid request") return uri = data[0].decode('utf-8') client = data[1].decode() method = data[2].decode() username = data[3].decode('utf-8') password = data[4].decode('utf-8') # Checking if the request must be allowed or denied allow = True if self.username is not None: # Must check username and password allow = self.username == username and self.password == password if method not in self.methods: allow = False if allow: self.logclass.logger("%s - %s %s" % (client, method, uri)) else: sock.send(b' ') self.logclass.logger("DENIED: %s - %s %s" % (client, method, uri)) sock.close() def __start_weborf(self, options, auth_socket) -> bool: '''Starts a weborf in a subprocess''' cmdline = ["weborf", "-p", str(options['port']), "-b", str( options['path']), "-I", "....", "-a", auth_socket] if options['tar'] and (options['cert'] or options['key']): self.logclass.logger('Tar and HTTPS cannot be enabled at the same time', self.logclass.DBG_ERROR) return False if options['tar']: cmdline.append('--tar') if options['cert'] or options['key']: cmdline.extend([ '--cert', options['cert'], '--key', options['key'], ]) if options['ip'] != None: cmdline.append('-i') cmdline.append(options['ip']) self.logclass.logger(' '.join(cmdline)) self.child = subprocess.Popen(cmdline) self.loglinks(options) # Starts thread to wait for weborf termination self.waiter = _Waiter(self.child) self.waiter.child_terminated.connect(self._child_terminated) self.waiter.start() self._running = True return True def loglinks(self, options): '''Prints to the log all the links that weborf is listening to''' if options['ip'] == None: addrs4 = nhelper.getaddrs(False) if self.ipv6: addrs6 = nhelper.getaddrs(True) else: addrs6 = [] else: if self.ipv6: # address can be both ipv6 or mapped ipv4 if '.' in options['ip']: addrs6 = [options['ip']] addrs4 = [options['ip'][7:]] else: # Normal ipv6 addrs4 = [] addrs6 = [options['ip']] else: addrs6 = [] addrs4 = [options['ip']] if options['cert'] or options['key']: protocol = 'https' else: protocol = 'http' # Output of addresses bound for i in addrs4: url = f'{protocol}://%s:%d/' % (i, options['port']) logentry = 'Address: %s' % (url, url) self.logclass.logger(logentry) for i in addrs6: url = f'{protocol}://[%s]:%d/' % (i, options['port']) logentry = 'Address: %s' % (url, url) self.logclass.logger(logentry) def _child_terminated(self, child, exit_code): '''Called when the child process is terminated param child is for now ignored''' if exit_code != 0: self.logclass.logger('Weborf terminated with exit code %d' % exit_code, self.logclass.DBG_ERROR) else: self.logclass.logger( "Termination complete", self.logclass.DBG_NOTICE) self._running = False pass def stop(self): '''Stop weborf and correlated processes. Will return True if it goes well It should be called only if start succeeded''' if self._running: self.logclass.logger( "Sending terminate signal and waiting for termination...") self.child.terminate() if self.socket: self.socket.close() # Closing socket, so the accept will fail and the # thread can terminate self.listener.stop() return True class __listener__(QtCore.QThread): '''This class is used to listen to a socket. It will accept connections and send those connection using new_socket(PyQt_PyObject). ''' new_socket = QtCore.pyqtSignal(object) def __init__(self, socket): QtCore.QThread.__init__(self) self.socket = socket self.socket.settimeout(2.0) self.cycle = True def stop(self): self.cycle = False def run(self): print("Ready to listen") self.socket.listen(1) while self.cycle: try: sock, addr = self.socket.accept() print(sock, addr) self.new_socket.emit(sock) except: pass class _Waiter(QtCore.QThread): '''This class creates a separate thread that will wait for the termination of weborf, and performs a callback when it occurs. A more normal way to do this would have been to handle SIGCHLD but the use of QT libraries prevents the use of signals apparently. connect to child_terminated(PyQt_PyObject,PyQt_PyObject) to handle the event''' child_terminated = QtCore.pyqtSignal(object, object) def __init__(self, child) -> None: '''child: child process to wait ''' QtCore.QThread.__init__(self) self.child = child def run(self): # wait termination for the child process t = self.child.wait() # Sends callback self.child_terminated.emit(self.child, t) weborf-1.4/qweborf/qweborf/qweborf.py0000664000175000017500000002262714647273321013500 #!/usr/bin/env python # -*- coding: utf-8 -*- # Weborf # Copyright (C) 2010-2024 Salvo "LtWorf" Tomaselli # # Weborf is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # author Salvo "LtWorf" Tomaselli from PyQt6 import QtGui, QtWidgets, QtCore import sys import os import qweborf.main as main import qweborf.whelper as whelper import qweborf.nhelper as nhelper class qweborfForm (QtWidgets.QWidget): DBG_DEFAULT = 0 DBG_WARNING = 1 DBG_ERROR = 2 DBG_NOTICE = 3 def setUi(self, ui) -> None: self.settings = QtCore.QSettings() self.ui = ui self.weborf = whelper.weborf_runner(self) self.started = False if self.weborf.version < '0.13': sys.exit('Ancient version of weborf detected') if not self.weborf.webdav: self.ui.chkDav.setEnabled(False) self.ui.chkWrite.setEnabled(False) if not self.weborf.https: self.ui.txtKey.setEnabled(False) self.ui.txtCert.setEnabled(False) self.ui.cmdOpenCert.setEnabled(False) self.ui.cmdOpenKey.setEnabled(False) # Listing addresses for i in nhelper.getaddrs(self.weborf.ipv6): self.ui.cmbAddress.addItem(i, None) self.ui.chkNAT.setEnabled(nhelper.can_redirect()) self.defaultdir = QtCore.QStandardPaths.writableLocation( QtCore.QStandardPaths.StandardLocation.HomeLocation) initialdir = self.settings.value('main/defaultdir', self.defaultdir) self.ui.chkDav.setChecked(self.settings.value('dav/dav', 'false') == 'true') self.ui.chkWrite.setChecked(self.settings.value('dav/dav_write', 'false') == 'true') self.ui.chkEnableAuth.setChecked(self.settings.value('auth/auth', 'false') == 'true') self.ui.txtPassword.setText(self.settings.value('auth/password', '')) self.ui.txtUsername.setText(self.settings.value('auth/username', '')) self.ui.chkTar.setChecked(self.settings.value('tar/tar', 'false') == 'true') self.ui.txtCert.setText(self.settings.value('ssl/cert', '')) self.ui.txtKey.setText(self.settings.value('ssl/key', '')) self.ui.chkNAT.setChecked(self.settings.value('net/nat', 'false') == 'true') self.ui.cmbAddress.setCurrentIndex(int(self.settings.value('net/address', 0))) self.ui.spinPort.setValue(int(self.settings.value('net/port', 8080))) if len(sys.argv) > 1 and os.path.exists(sys.argv[1]): initialdir = sys.argv[1] self.ui.txtPath.setText(initialdir) self.stop_sharing() def logger(self, data, level=DBG_DEFAULT): '''logs an entry, showing it in the GUI''' if level == self.DBG_WARNING: data = 'WARNING: %s' % data elif level == self.DBG_ERROR: data = 'ERROR: %s' % data elif level == self.DBG_NOTICE: data = 'NOTICE: %s' % data self.ui.txtLog.moveCursor(QtGui.QTextCursor.MoveOperation.End) self.ui.txtLog.insertHtml(data + '
') self.ui.txtLog.moveCursor(QtGui.QTextCursor.MoveOperation.End) def setDefaultValues(self): '''Sets default values into the form GUI. It has to be called after the form has been initialized''' pass def stop_sharing(self): self.weborf.stop() self.ui.cmdStart.setVisible(True) self.ui.cmdStop.setVisible(False) self.ui.tabWidget.setVisible(True) self.ui.LogLayout.setVisible(False) self.started = False def save_settings(self): self.settings.setValue('main/defaultdir', self.ui.txtPath.text()) self.settings.setValue('dav/dav', self.ui.chkDav.isChecked()) self.settings.setValue('dav/dav_write', self.ui.chkWrite.isChecked()) self.settings.setValue('auth/auth', self.ui.chkEnableAuth.isChecked()) self.settings.setValue('auth/password', self.ui.txtPassword.text()) self.settings.setValue('auth/username', self.ui.txtUsername.text()) self.settings.setValue('tar/tar', self.ui.chkTar.isChecked()) self.settings.setValue('ssl/cert', self.ui.txtCert.text()) self.settings.setValue('ssl/key', self.ui.txtKey.text()) self.settings.setValue('net/nat', self.ui.chkNAT.isChecked()) self.settings.setValue('net/address', self.ui.cmbAddress.currentIndex()) self.settings.setValue('net/port', self.ui.spinPort.value()) def about(self): self.logger('
Qweborf 1.4') self.logger('This program comes with ABSOLUTELY NO WARRANTY.' ' This is free software, and you are welcome to redistribute it under certain conditions.' ' For details see the GPLv3 Licese.') self.logger( 'Homepage') self.logger( 'Salvo \'LtWorf\' Tomaselli <tiposchi@tiscali.it>') def terminate(self): if self.started: self.stop_sharing() sys.exit(0) def start_sharing(self): options = {} # Dictionary with the chosen options options['path'] = self.ui.txtPath.text() if self.ui.chkEnableAuth.isChecked(): options['username'] = self.ui.txtUsername.text() options['password'] = self.ui.txtPassword.text() else: options['username'] = None options['password'] = None if self.ui.txtKey.text() or self.ui.txtCert.text(): options['key'] = self.ui.txtKey.text() options['cert'] = self.ui.txtCert.text() else: options['key'] = None options['cert'] = None options['port'] = self.ui.spinPort.value() options['dav'] = self.ui.chkDav.isChecked() if self.ui.chkDav.isChecked(): options['write'] = self.ui.chkWrite.isChecked() else: options['write'] = False options['tar'] = self.ui.chkTar.isChecked() if self.ui.cmbAddress.currentIndex() == 0: options['ip'] = None else: options['ip'] = str(self.ui.cmbAddress.currentText()) if self.weborf.start(options): self.ui.cmdStart.setVisible(False) self.ui.cmdStop.setVisible(True) self.ui.tabWidget.setVisible(False) self.ui.LogLayout.setVisible(True) self.started = True if self.ui.chkNAT.isChecked() and self.started==True: self.logger('Trying to use UPnP to open a redirection in the NAT device. Please wait...') QtCore.QCoreApplication.processEvents() external_addr = nhelper.externaladdr() QtCore.QCoreApplication.processEvents() self.logger('Public IP address %s' % str(external_addr)) QtCore.QCoreApplication.processEvents() if external_addr is not None: redirection=nhelper.open_nat(options['port']) if redirection is not None: self.redirection=redirection url='http://%s:%d/' % (external_addr,redirection.eport) logentry='Public address: %s' % (url,url) self.logger(logentry) else: self.logger('Could not create NAT route') else: self.logger('Could not find the external IP address') def select_cert(self) -> None: fname = QtWidgets.QFileDialog.getOpenFileName( self, 'Certificate', self.ui.txtCert.text(), filter='PEM certificates(*.pem);;All files(*)', )[0] if fname: self.ui.txtCert.setText(fname) def select_key(self) -> None: fname = QtWidgets.QFileDialog.getOpenFileName( self, 'Certificate', self.ui.txtKey.text(), )[0] if fname: self.ui.txtKey.setText(fname) def select_path(self) -> None: current = self.ui.txtPath.text() if len(current) == 0: current = self.defaultdir dirname = QtWidgets.QFileDialog.getExistingDirectory( self, 'Directory to share', current, QtWidgets.QFileDialog.Option.ShowDirsOnly ) if len(dirname) > 0: self.ui.txtPath.setText(dirname) def q_main() -> None: import sys app = QtWidgets.QApplication(sys.argv) app.setOrganizationName('weborf') app.setApplicationName('qweborf') app.setOrganizationDomain("org.ltworf") Form = qweborfForm() ui = main.Ui_Form() ui.setupUi(Form) Form.setUi(ui) Form.show() res = app.exec() Form.terminate() sys.exit(res) if __name__ == "__main__": q_main() weborf-1.4/qweborf/qweborf/qweborf0000664000175000017500000000152014634465635013045 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Weborf # Copyright (C) 2010 Salvo "LtWorf" Tomaselli # # Relational is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # author Salvo "LtWorf" Tomaselli import qweborf.qweborf qweborf.qweborf.q_main() weborf-1.4/qweborf/qweborf/__init__.py0000664000175000017500000000000014634465635013556 weborf-1.4/qweborf/integration/0000775000175000017500000000000014647273516012414 5weborf-1.4/qweborf/integration/qweborf.desktop0000775000175000017500000000052414634465635015401 [Desktop Entry] Name=qweborf GenericName=qweborf Keywords=http;NAT;network;share Comment=Shares files using the HTTP protocol Comment[it]=Condivide file usando il protocollo HTTP Exec=qweborf %f Icon=qweborf Terminal=0 Type=Application Categories=Network; MimeType=inode/directory X-Purism-FormFactor=Workstation;Mobile; StartupNotify=true weborf-1.4/qweborf/integration/qweborf_servicemenu.desktop0000664000175000017500000000073014634465635020002 [Desktop Entry] Type=Service ServiceTypes=KonqPopupMenu/Plugin MimeType=inode/directory; Actions=share; X-KDE-Priority=TopLevel X-KDE-StartupNotify=false [Desktop Action share] Name=Share directory via HTTP… Name[it]=Condividi cartella con HTTP… Icon=qweborf Exec=qweborf %f [Nemo Action] Active=true Name=Share directory via HTTP… Comment=share local files using the HTTP protocol. Exec=qweborf %F Icon-Name=qweborf Selection=notnone Extensions=dir; Quote=double weborf-1.4/qweborf/integration/qweborf.png0000664000175000017500000011022314634465635014507 ‰PNG  IHDR\r¨fsRGB®Îé pHYsnºnºÖÞ±tIMEæ .*i™fbKGDÿÿÿ ½§“IDATxÚì] p]Åyþöœ{u¯$[²d½mËÆ¶,¿̳áì M‡„B ´ÓNIh!4€c° &¥i(iiCÓ)´LÓÉtR ̸åQ^cê²ü-Ûz˶tuuçìn÷îݽ{ι– iI Þ­ÿw¯ÌÌ÷ýÿþ{î5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,~Ñ0o#,~¹ °°øE ;ÿÁÎÙRÎøRßçKg-Âob@8š‡TÅcNÒqDs‘À(ãYæóË2ÊÇAȰ2L눶—w?á|ïèÀ–\PFn……‹†p¦ÿàE>¥çú=Û§lmuu¬£¾®õuIÔÕUaö¬$ª«ã¢%H¸¨ˆ»p\”Q¢Cü€SÆ9ãà¢y>ÃTÆC&ç#—ñxz2GRé¦ÒÒétžåóì-—àXŒ¼Í˜óúèÑMݰ°`ñQFö-„3ö[¾O× ^.ˆÝ¹°}ÚÛkÐÚRÃ[šf“de<H,ãDgœÂ3Ixau¿H~*šg”óÂ|Á lŽCÉzIcp(Å'Æ3„ƒf@@^áà/€;ÏŽôm| í`¤ïAXX°ø…HÿÐbNý/eóÞµü¬e X¹¢™/ëh$µµ•Èæ|ˆèʪ‰ÍQŒæÂFEwÙô¼ö•8hâ›>U¾!é©<úŽŒch8%ßÓ!D4@¹ŸüCþp€p)üi?òò¹§Ž÷?ì7/ÜŒ¡C›aaÀbæ3üNém™lþ¶ÚÚÄüÕ«ZpºhK7Ȩž÷¨ŒÐT Mî0¡¹§¬`Ya­„‰¯Ç9ç’øcÇ2Øw`ÇÆ³u@]Z¨½¡ö0c\‚€;ÿçœ8Oz“éïŸy„7-Ú„áƒ[`aöL¿UŸçoÍçs_$]yîÚ¸à‚E"½¯CfÊ“)½!»±Lò,ÙEƒ&1‚g{5%Ƨrž•²pÈ4G÷Æñ]Ç1‘*ÒËušøÒjâ+kÖ©ñ„3€ÿàþÅpïÆ×`aàT&¾8×Ï£Ô0“ñníX2Ÿºp?kÍ|’÷)<†¢:À¡ûšøÆŠ5fÌ™§Z(‚ÑŠøb5+FýžÞ1ôö@Ìu@  ·0rCLKviË•^+@%pÚߣh:m3†{íÁ À©@üy[Χ4¿5—£Ÿþ âê+W¢fv…¬¼SMJbÈ­8VN| ,Šd”±Ò8Wûqèh/Ç#)?Ëyxwç ²yŽŠøeÄ×ÄÖv†èí³`Ÿ‰‡Â{ŒPgóÐÁoN4/Þ‚¡›¬Xü:áDûnøú4ÿ]ߣ§_vÉR~Õg–“xÌEÎ÷Á‘$e\ZEpRFtR°¦Í”ÕÇ΂…>œô¬¸{zÇd•_üNõ½ ÙKcArGEÀ8 ‰„ékßœ(þ1òÇ#6¦š—!Ø¿É €Å'§-äÌññÉ'<Ÿžsåºe|ݧ;I€yÊ@) ÉU+Ó Q}ý¥ÕÄ–}u]'mÄX°hnJCìÞ7ŠþáIÄNLć4b_pLÛ=B|Ž0Á£@dÜ‚ºE üo(‹ß5ºÿÞœ‹OÄ™••qÜ|Û·½ØýäèHê³—_¶„ßró¹¤:YŠD 2Ï)þ_áhCÇTÆÇÄTÇNd1>™•d&.4/ÃG€È5`$`(]ýg¶¿?$öÍ£˜ˆR}“¶+¢›s˜äÑè> ÁËȯ×2³®,+ÿcîìÙðí–¥bpßV,> h­ËNÿ³?¯¨pî^ÓÕÆ¯ûBI ÒDžÌx²Ê®«øŒÍ7SáW©y"Ç,Q¨›]‰9µ Ä]©´‡þ‘Iô ¦Šë"É %j(ñMAP­{k× ¼< ÃþIÎõÀÌç{Cr3Ï¢óÂFçŸF‚cÅÿ9Ç@œ…<ßÒ!„`ïV,>~xæ§»ð¹«Vá÷¿úï§ÓSOçrþœ E¯¾®ªHxí9“PêÏ ¡ÏúrŒ®ð<ÊP%2ˆæ†*,l-¯è§Ð}ð8²EL‰AèªP‹Š•¼µsHìUXŠøšô†”øÀÄ/?°è\tÌø`zlF!x<~íà¾{2V,>6Ð…4FyÍ]÷þøŸ·o?|M,îò/ßp‘äešàÁs>‘ÍŒkßp‘EûÊgŠØ>eð…mk¨ÆŠÓꑌ;Ø%„ ûÐ 8¥2>Õ„Ruƒ·Åý~Þã $ôŸIÃ%w”Ø'볂;MDÇLQ^ûÆF×Q „À¹u ç¾'[:ÙÀýV,~õð×ûÚõÏ=¿ûû»»*n¼áltv6 ’1É5‰°&²ë¦û,<†à3@ÐÊÈîsÑ|†Îö9Xµh†çðÚÎdóDí¼³wž'wœùz/zu‡è9=Úš(?]ÄŸ9#Ù€øóe‡ñuq‡çõÜoÀâWõ…­¿êóß{|ß¾á:—5ó/^ÛE(—sáOJdW¾é+ß=*˜1f¸«ÆœõÅYŸ¡~V®j–‹^ÜÞ‰´‡½ÇóBOð•Wú9f¸ÆÓÍ|¥g¢x9‰eáψKyFÀÝO1îs¸ë÷lx©uÙCè¹ß €Å/‡ü={ÇH,Fº.¹âñ§“ gáïÜtŽ|V_DÜpÔ'&ú² é‰!~Hñ£b`"ä1`b®úPÊ÷’1—ÙŠ\žáñŸìƸ‚¸ãw3dÿà…>6cª‰Ö3D{¦… ¼¯YYÃôû±Àœ%„<6ؽá®ÖέØ³Ñ €ÅG.î†Ï\ûWO¼úT[kMì¾?¹‚0p}?/ÍˆŽ³ÐÅ?a!¬*úé1%ÐÄWëŒLG~IzÑ‚ÏøAŽI{h8c©,n¹b)\‡à{Ï÷ çQ¸„D"ô¼®->@ñ.Dþé…à¤ç~#\ø0kŒO#{ª1ù%ø;Äççs—ûB¬X|tÑÿ3×üÝC/ÿç¾ü[[>GFR%BÂXZÑ7Y€"»&M(ûr.”ök?ü”`ôóú)?Âq"å¡g`ŸrÔVÅqûUØsd?xù*\˜Ç~#¤3þÉÈ%9Lú$3GDôšiÄ¢Dj5^":+Îq„ÖÁ |ЧKdð ‡ ‹%žÝVÿ/oüWï^vñRþЖ«É‘Á‰b¤%ŠÈ”-ôÑŠŽÊ áËy9VÞX½„…²\ƒ˜×ʾ µÖó9º&¹p\®hãøÙŽa1ÿ/¬ÄáÑ Oä‹9 „ˆ¦ÞŸ@ûÂÊNÀ7Öø¤Q>">Y£;Ž´êõÊW§“²ujšw„Ë¡ß_9ˆƒ“?ªi\ÿbjô?Ù ÀâÿÕsïÁäè#dõÙßyußþÑ n¸® _ºþlŒ›’Õ„ åÕ)¿ðR´WcjN­1¯36\ $*ËgÜ<üS£ÂqÀ±ãp c æ9~9],ÌSÜtÉ"Ì«Mâ±gºÁ)+òhÆj}h|ÚH.¬™ƒðéÉÒz¦öÎ ôºH”¾ÆdᢢðÃW…¿×¿ûž¿·€Åÿ Ë»þý½›Éâïé=8zÆïÞr®¸¢Äq çªèJçC”MÍÝ‚ï7˜ (+רµ®~­ŽRÆ …à ˆŠ|/±ÜE¯ˆìÊÄvŽèÕd”×}ùTᎾqt÷Oàë»0–Ê£o,ƒ˜z‰òß9É8”ð¸‰Ôf4¡è-‡Ã{È÷áj?è)Ó—0{ÈõòOpþ›" "x©mùÃH¾`3‹‡Æù÷câx>Ö6¿zïщ…wÜ~1Y¹ºm͵è;:¦£~)ší›”Ü FváȾiÐ@øõÓ<#`ªý¡ À|ö_®:6éá° 2!˜¾°Ç¯§ ™ÅŸjGûÜ*|ûGïÃu8tõ=•˳É)¦‰ò‘×ÐH–]éDsõú²ÌA_?R¦²S „òµNª²ó—"¸³mÅÃèÿ›6°øàŸÛŸšò MU‡ŽŸÈÌ¿ûÎËHGg3*“òÚI•ú£T¸ÓQÙ1w‰9ß«&üÒ8qõ9_Í«¾ÊL?xæ?¼L`H©Èè1àÀX±]ñõù]eÑÈ.š¬ì<<ŽýC“xøË]Ø.ž(œÈø2ƒDiýåOÀçpLè*‹òrÞ¼FA¹fµ6RPÓÂ'&ê›È¯Ýp6Á¥9vãºýïß÷ã¶2°`ñ¿“Ÿ1×I$ÈÁlÆk½óŽKÉÂE ò»øæ·ÕâÈ@ pu%_‘\6Ch“Æ;Ê’ɹ몣€+|Iv=o|Bû1 _ùŠ_bL_‰†!>4‰Múnæ!šìY$Lç)ž{w_»zêgW`Ç¡rœ8'KוÏÕ~3JtG®3¤7ÙOˆèê†èÒ”Á,àz˜¡´z¹YÈq–&!ÏÙ Àâ}cOUÍE{óžß~ë-ŽeM2ê×ÌNʇk¦²~”„¦Z_vþ‡$8)E~a•8Ž &|¢³Õ £¿Ô8`"~$úMùHå˜!k8âk[~F'Žf¥àqSÐÞX¯\z^Ü5,ÅÅѯáF ¸>£ëbž&,×Ì DDneÍïŒúfO2]Ô—Cú}ƒŠÚ„ãœÙë©‘m?³`1ù…Ý´#›ó–_ÝYdíÚvx>ƒÏÚç×áÈPʤá¦Ç #5¡uúï– ~t0,(L YÍ?ö!I(Ç Nd} Oz ˆ<~«S•zßd÷)|£­¦‹ç&Ñ!ÒüöúÚë*ešøXC'²œÈbXØa‘UŒŒç„½Ÿ_ŽŸ¾ÛWßEBŠ–&ù¾D?£ÌõïEÍg|C^J™è‹11s)0sk¢Ub^ã,,hª–VlÞ£è9tûÞcRh*d&ÅáÈ·‹þ}Íû”=CP@Æ9“¥ÏÓ ¡;ìÜ`À¢på·å&J½ª×`ß¼o²9 ý­TT8«W´à¿÷ Á‰éè%¼.Ö"ºë ßTïQì›´¿”曾z@È|ÊOFñà7û0iÍW|3ìÑæŠO ƒ${Îc˜[é¢sn%V4WauK5æTÆph,ƒž‘4zÓòîÿèñŒ$ªŒ¸pô%¤Ü`´Xû¸}ýq͘Ã^éCÑHÎ s>“¯|žÊ"äÒspú²¬él‚çQ¼±ýÞ|oCÓHT¸pþýÚ;*¤·×½Kæ­ú„X8EÉïRêÏúlÖ_»”Ì›_[Œ ª²O…·tÑ\Qü›DƧ*µG(‡¹n \£ªüòÚÏDÿâ¸<H_¶?ù)ÓcŠüLZñ;cßñâÎhHâœAú–*ôOzx·?÷ÒØ;’‘Ñ<.ïêM¤cå)´!êŒ"÷|\uF –ŠtýÑŸt#ÿP"`Þ›ª½_öùNC$–Y õ™¢Ê„‹3W4ã¼®6ÔÍNà•·ã5ÑÆSTÄU%‚"#‹6ÿ*ê7Ø àÅܶ¯û”žwå•+Éå—.ƒ'Éý¨­ì¯íš‡7w"wÃg}Mz˜ˆ®ú.ˆNóc®´Pd'®ô‹‚P˜–æÓ|:-Ö¤WgŸqY쫎9X8ËÅù‚ð5‚€oNámAú]‚ðD¾Ù‰!^€Ñçîõ¼ö™é—U çS\¼¼ç-­ÇÖîD"îÀ1Ÿ”ë`ö÷©\…òL…D¡üwe jŸ|·KÖ®nÅEkçˆm/Àö]ƒˆ«#ìÇ”O¸·Ýq÷?Z8ÅÐ8oó]”û.h¯Ç_½S™<˜:QêGx“É ´6ÏBOß 8nä“{rM$Úá»A1$—}¢úˆ¬!>tVuöW@…•ry–¯¯[SÇÙI¤Eÿ¥#Sx£ c B %„—Yt¦!“œ7}µ³9¡‹Š>“âxÎâ9¸rM+6>õŠl\GØpôˆ‚ÙÿäÙÀL¿;+ÿŽUCÈþ{ß­gUžù¼ßÿŸ{rNNrrr¿'„„) ((D[ADeì8Ž­kzY3­Õª¡ê¨SW¶ŽkÎtºf­«G´#-EDr‘kÜsr?ÉÉɹþ·oïù|ÿý®wïý?$mWO`þ-Û}ÿþÎÿ<ïe¿{¥z»ÛðÖK—âüÌLxøñ½øñc{x¼@PGŸíîv*η¶räÀ ŸiÀÿªËJcj;kÖØÏßv=%ÅDîëÓðZ dïÝggÚàp(Ä[v‰XGÚjû+¸= {’_²˜°¤¯¦–A½±§ˆ‹ç´1ð,á¹Á2v —Qx<¡f.² ˜Ø tÓP;à2¾´£Z5ذ¨·\¾Ÿ¼ýYt´$bfDÀ ¥·Q¢ÒïçHá´´Þ¨Õ,ÒZŠK7-ÂÛ.[ŽŸ=w>²‹µ—„ýšæ‘%Úu`Û§V/ÚðGÈH ôFßïï˜ù–—RkºÞ{Ó´pa7KZ†["Gq Uk±|ñ,ì?:”õi=ã/À·ý¯BÝö÷~9Ï?gÿz°”ËYeqGï˜ßŽ«æµáÐdŠ{Là'‡KÌê#UƒšåÇrÒ»‡¼è9ÓQ…ŽƒÂqDëuM ÿÁ¼kpøä$Ÿ$üØ5«pßó™Úíü"%ìÇæ0`5Y“ï£ W¤®óÉê ׃Ppþ–‡GñãŸîá÷.Þúž<ºgÿ0¸ðe ùôÙ=ý[:¼ð©û›‘€oà41ú“ŒþðËDÉu‹–öÐM¿²åšDÕ¡^rN-x jû/~0ü9Uú“3…öÊ\K |‰T“ÛƒªîJ¯Í™Šóâv´%À£ƒeüÝþIœL™ Ä–=VJAV õÜ 8.;gH ÖƒW€ìúÛÁ“¸sÃæExôåc(xbô,?² ë$ýpS¥OIÆ­×W©I@f=éȱq<òä>,š?7¿ó<šÀàà8Ÿsµ°Wt÷_÷íîþ«†Fþ¨i¼!U—˜Ý52¸í÷ßBKK=ÒŽä$°äsÑúyxü¥#(°OÁ{úUºûjÜf"Ð:ªº²g_6·kº‹Øz¬‚§ŽWa¬‘8 âÚ$€7Xê[ò…‚ìG:g´Ñ¿xÿE|3®qdð¶"îŸÓÛÉÞ÷щ*Dbƒ³8îø~4>@ç¹g– °fV Þ»rz[ xàð$:RÂÉ P$à_öA\:ÆÒ¿šÚÄV@ ȶÁÇ6)„””0NM °:&ÀòæÈ`!I2`ºr)Ÿ884 " Á 냹áX×V [ØÊty¢ïLy’¡$á]Ÿ§¶Â%,Äš•sðÊÎãHˆ©vKF_ÉLêÈÑû›ðPýYúwõ¼õ‰ªMé}7n¢™tO-Ô GPIínò]0w‡½–jÖx*O€ïŽwÓOÙZ,ënÅûÏéa)ô½½ãØ6TE9µlCûïdM^ÚÎ1‹Œ$ 4Ù䵂XpÉ:µýétˆA!˜)0ñ9Æÿ‡ÏƧn\‹m{NfDP VÅ„“×*Øø1P<-j“ÕˆIƪæ!§#_ÙQ÷Ylyëjlß}œÒ4Y³zÿ¶OÿŸ¦ðQýç.ùÜŸ!ÁåóæÏ¤ë·¬céxÇj‘èº&‡UKfaï‘1–¾H‚øÿØ!(ä ý|c±`f+n9·Ý­E|o×^^¾üÀ ŸþïM àõ,ýG2ÕÖ[ÿ<)`Ó9kçá’‹–r›ì½sI\Jv!ÀÀ¹Ëgáåý'ù‡‹ðZr6’Ým¶ïZ7çuàîí#Y˜î8j–PÏ‚f~ÎŽXðs_)*bpŸ‚—\·¡v¿¤fA¤Dõðv*b§c±Ôæ @ö ŽãׯYŸ?ÌÒVR¨uä‰!ï›Ð¹aŠÍŠ©‰!ŸB‡'x—à僸êò•tlhrA±ûêzæ¿}ßÈ‘û›ðúsú݆®î«û©@ß*× n¹éÞÎ3ñz£Û|­ Z»´¯îARH4($Š`MÅXl\”í3Ÿ?[FñÃLêW]°Œ’ ÕÁ©þÖêí¿àq•þ£U£'öÅN¥öÍ‚HÈZê”´&.}‡",i=z8!&M Õc–ÍíÂ’¾.¼zpžä­‹ÁÞ˜âÏ“v¸šƒµÌŒhÅŽÝCYá2{ìÄä¥;Ÿü½¯ãŸ9%h¦t:6ð ±_£vÅŠ9˜=»“^bîC) éc‚Hâ-B#sd¯ÕvjÀÀŸÙ^ÄÇ._„¾®|uëì8^âp¬Õç§n¯>Õxð—FÿÔ²2å6P’Ë4œ„•ŠUm@ «ðˆ}aZÓ¤!vQIa_¦¯=S»7?º;”ß?ð¿Ø…+ÏëÇòþ°Á=…¬½ÈrxŸÈ<Ɇ-]¬WiÉ“t^ü7(…f÷òÔ>´“²‚ó6]õ·ÿοÿç½@¨ˆfúG¥¹™ôZzØ÷WŒÁ›i&K5?‹$Ï¤Ö -¹$–ÚUãA$+KoÝ“Jüݲ¶‹{;pdzGq²œ²Ïn%X/Ö@=ÙÆmŠ÷,¹HÖ—ÝyyUÁü\;5 —¾¸>ó(4ãØXÝj3例c‚za¹ÏHYH=IÀ÷þþ7ŸÁíÿö2üÚ׃…q˜”ç xv9?Ï‘‡õGõu€®K2Vþž2¨s‚~ Jà®M£Èì``R~ôÉ}ömW¬üÚW¿ô®óܱ¡¦ðzHƒ™ô§ŸÏ2æd’é²Y,³,wëÅ9xÁ& µÔˆôrjÁñózZñ[W-Ǿá¾±u ~>ˆ/ñ°ž¤·*íS®‹´×:Ïõ4²¢õ‡j¾õ´r%Ëxèõ×F>å·Ü—1X´Î¥€˜¥¬š µ­XÀ'þ×ÓøÓ_ÛŒ‰rª: é3‡ø†ïT-€«ºF׉† s‘xCâÊÜ™àk„,V€žxzÿúïÞýò»‰¨i¼ž%øw©®¸t9&KU_uç¬m+ý*U‰„B j°ñÚMý¸êÜ>|ýÇ{ñÂÁq´èy~Uíø©~!(A~¶¨ýŽêWzAÞìÎÏS~5\$Uî¤ðª/¼v¢F¥ûŸ‚ê-íüÖ`¡@ž¨âïž:ˆ_½zœ¬WçÕ|%‰<1ØXåO¼ ˆ!&ŽC¢ÏK ±ßºó©ÏXk{›ð:IýË¿ô»H€bK‚µçö£¦¯ÂR0õ! “1ñ´Ë<9°cùšßxÇ ®à>²…ÄÏQ@˳lNês›³ø¸ÏºË2•ð5aÿÚ._²Xrãê½w@FÏHãBQ §¢Ç‡ut jwJïo¶®êÅ‚ÞvXã­¯ }MbЉ¡Á:™Ôähi)ÐÖ'÷^¶ÿàèÅî7Ô$€³=¥¿g»~]?ʕַTo Ò_ûœ]ë$:ogmXÒƒ\±·?2€g÷³Ô‡…ÞØ ‘ü*ÅM@,FÕ~WNmTkru8 qÁŸ Ü Éd&âRÛ€[}®&{†GÓüaŠ'j?ùÝVÔj&ÑOßþ þÓ‡/ÄdÕÀXß9O“drcbçÇ`ÇÔëÕj÷ê´_þÕo¾À*"jÀY+ù—}6“þ_Ø ¢EÕÔÐúuóùúªÔ’"q¶ˆÌh]¤9q™=7]¶‹û:ñ_ï݉±ÉˆÔ,à,çùÕîçl=©Îc©´%ˆÉ`][v ¸“s`ç‹9?!ÚÊSu_ƒJ®Ÿr!Ätj.ˆä{Ü#õ°rÔZÆ´$ þäû?Ç'ß»ž}- øpwB }VL R—yJ 9i®]R§©ý€¿Ž ‹üXa³-YnÀÙ˜Žîý<ˆèãH¬íénGß ¶·U ‹¤u@Wõ,¶{¹fù`K1Ë»v5^98†»?€$a[ß{#¯Úý¢¶½1A;µ øÀÖ·b¤Ù˜ÜûoÜàq8?·#s€|Ÿ¼­A™#Cj„[Šâ+ˆ‚i´ŒS"Nq œz]ðüîèh-bõÂne!v"Â.Hþ‰€‹pž”z¬1è¯kÜ€®s¹¥­Ðû¦-ߨ` 5 à¬M‰½ÕѺµó0Y®©¤÷}ªîK©€øÖÙ9Ýmø××®Á[÷ñK2[ŠIà+û]žËmßÉghôœÅáÇYê†Û€I™$|Ï#Ådâ1À@ÌØ!FØ“EÔ¶øz;uB&¡´?ãD#xÎ7‘ä -­|ñÎm¸íƒù:sÿã›\‰4 êRæw'â¯%ȵ€<1X-IÁf‡…n­ó­-d¹IgSê_ñ9Ì[ùÅ_«•ëÖö#M Y•³bk|B`Õ›ï _•I¥Uógâ¿Ýó*ŽUÂi àºJv±ñ tž¨ÿjÛË%ŸŽÀu#¦u¤2å3|?€ô‹è“É5’O5Ý tÒ¶j ñæ6N™B„Y@%x~"$J°µXÀŸ|ï%üÎ{Ö¡fíTŽÃ×6ѹ¡Î@L!1„æA#bm$!jm-|À~}DÔ$€³Jýßý9X¢$‰µ™çÀ"Ø~‹²E °–O ^¶aÖ/ïÅ‹بÔ! ÁšÖ9§ |#ο(+)èßFƸ΄`u à€­9ï0Jj× §(¸ B2¦š€ÀTú¦ºòô^c7Qœ –_Búì®XÐÛy=í0ÑÁrm®“Uľ1äï †[‚B‡naÆfçb¡€™«¾°@WÓ8 SBö=Hˆ Å~òØL–S=Z+ÒØ7TegOÿµ—,Ƭí¸ý¾íh)¼ÎÎVo½¨îVÈ "áìæ ôAÚ©FêÖs[íßàC´âNÀäv8+è… ”1¼1 bþ6B">9èØBh(hAH~sðg¿ý,¾ôá‹êwXŠÔýX+€yÿ€Jûx}^ÚK_¡˜ ½½Òµü¤ÂóÈv¶·~Àqkm[–›p6¤y+3õÕ—®q*K–b±€{Ú "ñô+€SëIð´.ùo|ë ~ÿÿ]ìað§©ágñ^iF†jÛûuÑ„¤.6?ß—çÖ+xIÅjVçžøbàçÁ¯ŽB©«i } !ºC t7àJ{f$ ûy­ I¸‘Þ—í¶,ƒm¨=4°&ò„HqÖ$zÿa-f÷tbã¹ýèho ‚ÁàJ%.7eÅIYÙ$€³!Ùõ9¸‘k)q6[!á-Àß‹$у9V=ðœKµ üoYÁáIÜûäŽXCbqr¢‚Et¤ösŸôÇN>'Íã½~ÔË4Þ0ž×ßxÄ KT©îUC¿FŠÖ@\† ·z"Ñ#‡¼³Púþ‰®ºµZå[’݇ß¼¢¡‘‡WG#u?îWg_^“æ%IÂw?\zÁ"t°@øóAJ-E¢žU_¼@kÓ8»¼ÿï­‹ å)ágÛ×xÀª`ÉÿžLòÍÀÿà3‡P,êÉ cUÌìhq õTxÍ n«c©¿çŸJœP·ü$júJ-®“Hunkgù[ƒòX€8¸þ’±)B…ãpâ8†Ð68g`Ï”˜ »ÚŠøü·žÃ|`ª©÷ó´+áJ?CˆS†gB´eŸ»qm?V.íE{{ $…æ†Ôë$Y(à&•¦ pÖ˜_œG@?‰ôטn¾ÐãÐà^ÚqŒÙÞíùóû毿|9Ž—3ðÌÆH<úœNŒ•ÑÝUDÍȶžä£íTí_ õßå°n­‚ßÔªˆ ¯Ùp6ž”&™#dâi @1¨€ üðú‚(ÂÈÝXú¤?À|}ýé&KÞÉ‚„°ïØ8¿Ø³oV;Œ‘‡6¸ìS•u©;`Û@+à$Ÿãg7·ov6œ3³ºÛÑ‘‘‘¿^çúZABôÊM˜nð¯ú<Ð5Hlx~äªÄNž½‡Gðêž!$”ðöo¾`!KãûŸÚ%8 ž,aîŒ6˜ÔäÁŸz=2žê»ü¸Ïw¦jû‹-gl×&fè¸Gd g‘öœÁdÕ@ÀTú5çw (ò%(»<“ru °N'QXcðÿÑÏã¶[/@©Z“ï£T£p÷Â{]=ÖHšÉŽkˆ™äïÁ‚þ(:¿‘[c3€†ç V­µM˜Vûçg„®&GÝ”¸LÐý\w1ÅÀ¡Q¼´û86¬éCÿìNüà‘ÝígÉ‹Ýg`˜À‚9ì46ŒÕWBP «_@"úd>420~g½+E¥gÐJ<d< ~ë™ †× ºu=âËDüR‡BLHäJs€n„ÈÚp‘€•ÿ{¿¸÷.\9‡ý#P`ŸQÔ!ÅuÊÇ+tu´bc&ý;³ÒÐÚVs¡ÀÄÀ7/¹ðßâæ4 `ºS\Mbÿ“xwü¸nrŒOló­X؃ïüh;ÿ!­õƒu؇O”± SE+©8îüyÐmhTžQÀ߀QƒªHˆ¯‘ç¨@¬'Éø‘‚nÁ”à×~‡f7&@ct[QOj¿?ï´ èzò|’¾pWà¯Ü…_wÆKµè’´S›–\ÓqòúçÏîÀºUsÿxËØ&‘º/Ć‹sùâæ6à4§ùkþ#@¸‰ÒspÜ…·Vª)>ü+qßO÷âØð$’DãÔwìÁðhEœ€’y|ï±q¾¸"u!»VÔ|ø<ßÞïàsöHÀà„R‡„øŠ†!ë‚,G—]4Rp%˜q%D h~‘ì JÒ¾ø^ï›Ü™3¸OamGÊ6²ßùÁïüxÞuùR˜Tçå[ ´W ¥2YÆï†8wUôwñqïJµ†ZÍÀ¦ÐD‚,k­jüLÓ=ÓWš»Ó™oÿCÉf¬Æ Glm-GyuvñÐÓ¼Hjß19QÂLÚs¨­0`±op‹ûºP«ù‘~ªî«ÝïNþ¥jï àó*¶Žö}äCÆ©ò&òÚ‰ÕÞèxãHAyFüâàm j]ƸŒÍ¸v$ÍIãô‰ˆtJù¯Wˆ}ë^|ðªU˜(×¢y±äǦ¾ñXÆúz;qÞª>öú—«)k‡•JV²Ó1 ŠüDD´&ÅKš0͉ˆ.!¶ýë7ðrÀûß¹ñÝçÑÑÒÜ+)¡úY€£|H°²óÐÖ,œ‰RÕˆ´÷¶ú¼@ n×A¨Þ·©IÀÆ„`dªôÀ?v 7_2d÷aê‹AõÒO3zî‰BŽô2=:XìJYGÑùƒ†š€Î°ˆÇâwùqdÞwÚëÞ´Ä1Ú”I· I[j¤p´µüÂöŸƒs3b¯š:øk†ãB²¶.£Pai}xÁ’ ¿Ò$€i&€5 (ð½ÿ‚¥rŠfN¿Û¿ÿ¢ ŠŽ"ÿ:é㣠–Yºee_w+jµÔ;À3Õµ^ jÆ™J×Ü!m«cO‰ Ü1 #ö¾sººøHýâ0»ØµÅ…È(ø€_@U>V z{1ÇC‚ïØî—^›w Æ„•á­{pëÛWc¬¤Z@œ(jÅU«®!þy+ûP,$lVkuû¿T©q;–ôyƒò˜…]=ðÌ'›0­‰lA¶þTÝ3¬úÏÅèX;÷ 厩6Ò(¥jŠ!G¯ìÁ²þ.¾~¸28f' ÷…ž×+!p¿®1žÀÔ38k›Ç,7t Oω¢[„â'ˆoÖRúDR+´§ŒÂóÿ]UêÇæ@èg^ýL…©”rº“£óî}r?®Ü4ŸÉñ´Á— ¼vFg+ÿ&f÷¶£’ÖÁŸžód™KYªá¿VŸfÌR²¦iLcZpî—ò(p.Y2ß|ÝzÜyÏKhi)Šôp*á¸틳dxâÕcX¿¤Õ4Eç·1ÐUäk_Ž£SÇõ8à¸ìïH;\AïùTñHÀÏÙöò µçõÍC ¥¿<‡òGŒum|Š@H@IJßoóê{B„;Øyí¹bžq²Ûûk–̪ų˜¨Xõ¯Ûÿœ'&«LS+6p jI«›0½i±NÜñÆ’ùš7¯Äý[w1h S$…znÞÅ™ÏîÆùK{0^NaôúnÅzx[D±úom Ä{`r7 GÙièÉ5¨Àl½:¦?âØ! uå¹z|pXÍnåmu>…o)VÜfòñìWö cåÂn!ÇÓŽÁaù€Ã}Ï[Ó‡¶ÖbÝëŸÈö_¹f0>YU€ÂgÇ&–XÑ$€éL„~ð'iÜæ¢ ó±õéý("‹_q ¼Öâ8<4¥ý]|O 8ýrçï òš„+¼ýV@.^.ãÃB¤6>#<6l¬ xÌû,wà4âFúþD÷ HΛú=r*¾ÔlþС|Íqúñ·/ãcïZŸV˜‰Nó'b1»»›Îé㲚ÕŸƒ€Ê)Æ&ÊYÛÈïHþ }ñ-ÈÖ´7 `Zõ³ÝuÑšÔâÚ·­ÆîßηÍp'E«òŒØ¿äÕÛ ^ÁŠþ¸EÚñ<͆³H÷ˆ¤ÜÐë¯~é7SÐ «c0çP’ %¹òVÃø]›/côW.Œï$ôB¡ã¡”0GÀ÷# ™„® Pà(Ažvê¤$6sF;ýÌéª_ó^M¹,UR&€jÅðÁ£±‰*ƒ~¾ú†'ƒåü—b“¦)Q‚~?Ü~“ Ö,ïŶ— )Px’¾µù†þ˜ëÒç‰íÇqÉšÙr†_Æòv¿ñÛ HÀ Ú4®­±ÿ†çÈ:‰ àúŒ~tÎ`ŒVµ Qåe?·Crrr_ÇÕTФ|0¤v=— x1|Lש& Uþ·¸·\½’5±Ó1fv¶aýÊ9X¶   \«;þÒTœY™¦ 02ZaÓ‘^ó i$eÝ¡Z°ýM˜¾ÔGÊÔüCó›–á¾Gvó¡Ÿ)Ýý6|›Ûì¶àá—Žâ›ðV‘NQ+ü’@þ°ÄôC‰ÀõSà'ˆn$â¶‘¶>Ïȶ¡nE*ð¡ßScÂPd½'E~k0rj]w(xyv¿¿c ßO’Ôüž ~öÊ Þ²q!ÆKU‹âý$ˆ0³«}= ÷Í2/®9`ÍÅŒO–˜X¦L6ÏV[}M˜®dÑÑÑÜu6­ëdz/FBþIŽFŠ@ GZrçøD•Ô3Ú‹°&|mÇA@:” Œ8ý´­'ËV| xؼ@Oº2Òp¸ÑÀþûc§§Hk…«šyI¯Q„ÀšAЇÈw Õ®ö"~šýmÏ_1ÆiE:-ücXžÀË{‡pthe·ÝG |¥fØþ/WR~uüèx ˜çú®r=å^}ÐÞ$€éJ µém¯ÎéÇÓ/f3@ÝÍùtEA¤¨„ Tж–?zö0Þ’‘‹1&:"GûIÆ$€P0ê ‹ý$àgGŸRˆ²á ˆï ö¨)AÜW–|&Ñ:˜uôÖaø(B›]ªjïçëj:èÕ‘¨ÇƒµÄ XE¡‡wHèÎvâƒ×¬a{=< ,»Ê¥ŠÁî#xîÕ£8ptÆ㥠Kýj5•]ö/LdYÈ(ôøË®C/cþ‰SÍtzÉ¢MOûY\’©éwÝû ÿP¢$PéRŽ€ïY–C0êžN(ÁC±|æ–óñ÷ÏDW!ñ´¯’8ý„{¹n“ÐslK*YŒˆÜç“S׉@#[¥bãíL!&Á@¤¬!-M`rxÕò¤¿ÇµmQlí@{÷lZ; ž÷þÛ¼b»ºnM’OÜk´mEpóau]ä[¬¢»«†IJ??ÿ_š«¼u{äø8&&ªèl+²iÐÞZèqÖGÇ«˜(Õôšr}ùÀ¥¤IÓ˜ZÁ¶?¡½½¢#ctt¶äÿX–Ô©yŠÉÊ×… D²qDÚÁ¡IÌínEѽ%ˆ ^I²$$8ŨvègH¤™RDp¯îŽhòv-\ôHÿ}”Üÿ¶~éfœNú¥Oþ5fÌmƒ5úùp¥:ðÂXåXÑ:BPÛÌ:¦€²BdVÚJ:ÌøÅw=´7\¾÷=¾ Ç›F¾[¯ÖU“â…íÇ2hÅÒ]|7D]Ý&ÞÈ4Áú©“ª$2¿µIÓ· P©œ³zžù0ß+ç§ô¤‡g”$êN@ï@!ƒ¬ì(ðàóGpÙÚ><¹cT°úl ÞK2^L‚éá$"DN+‚@´ÏY©ƒxÈ|Ò3ü’œ?iiÒIûd‹aäè!¬]³IK¬#?IŸ©NbøÐNÔ* gO³5í3g#)v„±ÎQÐjêUŸB‚€˜¾VÁºCpFA¤:q•ðàÓ‡ðO\‰¿ùÉ.t¶TuO–^c ú{»±sß ÞM˜˜,g$0=3Ú‘Àbt¬Ì;§úÛ T›0}© i-#€ås2ïÿNQäèÓRú¨}Šàê*=8û$$ÀýÏÂoÜpþù :e‹Q¤¼úŸ¸*ùU¶Ç^V͆™Š3!!oÛÉv"¿†/×di8‘IûG§öÎ;µ4 Tÿ˜Š­xá/ÿqºôã…®Ù ý(C5ì’¦XÒgÇß’3ÐÃcU>ëqFIÿžå&L7 »» Ã#etvµªÉäßï ™¨ý‚M„Á…D vÁ’¾hoITâS¸­H Nµ…EÞ{’ɰ) ßA¤|$ Q)H±á7Åæ7@i|4sŠ®µuÞöišò§J|jãFYÃ¥)¡41†®^°'µyVÍ op) vLxX0®$PHüý£û°åMKq÷ûaIÍ(ÿ}—ÌŸmÛ9óP3C''Q*Õ0wvkJhgœÊÍ]€i$k óævaààI}õŸ´Ô`‹ ˆ=Ïq,<|»Ò¢³µ€ïn݃6/b/t¨0Q@ÃÐa Ò ·õê-èüàjr†Ž»…È}6gîd`Y#W™ , §Ì9p)k„4,ôÌi¤¢¼t-ØF%ÿnW€®„Ð<é,mŽZ‰ |òçGqÅùó8D[Ì8Y /êrÞœN M"! Ì„Ôc“ d¤~2#þa©©Lk:ôÍžC‡GÅû¯9’úz÷½LP?8ÒªÎAß^åçßýø¾õÉ+qÇÃ{8ÐÄSyC)bœÍŸp—âý'R¥˜œì¸Ò‰âãH„ëÊüû ][5„€Yr—±BSj Ö¯˜ƒ—÷ 1øÅœ›òŦVÆ”¢csªQ"Jšï˜ÎDHöXJ`RïûK Tê©ÒÉÚ—* öÔ‰×ÑZÀß<:€k7/Dª§r^“äx¯:%ãæ•~x€æŸ™ƒ×ÏSøµ~&c~Žúø~Ö×Né' 5%MÒíp:ÌNßǶÆ…çΕóîÌFk6F¨ˆYèQJî>SíЪT8¿1yO“¦1 ¼ð‰}„Õšñ@RHƒ_nü‘äûuM„;Ú…_ß²†÷«9ˆ5é NæEWxCÞí•õÖ[€ÿT .‹~–>ì”kãÏ’LYŽL pþ˜qÞö×zþÞ¥Š t8!‹'~~—¬Ÿ“ò<Žó¿hýÜ,þŸßìæ„F½Uràfð9SŸ3Åê5ØMÀ4¦$)ŒWki%Hýij÷áGý¹’´ç#t Òäí ð@ýÆá§¶Çeëú±m÷ çæyPÇŸ%~F Åàjz½sIŸú,ô ¸ÖÀ—<–äÔó×Êâúkípöë mcjI(Zã¸õa(袰âXú#ðX‰ðþ öÁ9KfñI¿¶ÖkWÌ–×¾Å~˜àˆ·‘°ié¦:A“›+Ÿ|ÓÈ®4;šÀ´vd¬Jë *-–æˆÔ~-5^½Ñ¾æbðç÷¼Šßº__\ Žê¿~næ_ ntßßðüàõ[nÌ9'?αŠÞH’Çš@\odDê¿PèÇ€ËA¨/¢#Ū!ä¤?Ü:M¹³\¶”ùÚv“Õ ¼ïàȨGp<3 ùlíñÅ$èÙšô»céÅÿ¹©LgªTjÏp¾¼¥Þ7ëDÚ'A¸¯J~X.õ‡íûs逩RX·øŽO`h¬Šsucàø8,%~ÄŸ›'ÿOÑ}ƒA¹óyæ;˜ï²=}=ùyî±ÂM¬êV ÉÂÍ? Zº$]g€?gF›1üuÁKº~Ë~A·ˆóÎô¨Û©päV/=k¨JþÉ­uײÁÁjjÒN€;9)°#ÄR8uû•[;ßr~Ûe½.ããGF øÂGvå,3üœ’JÀ®õ_- g?ò Ç@'} lnnæ`ŸŽŽŽÑÎú]àZÆý+ïËóîûúÿĉ±ûìÑÜØ\~‚NÆ]£ ïu@7¬F]ò((.ÛväÁÓÞ?ˆP%c.…€|Îv¤ŠÖH8…”$KRÄ[V-¾C´óµe$!ˆRHŠëH–ÅÎÿöÅ1Î9]‰CÊ£æ,zß™mhãKÅ G P:x„€éÁQá £wX¢àaìØ6¶ˆ¨_ÒQŽø„ûÇCü:þLü=£|–±mmðˆ’œTˆ®XÈœ›¬ ØEZ±ÜM8Å °GV®Ú†77ô¢cl”²•‹\ñ_ˆ@¥Í'YXœI@k™KÀhøh•ì Íäs{°¡.—Ù+O\ð‹Ø9j=?n®ŽJžK)|ç¶çqÞqs8>ÝU#dðË;…XéA"­ô¡Ó)žÈ$Ô vÚ¾þ?ú9??>ß¸ÄÄUˆ<[Ö,¦.QR"H&^uT.¢ð]ıèã›kÑP›ÆÚÍýxeu/fMo…ÖÊMñ&$nÀsB´EÕs>×!òÿƒþ6mß««àŸÝ&íþ]ôô ?l ?’CŽcpÔ·Š€œ—$Ä·R"ˆ`½ó±;±ë¤FŒm#`v‰€RIi@¡2»pÜ'€ æëšÁ?Š+ïhj@¥¨/ÀwÀ-s þØ(G<Œb?¦Ï'ÃtE·—5ÀõþÛ®c@‰÷þû~“ñàSë82ðÕ5Û°ëÔ(%ª†ˆö1"âr}iûÆBÞäª'ü¿­]~~•ü³ÛÆ/BçÖÜCLÉ=‡ÃˆAp;j€sîŸàJÛ¯ë%œÌ½_ŸñqÅoVà¢Ïì\!°Ò‚cýGì]ò<â~ü¶„·»ßƒ­ìD$  »`Oˆý™LÆ^Ûû®ÔàxÊÜvòÅ8þ½µ[y¨¢8 ¹NC éJ,ÿæR)À1ÿ6÷<¶~”yicצN¨g¯ÐÄ1¬zÂöîóJeþx7ñ‰}†¼Õ«Wž©«*ÀÒ†Ö]²º¯/?hÔçŒÉ ôðó‚ÃõàÙ&úk%g·À$àãX?&müšJîË;ìZå1¡|fÒ ûøž}'Kô#Ç£ˆëˆƒ›‰€¬¹½Òè~f_o?”)EîêýâXQȉH$…f€ï7g<ÞXß‹þ¡HÒ7ðœãBDb°7]ñ_î‰5áôÛQ$xè.¨€¨ ï0¹ß´ ãâ¦3b»å¯*A̓½®ìju$téÏ—ãÛ§îƒÁ\Iî»Öñtt~e ŠÄ HwRVªÑÛßÏs¤4©X »€¹?÷ØúhÀ—¹£flذËV¼ˆ¾žÞŠšƒäüý]µH@&÷x©2Z+÷t´Öbr{ž~u ˆVMHy@jÞ#ÿÅÕWü·÷å7Á£<3 ± òùÿ¦í{M•ì(mòß©íöGÏóÈó\Ð;c¥N€ŽD*/·ð‡<ç¬A‰ŠñV÷‰ èÆöžˆ0TÛ³þ ×WIW`ª´HH0ÏÅ0ØÓÓ‡¥Ï¼€M›6¹áº¦ûhj(Á3À'ÏGsCÁÌÓð à›ë‹fÿ¸3hi,Â7kfnöfžáÞT_ä‘È<Ûð~ž7<Æ$ žO™2ì³'›š8ÁP®Åß­) „Öý嘼Î1ÿ>xþøÈ뜗¨ÑiÔ€±-5ji×™q[Ceñ’Jé v:àaõ’3ÿ¾vùyU°£´ /\ˆÎ•_»«»·À`aKe¹†? $Ycœ«—;寰ˆ‰ˆD€K“/ºí9\rÂ\®@kÅ}¿pøÑƈJ#mnjÄ!ûí…©Ó¦%ÀÏî»äcZG€@i£÷(ß̧LèE*]ÏÏ`Êø¤ü,ühnFîSÍÏ!YL× 2s˜>µ£ ”ý,îVÝÛ6‘HÝH0+[“Á‘Òû€ÒÌÝOúÈlÜò—W‘ò|xçì±èæmÃßR ¨¤ž/ŸÇu%À!÷œÓ{‹î€ª °¶Á¡Âƒ5cÒZC¹îñSäŽõ: Ëõ£uG pˆE!©×ßó*¾|ôn쥒’†ë ì9„“Ôº ƒÁ×ÒÚ’ðï·b¹Ö)®F dú¤qÝ Jƒ¼ &›¹gFßôIíÝ rß„Ic·11 ^çýÜ'߯#P~§ÒIðG¯Uâ8Õåü®æ¨QI5@B„q]¿“æÍÆ]¬B1 @$JâÑ—[‡ÐÞVË“îí'’ˆýBøZ°NN*Sˆ¼›¦íwM•ìpjÀžß‘wc_êÇdäÇ7ºÊÝ•®ÈŸ\GW—uÀ¯ÿú:æ8Íu(å€~j”#@F»µˆˆÝcшƒ1Ò‹}:b"0Ù ;Ú¶pþ„Ö­ðY™oYcÂ0±m+Ï™˜ý >´öÌ;{ønÀ¾gó'ºœ= ~×í×Y‹«e @1ð‰Ãg`ÙËè2êÁœz„Öã³sÛ ÆµŒàò(áÕRü¥²v¡\ÛïÒN5k–~åÖµËΫ€N xþBÓÏ»e8_ %Wüt½<+Dý WߤÇàØF—àâçÿä)\µà.=Åî¾®/€}–—+Å9HRƒÉ‘!ƒÝ•¢¹ýø^-yô†»ÃŒd€?¾µ ^ ô©T KÚºà§Æ˜žå=Di~vb$ )# ô0q‰¦|6%ˆ#mð*6‡½ï« ŸV¥ïÙÁÖ~ãíǾ¨ðÜ”PßÞ"šê³€*¯“ëþÍ/vÄ{8'$¹ã¾åAÝ U`nžÖîÌë1cRIÎ#Ö^¹Nˆª®SPåS;±ü®ø/× >/­éÁ†-ƒ˜·ÿd¡µàÃî‚Q\#PñïÅÏø^2Í·•zÂ,Æ+íC+†ÓC{ â -†ÓSšuýöÆNÚlS'É3DÂì!¤Êû[»ôÊôIc»ªí†38™ˆ‰ŽŸ4lẦќ‚x ÷ìÜŠ)ãêðà’õð}[EÉÕã…Ó÷Ðh@¨BhÇãoôøñ=Ô^×àQžb¢à‘ÖX³´Jvd5@“w]€Â’BŠRY#Š'ÉäŽ À{Í]Ç=Ø~DÖ÷qÙOã¢ãçƒF ûÜ“kèK*ùR•ž‹ä'€$7yHï‚̨AHO™û ÒTGäˆ/…ß^B6c@:ƒÔØ>ìØ¿T~ ~WzzÈb0 ÝI¤#ŠÿMTB £„Gähà·Õ‹4¦M¨ÇA»OÀ­÷½ŽŒï%,ûòoš4$ƒkÿéPT¬xw}ü“%œÄk‘øÚ1 j*®}êÜ»úóûáÿºªíÕ¦ìuM(lÎdSËHùTÇhˆ3§,àÿàG\¢½^lÎÏ8÷yêñh×Í%Ñ"sôãÊ1‡Mǹ?zµcÒÑm~—¤¨ñ¨ùB w_Gëös€® +1í­ß#ôjgòétŠ9|>h@sc îRØÄÇyÙlZÑ22ÏdR+ë åÙ¹ZøzŠÅºûRHQ fÞÓëö£X2s³^“DÙ/ÊÌ£æðfë1hŸ°+´Šëö””xtÁ/Ä!TíM5øôwÁu¿yé¨Ú¹ÆXØŠÀ’_qp¸ˆ Oß‹~¾”U° éMÅž' ."DÒL´Îj]»vé9Ê5'àÙèû.±À{¾'µã¬å—XÉ\žìq« k1Iá©n+c”Ä7yÕÃH5Ûøô3ðo{uà©—·p¯ý/V¶\8š „²×bÀ"¡¡\ü$v¤6þCß ÈrR)æJ.øt­õœtÔl\}ÓÓ|îï¤n)NtúDî~ Ï ÷ç=N)r¢È(k] EJÂCL`¯ÁM8€t•ìà-$o‘§érŠÄh"+^:ND¯®=ØJ"DN]Å‚GòbÜÇ‹œx$Beœ4FmÖÇÙ?|\{>vñý(•&1H*‘øgi ”€ ¨(Àƒ‡‰SgbÂQW ”–"½Ü×?ln>h¶)gO\ÏdÆ`ò”]ì#NÚ/-ëü ui|þ˜9XdÀï{‹ØKVªL¢,ÍE("ÿ(º¿Ø&’l‰â$·‡úï«—}eÖŸIU àÐ6={v~ò^Wݤµ>…4%Ž–<¾Ž"b"2¤ ð£ÛbJÄ™SȆ£è\šõ`“Õ€¤ ð™?x ?;ï0|겇Ð0b¤ô²’u—ä× %~ìBZ´B&U‹fÎoô½Vš¬9Ø5ñ…rüåk9RÚ<Úó™'é§c]ÿ}M g·'¾ûËeҘѕ€ ©ò#…ºR±pÀîrÒ°à×:YŠDTXóêÅ»mî§•¯Â*U#àŽÜ&Ï]þ%/ìÃÓÄé°S¹Öñ@(¹FB¢šP\‘"ŠÖ ¦Çê3ØÝ,á°Õøë{Snä¨ú¼CÚ”)€ü3%|\ÇPBïîá$ø´@ K(ú‘ëÛ„tØýöÛ‡trÝk AèDX‚ ÂXò ÍÏ„†8„†h¤QÀ©W<€Ÿž{ò…R™{*$cæ`ùÎV°kâÈ]ãÿßVpHé1q8J€žï;8^vï82Ùçí:qSÑQ_G[»¾uÃü®ë0à ‘ãÓ­)Çw¿‚HðTR¢SÄÿÉžÀ b–ûëMk—žõÛûZ xȾõÿ¾ù¨¶ÿuëï|}oÝßÝÐñÁý=`&@Dž=F“br|g«øˆ’©©TÈÏlÆ/‡Ã?t ” 9ên—Y³°få±7‘° àax  SÛ|¬Y»Å’ÂPAáÄÏÂýK6pDÕBŒt"¥TFÑÇÉíñwAÀÅ„Ag$Œ†‹ÜpYù~V_v ¯REîEÒ’È3 4fMkÆgLiµ+nX†”ç?äD7:Ù˜Ôg¥R í1>h¾y½¿/ üòžØ%™«’@ ¡AÖɇH¤>{j“8asêµkž:ë+ö‡Æ°$¯JÞImý c xöì5ŠôoËånÔ=ˆËidåVz„óð¿.ü~Ú¬E~EXxÌdR„šlºá<&ùž†tapëZLnpÿÍ—¡¸„#š‹®8oàì+ïÁ§Ÿ‚õVmï?¥’Ä@<… ˆ§Òue—û¼_:,ൠҀØó¾²\ž¯‘¬rÌKe›H._ıÿ¾ fOoÅ•7-G6í¹Ö~ü.‘v37%]‚Ù+þâ&,´ˆašG^àýÑîhôˆ<ÿ”“Ÿ¢›@x_Q%ïL)à*Î~ŠkÐRe Á bÁz÷2§áGÀßiÀŸÇQ›hÅàOy„Ó?jÀŸöQ 5[ökj²¸ëús1Üó&z7¾Œ‰M%üåæï §?‡\®„á<ÞØ>øïožŠþͯá³ß+샴OìU/˜¡´K ,À¤–($ª ‘ÝÀ÷$"Q8U À;W øªé_ÉkÂE¤É±èǸ¨p ‰C€°4ˆ¼C¦€{û4RjX—Ý<ËA'*„íQß{7aÎTà·?9cë1·ù\ƒÞ²Ö¡¡!d³Yø lcðß_§¢ÐV…³Ç‹ÖTfN®CLŠEUî%…B1ÉeˆÃØß:g>N¿à—øð>ÍØkçF.3FÚ±‰§ %Æ+'¡‰¥Cz\ŒÀ+4òÅË’){/nï„åÔè?þÚ¦Rïüà¶ÈfÓ Àj(7‚|®“ ÕɦìTô)Å~Íö–:lé˃|K¼hîñܪ|6fAG.ÐAI! ›ß\¼ð‰ ž¯o™Ê(´rI•¼›ZÓ ”>Š(:cç®Â"‚Âø7b÷é>î¸á"tmëEÿÀ³ÃøøÁc á1èy$"?4°9| wêÛ¢4ƒ1Ô!Κpê½z3WȦ5:‹-.† z– ¡éVÈá@C.ùò'pÒù¿À53:jQ ÂH\HÅ¡G~ˆ±NÒ´gÂñÅP(iÇ úµ½ë",„Bù|`òLÀ 2"ÿãxze2TÂGŸlLœ“X5C%ÕŠ  Ø:‘½ÏL]mš31—ï[ð›;ò³ÏK"­Ã°{í“g4ïí½Þ;Mÿ"ŵñªðÝÒ /ü }›ïÛØ4éC ÐÞÁJ‡¨«ñ0<ÔÏ¿9ÓSøýõ_EwO?‹øA©Ä.»Ãýl¼ó=ü555€:KøÕð¯Q*éT ð€³Æj`àd}»_òñè>6ÖaRí¿K™Î18!Ì8ÉÆÔÉ“1eb3.¼öÜxùÑxüù. äxd)%˜E<ùx.¢4¸Wü'fJW—¶Ý©­˜È‡íÚ”g>þúçöCüå?[œÖ'S~ž¢g |ªÌ» O *¢¤: ߊ÷Eî(†{·—WõÀOù ÎfYïW¦—Ç ÆdøÓì÷lkÏfô½µ üÀ‹lø«JïΦ±nùùç›ñͰTÒAiÈ€3v›J¸óW£sK7†‡‡‘Ïç ø Ã¥ ˆÎMÐÙÙ Ïó˜ó[ðß4||åõÞ|¾þK¨§F:DÚS¸ûEð| ^†,ж+ä ƒ¹=poì¿×LœúûqÃ%ïçrcA¨+Žÿ´²GJl1߀Š.÷ã6k°kîñ 8ôØgx,Æ6Õà†Kß;z¿¸óeÔe}DÇ­»/ú¶¼Ÿßeï»Q|n4¡9cäÚ“£½–ælë+ •¿gz4F{`s8Ø:aX&<žwÙº‡¾Ð–ªS‹'ÁPêî·UOÞmÍkßÒ²ïølf§ …|'˜[K·ÿòR¼¹zÅ0¿T*¢P0½X@©82/ ŸË¡câD쀇—®F}ÛdL?¿þæ<|ö’ûÑ=c"û¼dæu›³&ÛÝ” ×W –<â#•Óv1ÑZpÜ\LŸØˆËþç [¬”ŸIÖÙ3$*ˆ•âZ¥[ÒÝ)ÉóÖ†€_ŒwaŠ¡Âê̓ð|¾—LïÅ\ßôR˜^ ÍuøØš'Ï>ìÈçµWo.ïH؃4P%ïzüÈ£öTÝ{?~ÐÁ‡üðÏ·]jtþ>ð¼Q†P|ÞµT„ ¾ÎåóPJ1ÈÖ6`ñî!•/ŸÙ‡qJÍP‡zf¾§ðbÏ,[ŸEÚíµÀÍ£2jù‡ù·§6 ä¥"bðßqçÝX¼ä54Ûéš&(J¡­q nùÎ<œòйm)N<"!­‚í„·Ót" ·ð‚K…|Iá=Ó[qÁiûâÇ¿{KLàMMÆȪ •ÀQ_ˆƒNVãpJˆ%‰“H-ù­WÑ2-ÝòyD †Q=Æ  |=2–B­ ¥¾9W>>hiwÒPÿ3ÀÍбc¿ª ð®?0Jïô©£gÍþÃÍ—°ØŸ7€6à.–Š,þ—‚Rd(°= `Ö øyþÇßþO´¢@zü_D=5°›N_Û€_Q& „±µ _8ļ;Ð6—ê^xG§62WÒ”Âm¿û#yü%4´M…Ÿ©Èç`£îþ<ŽûÚŸqã¥ÄÔqõl’±Äs7,P½­ns ˆ«°¤*‹˜'‚ȉé²/ˆ£ß·Nûϰbåd³¾ÕÇE¥àN^þȸ'Þ„Nȵ¹Ã%cdFÏâ–ý”¤|µµY5Ê÷É“„¿‘QS±À£V¥€Ò- û+Ï [|¨&AãIÓ+ýªFÀw-øO<é¤ù×\}õÂá\^÷ööS©X@Ñ€|h„‹L ` ¢ïîî,Y²3gÍ4û‹1íØ]€F¯ äidRÀ£«ëð̦Zd|ðQÞø&—5ïæ\!åêŸ]¯Ø#3ŒoÝz/þ¶x šÇÏ@zL ïðˆ`Y{¡=ûuüò›GbùKoakwä‹3pTí¦«lÚ½ñ\À''C¹"ß{.7þÿºõYüùÑUȤˆæY†-„ÜuB¥HýHÛ÷[¾±èë¸ó@ñ Î6¹ïœÝç±®>‹æ†,6vGJ 1‘±AÙÙ'(Diÿ¨Cÿº`yQet>,íáðð«À»ü'œpÂüï_wÝ¡¡a=40@AP2@Ï!—/pÈjF6ù¯PÌðoòåË0{·ÙøúE_GÎx×ìLìÜ4޼iX¼ºOoª5sÍ`o«ÓøøÌ·¸:¹f±º~ų@!WL¨°µ¾çžñ)˜º†Kyè ˆ¸•x¬ù !Ž9ûO¸ò¬÷a]ZQ,ŒìÎ ÇÏNÁÛe-ñŒ„ +…0м4q\~qÙ‡°Ó¤&|ö¢¿`ýæÔ¤}†­åöb4TÑ+嘑$bG‘ ,¯À’ˆöÜì>ž/\¿³^~ÜÍy~êì×ùò½[_…n퇾w*ÊÉ>.ªXµ¼ÛÁâ‰ó¯¹òª…Cƒ:W(P®,Ö³¡ çXÔ/•ų^B__–>µ»ÌÞ^p«åBœÄà,âög}<¿yŒùÇßZ«qâ^=()bfÔÒÒˆ¶W^€gžž6àomGWs;R¤Íg1ÁUH×OB¶~ƒ>(ëü%eº™‡üí~ºê‘/-8vµöj† ø§C÷þÀŽ *ø×àüŸíu×.èëÓƒT Jlí7Üžõý’¹6ë´u‰åÕ­[·áùçV`Òä)¸äâ‹üZ«r|@&Ëó”Oxm á'Ï ëmõŸy_äïù÷ê‹hðP>§V!¶µŒCWK;|àb#3?ÿ‹W"U7Ùs/]bàYu€‰;]yöû8¨èÒ?ÉDÀª •Mÿßšf]_ñÊy'ïƒñmµøöõK°µ/‡ÔÇ•rÛÖØgŸ”šúRÕÏtOj”Š/‰àá‰õÒÞH‘jCƒßõØ}üH*EØ{—vÂ=ÝÝXºlvš>9ÿp>­4Ÿ ¥¼|¾ïI%R¾ÇêCg_Ç}üë#b bÀ÷ï0}b ü:>ð;Öm)â ç_lãdëÆÂOÕ€Xå ‰üÓ娻÷î6ß4!·§]özúr,aü£’Ò ¥@ñg-øä\¹7ÿýÛçðø³QÇå˨Âc@¬4 â<éØN¹+þ dáo3ñÊHïg « }F¯áúlèíí-õíÂ?ö·U)Å]B ø$UsC¥Nù(ý?ö¾ÊŠòZ÷ÛU±'º›‘QfTru‰Ï1&¹j’Á8›«yQㄊH4ï9&1÷Æ!Q£Æ›8O “QQQTP¹Ø 2È<4Ý@§ÏPõ¿}ö©Zuútz½wïÕÄÆÚkíüuþSÝ +ýíyhÚ ce`Y¢üÌ\ðkÁ÷u9-O@<ÁcϾŽù\,Š–‰@án¸ý'!ïη| MùÚ¾{o> ©Êƒ!%ïwŸW_¾,©k¹br+´Ä]mI·ÒO -žÜ°äÒïo»6œ.è’èGxµð‚~8Ð~÷Þû6û[ukK qÚN´|&’?ûý|f˜SÙ´Ÿ¸Í͹Tß!CpÝu׉€Hñ½© $’ UÄí—öW?m†€>L!2¡Aò9Ìn\ûêw6¢¹ªš5ÿ@('ƒîäk˶´[çžc‘0}òe<¹x úõ?F8"U¸Û£?6¬3‘‘ͺg1_~ÇØÂþq}e ?ääßW‹¹ooÂÓ¯~&…=¦·)Ù£üÇ‚%XÞÜøÀ|+ƒ\pú ÷µ¾ÿYþrª¼÷,êÐþÿ¿‘Èmœª( ¡8¤°nË^> t2ø3©´Nw¥ düzÓ’Ÿ\ñÏ;µÑ¹ºFA?\àuhÔÁ PðW0=÷ÜsϺ헿üI[k›Nv%(§å“v.ò‘aŸ\ é;Õ•Iƒ…Þzç :sn™–Öv‰"±ø—D€!™Hæöí‡LÉDÂaWkIüÊ aÛÖ­˜yÓMøþi߯áÓN‡W@ÿÍœ 'äj~B,Ê 6zžwãŒ~uÃ`†Ëd÷¡`¦!¼gx{ñ$ ×Ö™ârÝ~xò¶ÿml ¼ß°/,Ùˆ•ëö  ÁP>Öº¡äÿ.Aû’¿/ß×ñþ£Äóî@~ï}Ïêþ€NÈï&tû¯#/HÙ}Óm‹öŸ<ºKVlEqØ€´ÑÙÞ¥Tš´a\¼ñµK|°b1×\s-ö·´ƨX HÚI‰ú··vÈ®}“Ÿ;Ú;Xë‡äÞqlq+ˆmûqû·cÒ¡‡‚¢a4mÝ€þõƒ¡í òIj(ÃQ<Á þ¿,^‰~G ë'ÍIò¢öï®Âf×Ef «/Æñ\±÷­q5hÜŸÀOîz c†ôÃ7ÆÖ`oG±¢ˆX2DÚ]/ CAP¾)_(|àúÑ|ßÄ÷¹€ÎrsÏå-òr÷u®hôòûNÚÁÀŠ(ÖmÞ‹˜©`B£¥­S#e“Úü –œ´FÈ‚.óÀ? ø à"ò5¿DûϾçž{þe/ûüá§ÎÎŽ¬¶—‰»lògR)·¥”¶öö¬æ— à;K—bøðá¸þúëÀéA± ,Ë€ÁïÄì“Õp‹Ø]à± Л¦ÁïØ" ö46â†oÂØ±c0†™4Á ™èÏÁ¿Êڃĭð(­Âb3xà¿ÿ±çðøÝp„âe 3ÒÊ5ñ¥:PzÒ¶ƒÁUq:´ß[ÊÒ06·àµw`ù§{d澩¤Ø˜sÞ$¼ññ<òÊg2Æ\)ß·î•\P,ͦ¼yú¤s§¤#Rþ«Ë*ð ‹BÿÞŸåï>ûÙÕúRÕ'<Läó*þ7–Å ìØÑÊì(;øî=}—Ó ›¿Å>E³? ™ÌẼÏ;ï¼sî¼óö+÷ìiÖlæS§[á×ÅÀ²ùõ„€?dΤÄOojjÂ{Ë–aĈœê»Q„„RŠ¿Ë€ Äe°L ‘hDJ… ¡¼@ @pÜ­À{9€xý5×`ü„ 7n¼»ö‹ŽFäýšº()¯‘wmñ|a1ûÿõ‘gðȼüF¬ 0B(Ž˜¨g­7¼®#êK0¬¶H2v´ãÃõÍxmvhHaX€"òcŒ¹¡}oÊ`œ5ù`üæù¼³º17ø§ÑÛFqÿ‚üè}þÂrÿ¾°{‡à’ÿ3>T:þð™Í˜·UYŠzlÈØòÿÛh^)¶ƒ—1“ôÖííÄBaþÞ¸ôôË3*\m:Év8# è_WXØ ü8@Éb®`“úœ;WíIm¿b0·‹É¸¯µ!˔ۖtŸhÓFî±zu47qžŸ-éuWD#MZk±ØRŸµB!ñµ¥F‘‰OÓ0%€xíµ×aâÄ Ü/0JT]4‚e…D@ÄbqneU jذ]û6ŽàŹó±è½O1bô8 ¬¯GYY1 M…öé·5%°~Gs+6ïé„"H¦AZß ?ß ÃÚ³vûøMEøÉ©#q[w?¿šë ².ŒWEØ›òìkôÍÆ~\0_0ÈEP(ØH~`Ï òùã¹½i½|fü)Y’úkٟЛ6ï%3¾lýâ ÿíŒuÚÒíÒc¥ô3ª ñ<ðà·úÅb±qo¿½ô™X,ZÆÅ>䨴J~âã3è™%ò/¹~­µW­úþ¾ ·Ü2¥¥¥’0M+gn þlJg +©´™5H wBœVkÂϯ¼Ùç;v\ög¼¤h<r4ûàEâ*˜–…¢’JDK«QáÞGžÅ W¢|ÀH¨HÚÓ ‰Œ#AFC‘ ƒ Ͼø|CÚC¤·n´5¤¨®<‚ËN®”ƒû|†]û»Äm o^ᯗßïÝë#üGý· ×s[3Ùîc3è½z~[ØN¥ah`Ê¡µøˆ;!·okÙT2fÐñ“üö¶ýŸÁ¡œ¢(ôæôÛ5 ô‡ÆSÎ"0à'ƒ9Î<€yâ_ÿú׋D¢¥‰NÊ6ñx>LRöËí¹9+ r‹v€W®D’ß¹çW¿Êú’4ž äRy"4$efX2Ù—¤d×¥ž!Ë’1a3gÎÄØqã0žYk°Vµäw± ȲX–iò]D„@4aK wÿq>|ñ}TÔD¸¨*)(È£ i÷,pÉó éùäùÀ—Ÿü}ƒ<@S܉‹N†ŽdZ²ëwµ!2Aä7ñô$ÿêÅ{ðy w÷.Ú~c7S_ yr ¾“KÍ&Ó(² 7i€~õ­´·5y×Ö·þåšÓ>²-+j8Ù¶ŒšœWª¡w§T0[{}ý8À‰\ Â\ê ñ/½ôüíÑhQig{;uvuI‰/ ¥áÇÉåË$JJT_¦ý¬ýt5:»R¸ëŽ;ØüÎZŽÄ ¢‘04C)¼r#Üž;°cÇÜ6çŒ5ãüŽ£à–eŠ%ÁƒCøl¡@¹ñ€"¶ŠâQüáÉ…øõÓŸ rGû‹*üòŽRÝkäÉ5€ Ff rê¸ iŸoÆ÷NŽTÚœ­àAy±…çÞÝŽw×6Á’@¢¹ ö)o€¿¤D.½Ó;䯿!ñ€>%Àç‚?|ÇÕúàçauÅz`U1ýuéÆÏÌúê3¦>öÝõÛÖŽJÁ)m…~|0àü;4® äQ ¾à·˜cÌ%ÌQæbææ‰>øà5 ºbÏÔ×:7uWБèí¢1ù-‰œXÝÐ 5OÈ‚[´;¹ ÒvZ|}oÈåþý-øùϯà3Z€nbâËs4 z"Äù„R"  òÊŠRÜ÷Ø\ÜÍ%¸•œç·J+`Ze‚”á·½*/ÒŽünÀnMA ü |ÿNÞé¡’{'Gú 4JbN:¬“GõÇ;Ÿ6áO±¹¹Sf(*Ìø|}àù4ÄÔ/\ꑯñÅ×÷Ì}‰×døÄŸ‡ÔK±O[K ŸïûùúÅß}ZƒÖÚ°àDt¦xþsÍИö…Á&˜ÔGÈp£ÿ5D4lΜ9·¿þú럺 ì”SN©ŠÇã•lþw»þ‰vh §ÍÝ?|"w ªª¿ôýÏ›7Çw|. m¿Ixk)1ïwîÜ…Y\ä3£ýãÇ“š€p$*‹AYÈ–`E$.„a˜Ì„’x••å¸ï‘—pûC ¼z0Löù• wÏóûIð‚¥¥.šÉ=üî{x– Á;µWRìõÎîϘ†’ Á†­­xiù©röõÝ|>¹›xµô”išfpÒ°Zªûî¾ç.tÄëfËvù‰ùÞÜÄ¿«¯Æ“&aè°á¢õ¹@‚ƒ¦2G¥Î  1ˆBÙaŸRPT”Íó?:WßùûeTQ7LŠ|ŒHT4¿L¹qwúc­]+ ¿=Vžóóðùn9ü‹B@®äè=ï§ýC»V24Æ*ÃáCÊ1¼6ŽÏ9s°z[+ÖílÃŽ½bÕ¤ F‹æó¦ÿð 9ý¨~F¦òf$#Q]Fm¿(j+b,T[uÃg»i_K×’ /øÖ¬È9ß{§Ú¶àX)8: mÀÓþky€¯™1W]qÅ7qÏ…D$E8|6ŸtÒIå’û—`³`Á›5{Z ˜¸ÀÇMbò+¾ 1€áx›6 Ž ¬?ÿæ›oæ˜@ ¼ÑÕ;wíÂM³fa옱˜8a<2Žâ¢b)4Š3ðYû ØEdÝ€HT~w)Çžaîª+æ¼>¤¼zX<+Ñìó“2ü9À[”¡rÁ ¹ƒá •åm²Ý+òä±{§ž&¹p_ ]è€ß{ôs‰Þ*­´ÍÌà­+‹rð°˜…AêúEÀ$Y„=-IìkK¢­S–©H».\`@“R$ÉyR”å‚Ý4òNfÓ[om&Ÿä "ê9I‡ b¤ :ëüï©[‹¯ü‚±áþ;ð—„fl ;ãÆ+â&»8Ê¢!D,BH, ¦²Æ—…¡­,ÚÛ“ØËVCkkB„ÉDdšP9gÍãg®~²¸u:›ÐNº´ z[1ô[{Aô9´þ.!ð5ÏÿÇÜ ßðk¯½ö§GqÄ4"»YÀ¶|ðÁ1ºrïì§žü‹Í€ ³ÖÏõîC#l…ÁïÈÏð!¾:äýœöfB‚‡—]vþÏíwˆÖŸ0q"LeHJPñYZV "%AÃh,.q.$· Æ‚cáÂ…ïýøÇ?¾†µ1Z[ßXwÒ9‰ ¿ÿEjè?=xœ“êºJM!E¾ùïžÊð†k0Æï¸ÂÀä\î|ó?ÿ?PX9$'¨ûD_äoì‘ÞHra¨|"+ Ä×—h¾7†@Ÿwok¶ÉNÚ Cý¡äˆ·ýîöãvmkFˆÁßÅFC8Å»¡íjàY ~€ÆhÎÔÀÓ0\ îû3½á†.š2eÊ?yf1ŸmÆ ‹i­UôìØo¿ý6 dÚƒƒÓ­Ô3Ut^á 3 £XÊB ­£ãÆŒÃ(®ðs´k!‹H“g Üæ 1¾SÊ”ÊÃŠÊ Ì{eþ²sg̸ÀFÄK£ÃGtuþeNõf u+Ôüñ”=ýéšÎ»~­/W–#ÍÀ'(‚2óÖ\ñTž…@Þ Ëv?Ôø-»½/ ñÍ÷3 ÚÝN~JO¢úOítÛ¿Ç—RßaÖ5¨°ù¯§Î¿à-€.ÞJh8:aGtÖÛêÒÀK1ÀY ' 춬#ÀuÍÿ’ÁƒÜ´iS§Û 4î–[nùÎÑG=!7³/“j÷öǸLWñ îúÛooÞüyFkŠÈâÎpØÝp«Ý®>%=!Ó’Ïdäúý·mÛŽ‘#†ñwœ>“Ü›–)î).„‰h4 .Dʺ!X´há²éÓ]ð»™;1þ =Æh=Á jÙ Êt‚jÇÙCOxðd'‘žNZŸ 3 vÒ¤ˆ|!à‚Ý;™½{ÛßoPÏQ[= ‹zŸZ0í×c‰<Ðûk·´v5½·/éO§2Ù»ÝdLJÖýqÕý§®ùö„µ‡2pLN×>èâJhËx™Ùþ¿ðgB ¡° þW^yå¬áOûÅ/~qûç©#‹ß [!þ%Ù:‚eÜ™Ø;ø¿\õ(>_jã@ée?S­[Öí–NvF4ìˆm·†R‰T^}ÖÄHìi¦Yv”²âH)%c°Ikð“T ožž7qGÎüÀ_ÁÔÂB‚Züè6œÃ³<Áa7;Nê}‰×¨ÿž—£‡¥w…õhDk‡§‹†Œ¶­ÚþŽÙMw × ½¼ „=Ð8"ø³Àÿ›È-û­™6mÚwÎ>û컚Aœ¤Í‘ÿ4E³w\@Ÿþy›ý•ì¸]€©¶U«VŸ4Xe-öÈC±¹R/LJ‚x|+dÁP&´v$²O°± E> ~Oªü¼\,@Ä•(+뇹s_^öãÞ5ïTvߪl1­TÊ‚íD4Q ñI 1Mˆ9v‡¥”UÜÿè‘‘Ò±ãC᪡F¸ß 3TVOÊ$(¯ðÞé6kŸïýüùxüê]Ÿü}þ̤ø˜u–í®v;ݾɱÛ6¤“MŸt%>|/™Ü¸Ó•g *J’evšÑ¢„UR‘(=!U4jdfø gèÌèÎÀòVèÃÜÊ|“W:üÙàÿ?ýWÆ<ô˜cŽ9‰ëfyB€ýð4Gþm¦(›ûšÁO̬™œ ¾ƒãÈüÿ¶?ü0Æ@1g'ÙG}´ì’"-&¾°L+ÌÏJ´>¿#óJØ¿EÂòŽešâ ”ö+Âùó—ñ(²ÿ<ø}0C0Q„Àà'Š"Ç1’SE ˆjÒ1h'¬uŠÙ…‹V…cƒj­hu#\Yn…ËÊ”‹)+UF4¬Œ³ "݉Üu^¬ÅmÇîêÒNW§“IvÚ™Ž;µ¿)“Ú»;Óµgg¢}Íf;ݺŸT8¥T4¢1CS§&$è$R ˜VŠ%cuƒÓE‡f«;orÖ¾ ÂHhÔæøbfÿ ŸQwA lºlå–€œä É=?“ܹ€wO -àW”ßÁ /` áÈ Ø dcM± ÖÙS3C§´{Í y¶'ãþÛå÷ÀÀ—iĘë™Ç<þøã³***&ìÙ³§•Mò8ktñïµÖiö÷mQ¸43Wð;b pô¿mñâÅR,Äï°PH83g^ç°µ`eƒ{ ’à ?Ke i™" JJËðêâÅËÎ9çG_$ø ‰òXå±!ì» rú÷¤@îs.öç xÝÔ}Ð/Á[Þ=m@;8nWoFÖ ßk |Ê;rðÂÚ=€?_&ø#nõßHîÝ¿”óÿgpÚO|2 [:è OdAžþàƒlÖîž .j4hÖþ"æÏŸ/eÃüqªpÇo~soQmmM1Ê™ýa©ùI??nìyiÙùçŸÿ¥¿wa ¤˜©€• S/Ü3ûì÷úÙçôø{vJ#îß»øâ‹/ß¶m› äô˜ÜÊC:âÙtŸýOsÐO„ Í' :t/ ‚rÏhczùå—cü¹™ ‰Y¼hñO¹‹¯D›RñWÄ€ysç½{þùçÍ.ŒöÿÿNÈ?…{ÿ¾wÒÿ™3ü—G õF¦;ðcÀQGõMnй¼±±Q3vá1ƒ>«ÑKx·_‡Ÿ½³=ôP@‚ŸI3544”üñÇë½ñ^œÏ/æÚ‚ƒÿiØ+N˜vµÜ7ÐÂB:[Þ[VZŠE |À^4µÍœñÎðžY_òî»ïv0Ö&°¹o~øá%øâ*Áמyæ™'W®\ù6ßÉÏqEa›õ§è`ÞżjÊäÉ—s°pyE^Y°à­é3fÌêþ¯éÿ*F‚}•ýþ*æálªÏVJÕ³¹Ÿ-ôÇl¾{,€fS?ÌîA+ýÂ|G,Œúúz|À´aÆE>eZÑ¿ÿ2®ÂB–e•ò˜¯Q<|@3ó¾x`Á±SŽUgžyæ-¶372'üX—”_?惸è燡Õ~¢õ=ÍÏàÐç±§ù^å¡O ì{æé§Ÿ~8Þ°—y÷üjãÆ ´víÚ¶lÙò }Ʊ‚M‡rÈ1®PãÇÿÿŽEìF¬°Íš5pqéûï¿ïêÕ«—Øãº].'Ü3Íì  €‚,À—N*oéÇ„+V<È`.â|?±àEý%ðÇ à{©=6ýßçÈÿlWkÛÌõ<Êë8ôÝÀïefëC=ôCë]`K-rÔî‚?øÂÀ?~ëïP.ö¹Š+ð†{~?koð)ë¾óü~a¾ßòæ›oΰŽy's+s ŽF~-Wg·à­õvû|í.g»§éðô åoý­ã)¿SØdŸÌ):Ïç—“+üzøý,R¯¾úê,Ÿ»þz‡ ä sŠS{˜Ÿw?ï°Ë³P:Èo€¯NÔ¿’y0/ýø_<áGR~y9ÿBð‹ßÏùÿ»|ʼCÀïפ'] ·3+÷>Ô¬€¯fÔ¿”yà£>z kú"/×ïq¾ÉïÖýƒ€,äák¶¹@ÏäÛñ, ’-  øÕ/ø©™:uê79'?5ëëû §éoÛv6+°“s÷¿°Å5íS… ] ²}cæ_óäýÁ^‘õçS"ýyQÍB€^|ñÅKY¼+QOûPàô)²Ü ¿u³fÍ:@%kvôî÷‹éOœÃŒÁßàFü;ƒ"€ ïŽúêODÃN;í´ïsÎ_ûQiôéõçw¶²xÊõûÛ˜3yP`ôÝÀ_=çü/Éæû=¿ŸO…àÏFý—,Yr€­nYo*¨Ò (°újžô{oò9¢Ðôg¿‡éÏ =Ïràã 9' @ôý!e̵×_ý…Òã_ÐèÃ@ïõçÝ&nå}ÜíÎkeN# €ÐçÈð¶üòdÝy0ÇÖþä úß,øY¾|ùý~×ôüþ€Ð÷H¹Ú¿œ¹î?øÁ öýuïQÑþà´à*æ·ì ¢þAÀ¾ßíWæÿYlê³öïµÚ?{ýú¿sK}[‚¦€  o×û˦ßc=öŸ³ë¼ ªý Mpÿ\­õ·_?Dý ,€¾]ò[Ë;ýÿ'§ú ü=S~ÂÙÕ_©>úèQ·à§-¨ö (°úvÑO9óÁ‡vØÉ\Гoú ¦ýÖ¯_ÿg7ð×äü ,€¾­ý‹™ky§ßØô÷š}dÀ‡ ú´_˺uëž°;üX€ïÏ‹6†5ê8îöóÊ}}à¤ýxzï£nÔ_ö (°ú.™žöŸ9sætÊYXíWõ×üÝvžñ·Ð«ø Lÿ€  ïöç±Ü#y ï7Yû{>½jÿO>ùäa»ƒ´_@Ð÷Û}K˜k®¸âŠé\ô#àç>è{úØÈVÂ;öÚ? À8´MMÍhÞÖs¤7éG"þ½kÿ?ºÚ¿5Ðþ@ßÖþEÌ5—\rÉt.å-\èÑCû³€XËÀûš˜»íP`ôña¬ùÇUWWÆÀöMÿÞµÿ#vÝ~àÀõUÃ;ýg°O¯{¤üzjÿUœü((ù (FÞ¿ÿÿmï\^ªŠ¢0~öyx¯·2M%Já"*M„îPÁŸi)DÿXP D£& š5 ‹(u á+'6(µ2½êݧoÉÚpºPQ£öõûÁbŸãcø­Ç>{­A}ÍÍÍפÝBÿSô¿¯Ñÿ£?¡ð“þÓÓÓ'í¾hôùmôDZà·(Þ±ö'tµ1ꫵ»»ûzCCÃU¤þ¿ŒþîVߥ¥¥“SïMø 6}^½+Ñ=ÿæ7Ñ?@ôƒ~€iøaô'Ìj ú£Û¯„Q_E¤þªýÜÍÿ@¢?Û} @mDÿ¶ÁÁÁ;2ã¿:ݯŽþè | A¢ÿgîü:Ï}ê˜ï!¬í*øTìWÑý?2ú@Pc¾Ûn£—¿œøS±lôÇþÀ+ü~QjF¸ è)±ô9<<<q7AØBñœMý:qfyyù$ús矜vÂóÝ»ÜÓÓ36ß#ˆÝЉ#€Øå9uf­•èÿ?_”ÚŸ;ÿä´×À Ï‹ããã· ~ý±F¼Q a©{Fô¿çjŽú"§Ð÷AŸ…B¡ØÑÑqã@àGbBÈ‚w1+NÑÿ9þg™µ?!þf&ÓîÛ:99y‡y¾Aä±Z$«ˆ_ŸCÍ ,&ýºS{Œþ„øê4ú÷öö^oll¼² ò:X¢Nà‚aVÅa&À3üÏkBüuV§Ñÿ¾û"úoCà"þ#ç4ˆ]F€ê ]__ä¢?ÅO±§µÿù‘‘‘Ö2„¾ ËCè9XZ¢[ks[[[ñ·›°m^òAˆŸ ÔÚÿ ÒþÖb±xCH³¿ùây 0;;I›o¦±'ÒõHú}Ô)ÊŠûkkkën¾?ÅOˆÇ`nn.DÝ_Ѻ?„Yç@äžøKúïHäç¦!ž;Œö68ñgåbíïwfUø¡®‘4þ õÿúhÍoY÷â© :;;lú9Á›ŒøC1”Æ9)Ðì³Gñâ¹@ÍàF_ñ[™ß—ìiªÎÿ³«««RïW(~BþŽ(øÏXXXÐçÿÓ0OyÆŸ¼§xÔR) ÐèSAæ/âO)~BþüÇÌÌ̈ÐEü&â—Õ½\lll0êòü‚‚*›}Ÿ“áIEND®B`‚weborf-1.4/qweborf/integration/qweborf.metainfo.xml0000664000175000017500000000404114634465635016324 org.ltworf.qweborf GPL-3+ GPL-3+ qweborf qweborf qweborf Shares files using the HTTP protocol condivide file usando il protocollo HTTP

Qweborf provides an easy to use graphical interface to share local files using the HTTP protocol.

It can enable writing on the server, webdav, authentication and sending directories as tar.gz.

It can try to work across NAT.

Qweborf fornisce un'interfaccia grafica facile da usare per condividere file locali usando il protocollo HTTP.

Può abilitare la scrittura sul server, WebDAV, l'autenticazione e l'invio di directory come tar.gz.

Può provare a funzionare attraverso NAT.

qweborf qweborf.desktop tiposchi@tiscali.it Salvo 'LtWorf' Tomaselli https://ltworf.codeberg.page/weborf/qweborf.html https://codeberg.org/ltworf/weborf/issues/ https://ltworf.codeberg.page/weborf/qweborf.html https://liberapay.com/ltworf https://ltworf.github.io/weborf/images/qweborf.png Utility Qt http webdav share directory
weborf-1.4/cgi.h0000664000175000017500000000163214634465635007262 /* Weborf Copyright (C) 2010-2018 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #ifndef WEBORF_CGI_H #define WEBORF_CGI_H #include "options.h" #include "types.h" int exec_page(char * executor,string_t* post_param,char* real_basedir,connection_t* connection_prop); #endif weborf-1.4/cachedir.c0000664000175000017500000001452214634465635010257 /* Weborf Copyright (C) 2010-2020 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #include "options.h" #include #include #include #include #include #include #include #include #include #include "cachedir.h" #include "utils.h" #include "types.h" #include "instance.h" char *cachedir=NULL; /** Generates the filename for the cached entity and stores it in the buffer */ static inline void cached_filename(unsigned int uprefix,connection_t *connection_prop, char *buffer) { snprintf(buffer,PATH_LEN,"%s/%u-%llu-%llu-%ld",cachedir,uprefix,(unsigned long long int)connection_prop->strfile_stat.st_ino,(unsigned long long int)connection_prop->strfile_stat.st_dev,connection_prop->strfile_stat.st_mtime); } /** Returns true if the caching is enabled and false otherwise */ bool cache_is_enabled() { return cachedir != NULL; } /** Sends a cached item if present and returns true. Returns false on cache miss. */ bool cache_send_item(unsigned int uprefix,connection_t* connection_prop) {//Try to send the cached file instead int cachedfd=cache_get_item_fd(uprefix,connection_prop); if (cachedfd==-1) return false; int oldfd=connection_prop->strfile_fd; connection_prop->strfile_fd=cachedfd; /* replaces the stat of the directory with the stat of the cached file it is safe here since get_cached_item has already been executed */ fstat(connection_prop->strfile_fd, &connection_prop->strfile_stat); write_file(connection_prop); //Restore file descriptor so it can be closed later connection_prop->strfile_fd=oldfd; //Closes the cache file descriptor close(cachedfd); return true; } /** This function returns the file descriptor to the file containing the cached item. If a cache miss occurs -1 will be returned If cache is not in use (cache_init was not called) it will always return -1 uprefix is an integer that must be unique for each call of get_cached_dir. Its purpose is to distinguish between calls that will eventually generate an HTML file and calls that will generate XML or other data. So the directory would be the same but the generated content is different. Acquires a shared lock on the file, so if the file is already opened in write mode the lock will fail and the function will return the same result of a cache miss. */ int cache_get_item_fd(unsigned int uprefix,connection_t* connection_prop) { if (!cachedir) return -1; char fname[PATH_LEN]; //Get the filename cached_filename(uprefix,connection_prop,fname); int fd=open(fname,O_RDONLY); if (fd==-1) return -1; //Cache miss //Acquire lock on the file and return the file descriptor if (flock(fd,LOCK_SH|LOCK_NB)==0) return fd; //Lock could not be acquired close(fd); return -1; } /** Same as cache_get_item_fd but here the file is created and opened for reading and writing, and will be created if it doesn't exist An exclusive lock will be acquired over the file, since it is being opened for writing too. */ int cache_get_item_fd_wr(unsigned int uprefix,connection_t *connection_prop) { if (!cachedir) return -1; char fname[PATH_LEN]; //Get the filename cached_filename(uprefix,connection_prop,fname); int fd = open(fname,O_RDWR| O_CREAT,S_IRUSR|S_IWUSR); //Acquire the exclusive lock in a non-blocking way if (flock(fd,LOCK_EX|LOCK_NB)==0) { return fd; } close(fd); return -1; } /** Stores the content of the buffer "content" in cache, for the size specified by content_len The cache file will have an exclusive lock to prevent multiple threads accessing the same file in write mode. Lock is acquired in a non-blocking way, so if the file is already locked the method will just return without writing anything on the file. This behavior is wanted because it is assumed that the lock is held by another thread writing the same content on the file, waiting for the lock to be released would lead to override the content of the file with the same content. */ void cache_store_item(unsigned int uprefix,connection_t* connection_prop, char *content, size_t content_len) { if (!cachedir) return; char fname[PATH_LEN]; cached_filename(uprefix,connection_prop,fname); int fd=open(fname, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); if (fd == -1) return; //Just do nothing in case of error //Try to acquire lock in a non-blocking way, and exit if another thread has that lock if (flock(fd,LOCK_EX|LOCK_NB)!=0) { close(fd); return; } if (write(fd, content, content_len) != content_len) unlink(fname); close(fd); return; } /** This function initializes a cache directory. If the dir is not a directory or it is impossible to stat weborf will terminate. If it is impossible to delete and create files in it, weborf will just log a warning. */ void cache_init(char* dir) { cachedir=dir; { //Check if it exists struct stat stat_buf; if (stat(dir, &stat_buf)!=0) { dprintf(2, "Unable to stat cache directory\n"); #ifdef SERVERDBG syslog(LOG_ERR,"Unable to stat cache directory"); #endif exit(10); } //Check it is a directory if (!S_ISDIR(stat_buf.st_mode)) { dprintf(2, "--cache parameter must be a directory\n"); #ifdef SERVERDBG syslog(LOG_ERR,"--cache parameter must be a directory"); #endif exit(10); } } //check we have permissions if (access(dir,W_OK|R_OK)!=0) { dprintf(2,"no read or write permissions on cache dir\n"); #ifdef SERVERDBG syslog(LOG_ERR,"no read or write permissions on cache dir"); #endif exit(10); } } weborf-1.4/base64.c0000664000175000017500000000417514634465635007604 /* Weborf Copyright (C) 2007-2016 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #include "options.h" #include #include #include "base64.h" /** Returns the base64 (6bit) code of a char */ static char getCode(char c) { if ('A' <=c && c<='Z') { return c-'A'; } else if ('a' <=c && c<='z') { return c-'a'+26; } else if ('0' <=c && c<='9') { return c-'0'+52; } else if (c=='+') return 62; else if(c=='/') return 63; return 0; } /** Decodes a group of 4 characters and put 3 resulting chars in res res buffer must be able to contain 3 bytes. */ void decode4_64(char *res, char *group) { ///////CALCULATE CHAR 0 res[0] = getCode(group[0]) << 2; char t = getCode(group[1]); char t1 = t; t >>= 4; res[0] = res[0] | t; //Completed 1st char ///////CALCULATE CHAR 1 res[1] = t1 << 4; t = getCode(group[2]); t1 = t; res[1] = res[1] | (t >> 2); //CALCULATE CHAR 2 res[2] = t1 << 6; t = getCode(group[3]); res[2] = res[2] | t; } /** Decodes a base64 string, putting the result inside the result buffer. Terminates with a \0 the buffer, so string functions can be used on the result. Doesn't change the encoded string. result's length must be at least: (strlen(encoded) /4 *3 )+1 */ void decode64(char *result, char *encoded) { char *res = result; while (encoded[0] != 0) { decode4_64(res, encoded); encoded += 4; res += 3; res[0] = 0; } } weborf-1.4/examples/0000775000175000017500000000000014634465635010243 5weborf-1.4/examples/auth.py0000664000175000017500000000466714634465635011513 #!/usr/bin/python3 # This is an example authentication script. You can modify it to make it fit your needs # Weborf # Copyright (C) 2019-2023 Salvo "LtWorf" Tomaselli # # Weborf is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # author Salvo "LtWorf" Tomaselli import asyncio import os from typing import NamedTuple from syslog import * class Request(NamedTuple): url: bytes addr: bytes method: bytes username: bytes password: bytes protocol: bytes SOCKET_PATH = "/run/weborf/weborf_auth.socket" async def main(): try: os.remove(SOCKET_PATH) except OSError: pass l = asyncio.get_running_loop() server = await l.create_unix_server(Proto, SOCKET_PATH) await server.serve_forever() class Proto(asyncio.Protocol): def allow(self): self.transport.close() def deny(self): self.transport.write(b' ') self.transport.close() def connection_made(self, transport): self.transport = transport def data_received(self, data: bytes) -> None: fields = data.split(b'\r\n') request = Request(*fields[:6]) headers = {k:v for k, v in(i.split(b': ', 1) for i in fields[6:] if i)} # Allow all from internal network if request.addr.startswith(b'::ffff:10.0.'): self.allow() return # Require a password for some content if request.url.startswith(b'/movies/') or request.url.startswith(b'/music/'): if request.username != b'user' and request.password != b'pass': self.deny() return else: self.allow() return # Require another password for all other content elif request.username == b'user2' and request.password == b'pass2': self.allow() return self.deny() asyncio.run(main()) weborf-1.4/examples/index.py0000664000175000017500000000123114634465635011641 #!/usr/bin/python # -*- coding: utf-8 -*- ''' This is an example of index file. It adds a "." to a session variable on every refresh, shows the informations and sets a cookie. ''' import os import sys from cgi_weborf import * #imports module cgi cgi.session_start() cgi.setcookie("id","33") cgi.finalize_headers() #will output the final \r\n\r\n and the content-type header if 'nome' in cgi.SESSION: cgi.SESSION['nome']+="." else: cgi.SESSION['nome']="." sys.stdout.write( "") sys.stdout.write( "") sys.stdout.write( "

example

") cgi.pyinfo() sys.stdout.write( "") sys.stdout.write( "") cgi.savesession() weborf-1.4/examples/weborf_auth_dav.c0000664000175000017500000000555514634465635013500 /* Weborf Copyright (C) 2010 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ /*Example of authentication program This program will allow all GET and POST methods, will allow PROPFIND MKCOL and PUT only from 10.0.* And will deny the rest. For avoiding trouble, also the OPTIONS method is always enabled */ #include #include #include #include #include #include #include #include #define SOCK_PATH "/tmp/weborf_auth.socket" #define SIZE 1024 int main(void) { int s,s2, t, len; struct sockaddr_un local, remote; char str[SIZE]; //Removes the socket if already exists unlink(SOCK_PATH); if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { perror("socket"); exit(1); } local.sun_family = AF_UNIX; strcpy(local.sun_path, SOCK_PATH); unlink(SOCK_PATH); len = strlen(local.sun_path) + sizeof(local.sun_family); if (bind(s, (struct sockaddr *)&local, len) == -1) { perror("bind"); exit(1); } if (listen(s, 5) == -1) { perror("listen"); exit(1); } //Cycle to accept connections for (;;) { t = sizeof(remote); if ((s2 = accept(s, (struct sockaddr *)&remote, &t)) == -1) { perror("accept"); exit(1); } t = recv(s2, str, SIZE, 0); str[t] = '\0'; //Parse string to get the things we need char *uri = strtok(str,"\r\n"); char *ip = strtok(NULL,"\r\n"); char *method = strtok(NULL,"\r\n"); //Allow GET, POST, and OPTIONS if (strncmp(method,"GET",3)==0 || strncmp(method,"POST",4)==0 || strncmp(method,"OPTIONS",7)) { close(s2); //Closing the connection without sending anything will result in weborf accept the request } //Allow PROPFIND MKCOL PUT from local network else if (strncmp(method,"PROPFIND",8)==0 || strncmp(method,"PUT",3)==0 || strncmp(method,"MKCOL",5)==0) { if (strncmp(ip,"::ffff:10.0.",12)!=0) send(s2,"c",1,0); close(s2); } //Disallow the rest (DELETE, MOVE, COPY) else { send(s2,"c", 1,0); close(s2); } } return 0; } weborf-1.4/examples/xinetd.conf0000664000175000017500000000023614634465635012326 service www { socket_type = stream wait = no user = www-data instances = 100 server = /usr/bin/weborf server_args = -T port = 80 cps = 100 4 flags = IPv6 } weborf-1.4/examples/weborf_auth.service0000664000175000017500000000103714634465635014053 [Install] WantedBy=multi-user.target [Unit] Description=Weborf auth daemon [Service] InaccessiblePaths=/var InaccessiblePaths=-/srv ProtectSystem=strict ProtectHome=true PrivateDevices=true PrivateUsers=true NoNewPrivileges=true RestrictAddressFamilies=AF_UNIX ProtectKernelTunables=true ProtectKernelModules=true ProtectControlGroups=true PrivateTmp=true Type=simple Restart=always StandardOutput=syslog StandardError=syslog SyslogIdentifier=weborf_auth ExecStart=/usr/local/bin/auth.py RuntimeDirectory=weborf User=www-data Group=www-data weborf-1.4/examples/weborf_auth.c0000664000175000017500000000367014634465635012642 /* Weborf Copyright (C) 2009 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ //Example of authentication program #include #include #include #include #include #include #include #define SOCK_PATH "/tmp/weborf_auth.socket" #define SIZE 1024 int main(void) { int s,s2, t, len; struct sockaddr_un local, remote; char str[SIZE]; if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { perror("socket"); exit(1); } local.sun_family = AF_UNIX; strcpy(local.sun_path, SOCK_PATH); unlink(SOCK_PATH); len = strlen(local.sun_path) + sizeof(local.sun_family); if (bind(s, (struct sockaddr *)&local, len) == -1) { perror("bind"); exit(1); } if (listen(s, 5) == -1) { perror("listen"); exit(1); } for (;;) { t = sizeof(remote); if ((s2 = accept(s, (struct sockaddr *)&remote, &t)) == -1) { perror("accept"); exit(1); } t = recv(s2, str, SIZE, 0); str[t] = '\0'; if (str[1]=='f' && str[2]=='i' && str[3]=='l' && str[4]=='m') { if (strstr(str,"::ffff:10.0.")==NULL) { send(s2,"c", 1,0); } } close(s2); } return 0; } weborf-1.4/configuration.h0000664000175000017500000000156214634465635011371 /* Weborf Copyright (C) 2010 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #ifndef WEBORF_CONFIGURATION_H #define WEBORF_CONFIGURATION_H #include "types.h" #include "options.h" void configuration_load(int argc, char *argv[]); #endifweborf-1.4/cgi.c0000664000175000017500000003173714634465635007266 /* Weborf Copyright (C) 2010-2023 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli */ #include "options.h" #include #include #include #include #include #include #include #include #include #include #include "mystring.h" #include "cgi.h" #include "types.h" #include "instance.h" #include "myio.h" #define STDIN 0 #define STDOUT 1 #define STDERR 2 extern char ** environ; //To reset environ vars extern weborf_configuration_t weborf_conf; /** * This function will set enviromental variables mapping the HTTP request. * Each variable will be prefixed with "HTTP_" and will be converted to * upper case. */ static inline void cgi_set_http_env_vars(char *http_param) { //Sets Enviroment vars if (http_param == NULL) return; char *lasts; char *param; int i; int p_len; //Removes the 1st part with the protocol param = strtok_r(http_param, "\r\n", &lasts); setenv("SERVER_PROTOCOL", param, true); char hparam[200]; hparam[0] = 'H'; hparam[1] = 'T'; hparam[2] = 'T'; hparam[3] = 'P'; hparam[4] = '_'; //Cycles parameters while ((param = strtok_r(NULL, "\r\n", &lasts)) != NULL) { p_len = lasts-param-1; char *value = NULL; //Parses the parameter to split name from value for (i = 0; i < p_len; i++) { if (param[i] == ':' && param[i + 1] == ' ') { param[i] = '\0'; value = ¶m[i + 2]; strToUpper(param); //Converts to upper case strReplace(param, "-", '_'); memccpy(hparam+5,param,'\0',195); setenv(hparam, value, true); break; } } } } /** * Sets the SERVER_ADDR enviromental variable to be the string representation * of the SERVER IP ADDRESS which is being used by the socket * */ static inline void cgi_set_SERVER_ADDR_PORT(int sock) { #ifdef IPV6 char loc_addr[INET6_ADDRSTRLEN]; struct sockaddr_in6 addr; socklen_t addr_l=sizeof(struct sockaddr_in6); getsockname(sock, (struct sockaddr *)&addr, &addr_l); inet_ntop(AF_INET6, &addr.sin6_addr,(char*)&loc_addr, INET6_ADDRSTRLEN); #else char loc_addr[INET_ADDRSTRLEN]; struct sockaddr_in addr; int addr_l=sizeof(struct sockaddr_in); getsockname(sock, (struct sockaddr *)&addr,(socklen_t *) &addr_l); inet_ntop(AF_INET, &addr.sin_addr,(char*)&loc_addr, INET_ADDRSTRLEN); #endif setenv("SERVER_ADDR",(char*)&loc_addr,true); //TODO setenv("SERVER_PORT",weborf_conf.port,true); } /** * Sets env vars required by the CGI protocol * SERVER_SIGNATURE * SERVER_SOFTWARE * SERVER_NAME * GATEWAY_INTERFACE * REQUEST_METHOD * REDIRECT_STATUS (this is not specified in the CGI protocol but is needed to make php work) * SCRIPT_FILENAME * DOCUMENT_ROOT * REMOTE_ADDR * SCRIPT_NAME * REQUEST_URI (It is expected that the request is like /blblabla?query and not in two separate locations, ? is expected to be replaced by \0) * QUERY_STRING * */ static inline void cgi_set_env_vars(connection_t *connection_prop,char *real_basedir) { //Set CGI needed vars setenv("SERVER_SIGNATURE",SIGNATURE,true); setenv("SERVER_SOFTWARE",SIGNATURE,true); setenv("GATEWAY_INTERFACE","CGI/1.1",true); setenv("REQUEST_METHOD",connection_prop->method,true); //POST GET setenv("REDIRECT_STATUS","Ciao",true); // Mah.. i'll never understand php, this env var is needed setenv("SCRIPT_FILENAME",connection_prop->strfile,true); //This var is needed as well or php say no input file... setenv("DOCUMENT_ROOT",real_basedir,true); setenv("REMOTE_ADDR",connection_prop->ip_addr,true); //Client's address setenv("SCRIPT_NAME",connection_prop->page,true); //Name of the script without complete path char* http_host = getenv("HTTP_HOST"); if (http_host) setenv("SERVER_NAME", http_host,true); //TODO for older http version this header might not exist //Request URI with or without a query if (connection_prop->get_params==NULL) { setenv("REQUEST_URI",connection_prop->page,true); setenv("QUERY_STRING","",true);//Query after ? } else { setenv("QUERY_STRING",connection_prop->get_params,true);//Query after ? //file and params were the same string. //Joining them again temporarily int delim=connection_prop->page_len; connection_prop->page[delim]='?'; setenv("REQUEST_URI",connection_prop->page,true); connection_prop->page[delim]='\0'; } } /** * Sets env vars CONTENT_LENGTH and CONTENT_TYPE * just copying their value from HTTP_CONTENT_LENGTH * and HTTP_CONTENT_TYPE * Hence to work the HTTP_* env variables must be * already set * */ static inline void cgi_set_env_content_length() { //If Content-Length field exists char *content_l = getenv("HTTP_CONTENT_LENGTH"); char *content_type = getenv("HTTP_CONTENT_TYPE"); if (content_l != NULL && content_type != NULL) { setenv("CONTENT_LENGTH", content_l, true); setenv("CONTENT_TYPE", content_type, true); } } /** * Will chdir to the same directory that contains the CGI script * */ static inline char* cgi_child_chdir(connection_t *connection_prop) { //chdir to the directory char* last_slash = rindex(connection_prop->strfile, '/'); last_slash[0] = 0; chdir(connection_prop->strfile); last_slash[0] = '/'; return last_slash + 1; } /** * Closes unused ends of pipes, dups them, * sets the correct enviromental variables requested * by the CGI protocol and then executes the CGI. * * Will also set an alarm to try to prevent the script from * running forever. * */ static inline void cgi_execute_child(connection_t* connection_prop,string_t* post_param,char * executor,char* real_basedir,int *wpipe,int *ipipe) { char* errormsg = NULL; close(wpipe[0]); //Closes unused end of the pipe close(STDOUT); if (dup(wpipe[1]) == -1) { //Redirects the stdout errormsg = "dup() failed"; goto error; } #ifdef HIDE_CGI_ERRORS close(STDERR); #endif //Redirecting standard input only if there is POST data if (post_param->data != NULL) {//Send post data to script's stdin close(STDIN); if (dup(ipipe[0]) == -1) { errormsg = "dup() failed"; goto error; } } environ = NULL; //Clear env vars if (strlen(executor) == 0) { executor = connection_prop->strfile; } cgi_set_http_env_vars(connection_prop->http_param); cgi_set_SERVER_ADDR_PORT(myio_getfd(connection_prop->sock)); cgi_set_env_vars(connection_prop, real_basedir); cgi_set_env_content_length(); char *filename = cgi_child_chdir(connection_prop); alarm(SCRPT_TIMEOUT); //Sets the timeout for the script execl(executor, executor, filename, (char *)0); #ifdef SERVERDBG syslog(LOG_ERR,"Execution of %s failed", executor); perror("Execution of the page failed"); #endif error: #ifdef SERVERDBG if (errormsg) syslog(LOG_ERR, "%s", errormsg); #endif exit(1); } static inline int cgi_waitfor_child(connection_t* connection_prop,string_t* post_param,char * executor,pid_t wpid,int *wpipe,int *ipipe) { //Closing pipes, so if they're empty read is non blocking close (wpipe[1]); //Large buffer, must contain the output of the script char* header_buf=malloc(MAXSCRIPTOUT+HEADBUF); if (header_buf==NULL) { //Was unable to allocate the buffer int state; #ifdef SERVERDBG syslog(LOG_CRIT,"Not enough memory to allocate buffers for CGI"); #endif close (wpipe[0]); if (post_param->data!=NULL) {//Pipe created and used only if there is data to send to the script close (ipipe[0]); //Closes unused end of the pipe close (ipipe[1]); //Closes the pipe } kill(wpid,SIGKILL); //Kills cgi process waitpid (wpid,&state,0); //Removes zombie process return ERR_NOMEM;//Returns if buffer was not allocated } if (post_param->data!=NULL) {//Pipe created and used only if there is data to send to the script //Send post data to script's stdin write(ipipe[1],post_param->data,post_param->len); close (ipipe[0]); //Closes unused end of the pipe close (ipipe[1]); //Closes the pipe } //Reads output of the script int e_reads=read(wpipe[0],header_buf,MAXSCRIPTOUT+HEADBUF-1); header_buf[e_reads] = '\0'; //Separating header from contents char* scrpt_buf=strstr(header_buf, "\r\n\r\n"); long long unsigned int cgi_content_s = 0; if (scrpt_buf!=NULL) { scrpt_buf+=2; scrpt_buf[0]=0; scrpt_buf=scrpt_buf+2; cgi_content_s = e_reads - (scrpt_buf - header_buf);//Len of the content } else {//Something went wrong, ignoring the output (it's missing the headers) e_reads=0; } if (e_reads>0) {//There is output from script unsigned int status = 200; //Standard status { //Reading if there is another status char*s=strstr(header_buf,"Status: "); if (s!=NULL) { status=(unsigned int)strtoul( s+8 , NULL, 0 ); } } /* There could be other data, which didn't fit in the buffer, so we set reads to -1 (this will make connection non-keep-alive) and we continue reading and writing to the socket */ connection_prop->keep_alive = false; send_http_header(status, NULL, header_buf, true, -1, connection_prop); if (cgi_content_s) {//Sends the page if there is something to send myio_write(connection_prop->sock, scrpt_buf, cgi_content_s); } e_reads = 1; while (e_reads) { e_reads = read(wpipe[0],header_buf,MAXSCRIPTOUT+HEADBUF); if (myio_write(connection_prop->sock, header_buf, e_reads) != e_reads) break; //Write error, just break, can't send errors now } //Closing pipe close(wpipe[0]); } else {//No output from script, maybe terminated... send_err(connection_prop,500,"Internal server error"); } free(header_buf); { int state; waitpid (wpid,&state,0); //Wait the termination of the script } return 0; } /** Executes a CGI script with a given interpreter and sends the resulting output executor is the path to the binary which will execute the page post_param contains the post data sent to the page (if present). This can't be null, but the string pointer inside the struct can be null. real_basedir is the basedir (according to the virtualhost) connection_prop is the struct containing all the data of the request exec_page will fork and create pipes with the child. The child will clean all the envvars and then set new ones as needed by CGI. Then the child will call alarm to set the timeout to its execution, and then will exec the script. */ int exec_page(char * executor,string_t* post_param,char* real_basedir,connection_t* connection_prop) { #ifdef SENDINGDBG syslog(LOG_INFO,"Executing file %s",connection_prop->strfile); #endif int wpid;//Child's pid int wpipe[2];//Pipe's file descriptor int ipipe[2];//Pipe's file descriptor, used to pass POST on script's standard input //Pipe created and used only if there is POST data to send to the script if (post_param->data!=NULL) { if (pipe(ipipe) == -1 ) { syslog(LOG_ERR, "Unable to create pipe"); return ERR_NOMEM; } } //Pipe to get the output of the child if (pipe(wpipe) == -1) { syslog(LOG_ERR, "Unable to create pipe"); if (post_param->data!=NULL) { close(ipipe[0]); close(ipipe[1]); } return ERR_NOMEM; } if ((wpid=fork())<0) { //Error, returns a no memory error #ifdef SENDINGDBG syslog(LOG_CRIT,"Unable to fork to execute the file %s",connection_prop->strfile); #endif if (post_param->data!=NULL) { close(ipipe[0]); close(ipipe[1]); } close(wpipe[1]); close(wpipe[0]); return ERR_NOMEM; } else if (wpid==0) { /* never returns */ cgi_execute_child(connection_prop,post_param,executor,real_basedir,wpipe,ipipe); } else { //Father: reads from pipe and sends return cgi_waitfor_child(connection_prop,post_param,executor,wpid,wpipe,ipipe); } return 0; } weborf-1.4/instance.c0000664000175000017500000012561214634465635010324 /* Weborf Copyright (C) 2017-2023 Salvo "LtWorf" Tomaselli Weborf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . @author Salvo "LtWorf" Tomaselli @author Salvo Rinaldi */ #include "options.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "utils.h" #include "myio.h" #include "cgi.h" #include "queue.h" #include "mystring.h" #include "mime.h" #include "instance.h" #include "cachedir.h" #include "types.h" #include "auth.h" #include "mynet.h" extern syn_queue_t queue; //Queue for open sockets extern t_thread_info thread_info; extern weborf_configuration_t weborf_conf; extern char* indexes[MAXINDEXCOUNT]; //Array containing index files extern int indexes_l; //Length of array extern pthread_key_t thread_key; //key for pthread_setspecific int request_auth(connection_t *connection_prop); void piperr(); int write_dir(char *real_basedir, connection_t * connection_prop); static int tar_send_dir(connection_t* connection_prop); static int send_page(buffered_read_t* read_b, connection_t* connection_prop); static int send_error_header(int retval, connection_t *connection_prop); static int get_or_post(connection_t *connection_prop, string_t post_param); /** Checks if the required resource has the same date as the one cached in the client. If they are the same, returns 0, returns 1 otherwise If the ETag matches this function will send to the client a 304 response too, so if this function returns 0, the HTTP request has been already served. The char* buffer must be at least RBUFFER bytes (see definitions in options.h) */ static inline int check_etag(connection_t* connection_prop,char *a) { //Find if it is a range request, 13 is strlen of "if-none-match" char *if_none_match="If-None-Match"; if (get_param_value(connection_prop->http_param,if_none_match,a,RBUFFER,strlen(if_none_match))) { time_t etag=(time_t)strtol(a+1,NULL,0); if (connection_prop->strfile_stat.st_mtime==etag) { //Browser has the item in its cache, sending 304 send_http_header(304, NULL, NULL, true, etag, connection_prop); return 0; } } return 1; } /** This function does some changes on the URL. The url will never be longer than the original one. */ static inline void modURL(char* url, bool params) { replaceEscape(url); //Prevents the use of .. to access the whole filesystem if (!params) strReplace(url,"../",'\0'); //TODO AbsoluteURI: Check if the url uses absolute url, and in that case remove the 1st part } /** Sets keep_alive and protocol_version fields of connection_t */ static inline void set_connection_props(connection_t *connection_prop) { char a[12];//Gets the value //Obtains the connection header, writing it into the a buffer, and sets connection=true if the header is present bool connection=get_param_value(connection_prop->http_param,"Connection", a,sizeof(a),strlen("Connection")); //Setting the connection type, using protocol version if (connection_prop->http_param[7]=='1' && connection_prop->http_param[5]=='1') {//Keep alive by default (protocol 1.1) connection_prop->protocol_version=HTTP_1_1; connection_prop->keep_alive=(connection && strncmp(a,"close",5)==0)?false:true; } else {//Not http1.1 //Constants are set to make this line work connection_prop->protocol_version=connection_prop->http_param[7]; connection_prop->keep_alive=(connection && strncmp(a,"Keep",4)==0)?true:false; } split_get_params(connection_prop);//Splits URI into page and parameters modURL(connection_prop->page, false);//Operations on the url string modURL(connection_prop->get_params, true); connection_prop->basedir=get_basedir(connection_prop->http_param); } static inline void handle_requests(char* buf,buffered_read_t * read_b,int * bufFull,connection_t* connection_prop,long int id) { int from; fd_t sock = connection_prop->sock; char *lasts;//Used by strtok_r short int r; //Readed char char *end; //Pointer to header's end while (true) { //Infinite cycle to handle all pipelined requests if ((*bufFull)!=0) { memset(buf,0,(*bufFull));//Sets to 0 the buffer, only the part used for the previous request in the same connection (*bufFull)=0; } from=0; while ((end=strstr(buf+from,"\r\n\r"))==NULL) { //Determines if there is a \r\n\r which is an ending sequence r=buffer_read(sock, buf+(*bufFull),2,read_b);//Reads 2 char and adds to the buffer if (r<=0) { //Connection closed or error return; } if (!(buf[*bufFull]==10 || buf[*bufFull]==13)) {//Optimization to make strstr parse only the ending part of the string from=(*bufFull); } (*bufFull)+=r;//Sets the end of the user buffer (may contain more than one header) //Buffer full and still no valid http header if ((*bufFull)>=INBUFFER) goto bad_request; } //If we didn't read yet the lst \n of the ending sequence, we read it now, so it won't disturb the next request if (strstr(buf+from,"\r\n\r\n")==NULL) { *bufFull+=buffer_read(sock, buf+*bufFull,1,read_b); } end[2]='\0'; //Terminates the header, leaving a final \r\n in it //Finds out request's kind if (strncmp(buf,"GET",strlen("GET"))==0) connection_prop->method_id=GET; else if (strncmp(buf,"POST",strlen("POST"))==0) connection_prop->method_id=POST; else if (strncmp(buf,"PUT",strlen("PUT"))==0) connection_prop->method_id=PUT; else if (strncmp(buf,"DELETE",strlen("DELETE"))==0) connection_prop->method_id=DELETE; else if (strncmp(buf,"OPTIONS",strlen("OPTIONS"))==0) connection_prop->method_id=OPTIONS; #ifdef WEBDAV else if (strncmp(buf,"PROPFIND",strlen("PROPFIND"))==0) connection_prop->method_id=PROPFIND; else if (strncmp(buf,"MKCOL",strlen("MKCOL"))==0) connection_prop->method_id=MKCOL; else if (strncmp(buf,"COPY",strlen("COPY"))==0) connection_prop->method_id=COPY; else if (strncmp(buf,"MOVE",strlen("MOVE"))==0) connection_prop->method_id=MOVE; #endif else goto bad_request; connection_prop->method=strtok_r(buf," ",&lasts);//Must be done to eliminate the request connection_prop->page=strtok_r(NULL," ",&lasts); if (connection_prop->page==NULL || connection_prop->method == NULL) goto bad_request; connection_prop->http_param=lasts; #ifdef THREADDBG syslog(LOG_INFO,"Requested page: %s to Thread %ld",connection_prop->page,id); #endif //Stores the parameters of the request set_connection_props(connection_prop); if (send_page(read_b, connection_prop) < 0) { #ifdef REQUESTDBG syslog(LOG_INFO, "%s - FAILED - %s %s", connection_prop->ip_addr, connection_prop->method, connection_prop->page); #endif return; //Unable to send an error } #ifdef REQUESTDBG syslog(LOG_INFO, "%s - %d - %s %s", connection_prop->ip_addr, connection_prop->status_code, connection_prop->method, connection_prop->page ); #endif //Non pipelined if (connection_prop->keep_alive==false) return; } /* while */ bad_request: send_error_header(400, connection_prop); #ifdef REQUESTDBG syslog(LOG_INFO, "%s - %d", connection_prop->ip_addr, connection_prop->status_code); #endif return; } /** Set thread with id as free */ void change_free_thread(long int id,int free_d, int count_d) { pthread_mutex_lock(&thread_info.mutex); thread_info.free+=free_d; thread_info.count+=count_d; #ifdef THREADDBG syslog(LOG_DEBUG,"There are %d free threads",thread_info.free); #endif pthread_mutex_unlock(&thread_info.mutex); } /** Function executed at the beginning of the thread Takes open sockets from the queue and serves the requests Doesn't do busy waiting */ void * instance(void * nulla) { thread_prop_t thread_prop; //Server's props pthread_setspecific(thread_key, (void *)&thread_prop); //Set thread_prop as thread variable //General init of the thread thread_prop.id=(long int)nulla;//Set thread's id #ifdef THREADDBG syslog(LOG_DEBUG,"Starting thread %ld",thread_prop.id); #endif //Vars int bufFull=0; //Amount of buf used connection_t connection_prop; //Struct to contain properties of the connection buffered_read_t read_b; //Buffer for buffered reader int sock=0; //Socket with the client char * buf=calloc(INBUFFER+1,sizeof(char)); //Buffer to contain the HTTP request connection_prop.strfile=malloc(URI_LEN); //buffer for filename signal(SIGPIPE, SIG_IGN);//Ignores SIGPIPE #ifdef IPV6 struct sockaddr_in6 addr;//Local and remote address socklen_t addr_l=sizeof(struct sockaddr_in6); #else struct sockaddr_in addr; int addr_l=sizeof(struct sockaddr_in); #endif if (mime_init(&thread_prop.mime_token) != 0 || buffer_init(&read_b, BUFFERED_READER_SIZE) != 0 || buf == NULL || connection_prop.strfile == NULL) { //Unable to allocate the buffer #ifdef SERVERDBG syslog(LOG_CRIT, "Not enough memory to allocate buffers for new thread"); #endif goto release_resources; } //Start accepting sockets change_free_thread(thread_prop.id, 1, 0); while (true) { q_get(&queue, &sock);//Gets a socket from the queue change_free_thread(thread_prop.id, -1, 0);//Sets this thread as busy if (sock<0) { //Was not a socket but a termination order goto release_resources; } net_getpeername(sock, connection_prop.ip_addr); #ifdef HAVE_LIBSSL connection_prop.sock.fd = sock; if (weborf_conf.sslctx) { connection_prop.sock.ssl = SSL_new(weborf_conf.sslctx); SSL_set_fd(connection_prop.sock.ssl, sock); if (SSL_accept(connection_prop.sock.ssl) != 1) { syslog(LOG_INFO, "SSL connection failed from %s", connection_prop.ip_addr); goto closeconnection; } } else { connection_prop.sock.ssl = NULL; } #else connection_prop.sock = sock; #endif #ifdef THREADDBG syslog(LOG_DEBUG, "Thread %ld: Reading from socket", thread_prop.id); #endif handle_requests(buf, &read_b, &bufFull, &connection_prop, thread_prop.id); closeconnection: #ifdef THREADDBG syslog(LOG_DEBUG, "Thread %ld: Closing socket with client", thread_prop.id); #endif #ifdef HAVE_LIBSSL if (weborf_conf.sslctx) { SSL_shutdown(connection_prop.sock.ssl); SSL_free(connection_prop.sock.ssl); } #endif close(sock); //Closing the socket buffer_reset(&read_b); change_free_thread(thread_prop.id, 1, 0);//Sets this thread as free } release_resources: #ifdef THREADDBG syslog(LOG_DEBUG,"Terminating thread %ld",thread_prop.id); #endif free(buf); free(connection_prop.strfile); buffer_free(&read_b); mime_release(thread_prop.mime_token); change_free_thread(thread_prop.id,0,-1);//Reduces count of threads pthread_exit(0); return NULL;//Never reached } /** This function handles a PUT request. It requires the socket, connection_t struct and buffered_read_t to read from the socket, since the reading is internally buffered. PUT size has no hardcoded limits. Auth provider has to check for the file's size and refuse it if it is the case. This function will not work if there is no auth provider. */ int read_file(connection_t* connection_prop,buffered_read_t* read_b) { fd_t sock = connection_prop->sock; if (weborf_conf.authsock==NULL) { return ERR_FORBIDDEN; } char a[NBUFFER]; //Buffer for field's value int retval; long long int content_l; //Length of the put data //Gets the value of content-length header bool r=get_param_value(connection_prop->http_param,"Content-Length", a,NBUFFER,strlen("Content-Length"));//14 is content-length's len if (r!=false) {//If there is no content-length returns error content_l=strtoll( a , NULL, 0 ); } else {//No data return ERR_NODATA; } //Checks if file already exists or not (needed for response code) if (file_exists(connection_prop->strfile)) {//Resource already existed (No content) retval=OK_NOCONTENT; } else {//Resource was created (Created) retval=OK_CREATED; } int fd=open(connection_prop->strfile,O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR); if (fd == -1) { return ERR_FILENOTFOUND; } if (ftruncate(fd, content_l) == -1) { close(fd); return ERR_NOMEM; } char* buf=malloc(FILEBUF);//Buffer to read from file if (buf==NULL) { #ifdef SERVERDBG syslog(LOG_CRIT,"Not enough memory to allocate buffers"); #endif close(fd); return ERR_NOMEM; } long long int read_,write_; long long int tot_read=0; long long int to_read; while ((to_read=(content_l-tot_read)>FILEBUF?FILEBUF:content_l-tot_read)>0) { read_=buffer_read(sock,buf,to_read,read_b); write_=write(fd,buf,read_); if (write_!=read_) { retval = ERR_BRKPIPE; break; } tot_read += read_; } free(buf); close(fd); return retval; } /** This function handles a DELETE request. It requires the socket, connection_t struct Auth provider has to check if it is allowed to delete the file or not. This function will not work if there is no auth provider. */ int delete_file(connection_t* connection_prop) { int retval; if (weborf_conf.authsock==NULL) { return ERR_FORBIDDEN; } //connection_prop->strfile struct stat stat_d; if (stat(connection_prop->strfile,&stat_d)<0) { return ERR_FILENOTFOUND; } if (S_ISDIR(stat_d.st_mode)) { retval=dir_remove(connection_prop->strfile); } else { retval=unlink(connection_prop->strfile); } if (retval!=0) {//Returns a generic error return ERR_FORBIDDEN; } return OK_NOCONTENT; } /** Returns the list of supported methods. In theory this list should be different depending on the URI requested. But this method will return the same list for everything. */ static inline int options (connection_t* connection_prop) { #ifdef WEBDAV #define ALLOWED "Allow: GET,POST,PUT,DELETE,OPTIONS,PROPFIND,MKCOL,COPY,MOVE\r\nDAV: 1,2\r\nDAV: \r\nMS-Author-Via: DAV\r\n" #else #define ALLOWED "Allow: GET,POST,PUT,DELETE,OPTIONS\r\n" #endif send_http_header(200, NULL, ALLOWED, true, -1, connection_prop); return 0; } /** This function determines the requested page and sends it http_param is a string containing parameters of the HTTP request */ static int send_page(buffered_read_t* read_b, connection_t* connection_prop) { int retval = 0;//Return value after sending the page string_t post_param; //Contains POST data post_param.data = NULL; post_param.len = 0; #ifdef SENDINGDBG syslog (LOG_DEBUG,"URL changed into %s",connection_prop->page); #endif if (auth_check_request(connection_prop) != 0) { //If auth is required read_post_data(connection_prop, read_b); //Consume request body retval = ERR_NOAUTH; goto escape; } connection_prop->strfile_len = snprintf( connection_prop->strfile, URI_LEN, "%s%s", connection_prop->basedir, connection_prop->page); if (connection_prop->method_id >= PUT) {//Methods from PUT to other uncommon ones :-D switch (connection_prop->method_id) { case PUT: retval=read_file(connection_prop, read_b); break; case DELETE: retval=delete_file(connection_prop); break; case OPTIONS: retval=options(connection_prop); break; #ifdef WEBDAV case PROPFIND: //Propfind has data, not strictly post but read_post_data will work post_param = read_post_data(connection_prop, read_b); retval = propfind(connection_prop, &post_param); break; case MKCOL: retval = mkcol(connection_prop); break; case COPY: case MOVE: retval = copy_move(connection_prop); break; #endif } goto escape; } if (connection_prop->method_id == POST) post_param = read_post_data(connection_prop,read_b); if ((connection_prop->strfile_fd=open(connection_prop->strfile,O_RDONLY | O_LARGEFILE))<0) { //File doesn't exist. Must return errorcode retval = ERR_FILENOTFOUND; goto escape; } fstat(connection_prop->strfile_fd, &connection_prop->strfile_stat); retval = get_or_post(connection_prop, post_param); escape: free(post_param.data); //Closing local file previously opened if ((connection_prop->method_id==GET || connection_prop->method_id==POST) && connection_prop->strfile_fd>=0) { close(connection_prop->strfile_fd); } return send_error_header(retval, connection_prop); } /** * With get or post this function is called, it decides if execute CGI or send * the simple file, and if the request points to a directory it will redirect to * the appropriate index file or show the list of the files. * */ static int get_or_post(connection_t *connection_prop, string_t post_param) { unsigned long long int size_zero = 0; if (S_ISDIR(connection_prop->strfile_stat.st_mode)) {//Requested a directory if (weborf_conf.tar_directory) { return tar_send_dir(connection_prop); } //Requested a directory without ending / if (!endsWith(connection_prop->strfile,"/",connection_prop->strfile_len,1)) {//Putting the ending / and redirect char head[URI_LEN+12];//12 is the size for the location header snprintf(head,URI_LEN+12,"Location: %s/\r\n",connection_prop->page); send_http_header(301, &size_zero, head, true, -1, connection_prop); return 0; } else {//Requested directory with "/" Search for index files or list directory char* index_name=&connection_prop->strfile[connection_prop->strfile_len];//Pointer to where to write the filename int i; //Cyclyng through the indexes for (i=0; istrfile)) { //If index exists, redirect to it char head[URI_LEN+12];//12 is the size for the location header snprintf(head,URI_LEN+12,"Location: %s%s\r\n",connection_prop->page,weborf_conf.indexes[i]); send_http_header(303, &size_zero, head, true, -1, connection_prop); return 0; } } connection_prop->strfile[connection_prop->strfile_len]=0; //Removing the index part return write_dir(connection_prop->basedir,connection_prop); } } else {//Requested an existing file if (weborf_conf.exec_script) { //Scripts enabled int q_; int f_len; for (q_=0; q_page+connection_prop->page_len-f_len,weborf_conf.cgi_paths.data[q_],f_len,f_len)) { return exec_page(weborf_conf.cgi_paths.data[++q_],&post_param,connection_prop->basedir,connection_prop); } } } //send normal file, control reaches this point if scripts are disabled or if the filename doesn't trigger CGI return write_file(connection_prop); } } /** * If retval is not 0, this function will send an appropriate error * or request authentication or any other header that does not imply * sending some content as well. * */ static int send_error_header(int retval, connection_t *connection_prop) { switch (retval) { case 0: return 0; case ERR_BRKPIPE: return send_err(connection_prop,500,"Internal server error"); case ERR_FILENOTFOUND: return send_err(connection_prop,404,"Page not found"); case ERR_SERVICE_UNAVAILABLE: case ERR_NOMEM: return send_err(connection_prop,503,"Service Unavailable"); case ERR_RANGE_NOT_SATISFIABLE: return send_err(connection_prop,416,"Range not satisfiable"); case ERR_NODATA: case ERR_NOTHTTP: return send_err(connection_prop,400,"Bad request"); case ERR_FORBIDDEN: return send_err(connection_prop,403,"Forbidden"); case ERR_NOTIMPLEMENTED: return send_err(connection_prop,501,"Not implemented"); case ERR_PRECONDITION_FAILED: return send_err(connection_prop,412,"Precondition Failed"); case ERR_CONFLICT: return send_err(connection_prop,409,"Conflict"); case ERR_INSUFFICIENT_STORAGE: return send_err(connection_prop,507,"Insufficient Storage"); case ERR_NOT_ALLOWED: return send_err(connection_prop,405,"Method Not Allowed"); case ERR_NOAUTH: return request_auth(connection_prop);//Sends a request for authentication case OK_NOCONTENT: return send_http_header(204, NULL, NULL, true, -1, connection_prop); case OK_CREATED: return send_http_header(201, NULL, NULL, true, -1, connection_prop); } return 0; //Make gcc happy } /** This function writes on the specified socket an html page containing the list of files within the specified directory. */ int write_dir(char* real_basedir,connection_t* connection_prop) { fd_t sock = connection_prop->sock; /* WARNING This code checks the ETag and returns if the client has a copy in cache since the impact of using ETag for generated directory list is not known yet, if ETag goes away, also the following block will have to be deleted */ { char a[RBUFFER+MIMETYPELEN+16]; //Buffer for if-none-match from header //Check if the resource cached in the client is the same if (check_etag(connection_prop,&a[0])==0) return 0; } //Tries to send the item from the cache if (cache_send_item(0,connection_prop)) return 0; unsigned long long int pagelen; bool parent; /* Determines if has to show the link to parent dir or not. If page is the basedir, it won't show the link to .. */ { size_t basedir_len=strlen(real_basedir); if (connection_prop->strfile_len-1==basedir_len || connection_prop->strfile_len==basedir_len) parent=false; else parent=true; } char* html=malloc(MAXSCRIPTOUT);//Memory for the html page if (html==NULL) { //No memory #ifdef SERVERDBG syslog(LOG_CRIT,"Not enough memory to allocate buffers to list directory"); #endif return ERR_NOMEM; } if ((pagelen=list_dir (connection_prop,html,MAXSCRIPTOUT,parent))<0) { //Creates the page free(html);//Frees the memory used for the page switch (pagelen) { case -1: return ERR_FILENOTFOUND; case -2: default: #ifdef SERVERDBG syslog(LOG_ERR, "Directory too large to be listed"); #endif return ERR_INSUFFICIENT_STORAGE; } } else { //If there are no errors sends the page /*WARNING using the directory's mtime here allows better caching and the mtime will anyway be changed when files are added or deleted. Anyway i couldn't find the proof that it is changed also when files are modified. I tried on reiserfs and the directory's mtime changes too but i didn't find any doc about the other filesystems and OS. */ send_http_header( 200, &pagelen, "Content-Type: text/html\r\n", true, connection_prop->strfile_stat.st_mtime, connection_prop ); myio_write(sock, html, pagelen); //Write item in cache cache_store_item(0, connection_prop, html, pagelen); } free(html);//Frees the memory used for the page return 0; } /** Writes a file to the socket, compressing it with gzip. Then, since it is not possible to know the size of the compressed file, it is not possible to send the size in advance, so it will set keep_alive to false (and will seand the header "Connection: close" before) after sending. sock is the socket */ #ifdef __COMPRESSION static inline int write_compressed_file(connection_t* connection_prop ) { fd_t sock = connection_prop->sock; if ( connection_prop->strfile_stat.st_size>SIZE_COMPRESS_MIN && connection_prop->strfile_stat.st_sizehttp_param,"Accept-Encoding:"))!=NULL && (end=strstr(accept,"\r\n"))!=NULL) { //Avoid to parse the entire header. end[0]='\0'; char* gzip=strstr(accept,"gzip"); end[0]='\r'; if (gzip==NULL) { return NO_ACTION; } } } else { //File size is not in the size range to be compressed return NO_ACTION; } connection_prop->keep_alive=false; send_http_header(200, &connection_prop->strfile_stat.st_size, "Content-Encoding: gzip\r\n", false, connection_prop->strfile_stat.st_mtime, connection_prop); int pid=fork(); if (pid==0) { //child, executing gzip fclose (stdout); //Closing the stdout dup(sock); //Redirects the stdout #ifdef GZIPNICE nice(GZIPNICE); //Reducing priority #endif execlp("gzip","gzip","-c",connection_prop->strfile,(char *)0); } else if (pid>0) { //Father, does nothing int status; waitpid(pid,&status,0); } else { //Error return ERR_NOMEM; //Well not enough memory in process table... } return 0; } #endif /** * Returns the amount of bytes to send * Collaterally, this function seeks the file to the requested position * finds out the mimetype * sends the header * * a must be a pointer to a buffer large at least RBUFFER+MIMETYPELEN+16 * */ static inline unsigned long long int bytes_to_send(connection_t* connection_prop, char *a, int *errcode) { int http_code=200; errno=0; unsigned long long int count; char *hbuf=a; int remain=RBUFFER+MIMETYPELEN+16, t; a[0]='\0'; #ifdef __RANGE char *range="Range"; char *if_range="If-Range"; bool range_header=get_param_value(connection_prop->http_param,range,a,RBUFFER,strlen(range)); time_t etag=connection_prop->strfile_stat.st_mtime; //Range header present, seeking for If-Range if (range_header) { char b[RBUFFER]; //Buffer for If-Range if (get_param_value(connection_prop->http_param,if_range,&b[0],sizeof(b),strlen(if_range))) { etag=(time_t)strtol(&b[1],NULL,0); } } /* * If range header is present and (If-Range has the same etag OR there is no If-Range) * */ if (range_header && connection_prop->strfile_stat.st_mtime==etag) {//Find if it is a range request 5 is strlen of "range" unsigned long long int from; unsigned long long int to; { //Locating from and to //Range: bytes=12323-123401 char *eq, *sep; if ((eq=strstr(a,"="))==NULL ||(sep=strstr(eq,"-"))==NULL) {//Invalid data in Range header. *errcode = ERR_NOTHTTP; return 0; } sep[0]=0; from=strtoll(eq+1,NULL,0); to=strtoll(sep+1,NULL,0); if (to == 0 && strlen(sep +1) == 0) { //If no to is specified, it is to the end of the file to=connection_prop->strfile_stat.st_size-1; } } http_code=206; t=snprintf(hbuf,remain,"Accept-Ranges: bytes\r\nContent-Range: bytes %llu-%llu/%lld\r\n", from, to,(long long int)connection_prop->strfile_stat.st_size); hbuf+=t; remain-=t; count = to - from + 1; if (from >= connection_prop->strfile_stat.st_size || from + count > connection_prop->strfile_stat.st_size) { *errcode = ERR_RANGE_NOT_SATISFIABLE; return 0; } if (from) lseek(connection_prop->strfile_fd,from,SEEK_SET); } else //Normal request #endif { a[0]=0; //Reset buffer in case it isn't used for headers count = connection_prop->strfile_stat.st_size; } //Sending MIME to the client #ifdef SEND_MIMETYPES if (weborf_conf.send_content_type) { thread_prop_t *thread_prop = pthread_getspecific(thread_key); const char* mime=mime_get_fd(thread_prop->mime_token,connection_prop->strfile_fd,&(connection_prop->strfile_stat)); //t= snprintf(hbuf,remain,"Content-Type: %s\r\n",mime); //hbuf+=t; //remain-=t; } #endif send_http_header(http_code, &count,a,true,connection_prop->strfile_stat.st_mtime,connection_prop); return count; } /** This function reads a file and writes it to the socket. Also sends the http header with the content length header same as the file's size. There is no limit to file size, and it uses O_LARGEFILE flag to send file larger than 4gb. Since this flag isn't available on all systems, it will be 0 when compiled on system who doesn't have this flag. On those systems it is unpredictable if it will be able to send large files or not. If the file is larger, it will be sent using write_compressed_file, see that function for details. To work connection_prop.strfile_fd and connection_prop.strfile_stat must be set. The file sent is the one specified by strfile_fd, and it will not be closed after. */ int write_file(connection_t* connection_prop) { fd_t sock = connection_prop->sock; char a[RBUFFER+MIMETYPELEN+16]; //Buffer for Range, Content-Range headers, and reading if-none-match from header //Check if the resource cached in the client is the same if (check_etag(connection_prop,&a[0])==0) return 0; #ifdef __COMPRESSION { //Tryies gzipping and sending the file int c= write_compressed_file(connection_prop); if (c!=NO_ACTION) return c; } #endif //Determines how many bytes send, depending on file size and ranges //Also sends the http header int errcode = 0; unsigned long long int count = bytes_to_send(connection_prop,&a[0], &errcode); if (errcode != 0) return errcode; /*if (errno !=0) { int e=errno; errno=0; return e; }*/ //Copy file using descriptors; from to and size return fd_copy(fd2fd_t(connection_prop->strfile_fd), sock, count); } /** Sends a request for authentication */ int request_auth(connection_t *connection_prop) { fd_t sock = connection_prop->sock; char * descr = connection_prop->page; connection_prop->status_code=401; //Buffer for both header and page char * head=malloc(MAXSCRIPTOUT+HEADBUF); if (head==NULL) { #ifdef SERVERDBG syslog(LOG_CRIT,"Not enough memory to allocate buffers"); #endif return ERR_NOMEM; } char * page=head+HEADBUF; //Prepares html page int page_len=snprintf(page,MAXSCRIPTOUT,"%s

Authorization required

%s

%s",HTMLHEAD,descr,HTMLFOOT); //Prepares http header int head_len = snprintf(head,HEADBUF,"HTTP/1.1 401 Authorization Required\r\nServer: " SIGNATURE "\r\nContent-Length: %d\r\nWWW-Authenticate: Basic realm=\"%s\"\r\n\r\n",page_len,descr); //Sends the header if (myio_write (sock,head,head_len)!=head_len) { free(head); return ERR_SOCKWRITE; } //Sends the page if (myio_write(sock,page,page_len)!=page_len) { free(head); return ERR_SOCKWRITE; } free(head); return 0; } /** Sends an error to the client */ int send_err(connection_t *connection_prop, int err, char* descr) { fd_t sock = connection_prop->sock; connection_prop->status_code = err; //Sets status code, for the logs //Buffer for both header and page char * head=malloc(MAXSCRIPTOUT+HEADBUF); if (head==NULL) { #ifdef SERVERDBG syslog(LOG_CRIT,"Not enough memory to allocate buffers"); #endif return ERR_NOMEM; } char * page=head+HEADBUF; //Prepares the page int page_len=snprintf(page,MAXSCRIPTOUT,"%s

Error %d

%s %s",HTMLHEAD,err,descr,HTMLFOOT); //Prepares the header int head_len = snprintf(head,HEADBUF,"HTTP/1.1 %d %s\r\nServer: " SIGNATURE "\r\nContent-Length: %d\r\nContent-Type: text/html\r\n\r\n",err,descr ,(int)page_len); //Sends the http header if (myio_write(sock, head, head_len) != head_len) { free(head); return ERR_SOCKWRITE; } //Sends the html page if (myio_write(sock, page, page_len) != page_len) { free(head); return ERR_SOCKWRITE; } free(head); return 0; } /** This function reads post data and returns the pointer to the buffer containing the data (if there is any) or NULL if there was no data. If it doesn't return a null value, the returned pointer must be freed. */ string_t read_post_data(connection_t* connection_prop, buffered_read_t* read_b) { fd_t sock = connection_prop->sock; string_t res; res.len=0; res.data=NULL; //Buffer for field's value char a[NBUFFER]; //Gets the value char *content_length = "Content-Length"; //If there is a request body if (get_param_value(connection_prop->http_param, content_length, a, NBUFFER, strlen(content_length))) { long int l = strtol(a, NULL, 0 ); if (l<=POST_MAX_SIZE && (res.data=malloc(l))!=NULL) {//Post size is ok and buffer is allocated res.len=buffer_read(sock,res.data,l,read_b); } } return res; } /** This function returns a pointer to a string. It will use virtualhost settings to return this string and if no virtualhost is set for that host, it will return the default basedir. Those string must */ char* get_basedir(char* http_param) { if (weborf_conf.virtual_host==false) return weborf_conf.basedir; char* result; char* h=strstr(http_param,"\r\nHost: "); if (h==NULL) return weborf_conf.basedir; h+=8;//Removing "Host:" string char* end=strstr(h,"\r"); if (end==NULL) return weborf_conf.basedir; end[0]=0; result=getenv(h); end[0]='\r'; if (result==NULL) return weborf_conf.basedir; //Reqeusted host doesn't exist return result; } /** This function returns the reason phrase according to the response code. */ static inline char *reason_phrase(int code) { code /= 100; switch (code) { case 2: return "OK"; case 3: return "Found"; case 4: return "Request error"; case 5: return "Server error"; case 1: return "Received"; }; return "Something is very wrong"; } /** This function sends a code header to the specified socket size is the Content-Length field. headers can be NULL or some extra headers to add. Headers must be separated by \r\n and must have an \r\n at the end. Content says if the size is for content-length or for entity-length Timestamp is the timestamp for the content. Set to -1 to use the current timestamp for Last-Modified and to omit ETag. This function will automatically take care of generating Connection header when needed, according to keep_alive and protocol_version of connection_prop */ int send_http_header(int code, unsigned long long int *size,char* headers,bool content,time_t timestamp,connection_t* connection_prop) { fd_t sock = connection_prop->sock; int len_head,wrote; char *head=malloc(HEADBUF); char* h_ptr=head; int left_head=HEADBUF; connection_prop->status_code=code; //Sets status code, for the logs if (head==NULL) { #ifdef SERVERDBG syslog(LOG_CRIT,"Not enough memory to allocate buffers"); #endif return ERR_NOMEM; } if (headers==NULL) headers=""; /*Defines the Connection header It will send the connection header if the setting is non-default Ie: will send keep alive if keep-alive is enabled and protocol is not 1.1 And will send close if keep-alive isn't enabled and protocol is 1.1 */ char *connection_header; if (connection_prop->protocol_version!=HTTP_1_1 && connection_prop->keep_alive==true) { connection_header="Connection: Keep-Alive\r\n"; } else if (connection_prop->protocol_version==HTTP_1_1 && connection_prop->keep_alive==false) { connection_header="Connection: close\r\n"; } else { connection_header=""; } len_head=snprintf(head,HEADBUF,"HTTP/1.1 %d %s\r\nServer: " SIGNATURE "\r\n%s",code,reason_phrase(code),connection_header); //This stuff moves the pointer to the buffer forward, and reduces the left space in the buffer itself //Next snprintf will append their strings to the buffer, without overwriting. head+=len_head; left_head-=len_head; //Creating ETag and date from timestamp if (timestamp!=-1) { //Sends ETag, if a timestamp is set len_head = snprintf(head,left_head,"ETag: \"%d\"\r\n",(int)timestamp); head+=len_head; left_head-=len_head; } #ifdef SEND_LAST_MODIFIED_HEADER else {//timestamp with now, to be eventually used by Last-Modified timestamp=time(NULL); } { //Sends Date struct tm ts; localtime_r((time_t)×tamp,&ts); len_head = strftime(head,left_head, "Last-Modified: %a, %d %b %Y %H:%M:%S GMT\r\n", &ts); head+=len_head; left_head-=len_head; } #endif if (size != NULL && connection_prop->keep_alive==true) { //Content length (or entity length) and extra headers if (content) { len_head=snprintf(head,left_head,"Content-Length: %llu\r\n", *size); } else { len_head=snprintf(head,left_head,"entity-length: %llu\r\n", *size); } head+=len_head; left_head-=len_head; } len_head=snprintf(head,left_head,"%s\r\n",headers); //head+=len_head; Not necessary because the snprintf was the last one left_head-=len_head; wrote = myio_write(sock, h_ptr, HEADBUF - left_head); free(h_ptr); if (wrote!=HEADBUF-left_head) return ERR_BRKPIPE; return 0; } /** This function writes on the specified socket a tar.gz file containing the required directory. No caching at all is used or is allowed to the clients */ static int tar_send_dir(connection_t* connection_prop) { connection_prop->keep_alive=false; char* headers=malloc(HEADBUF); if (headers==NULL) return ERR_NOMEM; //Last char is always '/', i null it so i can use default name connection_prop->strfile[--connection_prop->strfile_len]=0; snprintf(headers,HEADBUF , "Content-Type: application/x-gzip\r\n" "Content-Disposition: attachment; filename=\"%s.tar.gz\"\r\n", strrchr(connection_prop->strfile,'/')+1 ); send_http_header(200, NULL, headers, true, -1, connection_prop); free(headers); int pid=fork(); if (pid==0) { //child, executing tar fclose (stdout); //Closing the stdout if (dup(myio_getfd(connection_prop->sock)) == -1) { //Redirects the stdout exit(1); } errno = 0; if (nice(1) == -1 && errno != 0) { //Failed to reduce priority syslog(LOG_INFO, "Failed to nice() child process"); } execlp("tar","tar","-cz",connection_prop->strfile,(char *)0); exit(1); } else if (pid>0) { //Father, does nothing int status; waitpid(pid, &status, 0); if (status != 0) { syslog(LOG_ERR, "tar terminated with exit code %d", status); return ERR_BRKPIPE; } } else { //Error return ERR_NOMEM; //Well not enough memory in process table... } return 0; } /** Function executed when weborf is called from inetd will use 0 as socket and exit after. It is almost a copy of instance() */ void inetd() { thread_prop_t thread_prop; //Server's props int bufFull=0; //Amount of buf used connection_t connection_prop; //Struct to contain properties of the connection buffered_read_t read_b; //Buffer for buffered reader char * buf=calloc(INBUFFER+1,sizeof(char)); //Buffer to contain the HTTP request connection_prop.strfile=malloc(URI_LEN); //buffer for filename thread_prop.id=0; signal(SIGPIPE, SIG_IGN);//Ignores SIGPIPE pthread_setspecific(thread_key, (void *)&thread_prop); //Set thread_prop as thread variable #ifdef THREADDBG syslog(LOG_DEBUG,"Starting from inetd"); #endif #ifdef IPV6 struct sockaddr_in6 addr;//Local and remote address socklen_t addr_l=sizeof(struct sockaddr_in6); #else struct sockaddr_in addr; int addr_l=sizeof(struct sockaddr_in); #endif if (mime_init(&thread_prop.mime_token)!=0 || buffer_init(&read_b, BUFFERED_READER_SIZE)!=0 || buf==NULL || connection_prop.strfile==NULL) { #ifdef SERVERDBG syslog(LOG_CRIT,"Not enough memory to allocate buffers for new thread"); #endif exit(1); } net_getpeername(0, connection_prop.ip_addr); #ifdef HAVE_LIBSSL connection_prop.sock.fd = 0; if (weborf_conf.sslctx) { connection_prop.sock.ssl = SSL_new(weborf_conf.sslctx); SSL_set_fd(connection_prop.sock.ssl, 0); if (SSL_accept(connection_prop.sock.ssl) != 1) { syslog(LOG_INFO, "SSL connection failed from %s", connection_prop.ip_addr); exit(1); } } else { connection_prop.sock.ssl = NULL; } #else connection_prop.sock = 0; #endif handle_requests(buf,&read_b,&bufFull,&connection_prop,thread_prop.id); exit(0); } weborf-1.4/configure.ac0000664000175000017500000000203014647273321010617 AC_INIT([weborf], [1.4], [tiposchi@tiscali.it]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([queue.c]) AC_CONFIG_HEADERS([config.h]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AM_INIT_AUTOMAKE([foreign -Wall -Werror]) AM_MAINTAINER_MODE AC_PROG_CC AC_SUBST([cgibindir], [${libdir}/cgi-bin]) AC_SUBST([initdir], [${sysconfdir}/init.d]) AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h syslog.h unistd.h]) AC_CHECK_FUNCS([alarm inet_ntoa localtime_r memmove memset mkdir putenv rmdir setenv socket strstr strtol strtoul ftruncate strrchr]) AC_SYS_LARGEFILE AC_HEADER_STDBOOL AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_UID_T AC_FUNC_FORK AC_FUNC_MALLOC AC_C_INLINE AC_CHECK_LIB([pthread], [pthread_create], , \ AC_MSG_ERROR([libpthread is needed]) ) AC_CHECK_LIB([magic], [magic_load]) AC_CHECK_LIB([crypto], [RAND_add]) AC_CHECK_LIB([ssl], [SSL_new]) #AC_CONFIG_HEADERS([config.h options.h]) AC_CONFIG_FILES([Makefile options.h ]) AC_OUTPUT