├── NEWS ├── Makefile.am ├── TODO ├── AUTHORS ├── .gitignore ├── .travis.yml ├── src ├── Makefile.am ├── webdav.h ├── cache.h ├── svn.h ├── config.h.in ├── wdfs-main.h ├── cache.c ├── svn.c ├── webdav.c └── Makefile.in ├── configure.ac ├── README ├── ChangeLog ├── INSTALL ├── install-sh ├── missing ├── COPYING ├── depcomp ├── Makefile.in └── aclocal.m4 /NEWS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS=src 2 | 3 | # eof 4 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codyps/wdfs/HEAD/TODO -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Jens Noedler or 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | .deps 3 | src/.deps/ 4 | Makefile 5 | src/Makefile 6 | *.status 7 | src/config.h 8 | src/stamp-h1 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | before_script: 2 | - sudo apt-get install libfuse-dev -y 3 | - sudo apt-get install libneon27-dev -y 4 | script: ./configure && make 5 | language: c 6 | compiler: 7 | - clang 8 | - gcc 9 | 10 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS = wdfs 2 | wdfs_SOURCES = cache.c cache.h svn.c svn.h wdfs-main.c wdfs-main.h webdav.c webdav.h 3 | 4 | # this flag is set via "#define FUSE_USE_VERSION XY" in wdfs-main.c 5 | # wdfs_CPPFLAGS = -DFUSE_USE_VERSION= 6 | 7 | # eof 8 | -------------------------------------------------------------------------------- /src/webdav.h: -------------------------------------------------------------------------------- 1 | #ifndef WEBDAV_H_ 2 | #define WEBDAV_H_ 3 | 4 | extern ne_session *session; 5 | 6 | int setup_webdav_session(); 7 | 8 | int lockfile(const char *remotepath, const int timeout); 9 | int unlockfile(const char *remotepath); 10 | void unlock_all_files(); 11 | 12 | #endif /*WEBDAV_H_*/ 13 | -------------------------------------------------------------------------------- /src/cache.h: -------------------------------------------------------------------------------- 1 | #ifndef CACHE_H_ 2 | #define CACHE_H_ 3 | 4 | void cache_initialize(); 5 | void cache_destroy(); 6 | void cache_add_item(struct stat *stat, const char *remotepath); 7 | void cache_delete_item(const char *remotepath); 8 | int cache_get_item(struct stat *stat, const char *remotepath); 9 | 10 | #endif /*CACHE_H_*/ 11 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | AC_INIT(wdfs, 1.4.2, [noedler@web.de]) 2 | AM_INIT_AUTOMAKE 3 | AM_CONFIG_HEADER(src/config.h) 4 | 5 | AC_CHECK_HEADERS([pthread.h]) 6 | # defines HAVE_STRNDUP if strndup() is available 7 | AC_CHECK_FUNCS([strndup]) 8 | 9 | AC_PROG_CC 10 | export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH 11 | PKG_CHECK_MODULES(WDFS, [fuse >= 2.5.0 neon >= 0.24.7 glib-2.0]) 12 | 13 | CFLAGS="$CFLAGS $WDFS_CFLAGS -Wall -D_GNU_SOURCE -D_REENTRANT" 14 | LIBS="$WDFS_LIBS" 15 | 16 | AC_CONFIG_FILES([Makefile src/Makefile]) 17 | AC_OUTPUT 18 | 19 | # eof 20 | -------------------------------------------------------------------------------- /src/svn.h: -------------------------------------------------------------------------------- 1 | #ifndef SVN_H_ 2 | #define SVN_H_ 3 | 4 | #include "wdfs-main.h" 5 | 6 | /* look at svn.c for comments on these extern variables */ 7 | extern const char *svn_basedir; 8 | 9 | int svn_set_repository_root(); 10 | void svn_free_repository_root(); 11 | 12 | char* svn_get_remotepath(const char *localpath); 13 | void svn_add_level1_directories(struct dir_item *item_data); 14 | int svn_add_level2_directories( 15 | struct dir_item *item_data, const char *localpath); 16 | struct stat svn_get_static_dir_stat(); 17 | int svn_get_level1_stat(struct stat *stat, const char *localpath); 18 | 19 | #endif /*SVN_H_*/ 20 | -------------------------------------------------------------------------------- /src/config.h.in: -------------------------------------------------------------------------------- 1 | /* src/config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_INTTYPES_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_MEMORY_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_PTHREAD_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_STDINT_H 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_STDLIB_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_STRINGS_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_STRING_H 23 | 24 | /* Define to 1 if you have the `strndup' function. */ 25 | #undef HAVE_STRNDUP 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_SYS_STAT_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_SYS_TYPES_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_UNISTD_H 35 | 36 | /* Name of package */ 37 | #undef PACKAGE 38 | 39 | /* Define to the address where bug reports for this package should be sent. */ 40 | #undef PACKAGE_BUGREPORT 41 | 42 | /* Define to the full name of this package. */ 43 | #undef PACKAGE_NAME 44 | 45 | /* Define to the full name and version of this package. */ 46 | #undef PACKAGE_STRING 47 | 48 | /* Define to the one symbol short name of this package. */ 49 | #undef PACKAGE_TARNAME 50 | 51 | /* Define to the version of this package. */ 52 | #undef PACKAGE_VERSION 53 | 54 | /* Define to 1 if you have the ANSI C header files. */ 55 | #undef STDC_HEADERS 56 | 57 | /* Version number of package */ 58 | #undef VERSION 59 | -------------------------------------------------------------------------------- /src/wdfs-main.h: -------------------------------------------------------------------------------- 1 | #ifndef WDFSMAIN_H_ 2 | #define WDFSMAIN_H_ 3 | 4 | #ifdef HAVE_CONFIG_H 5 | #include 6 | #endif 7 | 8 | #define FUSE_USE_VERSION 25 9 | 10 | #include 11 | #include 12 | 13 | /* build the neon version, which is not directly exported by the neon library */ 14 | #if defined(NE_FEATURE_TS_SSL) /* true for neon 0.26+ */ 15 | #define NEON_VERSION 26 16 | #elif defined(NE_FEATURE_SSL) /* true for neon 0.25+ */ 17 | #define NEON_VERSION 25 18 | #else /* neon 0.24 is the minimal requirement */ 19 | #define NEON_VERSION 24 20 | #endif 21 | /* it's also possible to replace the above with the following: 22 | (file configure.ac, after the PKG_CHECK_MODULES call) 23 | 24 | case `pkg-config --modversion neon` in 25 | 0.24*) AC_DEFINE(NEON_VERSION, 24, 26 | [The minor version number of the neon library]) ;; 27 | 0.25*) AC_DEFINE(NEON_VERSION, 25) ;; 28 | *) AC_DEFINE(NEON_VERSION, 26) ;; 29 | esac 30 | */ 31 | 32 | typedef enum { 33 | true = 1, 34 | false = 0 35 | } bool_t; 36 | 37 | /* used as mode for unify_path() */ 38 | enum { 39 | ESCAPE = 0x0, 40 | UNESCAPE = 0x1, 41 | /* do not remove trailing slashes */ 42 | LEAVESLASH = 0x2 43 | }; 44 | 45 | struct wdfs_conf { 46 | /* the name of the wdfs executable */ 47 | char *program_name; 48 | /* if set to "true" wdfs specific debug output is generated */ 49 | bool_t debug; 50 | /* if set to "true" every certificate is accepted without asking the user */ 51 | bool_t accept_certificate; 52 | /* username of the webdav resource */ 53 | char *username; 54 | /* password of the webdav resource */ 55 | char *password; 56 | /* if set to "true" enables http redirect support */ 57 | bool_t redirect; 58 | /* if set to "true" enables transparent access to all svn revisions in 59 | * a repository thru a virtual directory. */ 60 | bool_t svn_mode; 61 | /* locking mode of files */ 62 | int locking_mode; 63 | /* timeout for a lock in seconds */ 64 | int locking_timeout; 65 | /* address of the webdav resource we are connecting to */ 66 | char *webdav_resource; 67 | }; 68 | 69 | extern struct wdfs_conf wdfs; 70 | 71 | /* look at wdfs-main.c for comments on these extern variables */ 72 | extern const char *project_name; 73 | extern char *remotepath_basedir; 74 | 75 | /* used by wdfs_readdir() and by svn.h/svn.c to add files to requested 76 | * directories using fuse's filler() method. */ 77 | struct dir_item { 78 | void *buf; 79 | fuse_fill_dir_t filler; 80 | char *remotepath; 81 | }; 82 | 83 | char* remove_ending_slashes(const char *in); 84 | char* unify_path(const char *in, int mode); 85 | void free_chars(char **arg, ...); 86 | 87 | /* takes an lvalue and sets it to NULL after freeing. taken from neon. */ 88 | #define FREE(x) do { if ((x) != NULL) free((x)); (x) = NULL; } while (0) 89 | 90 | #ifndef HAVE_STRNDUP 91 | char* strndup(const char *s, size_t n); 92 | #endif 93 | 94 | #endif /*WDFSMAIN_H_*/ 95 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 2 | abstract: 3 | wdfs is a webdav filesystem with special features for accessing subversion 4 | repositories. it is based on fuse v2.5+ and neon v0.24.7+. 5 | 6 | 7 | author of wdfs: 8 | (c) 2005 - 2007 jens m. noedler, noedler@web.de 9 | 10 | 11 | license: 12 | wdfs is distributed under the terms of the gnu general public license. 13 | see file COPYING for details. 14 | 15 | 16 | home and svn repository of wdfs: 17 | http://noedler.de/projekte/wdfs/ 18 | http[s]://svn.projectai.org/svn/projects_private/wdfs/ 19 | 20 | 21 | features: 22 | - generic webdav filesystem 23 | - http redirect support 24 | - https support 25 | - file locking support (different modes) 26 | - access to all revisions of a webdav exported subversion repository 27 | - versioning filesystem for autoversioning enabled subversion repositories 28 | (see section "wdfs, subversion and apache" in this document) 29 | 30 | 31 | dependencies: 32 | - operating systems: linux (kernel 2.4 or 2.6), freebsd (6.x or 7.x), mac os x 33 | hint for linux user: using a kernel 2.6.15 or later is recommended. 34 | - fuse (filesystem in userspace) v2.5 or later (http://fuse.sourceforge.net/) 35 | - neon webdav library v0.24.7 or later (http://www.webdav.org/neon/) 36 | 37 | 38 | installation: 39 | $ tar xfz wdfs-1.x.x.tar.gz 40 | $ cd wdfs-1.x.x 41 | $ ./configure && make 42 | $ su -c "make install" 43 | 44 | 45 | usage: 46 | $ mkdir ~/mountpoint 47 | $ wdfs http[s]://server[:port][/directory/] ~/mountpoint [options] 48 | $ wdfs -h # prints wdfs and fuse options 49 | 50 | 51 | mounting wdfs using fstab: 52 | example entry for the /etc/fstab file: 53 | wdfs#http://server /mnt/wdfs fuse users,locking=simple 0 0 54 | 55 | hint: due to a bug in fuse 2.6.3 and earlier it's not possible to add 56 | the option "username=abc" to the option list. this will be fixed with 57 | later versions of fuse. 58 | 59 | 60 | wdfs, subversion and apache: 61 | wdfs may be used to access subversion repositories that are exported as 62 | webdav using the apache webserver. you need to load the required apache 63 | modules for webdav and for subversion and add a location directive like 64 | the following. 65 | 66 | 67 | DAV svn 68 | SVNPath /home/jens/repositories/wdfs 69 | SVNAutoversioning on 70 | AuthType None 71 | 72 | 73 | 74 | version number conventions: 75 | - the major number will never change. 76 | - the minor number changes if new features are introduced or 77 | if parts of the api are changed. 78 | warning: this may include backward-incompatible changes! 79 | - the last number changes on bug fixes and little non-api changes. 80 | e.g. v1.1.0 introduced new features from it's predecessor v1.0.1 81 | 82 | 83 | limitations of this implementation: 84 | - wdfs is not (yet) multithread safe. it always uses fuse single thread mode. 85 | - read/write of big files (~ 50 MB+) is slow, because the _complete_ file 86 | will be GET/PUT on a request. 87 | - svn mode: only up to 2^31-1 revisions can be accessed, 88 | because "latest_revision" is an integer variable. 89 | - svn mode: if a subdirectory of a subversion repository is mounted, the 90 | "svn_basedir" shows the content of the repository root and not only the 91 | content of the mounted subdir. [caused by svn_get_remotepath()] 92 | - http redirect support: 93 | * there is no redirect support for the mountpoint. please mount the new 94 | location, that will be printed as an error message. 95 | * the redirect support is limited to the webdav server, that is mounted. 96 | redirects to another server are not supported. 97 | 98 | 99 | limitations of wdfs, caused by other limitations: 100 | - wdfs supports only utf-8 encoded file and directory names for svn access. 101 | use utf8 capable applications or pure ascii (no iso8859!) encoded names. 102 | (limitation caused by subversion, which stores all data utf-8 encoded) 103 | - wdfs does not support setting file attributes with utime() or utimes(). 104 | (e.g. used by "touch file -m -t 200601010000"). see wdfs_setattr() for 105 | details. (limitation caused by webdav specification rfc 2518) 106 | 107 | 108 | source code conventions: 109 | - variable name "remotepath" is used for WebDAV access (/remote/dir/file) 110 | - variable name "localpath" is used for local access (/file) 111 | - variable name "ret" is used for the return values of methods 112 | - methods and structs starting with "ne_" are part of the neon library 113 | - error output: 114 | - "## " prefix for warnings and error messages 115 | - debug output: 116 | - ">> " prefix for fuse callback methods 117 | - "** " prefix for cache related messages (no errors) 118 | - "++ " prefix for locking related messages (no errors) 119 | - the code is formated with tabs (tab width 4 characters) 120 | - every line should not be longer than 80 characters 121 | 122 | 123 | acknowledgements: 124 | helmut neukirchen for supervising my bachelor thesis and the development 125 | of wdfs. miklos szeredi for developing fuse and being a great maintainer. 126 | the members of the fuse-devel mailing list for helping me and everybody 127 | who is contributing to wdfs. thanks! 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /src/cache.c: -------------------------------------------------------------------------------- 1 | /* 2 | * this file is part of wdfs --> http://noedler.de/projekte/wdfs/ 3 | * 4 | * wdfs is a webdav filesystem with special features for accessing subversion 5 | * repositories. it is based on fuse v2.5+ and neon v0.24.7+. 6 | * 7 | * copyright (c) 2005 - 2007 jens m. noedler, noedler@web.de 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | * This program is released under the GPL with the additional exemption 24 | * that compiling, linking and/or using OpenSSL is allowed. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #include "wdfs-main.h" 36 | #include "cache.h" 37 | 38 | /* this cache is designed to buffer the file's attributes (struct stat) locally 39 | * instead of sending a new request to the webdav server. this leads into a 40 | * better responsiveness of the filesystem. 41 | * every file's attributes is stored in a 'struct cache_item' that contains a 42 | * 'struct stat' and a 'time_t timeout' field. the timeout field is used to 43 | * purge the cache_item, if it is too old. how long a cache_item is stored is 44 | * configured at CACHE_ITEM_TIMEOUT (in seconds). 45 | * the cache_items are stored in a hash as a hash value and the corresponding 46 | * remotepath (uri) as the hash key. because the remotepath (uri) is unique, 47 | * a hash is a appropriate data structure and accessing it is fast. 48 | * a 2nd thread runs every CACHE_ITEM_TIMEOUT seconds in the background and 49 | * removed timed out cache_items. 50 | */ 51 | 52 | 53 | /* lifetime of a cache item in seconds. this value can be edit here. */ 54 | const size_t cache_item_lifetime = 20; 55 | 56 | /* initalize this mutex, which is used to prevent data 57 | * inconsistencies due to race conditions. */ 58 | pthread_mutex_t cache_mutex = PTHREAD_MUTEX_INITIALIZER; 59 | 60 | /* every created thread needs an id. this is the cache control thread's id. */ 61 | pthread_t cache_control_thread_id; 62 | 63 | /* hash object to store the cache items */ 64 | static GHashTable *cache; 65 | 66 | 67 | struct cache_item { 68 | struct stat stat; /* 96 bytes (i386) */ 69 | time_t timeout; /* 4 bytes (i386) */ 70 | }; 71 | 72 | 73 | /* +++++++ local static methods +++++++ */ 74 | /* author jens, 31.07.2005 18:44:28, location: heli at heinemanns */ 75 | 76 | 77 | /* returns 0 if the item is _not_ timed out, returns 1 if it _is_ timed out. */ 78 | static int cache_item_timed_out(const int timeout) 79 | { 80 | if (timeout - time(NULL) <= 0) 81 | return 1; 82 | else 83 | return 0; 84 | } 85 | 86 | 87 | /* callback method for g_hash_table_foreach_remove() called in cache_control_ 88 | * thread(). this method check if a cache item has reached it's timeout and 89 | * then removes it from the cache. */ 90 | static int cache_control_thread_callback(void *key, void *value, void *userdata) 91 | { 92 | struct cache_item *item = (struct cache_item *)value; 93 | if (cache_item_timed_out(item->timeout)) { 94 | if (wdfs.debug == true) { 95 | fprintf(stderr, 96 | "** cache control thread: " 97 | "item has timed out and is removed '%s'\n", (char*)key); 98 | } 99 | /* remove this item */ 100 | return 1; 101 | } 102 | /* don't remove this item */ 103 | return 0; 104 | } 105 | 106 | 107 | /* +++++++ exported non-static methods +++++++ */ 108 | 109 | 110 | /* this thread runs until it is canceled by the main thread and 111 | * removes every CACHE_ITEM_TIMEOUT seconds timed out cache items. */ 112 | static void* cache_control_thread(void *unused) 113 | { 114 | pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); 115 | /* thread exits if a cancel signal is recieved and 116 | * cansel state is PTHREAD_CANCEL_ENABLE */ 117 | pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); 118 | while (1) { 119 | sleep(cache_item_lifetime); 120 | /* do not allow cancling this thread while doing it's work */ 121 | pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); 122 | /* to avoid conflict with cache_delete_item() lock */ 123 | pthread_mutex_lock(&cache_mutex); 124 | /* check each cache item, if it is timed out and remove it */ 125 | g_hash_table_foreach_remove(cache, &cache_control_thread_callback, NULL); 126 | pthread_mutex_unlock(&cache_mutex); 127 | /* now this thread might be cancel, because it is idle */ 128 | pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); 129 | } 130 | return NULL; 131 | } 132 | 133 | 134 | /* initializes the cache's hash table and start a 2nd thread, that removed 135 | * timed out item from the cache periodically. */ 136 | void cache_initialize() 137 | { 138 | cache = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); 139 | assert(cache); 140 | 141 | /* setup a thread, that removes timed out cache items in the background */ 142 | pthread_create(&cache_control_thread_id, NULL, &cache_control_thread, NULL); 143 | } 144 | 145 | 146 | /* detroys the cache if it's no longer needed. joins the 2nd thread and kills 147 | * the hash table. */ 148 | void cache_destroy() 149 | { 150 | if (wdfs.debug == true) 151 | fprintf(stderr, 152 | "** destroying %d cache items\n", g_hash_table_size(cache)); 153 | /* exit cache control thread */ 154 | pthread_cancel(cache_control_thread_id); 155 | pthread_join(cache_control_thread_id, NULL); 156 | 157 | /* to avoid conflict with cache_control_thread() lock */ 158 | pthread_mutex_lock(&cache_mutex); 159 | g_hash_table_destroy(cache); 160 | pthread_mutex_unlock(&cache_mutex); 161 | } 162 | 163 | 164 | /* adds a new item to the cache and sets the items timeout. */ 165 | void cache_add_item(struct stat *stat, const char *remotepath) 166 | { 167 | assert(remotepath && stat); 168 | 169 | char *remotepath2 = unify_path(remotepath, UNESCAPE); 170 | if (remotepath2 == NULL) { 171 | fprintf(stderr, "## fatal error: unify_path() returned NULL\n"); 172 | return; 173 | } 174 | 175 | /* get the new cache item and set it's values */ 176 | struct cache_item *item = g_new0(struct cache_item, 1); 177 | item->stat = *stat; 178 | item->timeout = time(NULL) + cache_item_lifetime; 179 | 180 | /* to avoid conflict with cache_control_thread() lock */ 181 | pthread_mutex_lock(&cache_mutex); 182 | g_hash_table_insert(cache, strdup(remotepath2), item); 183 | pthread_mutex_unlock(&cache_mutex); 184 | 185 | if (wdfs.debug == true) 186 | fprintf(stderr, "** added cache item for '%s'\n", remotepath2); 187 | FREE(remotepath2); 188 | } 189 | 190 | 191 | /* deletes a cache item from the cache. */ 192 | void cache_delete_item(const char *remotepath) 193 | { 194 | assert(remotepath); 195 | 196 | char *remotepath2 = unify_path(remotepath, UNESCAPE); 197 | if (remotepath2 == NULL) { 198 | fprintf(stderr, "## fatal error: unify_path() returned NULL\n"); 199 | return; 200 | } 201 | 202 | /* to avoid conflict with cache_control_thread() lock */ 203 | pthread_mutex_lock(&cache_mutex); 204 | struct cache_item *item = 205 | (struct cache_item *)g_hash_table_lookup(cache, remotepath2); 206 | if (item != NULL) { 207 | g_hash_table_remove(cache, remotepath2); 208 | if (wdfs.debug == true) 209 | fprintf(stderr, "** removed cache item for '%s'\n", remotepath2); 210 | } 211 | pthread_mutex_unlock(&cache_mutex); 212 | FREE(remotepath2); 213 | } 214 | 215 | 216 | /* looks at the cache for the wanted item. if it's found and not already timed 217 | * out, the "struct stat *stat" is pointing to the wanted item's stat. 218 | * returns 0 on success or -1 on error. */ 219 | int cache_get_item(struct stat *stat, const char *remotepath) 220 | { 221 | int ret = -1; 222 | assert(remotepath && stat); 223 | 224 | char *remotepath2 = unify_path(remotepath, UNESCAPE); 225 | if (remotepath2 == NULL) { 226 | fprintf(stderr, "## error: unify_path() returned NULL\n"); 227 | return -1; 228 | } 229 | 230 | /* to avoid conflict with cache_control_thread() lock */ 231 | pthread_mutex_lock(&cache_mutex); 232 | if (g_hash_table_lookup(cache, remotepath2) != NULL) { 233 | struct cache_item *item = 234 | (struct cache_item *)g_hash_table_lookup(cache, remotepath2); 235 | pthread_mutex_unlock(&cache_mutex); 236 | /* used cached item, if it's not timed out */ 237 | if (!cache_item_timed_out(item->timeout)) { 238 | *stat = item->stat; 239 | ret = 0; 240 | if (wdfs.debug == true) 241 | fprintf(stderr, "** cache hit for '%s'\n", remotepath2); 242 | /* if this cache item has timed out, remove it */ 243 | } else { 244 | if (wdfs.debug == true) 245 | fprintf(stderr, "** cache item timed out '%s'\n", remotepath2); 246 | cache_delete_item(remotepath2); 247 | } 248 | } else { 249 | pthread_mutex_unlock(&cache_mutex); 250 | if (wdfs.debug == true) 251 | fprintf(stderr, "** cache hit for '%s'\n", remotepath2); 252 | } 253 | FREE(remotepath2); 254 | return ret; 255 | } 256 | 257 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 2007-04-17 noedler 2 | 3 | wdfs, 1.4.2 4 | 5 | 2007-04-17 noedler 6 | 7 | - fixed a stupid bug that avoids mounting the root of a server 8 | - documented the optional port for mounting a webdav server 9 | - improved attribute caching for some special cases 10 | 11 | 2007-02-05 noedler 12 | 13 | - wdfs, 1.4.1 14 | - updated README 15 | - added redirect handling for rename() and unlink(). thanks joseph! 16 | 17 | 2007-01-25 noedler 18 | 19 | compile fix for mac os x: define strndup() for apple computers 20 | 21 | 2007-01-24 noedler 22 | 23 | fixed mounting a webdav share that redirects (e.g.) from '/foo' to '/foo/'. thanks to joseph dunn for the patch. 24 | 25 | 2007-01-19 noedler 26 | 27 | wdfs, 1.4.0 28 | 29 | 2007-01-14 noedler 30 | 31 | enable http redirect support by default and add option "no_redirect" to disable it 32 | 33 | 2007-01-14 noedler 34 | 35 | coding style... 36 | 37 | 2007-01-13 noedler 38 | 39 | - updated copyright to 2007 40 | - added dummy impl of wdfs_init() 41 | - updated README with an example how to mount wdfs thru fstab 42 | 43 | 2007-01-13 noedler 44 | 45 | updated README file 46 | 47 | 2006-11-13 noedler 48 | 49 | added a dummy implementation for statfs() 50 | 51 | 2006-11-09 noedler 52 | 53 | fixed a bug in the assert statements, thanks sven bachmann for pointing it out! 54 | 55 | 2006-10-27 noedler 56 | 57 | fixed creating the ChangeLog 58 | 59 | 2006-10-27 noedler 60 | 61 | Initial commit for the public SVN 62 | 63 | 2006-10-17 jens m. noedler 64 | 65 | - introduced unify_path() which does the escaping/unescaping 66 | the remotepath in one place 67 | - added checks for the return value of remove_ending_slash() 68 | - new: remotepath_basedir may contain special chars 69 | - some random coding style improvements 70 | 71 | 2006-10-17 jens m. noedler 72 | 73 | improvement: return -EPERM instead of -ENOENT if deleting fails 74 | with "403 Forbidden". patch from joseph.dunn@colorado.edu 75 | 76 | 2006-10-16 jens m. noedler 77 | 78 | just some random coding style improvements 79 | 80 | 2006-10-14 jens m. noedler 81 | 82 | - fixed parsing of "-o accept_sslcert" parameter 83 | - added check of "-o locking_timeout" parameter 84 | 85 | 2006-10-14 jens m. noedler 86 | 87 | converted most printf() to fprintf(stderr, ...) 88 | 89 | 2006-10-14 jens m. noedler 90 | 91 | also allow to enter authentication information (username and password) 92 | via the terminal, based on a patch from joseph.dunn@colorado.edu. thanks! 93 | 94 | 2006-10-13 jens m. noedler 95 | 96 | - new command line parsing using the fuse option functions 97 | thanks to yuri vasilevski for the patch! 98 | - wdfs require due to this change fuse 2.5 or later 99 | 100 | 2006-08-22 jens m. noedler 101 | 102 | - replaced "DT_DIR << 12" with "S_IFDIR | 0777" for "." and ".." dentries 103 | - removed useless includes of time.h 104 | 105 | 2006-08-21 jens m. noedler 106 | 107 | bugfix: set . and .. to type DT_DIR 108 | thanks for the patch from mathieu boespflug 109 | 110 | 2006-08-01 jens m. noedler 111 | 112 | wdfs, 1.3.1 113 | 114 | 2006-08-01 jens m. noedler 115 | 116 | added these statement to permit debian to add wdfs to it's archive 117 | 118 | * This program is released under the GPL with the additional exemption 119 | * that compiling, linking and/or using OpenSSL is allowed. 120 | 121 | details: http://www.gnome.org/~markmc/openssl-and-the-gpl.html 122 | 123 | 2006-07-26 jens m. noedler 124 | 125 | wdfs, 1.3.0 126 | 127 | 2006-07-26 jens m. noedler 128 | 129 | implemented dummy wdfs_chmod() method 130 | 131 | 2006-07-26 jens m. noedler 132 | 133 | fixed some escape/unescape problems 134 | 135 | 2006-07-26 jens m. noedler 136 | 137 | fix: invalid read in remove_ending_slash() 138 | 139 | 2006-07-25 jens m. noedler 140 | 141 | simplified #definition of NEON_VERSION 142 | 143 | 2006-07-25 jens m. noedler 144 | 145 | - do not allow lock_timeout to be set to 0 seconds 146 | - fixed a bug regarding too late unescaping of the remotepath, 147 | what may lead to recursive adding of the directory to itself. 148 | 149 | 2006-07-25 jens m. noedler 150 | 151 | memory management: replaced wdfs_free() through FREE() and free_chars() 152 | 153 | 2006-07-25 jens m. noedler 154 | 155 | 2006-07-24 jens m. noedler 156 | 157 | wdfs is now compatible to neon 0.26, thanks again to suse 158 | 159 | 2006-07-21 jens m. noedler 160 | 161 | type updates and conversion of error_parameter_parsing from int to bool_t 162 | 163 | 2006-07-21 jens m. noedler 164 | 165 | correct indentation and fix for "the last parameter parsing bug" ;-) 166 | 167 | 2006-07-20 jens m. noedler 168 | 169 | typo updates 170 | 171 | 2006-07-20 jens m. noedler 172 | 173 | conversion from NE_FREE(...) to wdfs_free(...) 174 | 175 | 2006-07-20 jens m. noedler 176 | 177 | enhanced argument handling, also based on suse patches 178 | 179 | 2006-07-20 jens m. noedler 180 | 181 | reset arguments to avoid storing sensitive data in the process table 182 | based on a patch from max@suse.de 183 | 184 | 2006-07-20 jens m. noedler 185 | 186 | fix for 64 bit platforms due to missing braces 187 | patch from max@suse.de, thanks! 188 | 189 | 2006-06-27 jens m. noedler 190 | 191 | added a comment about freebsd compat in the README 192 | 193 | 2006-06-27 jens m. noedler 194 | 195 | wdfs, 1.2.1 196 | just a build fix for freebsd 197 | 198 | 2006-06-26 jens m. noedler 199 | 200 | compile fix for freebsd 201 | 202 | 2006-04-10 jens m. noedler 203 | 204 | wdfs, 1.2.0 205 | updated the README 206 | 207 | 2006-04-10 jens m. noedler 208 | 209 | finally fixed the last ftruncate() bug 210 | thanks to miklos! :-) 211 | 212 | 2006-04-06 jens m. noedler 213 | 214 | ftruncate() done. 215 | but there is still a bug with ftruncate() and O_APPEND 216 | 217 | 2006-03-12 jens m. noedler 218 | 219 | made redirect support configurable via parameter "-r" 220 | ("-r" is no longer used by fuse, I think since v2.5) 221 | 222 | 2006-03-12 jens m. noedler 223 | 224 | smoother redirect support using 225 | static int handle_redirect(char **remotepath); 226 | 227 | 2006-03-12 jens m. noedler 228 | 229 | stub for wdfs_ftruncate 230 | 231 | 2006-03-12 jens m. noedler 232 | 233 | some changes for FUSE_USE_VERSION 25 234 | and compat with fuse 2.3 and 2.4 235 | 236 | 2006-03-11 jens m. noedler 237 | 238 | first stage of redirect support 239 | first steps to go to fuse interface v25 240 | 241 | 2006-01-05 jens m. noedler 242 | 243 | wdfs, 1.1.1 244 | added some comments about the fixed bug 245 | 246 | 2006-01-04 jens m. noedler 247 | 248 | 1.1.1-pre1 249 | 250 | 2006-01-04 jens m. noedler 251 | 252 | fixed a bug that appeared if a servers sends the complete URI not only the path 253 | thanks to luke plant for reporting and supporting! 254 | 255 | 2006-01-04 jens m. noedler 256 | 257 | updated the year in the copyright statement 258 | 259 | 2005-11-19 jens m. noedler 260 | 261 | typo updates 262 | 263 | 2005-11-08 jens m. noedler 264 | 265 | added automatic ChangeLog generation 266 | 267 | 2005-11-08 jens m. noedler 268 | 269 | added version number conventions to README 270 | 271 | 2005-11-08 jens m. noedler 272 | 273 | wdfs, 1.1.0, 2nd checking ;) 274 | 275 | 2005-11-08 jens m. noedler 276 | 277 | wdfs, 1.1.0 278 | 279 | 2005-11-08 jens m. noedler 280 | 281 | - x = argv[arg_number + 1]; 282 | - arg_number++; 283 | + x = argv[++arg_number]; 284 | 285 | 2005-11-08 jens m. noedler 286 | 287 | added neon cross compiling 288 | 289 | 2005-11-05 jens m. noedler 290 | 291 | 1.1.0-pre2 292 | 293 | 2005-11-05 jens m. noedler 294 | 295 | typo only update 296 | 297 | 2005-11-05 jens m. noedler 298 | 299 | implemented parameter '-ac' (accept certificate) 300 | 301 | 2005-11-05 jens m. noedler 302 | 303 | choose gpl as license for wdfs and added gpl comments 304 | 305 | 2005-11-03 jens m. noedler 306 | 307 | commit 308 | 309 | 2005-11-03 jens m. noedler 310 | 311 | cleaned up verify_ssl_certificate() 312 | 313 | 2005-11-03 jens m. noedler 314 | 315 | fixed a bug when mounting non-webdav http resources 316 | 317 | 2005-11-01 jens m. noedler 318 | 319 | wdfs, 1.0.2-pre1: basic and buggy ssl support 320 | 321 | 2005-10-28 jens m. noedler 322 | 323 | README update 324 | 325 | 2005-10-08 jens m. noedler 326 | 327 | bugfix in svn.c (mounting a subdir of a repository and access old revisions works fine) 328 | 329 | 2005-10-06 jens m. noedler 330 | 331 | updated README 332 | 333 | 2005-09-17 jens m. noedler 334 | 335 | added files "jens-*" 336 | 337 | 2005-09-16 jens m. noedler 338 | 339 | renamed fuse01 to wdfs 340 | 341 | 2005-09-13 jens m. noedler 342 | 343 | wdfs, 1.0 344 | 345 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Installation Instructions 2 | ************************* 3 | 4 | Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free 5 | Software Foundation, Inc. 6 | 7 | This file is free documentation; the Free Software Foundation gives 8 | unlimited permission to copy, distribute and modify it. 9 | 10 | Basic Installation 11 | ================== 12 | 13 | These are generic installation instructions. 14 | 15 | The `configure' shell script attempts to guess correct values for 16 | various system-dependent variables used during compilation. It uses 17 | those values to create a `Makefile' in each directory of the package. 18 | It may also create one or more `.h' files containing system-dependent 19 | definitions. Finally, it creates a shell script `config.status' that 20 | you can run in the future to recreate the current configuration, and a 21 | file `config.log' containing compiler output (useful mainly for 22 | debugging `configure'). 23 | 24 | It can also use an optional file (typically called `config.cache' 25 | and enabled with `--cache-file=config.cache' or simply `-C') that saves 26 | the results of its tests to speed up reconfiguring. (Caching is 27 | disabled by default to prevent problems with accidental use of stale 28 | cache files.) 29 | 30 | If you need to do unusual things to compile the package, please try 31 | to figure out how `configure' could check whether to do them, and mail 32 | diffs or instructions to the address given in the `README' so they can 33 | be considered for the next release. If you are using the cache, and at 34 | some point `config.cache' contains results you don't want to keep, you 35 | may remove or edit it. 36 | 37 | The file `configure.ac' (or `configure.in') is used to create 38 | `configure' by a program called `autoconf'. You only need 39 | `configure.ac' if you want to change it or regenerate `configure' using 40 | a newer version of `autoconf'. 41 | 42 | The simplest way to compile this package is: 43 | 44 | 1. `cd' to the directory containing the package's source code and type 45 | `./configure' to configure the package for your system. If you're 46 | using `csh' on an old version of System V, you might need to type 47 | `sh ./configure' instead to prevent `csh' from trying to execute 48 | `configure' itself. 49 | 50 | Running `configure' takes awhile. While running, it prints some 51 | messages telling which features it is checking for. 52 | 53 | 2. Type `make' to compile the package. 54 | 55 | 3. Optionally, type `make check' to run any self-tests that come with 56 | the package. 57 | 58 | 4. Type `make install' to install the programs and any data files and 59 | documentation. 60 | 61 | 5. You can remove the program binaries and object files from the 62 | source code directory by typing `make clean'. To also remove the 63 | files that `configure' created (so you can compile the package for 64 | a different kind of computer), type `make distclean'. There is 65 | also a `make maintainer-clean' target, but that is intended mainly 66 | for the package's developers. If you use it, you may have to get 67 | all sorts of other programs in order to regenerate files that came 68 | with the distribution. 69 | 70 | Compilers and Options 71 | ===================== 72 | 73 | Some systems require unusual options for compilation or linking that the 74 | `configure' script does not know about. Run `./configure --help' for 75 | details on some of the pertinent environment variables. 76 | 77 | You can give `configure' initial values for configuration parameters 78 | by setting variables in the command line or in the environment. Here 79 | is an example: 80 | 81 | ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix 82 | 83 | *Note Defining Variables::, for more details. 84 | 85 | Compiling For Multiple Architectures 86 | ==================================== 87 | 88 | You can compile the package for more than one kind of computer at the 89 | same time, by placing the object files for each architecture in their 90 | own directory. To do this, you must use a version of `make' that 91 | supports the `VPATH' variable, such as GNU `make'. `cd' to the 92 | directory where you want the object files and executables to go and run 93 | the `configure' script. `configure' automatically checks for the 94 | source code in the directory that `configure' is in and in `..'. 95 | 96 | If you have to use a `make' that does not support the `VPATH' 97 | variable, you have to compile the package for one architecture at a 98 | time in the source code directory. After you have installed the 99 | package for one architecture, use `make distclean' before reconfiguring 100 | for another architecture. 101 | 102 | Installation Names 103 | ================== 104 | 105 | By default, `make install' installs the package's commands under 106 | `/usr/local/bin', include files under `/usr/local/include', etc. You 107 | can specify an installation prefix other than `/usr/local' by giving 108 | `configure' the option `--prefix=PREFIX'. 109 | 110 | You can specify separate installation prefixes for 111 | architecture-specific files and architecture-independent files. If you 112 | pass the option `--exec-prefix=PREFIX' to `configure', the package uses 113 | PREFIX as the prefix for installing programs and libraries. 114 | Documentation and other data files still use the regular prefix. 115 | 116 | In addition, if you use an unusual directory layout you can give 117 | options like `--bindir=DIR' to specify different values for particular 118 | kinds of files. Run `configure --help' for a list of the directories 119 | you can set and what kinds of files go in them. 120 | 121 | If the package supports it, you can cause programs to be installed 122 | with an extra prefix or suffix on their names by giving `configure' the 123 | option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. 124 | 125 | Optional Features 126 | ================= 127 | 128 | Some packages pay attention to `--enable-FEATURE' options to 129 | `configure', where FEATURE indicates an optional part of the package. 130 | They may also pay attention to `--with-PACKAGE' options, where PACKAGE 131 | is something like `gnu-as' or `x' (for the X Window System). The 132 | `README' should mention any `--enable-' and `--with-' options that the 133 | package recognizes. 134 | 135 | For packages that use the X Window System, `configure' can usually 136 | find the X include and library files automatically, but if it doesn't, 137 | you can use the `configure' options `--x-includes=DIR' and 138 | `--x-libraries=DIR' to specify their locations. 139 | 140 | Specifying the System Type 141 | ========================== 142 | 143 | There may be some features `configure' cannot figure out automatically, 144 | but needs to determine by the type of machine the package will run on. 145 | Usually, assuming the package is built to be run on the _same_ 146 | architectures, `configure' can figure that out, but if it prints a 147 | message saying it cannot guess the machine type, give it the 148 | `--build=TYPE' option. TYPE can either be a short name for the system 149 | type, such as `sun4', or a canonical name which has the form: 150 | 151 | CPU-COMPANY-SYSTEM 152 | 153 | where SYSTEM can have one of these forms: 154 | 155 | OS KERNEL-OS 156 | 157 | See the file `config.sub' for the possible values of each field. If 158 | `config.sub' isn't included in this package, then this package doesn't 159 | need to know the machine type. 160 | 161 | If you are _building_ compiler tools for cross-compiling, you should 162 | use the option `--target=TYPE' to select the type of system they will 163 | produce code for. 164 | 165 | If you want to _use_ a cross compiler, that generates code for a 166 | platform different from the build platform, you should specify the 167 | "host" platform (i.e., that on which the generated programs will 168 | eventually be run) with `--host=TYPE'. 169 | 170 | Sharing Defaults 171 | ================ 172 | 173 | If you want to set default values for `configure' scripts to share, you 174 | can create a site shell script called `config.site' that gives default 175 | values for variables like `CC', `cache_file', and `prefix'. 176 | `configure' looks for `PREFIX/share/config.site' if it exists, then 177 | `PREFIX/etc/config.site' if it exists. Or, you can set the 178 | `CONFIG_SITE' environment variable to the location of the site script. 179 | A warning: not all `configure' scripts look for a site script. 180 | 181 | Defining Variables 182 | ================== 183 | 184 | Variables not defined in a site shell script can be set in the 185 | environment passed to `configure'. However, some packages may run 186 | configure again during the build, and the customized values of these 187 | variables may be lost. In order to avoid this problem, you should set 188 | them in the `configure' command line, using `VAR=value'. For example: 189 | 190 | ./configure CC=/usr/local2/bin/gcc 191 | 192 | causes the specified `gcc' to be used as the C compiler (unless it is 193 | overridden in the site shell script). Here is a another example: 194 | 195 | /bin/bash ./configure CONFIG_SHELL=/bin/bash 196 | 197 | Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent 198 | configuration-related scripts to be executed by `/bin/bash'. 199 | 200 | `configure' Invocation 201 | ====================== 202 | 203 | `configure' recognizes the following options to control how it operates. 204 | 205 | `--help' 206 | `-h' 207 | Print a summary of the options to `configure', and exit. 208 | 209 | `--version' 210 | `-V' 211 | Print the version of Autoconf used to generate the `configure' 212 | script, and exit. 213 | 214 | `--cache-file=FILE' 215 | Enable the cache: use and save the results of the tests in FILE, 216 | traditionally `config.cache'. FILE defaults to `/dev/null' to 217 | disable caching. 218 | 219 | `--config-cache' 220 | `-C' 221 | Alias for `--cache-file=config.cache'. 222 | 223 | `--quiet' 224 | `--silent' 225 | `-q' 226 | Do not print messages saying which checks are being made. To 227 | suppress all normal output, redirect it to `/dev/null' (any error 228 | messages will still be shown). 229 | 230 | `--srcdir=DIR' 231 | Look for the package's source code in directory DIR. Usually 232 | `configure' can determine that directory automatically. 233 | 234 | `configure' also accepts some other, not widely useful, options. Run 235 | `configure --help' for more details. 236 | 237 | -------------------------------------------------------------------------------- /install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # install - install a program, script, or datafile 3 | 4 | scriptversion=2005-05-14.22 5 | 6 | # This originates from X11R5 (mit/util/scripts/install.sh), which was 7 | # later released in X11R6 (xc/config/util/install.sh) with the 8 | # following copyright and license. 9 | # 10 | # Copyright (C) 1994 X Consortium 11 | # 12 | # Permission is hereby granted, free of charge, to any person obtaining a copy 13 | # of this software and associated documentation files (the "Software"), to 14 | # deal in the Software without restriction, including without limitation the 15 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 16 | # sell copies of the Software, and to permit persons to whom the Software is 17 | # furnished to do so, subject to the following conditions: 18 | # 19 | # The above copyright notice and this permission notice shall be included in 20 | # all copies or substantial portions of the Software. 21 | # 22 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26 | # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- 27 | # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name of the X Consortium shall not 30 | # be used in advertising or otherwise to promote the sale, use or other deal- 31 | # ings in this Software without prior written authorization from the X Consor- 32 | # tium. 33 | # 34 | # 35 | # FSF changes to this file are in the public domain. 36 | # 37 | # Calling this script install-sh is preferred over install.sh, to prevent 38 | # `make' implicit rules from creating a file called install from it 39 | # when there is no Makefile. 40 | # 41 | # This script is compatible with the BSD install script, but was written 42 | # from scratch. It can only install one file at a time, a restriction 43 | # shared with many OS's install programs. 44 | 45 | # set DOITPROG to echo to test this script 46 | 47 | # Don't use :- since 4.3BSD and earlier shells don't like it. 48 | doit="${DOITPROG-}" 49 | 50 | # put in absolute paths if you don't have them in your path; or use env. vars. 51 | 52 | mvprog="${MVPROG-mv}" 53 | cpprog="${CPPROG-cp}" 54 | chmodprog="${CHMODPROG-chmod}" 55 | chownprog="${CHOWNPROG-chown}" 56 | chgrpprog="${CHGRPPROG-chgrp}" 57 | stripprog="${STRIPPROG-strip}" 58 | rmprog="${RMPROG-rm}" 59 | mkdirprog="${MKDIRPROG-mkdir}" 60 | 61 | chmodcmd="$chmodprog 0755" 62 | chowncmd= 63 | chgrpcmd= 64 | stripcmd= 65 | rmcmd="$rmprog -f" 66 | mvcmd="$mvprog" 67 | src= 68 | dst= 69 | dir_arg= 70 | dstarg= 71 | no_target_directory= 72 | 73 | usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE 74 | or: $0 [OPTION]... SRCFILES... DIRECTORY 75 | or: $0 [OPTION]... -t DIRECTORY SRCFILES... 76 | or: $0 [OPTION]... -d DIRECTORIES... 77 | 78 | In the 1st form, copy SRCFILE to DSTFILE. 79 | In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. 80 | In the 4th, create DIRECTORIES. 81 | 82 | Options: 83 | -c (ignored) 84 | -d create directories instead of installing files. 85 | -g GROUP $chgrpprog installed files to GROUP. 86 | -m MODE $chmodprog installed files to MODE. 87 | -o USER $chownprog installed files to USER. 88 | -s $stripprog installed files. 89 | -t DIRECTORY install into DIRECTORY. 90 | -T report an error if DSTFILE is a directory. 91 | --help display this help and exit. 92 | --version display version info and exit. 93 | 94 | Environment variables override the default commands: 95 | CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG 96 | " 97 | 98 | while test -n "$1"; do 99 | case $1 in 100 | -c) shift 101 | continue;; 102 | 103 | -d) dir_arg=true 104 | shift 105 | continue;; 106 | 107 | -g) chgrpcmd="$chgrpprog $2" 108 | shift 109 | shift 110 | continue;; 111 | 112 | --help) echo "$usage"; exit $?;; 113 | 114 | -m) chmodcmd="$chmodprog $2" 115 | shift 116 | shift 117 | continue;; 118 | 119 | -o) chowncmd="$chownprog $2" 120 | shift 121 | shift 122 | continue;; 123 | 124 | -s) stripcmd=$stripprog 125 | shift 126 | continue;; 127 | 128 | -t) dstarg=$2 129 | shift 130 | shift 131 | continue;; 132 | 133 | -T) no_target_directory=true 134 | shift 135 | continue;; 136 | 137 | --version) echo "$0 $scriptversion"; exit $?;; 138 | 139 | *) # When -d is used, all remaining arguments are directories to create. 140 | # When -t is used, the destination is already specified. 141 | test -n "$dir_arg$dstarg" && break 142 | # Otherwise, the last argument is the destination. Remove it from $@. 143 | for arg 144 | do 145 | if test -n "$dstarg"; then 146 | # $@ is not empty: it contains at least $arg. 147 | set fnord "$@" "$dstarg" 148 | shift # fnord 149 | fi 150 | shift # arg 151 | dstarg=$arg 152 | done 153 | break;; 154 | esac 155 | done 156 | 157 | if test -z "$1"; then 158 | if test -z "$dir_arg"; then 159 | echo "$0: no input file specified." >&2 160 | exit 1 161 | fi 162 | # It's OK to call `install-sh -d' without argument. 163 | # This can happen when creating conditional directories. 164 | exit 0 165 | fi 166 | 167 | for src 168 | do 169 | # Protect names starting with `-'. 170 | case $src in 171 | -*) src=./$src ;; 172 | esac 173 | 174 | if test -n "$dir_arg"; then 175 | dst=$src 176 | src= 177 | 178 | if test -d "$dst"; then 179 | mkdircmd=: 180 | chmodcmd= 181 | else 182 | mkdircmd=$mkdirprog 183 | fi 184 | else 185 | # Waiting for this to be detected by the "$cpprog $src $dsttmp" command 186 | # might cause directories to be created, which would be especially bad 187 | # if $src (and thus $dsttmp) contains '*'. 188 | if test ! -f "$src" && test ! -d "$src"; then 189 | echo "$0: $src does not exist." >&2 190 | exit 1 191 | fi 192 | 193 | if test -z "$dstarg"; then 194 | echo "$0: no destination specified." >&2 195 | exit 1 196 | fi 197 | 198 | dst=$dstarg 199 | # Protect names starting with `-'. 200 | case $dst in 201 | -*) dst=./$dst ;; 202 | esac 203 | 204 | # If destination is a directory, append the input filename; won't work 205 | # if double slashes aren't ignored. 206 | if test -d "$dst"; then 207 | if test -n "$no_target_directory"; then 208 | echo "$0: $dstarg: Is a directory" >&2 209 | exit 1 210 | fi 211 | dst=$dst/`basename "$src"` 212 | fi 213 | fi 214 | 215 | # This sed command emulates the dirname command. 216 | dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` 217 | 218 | # Make sure that the destination directory exists. 219 | 220 | # Skip lots of stat calls in the usual case. 221 | if test ! -d "$dstdir"; then 222 | defaultIFS=' 223 | ' 224 | IFS="${IFS-$defaultIFS}" 225 | 226 | oIFS=$IFS 227 | # Some sh's can't handle IFS=/ for some reason. 228 | IFS='%' 229 | set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` 230 | shift 231 | IFS=$oIFS 232 | 233 | pathcomp= 234 | 235 | while test $# -ne 0 ; do 236 | pathcomp=$pathcomp$1 237 | shift 238 | if test ! -d "$pathcomp"; then 239 | $mkdirprog "$pathcomp" 240 | # mkdir can fail with a `File exist' error in case several 241 | # install-sh are creating the directory concurrently. This 242 | # is OK. 243 | test -d "$pathcomp" || exit 244 | fi 245 | pathcomp=$pathcomp/ 246 | done 247 | fi 248 | 249 | if test -n "$dir_arg"; then 250 | $doit $mkdircmd "$dst" \ 251 | && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ 252 | && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ 253 | && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ 254 | && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } 255 | 256 | else 257 | dstfile=`basename "$dst"` 258 | 259 | # Make a couple of temp file names in the proper directory. 260 | dsttmp=$dstdir/_inst.$$_ 261 | rmtmp=$dstdir/_rm.$$_ 262 | 263 | # Trap to clean up those temp files at exit. 264 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 265 | trap '(exit $?); exit' 1 2 13 15 266 | 267 | # Copy the file name to the temp name. 268 | $doit $cpprog "$src" "$dsttmp" && 269 | 270 | # and set any options; do chmod last to preserve setuid bits. 271 | # 272 | # If any of these fail, we abort the whole thing. If we want to 273 | # ignore errors from any of these, just make sure not to ignore 274 | # errors from the above "$doit $cpprog $src $dsttmp" command. 275 | # 276 | { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ 277 | && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ 278 | && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ 279 | && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && 280 | 281 | # Now rename the file to the real destination. 282 | { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ 283 | || { 284 | # The rename failed, perhaps because mv can't rename something else 285 | # to itself, or perhaps because mv is so ancient that it does not 286 | # support -f. 287 | 288 | # Now remove or move aside any old file at destination location. 289 | # We try this two ways since rm can't unlink itself on some 290 | # systems and the destination file might be busy for other 291 | # reasons. In this case, the final cleanup might fail but the new 292 | # file should still install successfully. 293 | { 294 | if test -f "$dstdir/$dstfile"; then 295 | $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ 296 | || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ 297 | || { 298 | echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 299 | (exit 1); exit 1 300 | } 301 | else 302 | : 303 | fi 304 | } && 305 | 306 | # Now rename the file to the real destination. 307 | $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" 308 | } 309 | } 310 | fi || { (exit 1); exit 1; } 311 | done 312 | 313 | # The final little trick to "correctly" pass the exit status to the exit trap. 314 | { 315 | (exit 0); exit 0 316 | } 317 | 318 | # Local variables: 319 | # eval: (add-hook 'write-file-hooks 'time-stamp) 320 | # time-stamp-start: "scriptversion=" 321 | # time-stamp-format: "%:y-%02m-%02d.%02H" 322 | # time-stamp-end: "$" 323 | # End: 324 | -------------------------------------------------------------------------------- /missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | 4 | scriptversion=2005-06-08.21 5 | 6 | # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 7 | # Free Software Foundation, Inc. 8 | # Originally by Fran,cois Pinard , 1996. 9 | 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program; if not, write to the Free Software 22 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 23 | # 02110-1301, USA. 24 | 25 | # As a special exception to the GNU General Public License, if you 26 | # distribute this file as part of a program that contains a 27 | # configuration script generated by Autoconf, you may include it under 28 | # the same distribution terms that you use for the rest of that program. 29 | 30 | if test $# -eq 0; then 31 | echo 1>&2 "Try \`$0 --help' for more information" 32 | exit 1 33 | fi 34 | 35 | run=: 36 | 37 | # In the cases where this matters, `missing' is being run in the 38 | # srcdir already. 39 | if test -f configure.ac; then 40 | configure_ac=configure.ac 41 | else 42 | configure_ac=configure.in 43 | fi 44 | 45 | msg="missing on your system" 46 | 47 | case "$1" in 48 | --run) 49 | # Try to run requested program, and just exit if it succeeds. 50 | run= 51 | shift 52 | "$@" && exit 0 53 | # Exit code 63 means version mismatch. This often happens 54 | # when the user try to use an ancient version of a tool on 55 | # a file that requires a minimum version. In this case we 56 | # we should proceed has if the program had been absent, or 57 | # if --run hadn't been passed. 58 | if test $? = 63; then 59 | run=: 60 | msg="probably too old" 61 | fi 62 | ;; 63 | 64 | -h|--h|--he|--hel|--help) 65 | echo "\ 66 | $0 [OPTION]... PROGRAM [ARGUMENT]... 67 | 68 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 69 | error status if there is no known handling for PROGRAM. 70 | 71 | Options: 72 | -h, --help display this help and exit 73 | -v, --version output version information and exit 74 | --run try to run the given command, and emulate it if it fails 75 | 76 | Supported PROGRAM values: 77 | aclocal touch file \`aclocal.m4' 78 | autoconf touch file \`configure' 79 | autoheader touch file \`config.h.in' 80 | automake touch all \`Makefile.in' files 81 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 82 | flex create \`lex.yy.c', if possible, from existing .c 83 | help2man touch the output file 84 | lex create \`lex.yy.c', if possible, from existing .c 85 | makeinfo touch the output file 86 | tar try tar, gnutar, gtar, then tar without non-portable flags 87 | yacc create \`y.tab.[ch]', if possible, from existing .[ch] 88 | 89 | Send bug reports to ." 90 | exit $? 91 | ;; 92 | 93 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 94 | echo "missing $scriptversion (GNU Automake)" 95 | exit $? 96 | ;; 97 | 98 | -*) 99 | echo 1>&2 "$0: Unknown \`$1' option" 100 | echo 1>&2 "Try \`$0 --help' for more information" 101 | exit 1 102 | ;; 103 | 104 | esac 105 | 106 | # Now exit if we have it, but it failed. Also exit now if we 107 | # don't have it and --version was passed (most likely to detect 108 | # the program). 109 | case "$1" in 110 | lex|yacc) 111 | # Not GNU programs, they don't have --version. 112 | ;; 113 | 114 | tar) 115 | if test -n "$run"; then 116 | echo 1>&2 "ERROR: \`tar' requires --run" 117 | exit 1 118 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 119 | exit 1 120 | fi 121 | ;; 122 | 123 | *) 124 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 125 | # We have it, but it failed. 126 | exit 1 127 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 128 | # Could not run --version or --help. This is probably someone 129 | # running `$TOOL --version' or `$TOOL --help' to check whether 130 | # $TOOL exists and not knowing $TOOL uses missing. 131 | exit 1 132 | fi 133 | ;; 134 | esac 135 | 136 | # If it does not exist, or fails to run (possibly an outdated version), 137 | # try to emulate it. 138 | case "$1" in 139 | aclocal*) 140 | echo 1>&2 "\ 141 | WARNING: \`$1' is $msg. You should only need it if 142 | you modified \`acinclude.m4' or \`${configure_ac}'. You might want 143 | to install the \`Automake' and \`Perl' packages. Grab them from 144 | any GNU archive site." 145 | touch aclocal.m4 146 | ;; 147 | 148 | autoconf) 149 | echo 1>&2 "\ 150 | WARNING: \`$1' is $msg. You should only need it if 151 | you modified \`${configure_ac}'. You might want to install the 152 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 153 | archive site." 154 | touch configure 155 | ;; 156 | 157 | autoheader) 158 | echo 1>&2 "\ 159 | WARNING: \`$1' is $msg. You should only need it if 160 | you modified \`acconfig.h' or \`${configure_ac}'. You might want 161 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 162 | from any GNU archive site." 163 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 164 | test -z "$files" && files="config.h" 165 | touch_files= 166 | for f in $files; do 167 | case "$f" in 168 | *:*) touch_files="$touch_files "`echo "$f" | 169 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 170 | *) touch_files="$touch_files $f.in";; 171 | esac 172 | done 173 | touch $touch_files 174 | ;; 175 | 176 | automake*) 177 | echo 1>&2 "\ 178 | WARNING: \`$1' is $msg. You should only need it if 179 | you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 180 | You might want to install the \`Automake' and \`Perl' packages. 181 | Grab them from any GNU archive site." 182 | find . -type f -name Makefile.am -print | 183 | sed 's/\.am$/.in/' | 184 | while read f; do touch "$f"; done 185 | ;; 186 | 187 | autom4te) 188 | echo 1>&2 "\ 189 | WARNING: \`$1' is needed, but is $msg. 190 | You might have modified some files without having the 191 | proper tools for further handling them. 192 | You can get \`$1' as part of \`Autoconf' from any GNU 193 | archive site." 194 | 195 | file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` 196 | test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` 197 | if test -f "$file"; then 198 | touch $file 199 | else 200 | test -z "$file" || exec >$file 201 | echo "#! /bin/sh" 202 | echo "# Created by GNU Automake missing as a replacement of" 203 | echo "# $ $@" 204 | echo "exit 0" 205 | chmod +x $file 206 | exit 1 207 | fi 208 | ;; 209 | 210 | bison|yacc) 211 | echo 1>&2 "\ 212 | WARNING: \`$1' $msg. You should only need it if 213 | you modified a \`.y' file. You may need the \`Bison' package 214 | in order for those modifications to take effect. You can get 215 | \`Bison' from any GNU archive site." 216 | rm -f y.tab.c y.tab.h 217 | if [ $# -ne 1 ]; then 218 | eval LASTARG="\${$#}" 219 | case "$LASTARG" in 220 | *.y) 221 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 222 | if [ -f "$SRCFILE" ]; then 223 | cp "$SRCFILE" y.tab.c 224 | fi 225 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 226 | if [ -f "$SRCFILE" ]; then 227 | cp "$SRCFILE" y.tab.h 228 | fi 229 | ;; 230 | esac 231 | fi 232 | if [ ! -f y.tab.h ]; then 233 | echo >y.tab.h 234 | fi 235 | if [ ! -f y.tab.c ]; then 236 | echo 'main() { return 0; }' >y.tab.c 237 | fi 238 | ;; 239 | 240 | lex|flex) 241 | echo 1>&2 "\ 242 | WARNING: \`$1' is $msg. You should only need it if 243 | you modified a \`.l' file. You may need the \`Flex' package 244 | in order for those modifications to take effect. You can get 245 | \`Flex' from any GNU archive site." 246 | rm -f lex.yy.c 247 | if [ $# -ne 1 ]; then 248 | eval LASTARG="\${$#}" 249 | case "$LASTARG" in 250 | *.l) 251 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 252 | if [ -f "$SRCFILE" ]; then 253 | cp "$SRCFILE" lex.yy.c 254 | fi 255 | ;; 256 | esac 257 | fi 258 | if [ ! -f lex.yy.c ]; then 259 | echo 'main() { return 0; }' >lex.yy.c 260 | fi 261 | ;; 262 | 263 | help2man) 264 | echo 1>&2 "\ 265 | WARNING: \`$1' is $msg. You should only need it if 266 | you modified a dependency of a manual page. You may need the 267 | \`Help2man' package in order for those modifications to take 268 | effect. You can get \`Help2man' from any GNU archive site." 269 | 270 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 271 | if test -z "$file"; then 272 | file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` 273 | fi 274 | if [ -f "$file" ]; then 275 | touch $file 276 | else 277 | test -z "$file" || exec >$file 278 | echo ".ab help2man is required to generate this page" 279 | exit 1 280 | fi 281 | ;; 282 | 283 | makeinfo) 284 | echo 1>&2 "\ 285 | WARNING: \`$1' is $msg. You should only need it if 286 | you modified a \`.texi' or \`.texinfo' file, or any other file 287 | indirectly affecting the aspect of the manual. The spurious 288 | call might also be the consequence of using a buggy \`make' (AIX, 289 | DU, IRIX). You might want to install the \`Texinfo' package or 290 | the \`GNU make' package. Grab either from any GNU archive site." 291 | # The file to touch is that specified with -o ... 292 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 293 | if test -z "$file"; then 294 | # ... or it is the one specified with @setfilename ... 295 | infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 296 | file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` 297 | # ... or it is derived from the source name (dir/f.texi becomes f.info) 298 | test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 299 | fi 300 | # If the file does not exist, the user really needs makeinfo; 301 | # let's fail without touching anything. 302 | test -f $file || exit 1 303 | touch $file 304 | ;; 305 | 306 | tar) 307 | shift 308 | 309 | # We have already tried tar in the generic part. 310 | # Look for gnutar/gtar before invocation to avoid ugly error 311 | # messages. 312 | if (gnutar --version > /dev/null 2>&1); then 313 | gnutar "$@" && exit 0 314 | fi 315 | if (gtar --version > /dev/null 2>&1); then 316 | gtar "$@" && exit 0 317 | fi 318 | firstarg="$1" 319 | if shift; then 320 | case "$firstarg" in 321 | *o*) 322 | firstarg=`echo "$firstarg" | sed s/o//` 323 | tar "$firstarg" "$@" && exit 0 324 | ;; 325 | esac 326 | case "$firstarg" in 327 | *h*) 328 | firstarg=`echo "$firstarg" | sed s/h//` 329 | tar "$firstarg" "$@" && exit 0 330 | ;; 331 | esac 332 | fi 333 | 334 | echo 1>&2 "\ 335 | WARNING: I can't seem to be able to run \`tar' with the given arguments. 336 | You may want to install GNU tar or Free paxutils, or check the 337 | command line arguments." 338 | exit 1 339 | ;; 340 | 341 | *) 342 | echo 1>&2 "\ 343 | WARNING: \`$1' is needed, and is $msg. 344 | You might have modified some files without having the 345 | proper tools for further handling them. Check the \`README' file, 346 | it often tells you about the needed prerequisites for installing 347 | this package. You may also peek at any GNU archive site, in case 348 | some other package would contain this missing \`$1' program." 349 | exit 1 350 | ;; 351 | esac 352 | 353 | exit 0 354 | 355 | # Local variables: 356 | # eval: (add-hook 'write-file-hooks 'time-stamp) 357 | # time-stamp-start: "scriptversion=" 358 | # time-stamp-format: "%:y-%02m-%02d.%02H" 359 | # time-stamp-end: "$" 360 | # End: 361 | -------------------------------------------------------------------------------- /src/svn.c: -------------------------------------------------------------------------------- 1 | /* 2 | * this file is part of wdfs --> http://noedler.de/projekte/wdfs/ 3 | * 4 | * wdfs is a webdav filesystem with special features for accessing subversion 5 | * repositories. it is based on fuse v2.5+ and neon v0.24.7+. 6 | * 7 | * copyright (c) 2005 - 2007 jens m. noedler, noedler@web.de 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | * This program is released under the GPL with the additional exemption 24 | * that compiling, linking and/or using OpenSSL is allowed. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #include "wdfs-main.h" 36 | #include "webdav.h" 37 | #include "svn.h" 38 | 39 | 40 | /* wdfs has some special subversion (svn) related features. if "svn_mode" is 41 | * set to "true", wdfs will provide transparent access to all svn revisions via 42 | * a virtual directory, that will be added below the fuse mountpoint. the name 43 | * of the virtual directory is set to the value of the variable "svn_basedir". 44 | * 45 | * below the svn_basedir there will be a dirctory for each revision, that 46 | * contains all files, that belong to the specific revision. because there 47 | * can be a lot of revision, the directories will be clustered into chunks. 48 | * 49 | * the directory chunks are called "level 1" and the ones, which contains the 50 | * specific revision's data are called "level 2": 51 | * 52 | * level 2 -----------------\ 53 | * level 1 ---------\ | 54 | * | | 55 | * ... | | 56 | * /svn_basedir/5000-5199/5000/ 57 | * /svn_basedir/5000-5199/5001/ 58 | * ... 59 | * /svn_basedir/5000-5199/5119/ 60 | * /svn_basedir/5200-5399/5200/ 61 | * /svn_basedir/5200-5399/5201/ 62 | * ... 63 | * 64 | */ 65 | 66 | 67 | /* svn_basedir specifies the name of the virtual directory, that allows 68 | * accessing all svn revisions. it must start with '/' and end without '/'. 69 | * it may be edited here. */ 70 | const char *svn_basedir = "/0-all-revisions"; 71 | 72 | /* svn_repository_root is the path to the root of the svn repository. this is 73 | * needed, if a subdir of the repository is mounted to allow access to the old 74 | * revisions, because the path to access them always starts at the root of a 75 | * repository. */ 76 | char *svn_repository_root = NULL; 77 | 78 | /* controls how many directories are put in a single level 2 chunk. editable. */ 79 | static const int svn_revisions_per_level2_directory = 200; 80 | 81 | /* webdav properties used to get the latest svn revision */ 82 | static const ne_propname property_checked_in[] = { 83 | { "DAV:", "checked-in"}, 84 | { NULL } /* MUST be NULL terminated! */ 85 | }; 86 | 87 | static const ne_propname property_vcc[] = { 88 | { "DAV:", "version-controlled-configuration"}, 89 | { NULL } /* MUST be NULL terminated! */ 90 | }; 91 | 92 | 93 | 94 | /* +++++++ local static methods +++++++ */ 95 | 96 | /* author jens, 03.08.2005 14:39:23, location: goettingen */ 97 | 98 | 99 | /* this function extracts the revision number from a string */ 100 | static void svn_get_latest_revision_callback( 101 | #if NEON_VERSION >= 26 102 | void *userdata, const ne_uri* href_uri, const ne_prop_result_set *results) 103 | #else 104 | void *userdata, const char *href, const ne_prop_result_set *results) 105 | #endif 106 | { 107 | assert(userdata && results); 108 | 109 | int *latest_revision = (int*)userdata; 110 | char *latest_revision_string = NULL; 111 | const char delimiters[] = "/"; 112 | char *token = NULL; 113 | char *result = (char*)ne_propset_value(results, &property_checked_in[0]); 114 | /* result now looks like this "/svn/dir1/dirx/!svn/bln/1234". 115 | * extracting the number in a bit tricky. split the string at each '/' 116 | * and check if it's "!svn" followed by "bln" followed by the number. */ 117 | do { 118 | token = strsep(&result, delimiters); 119 | if (token != NULL && !strcmp("!svn", token)) { 120 | /* next token should be bln */ 121 | token = strsep(&result, delimiters); 122 | if (token != NULL && !strcmp("bln", token)) { 123 | /* the next token is the svn revision */ 124 | token = strsep(&result, delimiters); 125 | if (token != NULL) { 126 | /* remove the last char; e.g. "1234<" to "1234" */ 127 | latest_revision_string = strndup(token, strlen(token) - 1); 128 | } 129 | } 130 | } 131 | } while (token != NULL ); 132 | 133 | if (wdfs.debug == true) 134 | fprintf(stderr, 135 | ">> SVN latest revision _string_: %s\n", latest_revision_string); 136 | 137 | /* string to integer conversion */ 138 | *latest_revision = atoi(latest_revision_string); 139 | 140 | FREE(latest_revision_string); 141 | } 142 | 143 | 144 | /* returns -1 on error or the latest svn revision on success */ 145 | static int svn_get_latest_revision() 146 | { 147 | int latest_revision; 148 | char *uri = ne_concat(svn_repository_root, "!svn/vcc/default", NULL); 149 | ne_propfind_handler *pfh = ne_propfind_create(session, uri, NE_DEPTH_ZERO); 150 | int ret = ne_propfind_named(pfh, property_checked_in, 151 | &svn_get_latest_revision_callback, &latest_revision); 152 | ne_propfind_destroy(pfh); 153 | FREE(uri); 154 | if (ret != NE_OK) { 155 | fprintf(stderr, "## ne_propfind_named() error\n"); 156 | return -1; 157 | } 158 | return latest_revision; 159 | } 160 | 161 | 162 | /* return the number of '/' found in a given string */ 163 | static int svn_directory_depth(const char *in) 164 | { 165 | assert(in); 166 | 167 | int i, ret = 0; 168 | int len = strlen(in); 169 | for (i = 0; i < len; i++) { 170 | if (in[i] == '/') 171 | ret++; 172 | } 173 | return ret; 174 | } 175 | 176 | 177 | /* like strlen(), but for integers */ 178 | static int get_integer_length(int in) 179 | { 180 | assert(in); 181 | 182 | int length = 1; 183 | while (in >= 10) { 184 | in = in / 10; 185 | length++; 186 | } 187 | return length; 188 | } 189 | 190 | 191 | /* callback from svn_set_repository_root() to do the dirty string parsing. */ 192 | static void svn_set_repository_root_callback( 193 | #if NEON_VERSION >= 26 194 | void *userdata, const ne_uri* href_uri, const ne_prop_result_set *results) 195 | #else 196 | void *userdata, const char *href, const ne_prop_result_set *results) 197 | #endif 198 | { 199 | assert(results); 200 | 201 | /* the string looks like "/.../.../!svn/vcc/default" */ 202 | char *result = (char*)ne_propset_value(results, &property_vcc[0]); 203 | /* use a GString struct for comfortable string erasing */ 204 | GString *g_result = g_string_new(result); 205 | /* remove starting tag ("") */ 206 | g_string_erase(g_result, 0, 6); 207 | /* remove trailing stuff ("!svn/vcc/default"), 208 | * so that only "/.../.../" -- the repository root path -- remains. */ 209 | g_string_erase(g_result, g_result->len - 23, 23); 210 | svn_repository_root = strdup(g_result->str); 211 | g_string_free(g_result, TRUE); 212 | } 213 | 214 | 215 | /* +++++++ exported non-static methods +++++++ */ 216 | 217 | /* set the root path of the mounted repository. this path might differ from the 218 | * mounted uri if a subdir of the repository is mounted. return 0 on success or 219 | * -1 on error. */ 220 | int svn_set_repository_root() 221 | { 222 | /* if remotepath_basedir is empty set svn_repository_root to "/" and quit */ 223 | if (!strcmp(remotepath_basedir, "")) { 224 | svn_repository_root = strdup("/"); 225 | return 0; 226 | } 227 | 228 | ne_propfind_handler *pfh = 229 | ne_propfind_create(session, remotepath_basedir, NE_DEPTH_ZERO); 230 | int ret = ne_propfind_named(pfh, property_vcc, 231 | &svn_set_repository_root_callback, NULL); 232 | ne_propfind_destroy(pfh); 233 | if (ret != NE_OK) { 234 | fprintf(stderr, "## ne_propfind_named() error\n"); 235 | return -1; 236 | } 237 | return 0; 238 | } 239 | 240 | void svn_free_repository_root() 241 | { 242 | FREE(svn_repository_root); 243 | } 244 | 245 | 246 | /* converts a localpath to a remotepath to access old revision 247 | * IN: /svn_basedir/x-y/1234/directory/file.txt 248 | * OUT: /svn_repository_root/!svn/bc/1234/directory/file.txt or NULL on error */ 249 | char* svn_get_remotepath(const char *localpath) 250 | { 251 | assert(localpath); 252 | /* use a GString struct for comfortable string erasing */ 253 | GString *g_localpath = g_string_new(localpath); 254 | /* remove the svn_basedir and the next char from the start of the string */ 255 | g_string_erase(g_localpath, 0, strlen(svn_basedir) + 1); 256 | /* save the string starting with the next '/', because it's the relative 257 | * path including the revision. e.g. "/1234/directory/file.txt" */ 258 | char *path = strchr(g_localpath->str, '/'); 259 | /* concat the svn uri string, that allows to access this revision */ 260 | char *remotepath = ne_concat(svn_repository_root, "!svn/bc", path, NULL); 261 | g_string_free(g_localpath, TRUE); 262 | if (remotepath == NULL) 263 | return NULL; 264 | /* finally escape the string */ 265 | char *remotepath2 = ne_path_escape(remotepath); 266 | FREE(remotepath); 267 | if (remotepath2 == NULL) 268 | return NULL; 269 | return remotepath2; 270 | } 271 | 272 | 273 | /* return a static stat, used for svn_basedir and level 1 directories */ 274 | struct stat svn_get_static_dir_stat() 275 | { 276 | struct stat stat; 277 | stat.st_mode = S_IFDIR | 0777; 278 | stat.st_size = 4096; 279 | stat.st_nlink = 1; 280 | stat.st_atime = stat.st_mtime = stat.st_ctime = time(NULL); 281 | stat.st_blocks = (stat.st_size + 511) / 512; 282 | stat.st_mode &= ~umask(0); 283 | stat.st_uid = getuid(); 284 | stat.st_gid = getgid(); 285 | return stat; 286 | } 287 | 288 | 289 | /* gets the latest revision number from subversion and adds the level1-dirs */ 290 | void svn_add_level1_directories(struct dir_item *item_data) 291 | { 292 | assert(item_data); 293 | 294 | int latest_revision = svn_get_latest_revision(); 295 | if (latest_revision >= 0) { 296 | 297 | GString *int2string = 298 | g_string_new_len("", get_integer_length(latest_revision)); 299 | 300 | int i, rest = latest_revision % svn_revisions_per_level2_directory; 301 | for (i = 0; i <= latest_revision; i++) { 302 | if (i % svn_revisions_per_level2_directory == 0) { 303 | GString *directory_name = g_string_new(""); 304 | sprintf(int2string->str, "%d", i); 305 | g_string_append(directory_name, int2string->str); 306 | g_string_append_c(directory_name, '-'); 307 | if (i + svn_revisions_per_level2_directory > latest_revision) 308 | sprintf(int2string->str, "%d", i + rest ); 309 | else 310 | sprintf(int2string->str, "%d", 311 | i + (svn_revisions_per_level2_directory - 1) ); 312 | g_string_append(directory_name, int2string->str); 313 | item_data->filler(item_data->buf, directory_name->str, NULL, 0); 314 | g_string_free(directory_name, TRUE); 315 | } 316 | } 317 | g_string_free(int2string, TRUE); 318 | } else { 319 | fprintf(stderr, "## Error: Could not get latest revision from SVN.\n"); 320 | } 321 | } 322 | 323 | 324 | /* sets the stat for a level1 directory and returns 0 (success) or 1 (error). */ 325 | int svn_get_level1_stat(struct stat *stat, const char *localpath) 326 | { 327 | assert(stat && localpath); 328 | 329 | if (svn_directory_depth(localpath) == 2) { 330 | *stat = svn_get_static_dir_stat(); 331 | return 0; 332 | } 333 | return 1; 334 | } 335 | 336 | 337 | /* IN: /svn_basedir/x-y/ (as string, x and y are revision numbers) 338 | * OUT: /svn_basedir/x-y/x/ (as level2-dentry, added with filler method) 339 | * /svn_basedir/x-y/x+1/ (as level2-dentry, added with filler method) 340 | * /svn_basedir/x-y/../ (as level2-dentry, added with filler method) 341 | * /svn_basedir/x-y/y-1/ (as level2-dentry, added with filler method) 342 | * /svn_basedir/x-y/y/ (as level2-dentry, added with filler method) 343 | * returns 0 on success (added level2 directories) and 1 otherwise. */ 344 | int svn_add_level2_directories( 345 | struct dir_item *item_data, const char *localpath) 346 | { 347 | assert(item_data && localpath); 348 | 349 | if (svn_directory_depth(localpath) == 2) { 350 | /* use a GString object for comfortable string erasing */ 351 | GString *g_localpath = g_string_new(localpath); 352 | /* remove the svn_basedir and the next char from the start */ 353 | g_string_erase(g_localpath, 0, strlen(svn_basedir) + 1); 354 | 355 | char delimiters[] = "-"; 356 | char *token; 357 | /* the variable x_y contains the string "x-y", x and y are numbers */ 358 | char *x_y = strdup(g_localpath->str); 359 | g_string_free(g_localpath, TRUE); 360 | 361 | char *pointer = x_y; 362 | token = strsep(&x_y, delimiters); 363 | int x = atoi(token); 364 | token = strsep(&x_y, delimiters); 365 | int y = atoi(token); 366 | FREE(pointer); 367 | 368 | GString *int2string = g_string_new_len("", get_integer_length(y)); 369 | int i; 370 | /* insert all level2-dentries from x to y */ 371 | for (i = x; i <= y; i++) { 372 | /* convert int to string by printing it into a string object */ 373 | sprintf(int2string->str, "%d", i); 374 | item_data->filler(item_data->buf, int2string->str, NULL, 0); 375 | } 376 | g_string_free(int2string, TRUE); 377 | return 0; 378 | } 379 | return 1; 380 | } 381 | 382 | -------------------------------------------------------------------------------- /src/webdav.c: -------------------------------------------------------------------------------- 1 | /* 2 | * this file is part of wdfs --> http://noedler.de/projekte/wdfs/ 3 | * 4 | * wdfs is a webdav filesystem with special features for accessing subversion 5 | * repositories. it is based on fuse v2.5+ and neon v0.24.7+. 6 | * 7 | * copyright (c) 2005 - 2007 jens m. noedler, noedler@web.de 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | * This program is released under the GPL with the additional exemption 24 | * that compiling, linking and/or using OpenSSL is allowed. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #include "wdfs-main.h" 40 | #include "webdav.h" 41 | 42 | 43 | /* used to authorize at the webdav server */ 44 | struct ne_auth_data { 45 | const char *username; 46 | const char *password; 47 | }; 48 | 49 | ne_session *session; 50 | ne_lock_store *store = NULL; 51 | struct ne_auth_data auth_data; 52 | 53 | 54 | /* reads from the terminal without displaying the typed chars. used to type 55 | * the password savely. */ 56 | static int fgets_hidden(char *lineptr, size_t n, FILE *stream) 57 | { 58 | struct termios settings_old, settings_new; 59 | int ret = 0; 60 | 61 | if (isatty(fileno(stream))) { 62 | /* turn echoing off and fail if we can't */ 63 | if (tcgetattr(fileno(stream), &settings_old) == 0) { 64 | settings_new = settings_old; 65 | settings_new.c_lflag &= ~ECHO; 66 | if (tcsetattr(fileno(stream), TCSAFLUSH, &settings_new) == 0) 67 | ret = 1; 68 | } 69 | } 70 | else 71 | ret = 1; 72 | 73 | /* read the password */ 74 | if (ret == 1 && fgets(lineptr, n, stream) == NULL) 75 | ret = 0; 76 | 77 | if (isatty(fileno(stream))) 78 | /* restore terminal */ 79 | (void) tcsetattr(fileno(stream), TCSAFLUSH, &settings_old); 80 | 81 | return ret; 82 | } 83 | 84 | 85 | /* this method is envoked, if the server requires authentication */ 86 | static int ne_set_server_auth_callback( 87 | void *userdata, const char *realm, 88 | int attempt, char *username, char *password) 89 | { 90 | const size_t length = 100; 91 | char buffer[length]; 92 | 93 | /* ask the user for the username and password if needed */ 94 | if (auth_data.username == NULL) { 95 | printf("username: "); 96 | if (fgets(buffer, length, stdin)) { 97 | int len = strlen(buffer); 98 | if (buffer[len - 1] == '\n') 99 | buffer[len - 1] = '\0'; 100 | auth_data.username = strdup(buffer); 101 | } 102 | } 103 | if (auth_data.password == NULL) { 104 | printf("password: "); 105 | if (fgets_hidden(buffer, length, stdin)) { 106 | int len = strlen(buffer); 107 | if (buffer[len - 1] == '\n') 108 | buffer[len - 1] = '\0'; 109 | auth_data.password = strdup(buffer); 110 | } 111 | printf("\n"); 112 | } 113 | 114 | assert(auth_data.username && auth_data.password); 115 | strncpy(username, auth_data.username, NE_ABUFSIZ); 116 | strncpy(password, auth_data.password, NE_ABUFSIZ); 117 | 118 | return attempt; 119 | } 120 | 121 | 122 | /* this is called from ne_ssl_set_verify() if there is something wrong with the 123 | * ssl certificate. */ 124 | static int verify_ssl_certificate( 125 | void *userdata, int failures, const ne_ssl_certificate *certificate) 126 | { 127 | ne_uri *uri = (ne_uri*)userdata; 128 | char from[NE_SSL_VDATELEN], to[NE_SSL_VDATELEN]; 129 | const char *ident; 130 | 131 | ident = ne_ssl_cert_identity(certificate); 132 | 133 | if (ident) { 134 | fprintf(stderr, 135 | "WARNING: untrusted server certificate for '%s':\n", ident); 136 | } 137 | 138 | if (failures & NE_SSL_IDMISMATCH) { 139 | fprintf(stderr, 140 | " certificate was issued to hostname '%s' rather than '%s'\n", 141 | ne_ssl_cert_identity(certificate), uri->host); 142 | fprintf(stderr, " this connection could have been intercepted!\n"); 143 | } 144 | 145 | ne_ssl_cert_validity(certificate, from, to); 146 | printf(" certificate is valid from %s to %s\n", from, to); 147 | if (failures & NE_SSL_EXPIRED) 148 | fprintf(stderr, " >> certificate expired! <<\n"); 149 | 150 | char *issued_to = ne_ssl_readable_dname(ne_ssl_cert_subject(certificate)); 151 | char *issued_by = ne_ssl_readable_dname(ne_ssl_cert_issuer(certificate)); 152 | printf(" issued to: %s\n", issued_to); 153 | printf(" issued by: %s\n", issued_by); 154 | free_chars(&issued_to, &issued_by, NULL); 155 | 156 | /* don't prompt the user if the parameter "-ac" was passed to wdfs */ 157 | if (wdfs.accept_certificate == true) 158 | return 0; 159 | 160 | /* prompt the user wether he/she wants to accept this certificate */ 161 | int answer; 162 | while (1) { 163 | printf(" do you wish to accept this certificate? (y/n) "); 164 | answer = getchar(); 165 | /* delete the input buffer (if the char is not a newline) */ 166 | if (answer != '\n') 167 | while (getchar() != '\n'); 168 | /* stop asking if the answer was 'y' or 'n' */ 169 | if (answer == 'y' || answer == 'n') 170 | break; 171 | } 172 | 173 | if (answer == 'y') { 174 | return 0; 175 | } else { 176 | printf(" certificate rejected.\n"); 177 | return -1; 178 | } 179 | } 180 | 181 | 182 | /* sets up a webdav connection. if the servers needs authentication, the passed 183 | * parameters username and password are used. if they were not passed they can 184 | * be entered interactively. this method returns 0 on success or -1 on error. */ 185 | int setup_webdav_session( 186 | const char *uri_string, const char *username, const char *password) 187 | { 188 | assert(uri_string); 189 | 190 | auth_data.username = username; 191 | auth_data.password = password; 192 | 193 | /* parse the uri_string and return a uri struct */ 194 | ne_uri uri; 195 | if (ne_uri_parse(uri_string, &uri)) { 196 | fprintf(stderr, 197 | "## ne_uri_parse() error: invalid URI '%s'.\n", uri_string); 198 | ne_uri_free(&uri); 199 | return -1; 200 | } 201 | 202 | assert(uri.scheme && uri.host && uri.path); 203 | 204 | /* if no port was defined use the default port */ 205 | uri.port = uri.port ? uri.port : ne_uri_defaultport(uri.scheme); 206 | 207 | ne_debug_init(stderr,0); 208 | 209 | /* needed for ssl connections. it's not documented. nice to know... ;-) */ 210 | ne_sock_init(); 211 | 212 | /* create a session object, that allows to access the server */ 213 | session = ne_session_create(uri.scheme, uri.host, uri.port); 214 | 215 | /* init ssl if needed */ 216 | if (!strcasecmp(uri.scheme, "https")) { 217 | #if NEON_VERSION >= 25 218 | if (ne_has_support(NE_FEATURE_SSL)) { 219 | #else 220 | if (ne_supports_ssl()) { 221 | #endif 222 | ne_ssl_trust_default_ca(session); 223 | ne_ssl_set_verify(session, verify_ssl_certificate, &uri); 224 | } else { 225 | fprintf(stderr, "## error: neon ssl support is not enabled.\n"); 226 | ne_session_destroy(session); 227 | ne_uri_free(&uri); 228 | return -1; 229 | } 230 | } 231 | 232 | /* enable this for on-demand authentication */ 233 | ne_set_server_auth(session, ne_set_server_auth_callback, NULL); 234 | 235 | /* enable redirect support */ 236 | ne_redirect_register(session); 237 | 238 | /* escape the path for the case that it contains special chars */ 239 | char *path = unify_path(uri.path, ESCAPE | LEAVESLASH); 240 | if (path == NULL) { 241 | printf("## error: unify_path() returned NULL\n"); 242 | ne_session_destroy(session); 243 | ne_uri_free(&uri); 244 | return -1; 245 | } 246 | 247 | ne_set_useragent(session,"wdfs"); 248 | 249 | /* try to access the server */ 250 | ne_server_capabilities capabilities; 251 | int ret = ne_options(session, path, &capabilities); 252 | if (ret != NE_OK) { 253 | fprintf(stderr, 254 | "## error: could not mount remote server '%s'. ", uri_string); 255 | fprintf(stderr, "reason: %s", ne_get_error(session)); 256 | /* if we got a redirect, print the new destination uri and exit */ 257 | if (ret == NE_REDIRECT) { 258 | const ne_uri *new_uri = ne_redirect_location(session); 259 | char *new_uri_string = ne_uri_unparse(new_uri); 260 | fprintf(stderr, " to '%s'", new_uri_string); 261 | FREE(new_uri_string); 262 | } 263 | fprintf(stderr, ".\n"); 264 | ne_session_destroy(session); 265 | ne_uri_free(&uri); 266 | FREE(path); 267 | return -1; 268 | } 269 | FREE(path); 270 | 271 | /* is this a webdav server that fulfills webdav class 1? */ 272 | if (capabilities.dav_class1 != 1) { 273 | fprintf(stderr, 274 | "## error: '%s' is not a webdav enabled server.\n", uri_string); 275 | ne_session_destroy(session); 276 | ne_uri_free(&uri); 277 | return -1; 278 | } 279 | 280 | /* set a useragent string, to identify wdfs in the server log files */ 281 | ne_set_useragent(session, project_name); 282 | 283 | /* save the remotepath, because each fuse callback method need it to 284 | * access the files at the webdav server */ 285 | remotepath_basedir = remove_ending_slashes(uri.path); 286 | if (remotepath_basedir == NULL) { 287 | ne_session_destroy(session); 288 | ne_uri_free(&uri); 289 | return -1; 290 | } 291 | 292 | ne_uri_free(&uri); 293 | return 0; 294 | } 295 | 296 | 297 | /* +++++++ locking methods +++++++ */ 298 | 299 | /* returns the lock for this file from the lockstore on success 300 | * or NULL if the lock is not found in the lockstore. */ 301 | static struct ne_lock* get_lock_by_path(const char *remotepath) 302 | { 303 | assert(remotepath); 304 | 305 | /* unless the lockstore is initialized, no lock can be found */ 306 | if (store == NULL) 307 | return NULL; 308 | 309 | /* generate a ne_uri object to find the lock by its uri */ 310 | ne_uri uri; 311 | uri.path = (char *)remotepath; 312 | ne_fill_server_uri(session, &uri); 313 | 314 | /* find the lock for this uri in the lockstore */ 315 | struct ne_lock *lock = NULL; 316 | lock = ne_lockstore_findbyuri(store, &uri); 317 | 318 | /* ne_fill_server_uri() malloc()d these fields, time to free them */ 319 | free_chars(&uri.scheme, &uri.host, NULL); 320 | 321 | return lock; 322 | } 323 | 324 | 325 | /* tries to lock the file and returns 0 on success and 1 on error */ 326 | int lockfile(const char *remotepath, const int timeout) 327 | { 328 | assert(remotepath && timeout); 329 | 330 | /* initialize the lockstore, if needed (e.g. first locking a file). */ 331 | if (store == NULL) { 332 | store = ne_lockstore_create(); 333 | if (store == NULL) 334 | return 1; 335 | ne_lockstore_register(store, session); 336 | } 337 | 338 | 339 | /* check, if we already hold a lock for this file */ 340 | struct ne_lock *lock = get_lock_by_path(remotepath); 341 | 342 | /* we already hold a lock for this file, simply return 0 */ 343 | if (lock != NULL) { 344 | if (wdfs.debug == true) 345 | fprintf(stderr, "++ file '%s' is already locked.\n", remotepath); 346 | return 0; 347 | } 348 | 349 | /* otherwise lock the file exclusivly */ 350 | lock = ne_lock_create(); 351 | enum ne_lock_scope scope = ne_lockscope_exclusive; 352 | lock->scope = scope; 353 | lock->owner = ne_concat("wdfs, user: ", getenv("USER"), NULL); 354 | lock->timeout = timeout; 355 | lock->depth = NE_DEPTH_ZERO; 356 | ne_fill_server_uri(session, &lock->uri); 357 | lock->uri.path = ne_strdup(remotepath); 358 | 359 | if (ne_lock(session, lock)) { 360 | fprintf(stderr, "## ne_lock() error:\n"); 361 | fprintf(stderr, "## could _not_ lock file '%s'.\n", lock->uri.path); 362 | ne_lock_destroy(lock); 363 | return 1; 364 | } else { 365 | ne_lockstore_add(store, lock); 366 | if (wdfs.debug == true) 367 | fprintf(stderr, "++ locked file '%s'.\n", remotepath); 368 | } 369 | 370 | return 0; 371 | } 372 | 373 | 374 | /* tries to unlock the file and returns 0 on success and 1 on error */ 375 | int unlockfile(const char *remotepath) 376 | { 377 | assert(remotepath); 378 | 379 | struct ne_lock *lock = get_lock_by_path(remotepath); 380 | 381 | /* if the lock was not found, the file is already unlocked */ 382 | if (lock == NULL) 383 | return 0; 384 | 385 | 386 | /* if the lock was found, unlock the file */ 387 | if (ne_unlock(session, lock)) { 388 | fprintf(stderr, "## ne_unlock() error:\n"); 389 | fprintf(stderr, "## could _not_ unlock file '%s'.\n", lock->uri.path); 390 | ne_lock_destroy(lock); 391 | return 1; 392 | } else { 393 | /* on success remove the lock from the store and destroy the lock */ 394 | ne_lockstore_remove(store, lock); 395 | ne_lock_destroy(lock); 396 | if (wdfs.debug == true) 397 | fprintf(stderr, "++ unlocked file '%s'.\n", remotepath); 398 | } 399 | 400 | return 0; 401 | } 402 | 403 | 404 | /* this method unlocks all files of the lockstore and destroys the lockstore */ 405 | void unlock_all_files() 406 | { 407 | /* only unlock all files, if the lockstore is initialized */ 408 | if (store != NULL) { 409 | /* get each lock from the lockstore and try to unlock the file */ 410 | struct ne_lock *this_lock = NULL; 411 | this_lock = ne_lockstore_first(store); 412 | while (this_lock != NULL) { 413 | if (ne_unlock(session, this_lock)) { 414 | fprintf(stderr, 415 | "## ne_unlock() error:\n" 416 | "## could _not_ unlock file '%s'.\n", this_lock->uri.path); 417 | } else { 418 | if (wdfs.debug == true) 419 | fprintf(stderr, 420 | "++ unlocked file '%s'.\n", this_lock->uri.path); 421 | } 422 | /* get the next lock from the lockstore */ 423 | this_lock = ne_lockstore_next(store); 424 | } 425 | 426 | /* finally destroy the lockstore */ 427 | if (wdfs.debug == true) 428 | fprintf(stderr, "++ destroying lockstore.\n"); 429 | ne_lockstore_destroy(store); 430 | } 431 | } 432 | 433 | -------------------------------------------------------------------------------- /src/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.9.6 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005 Free Software Foundation, Inc. 6 | # This Makefile.in is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | @SET_MAKE@ 16 | 17 | srcdir = @srcdir@ 18 | top_srcdir = @top_srcdir@ 19 | VPATH = @srcdir@ 20 | pkgdatadir = $(datadir)/@PACKAGE@ 21 | pkglibdir = $(libdir)/@PACKAGE@ 22 | pkgincludedir = $(includedir)/@PACKAGE@ 23 | top_builddir = .. 24 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 25 | INSTALL = @INSTALL@ 26 | install_sh_DATA = $(install_sh) -c -m 644 27 | install_sh_PROGRAM = $(install_sh) -c 28 | install_sh_SCRIPT = $(install_sh) -c 29 | INSTALL_HEADER = $(INSTALL_DATA) 30 | transform = $(program_transform_name) 31 | NORMAL_INSTALL = : 32 | PRE_INSTALL = : 33 | POST_INSTALL = : 34 | NORMAL_UNINSTALL = : 35 | PRE_UNINSTALL = : 36 | POST_UNINSTALL = : 37 | bin_PROGRAMS = wdfs$(EXEEXT) 38 | subdir = src 39 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ 40 | $(srcdir)/config.h.in 41 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 42 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 43 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 44 | $(ACLOCAL_M4) 45 | mkinstalldirs = $(install_sh) -d 46 | CONFIG_HEADER = config.h 47 | CONFIG_CLEAN_FILES = 48 | am__installdirs = "$(DESTDIR)$(bindir)" 49 | binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) 50 | PROGRAMS = $(bin_PROGRAMS) 51 | am_wdfs_OBJECTS = cache.$(OBJEXT) svn.$(OBJEXT) wdfs-main.$(OBJEXT) \ 52 | webdav.$(OBJEXT) 53 | wdfs_OBJECTS = $(am_wdfs_OBJECTS) 54 | wdfs_LDADD = $(LDADD) 55 | DEFAULT_INCLUDES = -I. -I$(srcdir) -I. 56 | depcomp = $(SHELL) $(top_srcdir)/depcomp 57 | am__depfiles_maybe = depfiles 58 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 59 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 60 | CCLD = $(CC) 61 | LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ 62 | SOURCES = $(wdfs_SOURCES) 63 | DIST_SOURCES = $(wdfs_SOURCES) 64 | ETAGS = etags 65 | CTAGS = ctags 66 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 67 | ACLOCAL = @ACLOCAL@ 68 | AMDEP_FALSE = @AMDEP_FALSE@ 69 | AMDEP_TRUE = @AMDEP_TRUE@ 70 | AMTAR = @AMTAR@ 71 | AUTOCONF = @AUTOCONF@ 72 | AUTOHEADER = @AUTOHEADER@ 73 | AUTOMAKE = @AUTOMAKE@ 74 | AWK = @AWK@ 75 | CC = @CC@ 76 | CCDEPMODE = @CCDEPMODE@ 77 | CFLAGS = @CFLAGS@ 78 | CPP = @CPP@ 79 | CPPFLAGS = @CPPFLAGS@ 80 | CYGPATH_W = @CYGPATH_W@ 81 | DEFS = @DEFS@ 82 | DEPDIR = @DEPDIR@ 83 | ECHO_C = @ECHO_C@ 84 | ECHO_N = @ECHO_N@ 85 | ECHO_T = @ECHO_T@ 86 | EGREP = @EGREP@ 87 | EXEEXT = @EXEEXT@ 88 | GREP = @GREP@ 89 | INSTALL_DATA = @INSTALL_DATA@ 90 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 91 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 92 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 93 | LDFLAGS = @LDFLAGS@ 94 | LIBOBJS = @LIBOBJS@ 95 | LIBS = @LIBS@ 96 | LTLIBOBJS = @LTLIBOBJS@ 97 | MAKEINFO = @MAKEINFO@ 98 | OBJEXT = @OBJEXT@ 99 | PACKAGE = @PACKAGE@ 100 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 101 | PACKAGE_NAME = @PACKAGE_NAME@ 102 | PACKAGE_STRING = @PACKAGE_STRING@ 103 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 104 | PACKAGE_VERSION = @PACKAGE_VERSION@ 105 | PATH_SEPARATOR = @PATH_SEPARATOR@ 106 | PKG_CONFIG = @PKG_CONFIG@ 107 | SET_MAKE = @SET_MAKE@ 108 | SHELL = @SHELL@ 109 | STRIP = @STRIP@ 110 | VERSION = @VERSION@ 111 | WDFS_CFLAGS = @WDFS_CFLAGS@ 112 | WDFS_LIBS = @WDFS_LIBS@ 113 | ac_ct_CC = @ac_ct_CC@ 114 | am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ 115 | am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ 116 | am__include = @am__include@ 117 | am__leading_dot = @am__leading_dot@ 118 | am__quote = @am__quote@ 119 | am__tar = @am__tar@ 120 | am__untar = @am__untar@ 121 | bindir = @bindir@ 122 | build_alias = @build_alias@ 123 | datadir = @datadir@ 124 | datarootdir = @datarootdir@ 125 | docdir = @docdir@ 126 | dvidir = @dvidir@ 127 | exec_prefix = @exec_prefix@ 128 | host_alias = @host_alias@ 129 | htmldir = @htmldir@ 130 | includedir = @includedir@ 131 | infodir = @infodir@ 132 | install_sh = @install_sh@ 133 | libdir = @libdir@ 134 | libexecdir = @libexecdir@ 135 | localedir = @localedir@ 136 | localstatedir = @localstatedir@ 137 | mandir = @mandir@ 138 | mkdir_p = @mkdir_p@ 139 | oldincludedir = @oldincludedir@ 140 | pdfdir = @pdfdir@ 141 | prefix = @prefix@ 142 | program_transform_name = @program_transform_name@ 143 | psdir = @psdir@ 144 | sbindir = @sbindir@ 145 | sharedstatedir = @sharedstatedir@ 146 | sysconfdir = @sysconfdir@ 147 | target_alias = @target_alias@ 148 | wdfs_SOURCES = cache.c cache.h svn.c svn.h wdfs-main.c wdfs-main.h webdav.c webdav.h 149 | all: config.h 150 | $(MAKE) $(AM_MAKEFLAGS) all-am 151 | 152 | .SUFFIXES: 153 | .SUFFIXES: .c .o .obj 154 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 155 | @for dep in $?; do \ 156 | case '$(am__configure_deps)' in \ 157 | *$$dep*) \ 158 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ 159 | && exit 0; \ 160 | exit 1;; \ 161 | esac; \ 162 | done; \ 163 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ 164 | cd $(top_srcdir) && \ 165 | $(AUTOMAKE) --gnu src/Makefile 166 | .PRECIOUS: Makefile 167 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 168 | @case '$?' in \ 169 | *config.status*) \ 170 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 171 | *) \ 172 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 173 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 174 | esac; 175 | 176 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 177 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 178 | 179 | $(top_srcdir)/configure: $(am__configure_deps) 180 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 181 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 182 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 183 | 184 | config.h: stamp-h1 185 | @if test ! -f $@; then \ 186 | rm -f stamp-h1; \ 187 | $(MAKE) stamp-h1; \ 188 | else :; fi 189 | 190 | stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status 191 | @rm -f stamp-h1 192 | cd $(top_builddir) && $(SHELL) ./config.status src/config.h 193 | $(srcdir)/config.h.in: $(am__configure_deps) 194 | cd $(top_srcdir) && $(AUTOHEADER) 195 | rm -f stamp-h1 196 | touch $@ 197 | 198 | distclean-hdr: 199 | -rm -f config.h stamp-h1 200 | install-binPROGRAMS: $(bin_PROGRAMS) 201 | @$(NORMAL_INSTALL) 202 | test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" 203 | @list='$(bin_PROGRAMS)'; for p in $$list; do \ 204 | p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ 205 | if test -f $$p \ 206 | ; then \ 207 | f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ 208 | echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ 209 | $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ 210 | else :; fi; \ 211 | done 212 | 213 | uninstall-binPROGRAMS: 214 | @$(NORMAL_UNINSTALL) 215 | @list='$(bin_PROGRAMS)'; for p in $$list; do \ 216 | f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ 217 | echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ 218 | rm -f "$(DESTDIR)$(bindir)/$$f"; \ 219 | done 220 | 221 | clean-binPROGRAMS: 222 | -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) 223 | wdfs$(EXEEXT): $(wdfs_OBJECTS) $(wdfs_DEPENDENCIES) 224 | @rm -f wdfs$(EXEEXT) 225 | $(LINK) $(wdfs_LDFLAGS) $(wdfs_OBJECTS) $(wdfs_LDADD) $(LIBS) 226 | 227 | mostlyclean-compile: 228 | -rm -f *.$(OBJEXT) 229 | 230 | distclean-compile: 231 | -rm -f *.tab.c 232 | 233 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache.Po@am__quote@ 234 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svn.Po@am__quote@ 235 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wdfs-main.Po@am__quote@ 236 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/webdav.Po@am__quote@ 237 | 238 | .c.o: 239 | @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ 240 | @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi 241 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 242 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 243 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< 244 | 245 | .c.obj: 246 | @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ 247 | @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi 248 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 249 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 250 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` 251 | uninstall-info-am: 252 | 253 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 254 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 255 | unique=`for i in $$list; do \ 256 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 257 | done | \ 258 | $(AWK) ' { files[$$0] = 1; } \ 259 | END { for (i in files) print i; }'`; \ 260 | mkid -fID $$unique 261 | tags: TAGS 262 | 263 | TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ 264 | $(TAGS_FILES) $(LISP) 265 | tags=; \ 266 | here=`pwd`; \ 267 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ 268 | unique=`for i in $$list; do \ 269 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 270 | done | \ 271 | $(AWK) ' { files[$$0] = 1; } \ 272 | END { for (i in files) print i; }'`; \ 273 | if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ 274 | test -n "$$unique" || unique=$$empty_fix; \ 275 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 276 | $$tags $$unique; \ 277 | fi 278 | ctags: CTAGS 279 | CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ 280 | $(TAGS_FILES) $(LISP) 281 | tags=; \ 282 | here=`pwd`; \ 283 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ 284 | unique=`for i in $$list; do \ 285 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 286 | done | \ 287 | $(AWK) ' { files[$$0] = 1; } \ 288 | END { for (i in files) print i; }'`; \ 289 | test -z "$(CTAGS_ARGS)$$tags$$unique" \ 290 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 291 | $$tags $$unique 292 | 293 | GTAGS: 294 | here=`$(am__cd) $(top_builddir) && pwd` \ 295 | && cd $(top_srcdir) \ 296 | && gtags -i $(GTAGS_ARGS) $$here 297 | 298 | distclean-tags: 299 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 300 | 301 | distdir: $(DISTFILES) 302 | @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ 303 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ 304 | list='$(DISTFILES)'; for file in $$list; do \ 305 | case $$file in \ 306 | $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ 307 | $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ 308 | esac; \ 309 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 310 | dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ 311 | if test "$$dir" != "$$file" && test "$$dir" != "."; then \ 312 | dir="/$$dir"; \ 313 | $(mkdir_p) "$(distdir)$$dir"; \ 314 | else \ 315 | dir=''; \ 316 | fi; \ 317 | if test -d $$d/$$file; then \ 318 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 319 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ 320 | fi; \ 321 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ 322 | else \ 323 | test -f $(distdir)/$$file \ 324 | || cp -p $$d/$$file $(distdir)/$$file \ 325 | || exit 1; \ 326 | fi; \ 327 | done 328 | check-am: all-am 329 | check: check-am 330 | all-am: Makefile $(PROGRAMS) config.h 331 | installdirs: 332 | for dir in "$(DESTDIR)$(bindir)"; do \ 333 | test -z "$$dir" || $(mkdir_p) "$$dir"; \ 334 | done 335 | install: install-am 336 | install-exec: install-exec-am 337 | install-data: install-data-am 338 | uninstall: uninstall-am 339 | 340 | install-am: all-am 341 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 342 | 343 | installcheck: installcheck-am 344 | install-strip: 345 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 346 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 347 | `test -z '$(STRIP)' || \ 348 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 349 | mostlyclean-generic: 350 | 351 | clean-generic: 352 | 353 | distclean-generic: 354 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 355 | 356 | maintainer-clean-generic: 357 | @echo "This command is intended for maintainers to use" 358 | @echo "it deletes files that may require special tools to rebuild." 359 | clean: clean-am 360 | 361 | clean-am: clean-binPROGRAMS clean-generic mostlyclean-am 362 | 363 | distclean: distclean-am 364 | -rm -rf ./$(DEPDIR) 365 | -rm -f Makefile 366 | distclean-am: clean-am distclean-compile distclean-generic \ 367 | distclean-hdr distclean-tags 368 | 369 | dvi: dvi-am 370 | 371 | dvi-am: 372 | 373 | html: html-am 374 | 375 | info: info-am 376 | 377 | info-am: 378 | 379 | install-data-am: 380 | 381 | install-exec-am: install-binPROGRAMS 382 | 383 | install-info: install-info-am 384 | 385 | install-man: 386 | 387 | installcheck-am: 388 | 389 | maintainer-clean: maintainer-clean-am 390 | -rm -rf ./$(DEPDIR) 391 | -rm -f Makefile 392 | maintainer-clean-am: distclean-am maintainer-clean-generic 393 | 394 | mostlyclean: mostlyclean-am 395 | 396 | mostlyclean-am: mostlyclean-compile mostlyclean-generic 397 | 398 | pdf: pdf-am 399 | 400 | pdf-am: 401 | 402 | ps: ps-am 403 | 404 | ps-am: 405 | 406 | uninstall-am: uninstall-binPROGRAMS uninstall-info-am 407 | 408 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ 409 | clean-generic ctags distclean distclean-compile \ 410 | distclean-generic distclean-hdr distclean-tags distdir dvi \ 411 | dvi-am html html-am info info-am install install-am \ 412 | install-binPROGRAMS install-data install-data-am install-exec \ 413 | install-exec-am install-info install-info-am install-man \ 414 | install-strip installcheck installcheck-am installdirs \ 415 | maintainer-clean maintainer-clean-generic mostlyclean \ 416 | mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ 417 | tags uninstall uninstall-am uninstall-binPROGRAMS \ 418 | uninstall-info-am 419 | 420 | 421 | # this flag is set via "#define FUSE_USE_VERSION XY" in wdfs-main.c 422 | # wdfs_CPPFLAGS = -DFUSE_USE_VERSION= 423 | 424 | # eof 425 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 426 | # Otherwise a system limit (for SysV at least) may be exceeded. 427 | .NOEXPORT: 428 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | -------------------------------------------------------------------------------- /depcomp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # depcomp - compile a program generating dependencies as side-effects 3 | 4 | scriptversion=2005-07-09.11 5 | 6 | # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. 7 | 8 | # This program is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 2, or (at your option) 11 | # any later version. 12 | 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 21 | # 02110-1301, USA. 22 | 23 | # As a special exception to the GNU General Public License, if you 24 | # distribute this file as part of a program that contains a 25 | # configuration script generated by Autoconf, you may include it under 26 | # the same distribution terms that you use for the rest of that program. 27 | 28 | # Originally written by Alexandre Oliva . 29 | 30 | case $1 in 31 | '') 32 | echo "$0: No command. Try \`$0 --help' for more information." 1>&2 33 | exit 1; 34 | ;; 35 | -h | --h*) 36 | cat <<\EOF 37 | Usage: depcomp [--help] [--version] PROGRAM [ARGS] 38 | 39 | Run PROGRAMS ARGS to compile a file, generating dependencies 40 | as side-effects. 41 | 42 | Environment variables: 43 | depmode Dependency tracking mode. 44 | source Source file read by `PROGRAMS ARGS'. 45 | object Object file output by `PROGRAMS ARGS'. 46 | DEPDIR directory where to store dependencies. 47 | depfile Dependency file to output. 48 | tmpdepfile Temporary file to use when outputing dependencies. 49 | libtool Whether libtool is used (yes/no). 50 | 51 | Report bugs to . 52 | EOF 53 | exit $? 54 | ;; 55 | -v | --v*) 56 | echo "depcomp $scriptversion" 57 | exit $? 58 | ;; 59 | esac 60 | 61 | if test -z "$depmode" || test -z "$source" || test -z "$object"; then 62 | echo "depcomp: Variables source, object and depmode must be set" 1>&2 63 | exit 1 64 | fi 65 | 66 | # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. 67 | depfile=${depfile-`echo "$object" | 68 | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} 69 | tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} 70 | 71 | rm -f "$tmpdepfile" 72 | 73 | # Some modes work just like other modes, but use different flags. We 74 | # parameterize here, but still list the modes in the big case below, 75 | # to make depend.m4 easier to write. Note that we *cannot* use a case 76 | # here, because this file can only contain one case statement. 77 | if test "$depmode" = hp; then 78 | # HP compiler uses -M and no extra arg. 79 | gccflag=-M 80 | depmode=gcc 81 | fi 82 | 83 | if test "$depmode" = dashXmstdout; then 84 | # This is just like dashmstdout with a different argument. 85 | dashmflag=-xM 86 | depmode=dashmstdout 87 | fi 88 | 89 | case "$depmode" in 90 | gcc3) 91 | ## gcc 3 implements dependency tracking that does exactly what 92 | ## we want. Yay! Note: for some reason libtool 1.4 doesn't like 93 | ## it if -MD -MP comes after the -MF stuff. Hmm. 94 | "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" 95 | stat=$? 96 | if test $stat -eq 0; then : 97 | else 98 | rm -f "$tmpdepfile" 99 | exit $stat 100 | fi 101 | mv "$tmpdepfile" "$depfile" 102 | ;; 103 | 104 | gcc) 105 | ## There are various ways to get dependency output from gcc. Here's 106 | ## why we pick this rather obscure method: 107 | ## - Don't want to use -MD because we'd like the dependencies to end 108 | ## up in a subdir. Having to rename by hand is ugly. 109 | ## (We might end up doing this anyway to support other compilers.) 110 | ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like 111 | ## -MM, not -M (despite what the docs say). 112 | ## - Using -M directly means running the compiler twice (even worse 113 | ## than renaming). 114 | if test -z "$gccflag"; then 115 | gccflag=-MD, 116 | fi 117 | "$@" -Wp,"$gccflag$tmpdepfile" 118 | stat=$? 119 | if test $stat -eq 0; then : 120 | else 121 | rm -f "$tmpdepfile" 122 | exit $stat 123 | fi 124 | rm -f "$depfile" 125 | echo "$object : \\" > "$depfile" 126 | alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 127 | ## The second -e expression handles DOS-style file names with drive letters. 128 | sed -e 's/^[^:]*: / /' \ 129 | -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" 130 | ## This next piece of magic avoids the `deleted header file' problem. 131 | ## The problem is that when a header file which appears in a .P file 132 | ## is deleted, the dependency causes make to die (because there is 133 | ## typically no way to rebuild the header). We avoid this by adding 134 | ## dummy dependencies for each header file. Too bad gcc doesn't do 135 | ## this for us directly. 136 | tr ' ' ' 137 | ' < "$tmpdepfile" | 138 | ## Some versions of gcc put a space before the `:'. On the theory 139 | ## that the space means something, we add a space to the output as 140 | ## well. 141 | ## Some versions of the HPUX 10.20 sed can't process this invocation 142 | ## correctly. Breaking it into two sed invocations is a workaround. 143 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 144 | rm -f "$tmpdepfile" 145 | ;; 146 | 147 | hp) 148 | # This case exists only to let depend.m4 do its work. It works by 149 | # looking at the text of this script. This case will never be run, 150 | # since it is checked for above. 151 | exit 1 152 | ;; 153 | 154 | sgi) 155 | if test "$libtool" = yes; then 156 | "$@" "-Wp,-MDupdate,$tmpdepfile" 157 | else 158 | "$@" -MDupdate "$tmpdepfile" 159 | fi 160 | stat=$? 161 | if test $stat -eq 0; then : 162 | else 163 | rm -f "$tmpdepfile" 164 | exit $stat 165 | fi 166 | rm -f "$depfile" 167 | 168 | if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files 169 | echo "$object : \\" > "$depfile" 170 | 171 | # Clip off the initial element (the dependent). Don't try to be 172 | # clever and replace this with sed code, as IRIX sed won't handle 173 | # lines with more than a fixed number of characters (4096 in 174 | # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; 175 | # the IRIX cc adds comments like `#:fec' to the end of the 176 | # dependency line. 177 | tr ' ' ' 178 | ' < "$tmpdepfile" \ 179 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ 180 | tr ' 181 | ' ' ' >> $depfile 182 | echo >> $depfile 183 | 184 | # The second pass generates a dummy entry for each header file. 185 | tr ' ' ' 186 | ' < "$tmpdepfile" \ 187 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ 188 | >> $depfile 189 | else 190 | # The sourcefile does not contain any dependencies, so just 191 | # store a dummy comment line, to avoid errors with the Makefile 192 | # "include basename.Plo" scheme. 193 | echo "#dummy" > "$depfile" 194 | fi 195 | rm -f "$tmpdepfile" 196 | ;; 197 | 198 | aix) 199 | # The C for AIX Compiler uses -M and outputs the dependencies 200 | # in a .u file. In older versions, this file always lives in the 201 | # current directory. Also, the AIX compiler puts `$object:' at the 202 | # start of each line; $object doesn't have directory information. 203 | # Version 6 uses the directory in both cases. 204 | stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` 205 | tmpdepfile="$stripped.u" 206 | if test "$libtool" = yes; then 207 | "$@" -Wc,-M 208 | else 209 | "$@" -M 210 | fi 211 | stat=$? 212 | 213 | if test -f "$tmpdepfile"; then : 214 | else 215 | stripped=`echo "$stripped" | sed 's,^.*/,,'` 216 | tmpdepfile="$stripped.u" 217 | fi 218 | 219 | if test $stat -eq 0; then : 220 | else 221 | rm -f "$tmpdepfile" 222 | exit $stat 223 | fi 224 | 225 | if test -f "$tmpdepfile"; then 226 | outname="$stripped.o" 227 | # Each line is of the form `foo.o: dependent.h'. 228 | # Do two passes, one to just change these to 229 | # `$object: dependent.h' and one to simply `dependent.h:'. 230 | sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" 231 | sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" 232 | else 233 | # The sourcefile does not contain any dependencies, so just 234 | # store a dummy comment line, to avoid errors with the Makefile 235 | # "include basename.Plo" scheme. 236 | echo "#dummy" > "$depfile" 237 | fi 238 | rm -f "$tmpdepfile" 239 | ;; 240 | 241 | icc) 242 | # Intel's C compiler understands `-MD -MF file'. However on 243 | # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c 244 | # ICC 7.0 will fill foo.d with something like 245 | # foo.o: sub/foo.c 246 | # foo.o: sub/foo.h 247 | # which is wrong. We want: 248 | # sub/foo.o: sub/foo.c 249 | # sub/foo.o: sub/foo.h 250 | # sub/foo.c: 251 | # sub/foo.h: 252 | # ICC 7.1 will output 253 | # foo.o: sub/foo.c sub/foo.h 254 | # and will wrap long lines using \ : 255 | # foo.o: sub/foo.c ... \ 256 | # sub/foo.h ... \ 257 | # ... 258 | 259 | "$@" -MD -MF "$tmpdepfile" 260 | stat=$? 261 | if test $stat -eq 0; then : 262 | else 263 | rm -f "$tmpdepfile" 264 | exit $stat 265 | fi 266 | rm -f "$depfile" 267 | # Each line is of the form `foo.o: dependent.h', 268 | # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. 269 | # Do two passes, one to just change these to 270 | # `$object: dependent.h' and one to simply `dependent.h:'. 271 | sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" 272 | # Some versions of the HPUX 10.20 sed can't process this invocation 273 | # correctly. Breaking it into two sed invocations is a workaround. 274 | sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | 275 | sed -e 's/$/ :/' >> "$depfile" 276 | rm -f "$tmpdepfile" 277 | ;; 278 | 279 | tru64) 280 | # The Tru64 compiler uses -MD to generate dependencies as a side 281 | # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. 282 | # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 283 | # dependencies in `foo.d' instead, so we check for that too. 284 | # Subdirectories are respected. 285 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 286 | test "x$dir" = "x$object" && dir= 287 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 288 | 289 | if test "$libtool" = yes; then 290 | # With Tru64 cc, shared objects can also be used to make a 291 | # static library. This mecanism is used in libtool 1.4 series to 292 | # handle both shared and static libraries in a single compilation. 293 | # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. 294 | # 295 | # With libtool 1.5 this exception was removed, and libtool now 296 | # generates 2 separate objects for the 2 libraries. These two 297 | # compilations output dependencies in in $dir.libs/$base.o.d and 298 | # in $dir$base.o.d. We have to check for both files, because 299 | # one of the two compilations can be disabled. We should prefer 300 | # $dir$base.o.d over $dir.libs/$base.o.d because the latter is 301 | # automatically cleaned when .libs/ is deleted, while ignoring 302 | # the former would cause a distcleancheck panic. 303 | tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 304 | tmpdepfile2=$dir$base.o.d # libtool 1.5 305 | tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 306 | tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 307 | "$@" -Wc,-MD 308 | else 309 | tmpdepfile1=$dir$base.o.d 310 | tmpdepfile2=$dir$base.d 311 | tmpdepfile3=$dir$base.d 312 | tmpdepfile4=$dir$base.d 313 | "$@" -MD 314 | fi 315 | 316 | stat=$? 317 | if test $stat -eq 0; then : 318 | else 319 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 320 | exit $stat 321 | fi 322 | 323 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 324 | do 325 | test -f "$tmpdepfile" && break 326 | done 327 | if test -f "$tmpdepfile"; then 328 | sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 329 | # That's a tab and a space in the []. 330 | sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 331 | else 332 | echo "#dummy" > "$depfile" 333 | fi 334 | rm -f "$tmpdepfile" 335 | ;; 336 | 337 | #nosideeffect) 338 | # This comment above is used by automake to tell side-effect 339 | # dependency tracking mechanisms from slower ones. 340 | 341 | dashmstdout) 342 | # Important note: in order to support this mode, a compiler *must* 343 | # always write the preprocessed file to stdout, regardless of -o. 344 | "$@" || exit $? 345 | 346 | # Remove the call to Libtool. 347 | if test "$libtool" = yes; then 348 | while test $1 != '--mode=compile'; do 349 | shift 350 | done 351 | shift 352 | fi 353 | 354 | # Remove `-o $object'. 355 | IFS=" " 356 | for arg 357 | do 358 | case $arg in 359 | -o) 360 | shift 361 | ;; 362 | $object) 363 | shift 364 | ;; 365 | *) 366 | set fnord "$@" "$arg" 367 | shift # fnord 368 | shift # $arg 369 | ;; 370 | esac 371 | done 372 | 373 | test -z "$dashmflag" && dashmflag=-M 374 | # Require at least two characters before searching for `:' 375 | # in the target name. This is to cope with DOS-style filenames: 376 | # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. 377 | "$@" $dashmflag | 378 | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" 379 | rm -f "$depfile" 380 | cat < "$tmpdepfile" > "$depfile" 381 | tr ' ' ' 382 | ' < "$tmpdepfile" | \ 383 | ## Some versions of the HPUX 10.20 sed can't process this invocation 384 | ## correctly. Breaking it into two sed invocations is a workaround. 385 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 386 | rm -f "$tmpdepfile" 387 | ;; 388 | 389 | dashXmstdout) 390 | # This case only exists to satisfy depend.m4. It is never actually 391 | # run, as this mode is specially recognized in the preamble. 392 | exit 1 393 | ;; 394 | 395 | makedepend) 396 | "$@" || exit $? 397 | # Remove any Libtool call 398 | if test "$libtool" = yes; then 399 | while test $1 != '--mode=compile'; do 400 | shift 401 | done 402 | shift 403 | fi 404 | # X makedepend 405 | shift 406 | cleared=no 407 | for arg in "$@"; do 408 | case $cleared in 409 | no) 410 | set ""; shift 411 | cleared=yes ;; 412 | esac 413 | case "$arg" in 414 | -D*|-I*) 415 | set fnord "$@" "$arg"; shift ;; 416 | # Strip any option that makedepend may not understand. Remove 417 | # the object too, otherwise makedepend will parse it as a source file. 418 | -*|$object) 419 | ;; 420 | *) 421 | set fnord "$@" "$arg"; shift ;; 422 | esac 423 | done 424 | obj_suffix="`echo $object | sed 's/^.*\././'`" 425 | touch "$tmpdepfile" 426 | ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" 427 | rm -f "$depfile" 428 | cat < "$tmpdepfile" > "$depfile" 429 | sed '1,2d' "$tmpdepfile" | tr ' ' ' 430 | ' | \ 431 | ## Some versions of the HPUX 10.20 sed can't process this invocation 432 | ## correctly. Breaking it into two sed invocations is a workaround. 433 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 434 | rm -f "$tmpdepfile" "$tmpdepfile".bak 435 | ;; 436 | 437 | cpp) 438 | # Important note: in order to support this mode, a compiler *must* 439 | # always write the preprocessed file to stdout. 440 | "$@" || exit $? 441 | 442 | # Remove the call to Libtool. 443 | if test "$libtool" = yes; then 444 | while test $1 != '--mode=compile'; do 445 | shift 446 | done 447 | shift 448 | fi 449 | 450 | # Remove `-o $object'. 451 | IFS=" " 452 | for arg 453 | do 454 | case $arg in 455 | -o) 456 | shift 457 | ;; 458 | $object) 459 | shift 460 | ;; 461 | *) 462 | set fnord "$@" "$arg" 463 | shift # fnord 464 | shift # $arg 465 | ;; 466 | esac 467 | done 468 | 469 | "$@" -E | 470 | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 471 | -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | 472 | sed '$ s: \\$::' > "$tmpdepfile" 473 | rm -f "$depfile" 474 | echo "$object : \\" > "$depfile" 475 | cat < "$tmpdepfile" >> "$depfile" 476 | sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" 477 | rm -f "$tmpdepfile" 478 | ;; 479 | 480 | msvisualcpp) 481 | # Important note: in order to support this mode, a compiler *must* 482 | # always write the preprocessed file to stdout, regardless of -o, 483 | # because we must use -o when running libtool. 484 | "$@" || exit $? 485 | IFS=" " 486 | for arg 487 | do 488 | case "$arg" in 489 | "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") 490 | set fnord "$@" 491 | shift 492 | shift 493 | ;; 494 | *) 495 | set fnord "$@" "$arg" 496 | shift 497 | shift 498 | ;; 499 | esac 500 | done 501 | "$@" -E | 502 | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" 503 | rm -f "$depfile" 504 | echo "$object : \\" > "$depfile" 505 | . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" 506 | echo " " >> "$depfile" 507 | . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" 508 | rm -f "$tmpdepfile" 509 | ;; 510 | 511 | none) 512 | exec "$@" 513 | ;; 514 | 515 | *) 516 | echo "Unknown depmode $depmode" 1>&2 517 | exit 1 518 | ;; 519 | esac 520 | 521 | exit 0 522 | 523 | # Local Variables: 524 | # mode: shell-script 525 | # sh-indentation: 2 526 | # eval: (add-hook 'write-file-hooks 'time-stamp) 527 | # time-stamp-start: "scriptversion=" 528 | # time-stamp-format: "%:y-%02m-%02d.%02H" 529 | # time-stamp-end: "$" 530 | # End: 531 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.9.6 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005 Free Software Foundation, Inc. 6 | # This Makefile.in is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | @SET_MAKE@ 16 | srcdir = @srcdir@ 17 | top_srcdir = @top_srcdir@ 18 | VPATH = @srcdir@ 19 | pkgdatadir = $(datadir)/@PACKAGE@ 20 | pkglibdir = $(libdir)/@PACKAGE@ 21 | pkgincludedir = $(includedir)/@PACKAGE@ 22 | top_builddir = . 23 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 24 | INSTALL = @INSTALL@ 25 | install_sh_DATA = $(install_sh) -c -m 644 26 | install_sh_PROGRAM = $(install_sh) -c 27 | install_sh_SCRIPT = $(install_sh) -c 28 | INSTALL_HEADER = $(INSTALL_DATA) 29 | transform = $(program_transform_name) 30 | NORMAL_INSTALL = : 31 | PRE_INSTALL = : 32 | POST_INSTALL = : 33 | NORMAL_UNINSTALL = : 34 | PRE_UNINSTALL = : 35 | POST_UNINSTALL = : 36 | subdir = . 37 | DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ 38 | $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ 39 | ChangeLog INSTALL NEWS TODO depcomp install-sh missing 40 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 41 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 42 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 43 | $(ACLOCAL_M4) 44 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ 45 | configure.lineno configure.status.lineno 46 | mkinstalldirs = $(install_sh) -d 47 | CONFIG_HEADER = $(top_builddir)/src/config.h 48 | CONFIG_CLEAN_FILES = 49 | SOURCES = 50 | DIST_SOURCES = 51 | RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ 52 | html-recursive info-recursive install-data-recursive \ 53 | install-exec-recursive install-info-recursive \ 54 | install-recursive installcheck-recursive installdirs-recursive \ 55 | pdf-recursive ps-recursive uninstall-info-recursive \ 56 | uninstall-recursive 57 | ETAGS = etags 58 | CTAGS = ctags 59 | DIST_SUBDIRS = $(SUBDIRS) 60 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 61 | distdir = $(PACKAGE)-$(VERSION) 62 | top_distdir = $(distdir) 63 | am__remove_distdir = \ 64 | { test ! -d $(distdir) \ 65 | || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ 66 | && rm -fr $(distdir); }; } 67 | DIST_ARCHIVES = $(distdir).tar.gz 68 | GZIP_ENV = --best 69 | distuninstallcheck_listfiles = find . -type f -print 70 | distcleancheck_listfiles = find . -type f -print 71 | ACLOCAL = @ACLOCAL@ 72 | AMDEP_FALSE = @AMDEP_FALSE@ 73 | AMDEP_TRUE = @AMDEP_TRUE@ 74 | AMTAR = @AMTAR@ 75 | AUTOCONF = @AUTOCONF@ 76 | AUTOHEADER = @AUTOHEADER@ 77 | AUTOMAKE = @AUTOMAKE@ 78 | AWK = @AWK@ 79 | CC = @CC@ 80 | CCDEPMODE = @CCDEPMODE@ 81 | CFLAGS = @CFLAGS@ 82 | CPP = @CPP@ 83 | CPPFLAGS = @CPPFLAGS@ 84 | CYGPATH_W = @CYGPATH_W@ 85 | DEFS = @DEFS@ 86 | DEPDIR = @DEPDIR@ 87 | ECHO_C = @ECHO_C@ 88 | ECHO_N = @ECHO_N@ 89 | ECHO_T = @ECHO_T@ 90 | EGREP = @EGREP@ 91 | EXEEXT = @EXEEXT@ 92 | GREP = @GREP@ 93 | INSTALL_DATA = @INSTALL_DATA@ 94 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 95 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 96 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 97 | LDFLAGS = @LDFLAGS@ 98 | LIBOBJS = @LIBOBJS@ 99 | LIBS = @LIBS@ 100 | LTLIBOBJS = @LTLIBOBJS@ 101 | MAKEINFO = @MAKEINFO@ 102 | OBJEXT = @OBJEXT@ 103 | PACKAGE = @PACKAGE@ 104 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 105 | PACKAGE_NAME = @PACKAGE_NAME@ 106 | PACKAGE_STRING = @PACKAGE_STRING@ 107 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 108 | PACKAGE_VERSION = @PACKAGE_VERSION@ 109 | PATH_SEPARATOR = @PATH_SEPARATOR@ 110 | PKG_CONFIG = @PKG_CONFIG@ 111 | SET_MAKE = @SET_MAKE@ 112 | SHELL = @SHELL@ 113 | STRIP = @STRIP@ 114 | VERSION = @VERSION@ 115 | WDFS_CFLAGS = @WDFS_CFLAGS@ 116 | WDFS_LIBS = @WDFS_LIBS@ 117 | ac_ct_CC = @ac_ct_CC@ 118 | am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ 119 | am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ 120 | am__include = @am__include@ 121 | am__leading_dot = @am__leading_dot@ 122 | am__quote = @am__quote@ 123 | am__tar = @am__tar@ 124 | am__untar = @am__untar@ 125 | bindir = @bindir@ 126 | build_alias = @build_alias@ 127 | datadir = @datadir@ 128 | datarootdir = @datarootdir@ 129 | docdir = @docdir@ 130 | dvidir = @dvidir@ 131 | exec_prefix = @exec_prefix@ 132 | host_alias = @host_alias@ 133 | htmldir = @htmldir@ 134 | includedir = @includedir@ 135 | infodir = @infodir@ 136 | install_sh = @install_sh@ 137 | libdir = @libdir@ 138 | libexecdir = @libexecdir@ 139 | localedir = @localedir@ 140 | localstatedir = @localstatedir@ 141 | mandir = @mandir@ 142 | mkdir_p = @mkdir_p@ 143 | oldincludedir = @oldincludedir@ 144 | pdfdir = @pdfdir@ 145 | prefix = @prefix@ 146 | program_transform_name = @program_transform_name@ 147 | psdir = @psdir@ 148 | sbindir = @sbindir@ 149 | sharedstatedir = @sharedstatedir@ 150 | sysconfdir = @sysconfdir@ 151 | target_alias = @target_alias@ 152 | SUBDIRS = src 153 | all: all-recursive 154 | 155 | .SUFFIXES: 156 | am--refresh: 157 | @: 158 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 159 | @for dep in $?; do \ 160 | case '$(am__configure_deps)' in \ 161 | *$$dep*) \ 162 | echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ 163 | cd $(srcdir) && $(AUTOMAKE) --gnu \ 164 | && exit 0; \ 165 | exit 1;; \ 166 | esac; \ 167 | done; \ 168 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ 169 | cd $(top_srcdir) && \ 170 | $(AUTOMAKE) --gnu Makefile 171 | .PRECIOUS: Makefile 172 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 173 | @case '$?' in \ 174 | *config.status*) \ 175 | echo ' $(SHELL) ./config.status'; \ 176 | $(SHELL) ./config.status;; \ 177 | *) \ 178 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ 179 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ 180 | esac; 181 | 182 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 183 | $(SHELL) ./config.status --recheck 184 | 185 | $(top_srcdir)/configure: $(am__configure_deps) 186 | cd $(srcdir) && $(AUTOCONF) 187 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 188 | cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 189 | uninstall-info-am: 190 | 191 | # This directory's subdirectories are mostly independent; you can cd 192 | # into them and run `make' without going through this Makefile. 193 | # To change the values of `make' variables: instead of editing Makefiles, 194 | # (1) if the variable is set in `config.status', edit `config.status' 195 | # (which will cause the Makefiles to be regenerated when you run `make'); 196 | # (2) otherwise, pass the desired values on the `make' command line. 197 | $(RECURSIVE_TARGETS): 198 | @failcom='exit 1'; \ 199 | for f in x $$MAKEFLAGS; do \ 200 | case $$f in \ 201 | *=* | --[!k]*);; \ 202 | *k*) failcom='fail=yes';; \ 203 | esac; \ 204 | done; \ 205 | dot_seen=no; \ 206 | target=`echo $@ | sed s/-recursive//`; \ 207 | list='$(SUBDIRS)'; for subdir in $$list; do \ 208 | echo "Making $$target in $$subdir"; \ 209 | if test "$$subdir" = "."; then \ 210 | dot_seen=yes; \ 211 | local_target="$$target-am"; \ 212 | else \ 213 | local_target="$$target"; \ 214 | fi; \ 215 | (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 216 | || eval $$failcom; \ 217 | done; \ 218 | if test "$$dot_seen" = "no"; then \ 219 | $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ 220 | fi; test -z "$$fail" 221 | 222 | mostlyclean-recursive clean-recursive distclean-recursive \ 223 | maintainer-clean-recursive: 224 | @failcom='exit 1'; \ 225 | for f in x $$MAKEFLAGS; do \ 226 | case $$f in \ 227 | *=* | --[!k]*);; \ 228 | *k*) failcom='fail=yes';; \ 229 | esac; \ 230 | done; \ 231 | dot_seen=no; \ 232 | case "$@" in \ 233 | distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ 234 | *) list='$(SUBDIRS)' ;; \ 235 | esac; \ 236 | rev=''; for subdir in $$list; do \ 237 | if test "$$subdir" = "."; then :; else \ 238 | rev="$$subdir $$rev"; \ 239 | fi; \ 240 | done; \ 241 | rev="$$rev ."; \ 242 | target=`echo $@ | sed s/-recursive//`; \ 243 | for subdir in $$rev; do \ 244 | echo "Making $$target in $$subdir"; \ 245 | if test "$$subdir" = "."; then \ 246 | local_target="$$target-am"; \ 247 | else \ 248 | local_target="$$target"; \ 249 | fi; \ 250 | (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 251 | || eval $$failcom; \ 252 | done && test -z "$$fail" 253 | tags-recursive: 254 | list='$(SUBDIRS)'; for subdir in $$list; do \ 255 | test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ 256 | done 257 | ctags-recursive: 258 | list='$(SUBDIRS)'; for subdir in $$list; do \ 259 | test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ 260 | done 261 | 262 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 263 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 264 | unique=`for i in $$list; do \ 265 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 266 | done | \ 267 | $(AWK) ' { files[$$0] = 1; } \ 268 | END { for (i in files) print i; }'`; \ 269 | mkid -fID $$unique 270 | tags: TAGS 271 | 272 | TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 273 | $(TAGS_FILES) $(LISP) 274 | tags=; \ 275 | here=`pwd`; \ 276 | if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ 277 | include_option=--etags-include; \ 278 | empty_fix=.; \ 279 | else \ 280 | include_option=--include; \ 281 | empty_fix=; \ 282 | fi; \ 283 | list='$(SUBDIRS)'; for subdir in $$list; do \ 284 | if test "$$subdir" = .; then :; else \ 285 | test ! -f $$subdir/TAGS || \ 286 | tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ 287 | fi; \ 288 | done; \ 289 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 290 | unique=`for i in $$list; do \ 291 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 292 | done | \ 293 | $(AWK) ' { files[$$0] = 1; } \ 294 | END { for (i in files) print i; }'`; \ 295 | if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ 296 | test -n "$$unique" || unique=$$empty_fix; \ 297 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 298 | $$tags $$unique; \ 299 | fi 300 | ctags: CTAGS 301 | CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 302 | $(TAGS_FILES) $(LISP) 303 | tags=; \ 304 | here=`pwd`; \ 305 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 306 | unique=`for i in $$list; do \ 307 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 308 | done | \ 309 | $(AWK) ' { files[$$0] = 1; } \ 310 | END { for (i in files) print i; }'`; \ 311 | test -z "$(CTAGS_ARGS)$$tags$$unique" \ 312 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 313 | $$tags $$unique 314 | 315 | GTAGS: 316 | here=`$(am__cd) $(top_builddir) && pwd` \ 317 | && cd $(top_srcdir) \ 318 | && gtags -i $(GTAGS_ARGS) $$here 319 | 320 | distclean-tags: 321 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 322 | 323 | distdir: $(DISTFILES) 324 | $(am__remove_distdir) 325 | mkdir $(distdir) 326 | @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ 327 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ 328 | list='$(DISTFILES)'; for file in $$list; do \ 329 | case $$file in \ 330 | $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ 331 | $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ 332 | esac; \ 333 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 334 | dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ 335 | if test "$$dir" != "$$file" && test "$$dir" != "."; then \ 336 | dir="/$$dir"; \ 337 | $(mkdir_p) "$(distdir)$$dir"; \ 338 | else \ 339 | dir=''; \ 340 | fi; \ 341 | if test -d $$d/$$file; then \ 342 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 343 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ 344 | fi; \ 345 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ 346 | else \ 347 | test -f $(distdir)/$$file \ 348 | || cp -p $$d/$$file $(distdir)/$$file \ 349 | || exit 1; \ 350 | fi; \ 351 | done 352 | list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 353 | if test "$$subdir" = .; then :; else \ 354 | test -d "$(distdir)/$$subdir" \ 355 | || $(mkdir_p) "$(distdir)/$$subdir" \ 356 | || exit 1; \ 357 | distdir=`$(am__cd) $(distdir) && pwd`; \ 358 | top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ 359 | (cd $$subdir && \ 360 | $(MAKE) $(AM_MAKEFLAGS) \ 361 | top_distdir="$$top_distdir" \ 362 | distdir="$$distdir/$$subdir" \ 363 | distdir) \ 364 | || exit 1; \ 365 | fi; \ 366 | done 367 | -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ 368 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ 369 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ 370 | ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ 371 | || chmod -R a+r $(distdir) 372 | dist-gzip: distdir 373 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 374 | $(am__remove_distdir) 375 | 376 | dist-bzip2: distdir 377 | tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 378 | $(am__remove_distdir) 379 | 380 | dist-tarZ: distdir 381 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z 382 | $(am__remove_distdir) 383 | 384 | dist-shar: distdir 385 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz 386 | $(am__remove_distdir) 387 | 388 | dist-zip: distdir 389 | -rm -f $(distdir).zip 390 | zip -rq $(distdir).zip $(distdir) 391 | $(am__remove_distdir) 392 | 393 | dist dist-all: distdir 394 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 395 | $(am__remove_distdir) 396 | 397 | # This target untars the dist file and tries a VPATH configuration. Then 398 | # it guarantees that the distribution is self-contained by making another 399 | # tarfile. 400 | distcheck: dist 401 | case '$(DIST_ARCHIVES)' in \ 402 | *.tar.gz*) \ 403 | GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ 404 | *.tar.bz2*) \ 405 | bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ 406 | *.tar.Z*) \ 407 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ 408 | *.shar.gz*) \ 409 | GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ 410 | *.zip*) \ 411 | unzip $(distdir).zip ;;\ 412 | esac 413 | chmod -R a-w $(distdir); chmod a+w $(distdir) 414 | mkdir $(distdir)/_build 415 | mkdir $(distdir)/_inst 416 | chmod a-w $(distdir) 417 | dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ 418 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ 419 | && cd $(distdir)/_build \ 420 | && ../configure --srcdir=.. --prefix="$$dc_install_base" \ 421 | $(DISTCHECK_CONFIGURE_FLAGS) \ 422 | && $(MAKE) $(AM_MAKEFLAGS) \ 423 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ 424 | && $(MAKE) $(AM_MAKEFLAGS) check \ 425 | && $(MAKE) $(AM_MAKEFLAGS) install \ 426 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ 427 | && $(MAKE) $(AM_MAKEFLAGS) uninstall \ 428 | && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ 429 | distuninstallcheck \ 430 | && chmod -R a-w "$$dc_install_base" \ 431 | && ({ \ 432 | (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ 433 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ 434 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ 435 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ 436 | distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ 437 | } || { rm -rf "$$dc_destdir"; exit 1; }) \ 438 | && rm -rf "$$dc_destdir" \ 439 | && $(MAKE) $(AM_MAKEFLAGS) dist \ 440 | && rm -rf $(DIST_ARCHIVES) \ 441 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck 442 | $(am__remove_distdir) 443 | @(echo "$(distdir) archives ready for distribution: "; \ 444 | list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ 445 | sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' 446 | distuninstallcheck: 447 | @cd $(distuninstallcheck_dir) \ 448 | && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ 449 | || { echo "ERROR: files left after uninstall:" ; \ 450 | if test -n "$(DESTDIR)"; then \ 451 | echo " (check DESTDIR support)"; \ 452 | fi ; \ 453 | $(distuninstallcheck_listfiles) ; \ 454 | exit 1; } >&2 455 | distcleancheck: distclean 456 | @if test '$(srcdir)' = . ; then \ 457 | echo "ERROR: distcleancheck can only run from a VPATH build" ; \ 458 | exit 1 ; \ 459 | fi 460 | @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ 461 | || { echo "ERROR: files left in build directory after distclean:" ; \ 462 | $(distcleancheck_listfiles) ; \ 463 | exit 1; } >&2 464 | check-am: all-am 465 | check: check-recursive 466 | all-am: Makefile 467 | installdirs: installdirs-recursive 468 | installdirs-am: 469 | install: install-recursive 470 | install-exec: install-exec-recursive 471 | install-data: install-data-recursive 472 | uninstall: uninstall-recursive 473 | 474 | install-am: all-am 475 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 476 | 477 | installcheck: installcheck-recursive 478 | install-strip: 479 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 480 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 481 | `test -z '$(STRIP)' || \ 482 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 483 | mostlyclean-generic: 484 | 485 | clean-generic: 486 | 487 | distclean-generic: 488 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 489 | 490 | maintainer-clean-generic: 491 | @echo "This command is intended for maintainers to use" 492 | @echo "it deletes files that may require special tools to rebuild." 493 | clean: clean-recursive 494 | 495 | clean-am: clean-generic mostlyclean-am 496 | 497 | distclean: distclean-recursive 498 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 499 | -rm -f Makefile 500 | distclean-am: clean-am distclean-generic distclean-tags 501 | 502 | dvi: dvi-recursive 503 | 504 | dvi-am: 505 | 506 | html: html-recursive 507 | 508 | info: info-recursive 509 | 510 | info-am: 511 | 512 | install-data-am: 513 | 514 | install-exec-am: 515 | 516 | install-info: install-info-recursive 517 | 518 | install-man: 519 | 520 | installcheck-am: 521 | 522 | maintainer-clean: maintainer-clean-recursive 523 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 524 | -rm -rf $(top_srcdir)/autom4te.cache 525 | -rm -f Makefile 526 | maintainer-clean-am: distclean-am maintainer-clean-generic 527 | 528 | mostlyclean: mostlyclean-recursive 529 | 530 | mostlyclean-am: mostlyclean-generic 531 | 532 | pdf: pdf-recursive 533 | 534 | pdf-am: 535 | 536 | ps: ps-recursive 537 | 538 | ps-am: 539 | 540 | uninstall-am: uninstall-info-am 541 | 542 | uninstall-info: uninstall-info-recursive 543 | 544 | .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ 545 | check-am clean clean-generic clean-recursive ctags \ 546 | ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ 547 | dist-tarZ dist-zip distcheck distclean distclean-generic \ 548 | distclean-recursive distclean-tags distcleancheck distdir \ 549 | distuninstallcheck dvi dvi-am html html-am info info-am \ 550 | install install-am install-data install-data-am install-exec \ 551 | install-exec-am install-info install-info-am install-man \ 552 | install-strip installcheck installcheck-am installdirs \ 553 | installdirs-am maintainer-clean maintainer-clean-generic \ 554 | maintainer-clean-recursive mostlyclean mostlyclean-generic \ 555 | mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ 556 | uninstall uninstall-am uninstall-info-am 557 | 558 | 559 | # eof 560 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 561 | # Otherwise a system limit (for SysV at least) may be exceeded. 562 | .NOEXPORT: 563 | -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | # generated automatically by aclocal 1.9.6 -*- Autoconf -*- 2 | 3 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4 | # 2005 Free Software Foundation, Inc. 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | # PARTICULAR PURPOSE. 13 | 14 | # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 15 | # 16 | # Copyright © 2004 Scott James Remnant . 17 | # 18 | # This program is free software; you can redistribute it and/or modify 19 | # it under the terms of the GNU General Public License as published by 20 | # the Free Software Foundation; either version 2 of the License, or 21 | # (at your option) any later version. 22 | # 23 | # This program is distributed in the hope that it will be useful, but 24 | # WITHOUT ANY WARRANTY; without even the implied warranty of 25 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 26 | # General Public License for more details. 27 | # 28 | # You should have received a copy of the GNU General Public License 29 | # along with this program; if not, write to the Free Software 30 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 31 | # 32 | # As a special exception to the GNU General Public License, if you 33 | # distribute this file as part of a program that contains a 34 | # configuration script generated by Autoconf, you may include it under 35 | # the same distribution terms that you use for the rest of that program. 36 | 37 | # PKG_PROG_PKG_CONFIG([MIN-VERSION]) 38 | # ---------------------------------- 39 | AC_DEFUN([PKG_PROG_PKG_CONFIG], 40 | [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 41 | m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 42 | AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 43 | if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 44 | AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 45 | fi 46 | if test -n "$PKG_CONFIG"; then 47 | _pkg_min_version=m4_default([$1], [0.9.0]) 48 | AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 49 | if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 50 | AC_MSG_RESULT([yes]) 51 | else 52 | AC_MSG_RESULT([no]) 53 | PKG_CONFIG="" 54 | fi 55 | 56 | fi[]dnl 57 | ])# PKG_PROG_PKG_CONFIG 58 | 59 | # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 60 | # 61 | # Check to see whether a particular set of modules exists. Similar 62 | # to PKG_CHECK_MODULES(), but does not set variables or print errors. 63 | # 64 | # 65 | # Similar to PKG_CHECK_MODULES, make sure that the first instance of 66 | # this or PKG_CHECK_MODULES is called, or make sure to call 67 | # PKG_CHECK_EXISTS manually 68 | # -------------------------------------------------------------- 69 | AC_DEFUN([PKG_CHECK_EXISTS], 70 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 71 | if test -n "$PKG_CONFIG" && \ 72 | AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 73 | m4_ifval([$2], [$2], [:]) 74 | m4_ifvaln([$3], [else 75 | $3])dnl 76 | fi]) 77 | 78 | 79 | # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 80 | # --------------------------------------------- 81 | m4_define([_PKG_CONFIG], 82 | [if test -n "$PKG_CONFIG"; then 83 | if test -n "$$1"; then 84 | pkg_cv_[]$1="$$1" 85 | else 86 | PKG_CHECK_EXISTS([$3], 87 | [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 88 | [pkg_failed=yes]) 89 | fi 90 | else 91 | pkg_failed=untried 92 | fi[]dnl 93 | ])# _PKG_CONFIG 94 | 95 | # _PKG_SHORT_ERRORS_SUPPORTED 96 | # ----------------------------- 97 | AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 98 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 99 | if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 100 | _pkg_short_errors_supported=yes 101 | else 102 | _pkg_short_errors_supported=no 103 | fi[]dnl 104 | ])# _PKG_SHORT_ERRORS_SUPPORTED 105 | 106 | 107 | # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 108 | # [ACTION-IF-NOT-FOUND]) 109 | # 110 | # 111 | # Note that if there is a possibility the first call to 112 | # PKG_CHECK_MODULES might not happen, you should be sure to include an 113 | # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 114 | # 115 | # 116 | # -------------------------------------------------------------- 117 | AC_DEFUN([PKG_CHECK_MODULES], 118 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 119 | AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 120 | AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 121 | 122 | pkg_failed=no 123 | AC_MSG_CHECKING([for $1]) 124 | 125 | _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 126 | _PKG_CONFIG([$1][_LIBS], [libs], [$2]) 127 | 128 | m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 129 | and $1[]_LIBS to avoid the need to call pkg-config. 130 | See the pkg-config man page for more details.]) 131 | 132 | if test $pkg_failed = yes; then 133 | _PKG_SHORT_ERRORS_SUPPORTED 134 | if test $_pkg_short_errors_supported = yes; then 135 | $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` 136 | else 137 | $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` 138 | fi 139 | # Put the nasty error message in config.log where it belongs 140 | echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 141 | 142 | ifelse([$4], , [AC_MSG_ERROR(dnl 143 | [Package requirements ($2) were not met: 144 | 145 | $$1_PKG_ERRORS 146 | 147 | Consider adjusting the PKG_CONFIG_PATH environment variable if you 148 | installed software in a non-standard prefix. 149 | 150 | _PKG_TEXT 151 | ])], 152 | [AC_MSG_RESULT([no]) 153 | $4]) 154 | elif test $pkg_failed = untried; then 155 | ifelse([$4], , [AC_MSG_FAILURE(dnl 156 | [The pkg-config script could not be found or is too old. Make sure it 157 | is in your PATH or set the PKG_CONFIG environment variable to the full 158 | path to pkg-config. 159 | 160 | _PKG_TEXT 161 | 162 | To get pkg-config, see .])], 163 | [$4]) 164 | else 165 | $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 166 | $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 167 | AC_MSG_RESULT([yes]) 168 | ifelse([$3], , :, [$3]) 169 | fi[]dnl 170 | ])# PKG_CHECK_MODULES 171 | 172 | # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. 173 | # 174 | # This file is free software; the Free Software Foundation 175 | # gives unlimited permission to copy and/or distribute it, 176 | # with or without modifications, as long as this notice is preserved. 177 | 178 | # AM_AUTOMAKE_VERSION(VERSION) 179 | # ---------------------------- 180 | # Automake X.Y traces this macro to ensure aclocal.m4 has been 181 | # generated from the m4 files accompanying Automake X.Y. 182 | AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) 183 | 184 | # AM_SET_CURRENT_AUTOMAKE_VERSION 185 | # ------------------------------- 186 | # Call AM_AUTOMAKE_VERSION so it can be traced. 187 | # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. 188 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 189 | [AM_AUTOMAKE_VERSION([1.9.6])]) 190 | 191 | # AM_AUX_DIR_EXPAND -*- Autoconf -*- 192 | 193 | # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 194 | # 195 | # This file is free software; the Free Software Foundation 196 | # gives unlimited permission to copy and/or distribute it, 197 | # with or without modifications, as long as this notice is preserved. 198 | 199 | # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 200 | # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 201 | # `$srcdir', `$srcdir/..', or `$srcdir/../..'. 202 | # 203 | # Of course, Automake must honor this variable whenever it calls a 204 | # tool from the auxiliary directory. The problem is that $srcdir (and 205 | # therefore $ac_aux_dir as well) can be either absolute or relative, 206 | # depending on how configure is run. This is pretty annoying, since 207 | # it makes $ac_aux_dir quite unusable in subdirectories: in the top 208 | # source directory, any form will work fine, but in subdirectories a 209 | # relative path needs to be adjusted first. 210 | # 211 | # $ac_aux_dir/missing 212 | # fails when called from a subdirectory if $ac_aux_dir is relative 213 | # $top_srcdir/$ac_aux_dir/missing 214 | # fails if $ac_aux_dir is absolute, 215 | # fails when called from a subdirectory in a VPATH build with 216 | # a relative $ac_aux_dir 217 | # 218 | # The reason of the latter failure is that $top_srcdir and $ac_aux_dir 219 | # are both prefixed by $srcdir. In an in-source build this is usually 220 | # harmless because $srcdir is `.', but things will broke when you 221 | # start a VPATH build or use an absolute $srcdir. 222 | # 223 | # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 224 | # iff we strip the leading $srcdir from $ac_aux_dir. That would be: 225 | # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 226 | # and then we would define $MISSING as 227 | # MISSING="\${SHELL} $am_aux_dir/missing" 228 | # This will work as long as MISSING is not called from configure, because 229 | # unfortunately $(top_srcdir) has no meaning in configure. 230 | # However there are other variables, like CC, which are often used in 231 | # configure, and could therefore not use this "fixed" $ac_aux_dir. 232 | # 233 | # Another solution, used here, is to always expand $ac_aux_dir to an 234 | # absolute PATH. The drawback is that using absolute paths prevent a 235 | # configured tree to be moved without reconfiguration. 236 | 237 | AC_DEFUN([AM_AUX_DIR_EXPAND], 238 | [dnl Rely on autoconf to set up CDPATH properly. 239 | AC_PREREQ([2.50])dnl 240 | # expand $ac_aux_dir to an absolute path 241 | am_aux_dir=`cd $ac_aux_dir && pwd` 242 | ]) 243 | 244 | # AM_CONDITIONAL -*- Autoconf -*- 245 | 246 | # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 247 | # Free Software Foundation, Inc. 248 | # 249 | # This file is free software; the Free Software Foundation 250 | # gives unlimited permission to copy and/or distribute it, 251 | # with or without modifications, as long as this notice is preserved. 252 | 253 | # serial 7 254 | 255 | # AM_CONDITIONAL(NAME, SHELL-CONDITION) 256 | # ------------------------------------- 257 | # Define a conditional. 258 | AC_DEFUN([AM_CONDITIONAL], 259 | [AC_PREREQ(2.52)dnl 260 | ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 261 | [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 262 | AC_SUBST([$1_TRUE]) 263 | AC_SUBST([$1_FALSE]) 264 | if $2; then 265 | $1_TRUE= 266 | $1_FALSE='#' 267 | else 268 | $1_TRUE='#' 269 | $1_FALSE= 270 | fi 271 | AC_CONFIG_COMMANDS_PRE( 272 | [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 273 | AC_MSG_ERROR([[conditional "$1" was never defined. 274 | Usually this means the macro was only invoked conditionally.]]) 275 | fi])]) 276 | 277 | 278 | # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 279 | # Free Software Foundation, Inc. 280 | # 281 | # This file is free software; the Free Software Foundation 282 | # gives unlimited permission to copy and/or distribute it, 283 | # with or without modifications, as long as this notice is preserved. 284 | 285 | # serial 8 286 | 287 | # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 288 | # written in clear, in which case automake, when reading aclocal.m4, 289 | # will think it sees a *use*, and therefore will trigger all it's 290 | # C support machinery. Also note that it means that autoscan, seeing 291 | # CC etc. in the Makefile, will ask for an AC_PROG_CC use... 292 | 293 | 294 | # _AM_DEPENDENCIES(NAME) 295 | # ---------------------- 296 | # See how the compiler implements dependency checking. 297 | # NAME is "CC", "CXX", "GCJ", or "OBJC". 298 | # We try a few techniques and use that to set a single cache variable. 299 | # 300 | # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 301 | # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 302 | # dependency, and given that the user is not expected to run this macro, 303 | # just rely on AC_PROG_CC. 304 | AC_DEFUN([_AM_DEPENDENCIES], 305 | [AC_REQUIRE([AM_SET_DEPDIR])dnl 306 | AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 307 | AC_REQUIRE([AM_MAKE_INCLUDE])dnl 308 | AC_REQUIRE([AM_DEP_TRACK])dnl 309 | 310 | ifelse([$1], CC, [depcc="$CC" am_compiler_list=], 311 | [$1], CXX, [depcc="$CXX" am_compiler_list=], 312 | [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 313 | [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 314 | [depcc="$$1" am_compiler_list=]) 315 | 316 | AC_CACHE_CHECK([dependency style of $depcc], 317 | [am_cv_$1_dependencies_compiler_type], 318 | [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 319 | # We make a subdir and do the tests there. Otherwise we can end up 320 | # making bogus files that we don't know about and never remove. For 321 | # instance it was reported that on HP-UX the gcc test will end up 322 | # making a dummy file named `D' -- because `-MD' means `put the output 323 | # in D'. 324 | mkdir conftest.dir 325 | # Copy depcomp to subdir because otherwise we won't find it if we're 326 | # using a relative directory. 327 | cp "$am_depcomp" conftest.dir 328 | cd conftest.dir 329 | # We will build objects and dependencies in a subdirectory because 330 | # it helps to detect inapplicable dependency modes. For instance 331 | # both Tru64's cc and ICC support -MD to output dependencies as a 332 | # side effect of compilation, but ICC will put the dependencies in 333 | # the current directory while Tru64 will put them in the object 334 | # directory. 335 | mkdir sub 336 | 337 | am_cv_$1_dependencies_compiler_type=none 338 | if test "$am_compiler_list" = ""; then 339 | am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 340 | fi 341 | for depmode in $am_compiler_list; do 342 | # Setup a source with many dependencies, because some compilers 343 | # like to wrap large dependency lists on column 80 (with \), and 344 | # we should not choose a depcomp mode which is confused by this. 345 | # 346 | # We need to recreate these files for each test, as the compiler may 347 | # overwrite some of them when testing with obscure command lines. 348 | # This happens at least with the AIX C compiler. 349 | : > sub/conftest.c 350 | for i in 1 2 3 4 5 6; do 351 | echo '#include "conftst'$i'.h"' >> sub/conftest.c 352 | # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 353 | # Solaris 8's {/usr,}/bin/sh. 354 | touch sub/conftst$i.h 355 | done 356 | echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 357 | 358 | case $depmode in 359 | nosideeffect) 360 | # after this tag, mechanisms are not by side-effect, so they'll 361 | # only be used when explicitly requested 362 | if test "x$enable_dependency_tracking" = xyes; then 363 | continue 364 | else 365 | break 366 | fi 367 | ;; 368 | none) break ;; 369 | esac 370 | # We check with `-c' and `-o' for the sake of the "dashmstdout" 371 | # mode. It turns out that the SunPro C++ compiler does not properly 372 | # handle `-M -o', and we need to detect this. 373 | if depmode=$depmode \ 374 | source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ 375 | depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 376 | $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ 377 | >/dev/null 2>conftest.err && 378 | grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 379 | grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && 380 | ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 381 | # icc doesn't choke on unknown options, it will just issue warnings 382 | # or remarks (even with -Werror). So we grep stderr for any message 383 | # that says an option was ignored or not supported. 384 | # When given -MP, icc 7.0 and 7.1 complain thusly: 385 | # icc: Command line warning: ignoring option '-M'; no argument required 386 | # The diagnosis changed in icc 8.0: 387 | # icc: Command line remark: option '-MP' not supported 388 | if (grep 'ignoring option' conftest.err || 389 | grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 390 | am_cv_$1_dependencies_compiler_type=$depmode 391 | break 392 | fi 393 | fi 394 | done 395 | 396 | cd .. 397 | rm -rf conftest.dir 398 | else 399 | am_cv_$1_dependencies_compiler_type=none 400 | fi 401 | ]) 402 | AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 403 | AM_CONDITIONAL([am__fastdep$1], [ 404 | test "x$enable_dependency_tracking" != xno \ 405 | && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 406 | ]) 407 | 408 | 409 | # AM_SET_DEPDIR 410 | # ------------- 411 | # Choose a directory name for dependency files. 412 | # This macro is AC_REQUIREd in _AM_DEPENDENCIES 413 | AC_DEFUN([AM_SET_DEPDIR], 414 | [AC_REQUIRE([AM_SET_LEADING_DOT])dnl 415 | AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 416 | ]) 417 | 418 | 419 | # AM_DEP_TRACK 420 | # ------------ 421 | AC_DEFUN([AM_DEP_TRACK], 422 | [AC_ARG_ENABLE(dependency-tracking, 423 | [ --disable-dependency-tracking speeds up one-time build 424 | --enable-dependency-tracking do not reject slow dependency extractors]) 425 | if test "x$enable_dependency_tracking" != xno; then 426 | am_depcomp="$ac_aux_dir/depcomp" 427 | AMDEPBACKSLASH='\' 428 | fi 429 | AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 430 | AC_SUBST([AMDEPBACKSLASH]) 431 | ]) 432 | 433 | # Generate code to set up dependency tracking. -*- Autoconf -*- 434 | 435 | # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 436 | # Free Software Foundation, Inc. 437 | # 438 | # This file is free software; the Free Software Foundation 439 | # gives unlimited permission to copy and/or distribute it, 440 | # with or without modifications, as long as this notice is preserved. 441 | 442 | #serial 3 443 | 444 | # _AM_OUTPUT_DEPENDENCY_COMMANDS 445 | # ------------------------------ 446 | AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 447 | [for mf in $CONFIG_FILES; do 448 | # Strip MF so we end up with the name of the file. 449 | mf=`echo "$mf" | sed -e 's/:.*$//'` 450 | # Check whether this is an Automake generated Makefile or not. 451 | # We used to match only the files named `Makefile.in', but 452 | # some people rename them; so instead we look at the file content. 453 | # Grep'ing the first line is not enough: some people post-process 454 | # each Makefile.in and add a new line on top of each file to say so. 455 | # So let's grep whole file. 456 | if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then 457 | dirpart=`AS_DIRNAME("$mf")` 458 | else 459 | continue 460 | fi 461 | # Extract the definition of DEPDIR, am__include, and am__quote 462 | # from the Makefile without running `make'. 463 | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 464 | test -z "$DEPDIR" && continue 465 | am__include=`sed -n 's/^am__include = //p' < "$mf"` 466 | test -z "am__include" && continue 467 | am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 468 | # When using ansi2knr, U may be empty or an underscore; expand it 469 | U=`sed -n 's/^U = //p' < "$mf"` 470 | # Find all dependency output files, they are included files with 471 | # $(DEPDIR) in their names. We invoke sed twice because it is the 472 | # simplest approach to changing $(DEPDIR) to its actual value in the 473 | # expansion. 474 | for file in `sed -n " 475 | s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 476 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 477 | # Make sure the directory exists. 478 | test -f "$dirpart/$file" && continue 479 | fdir=`AS_DIRNAME(["$file"])` 480 | AS_MKDIR_P([$dirpart/$fdir]) 481 | # echo "creating $dirpart/$file" 482 | echo '# dummy' > "$dirpart/$file" 483 | done 484 | done 485 | ])# _AM_OUTPUT_DEPENDENCY_COMMANDS 486 | 487 | 488 | # AM_OUTPUT_DEPENDENCY_COMMANDS 489 | # ----------------------------- 490 | # This macro should only be invoked once -- use via AC_REQUIRE. 491 | # 492 | # This code is only required when automatic dependency tracking 493 | # is enabled. FIXME. This creates each `.P' file that we will 494 | # need in order to bootstrap the dependency handling code. 495 | AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 496 | [AC_CONFIG_COMMANDS([depfiles], 497 | [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 498 | [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 499 | ]) 500 | 501 | # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 502 | # Free Software Foundation, Inc. 503 | # 504 | # This file is free software; the Free Software Foundation 505 | # gives unlimited permission to copy and/or distribute it, 506 | # with or without modifications, as long as this notice is preserved. 507 | 508 | # serial 8 509 | 510 | # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. 511 | AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) 512 | 513 | # Do all the work for Automake. -*- Autoconf -*- 514 | 515 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 516 | # Free Software Foundation, Inc. 517 | # 518 | # This file is free software; the Free Software Foundation 519 | # gives unlimited permission to copy and/or distribute it, 520 | # with or without modifications, as long as this notice is preserved. 521 | 522 | # serial 12 523 | 524 | # This macro actually does too much. Some checks are only needed if 525 | # your package does certain things. But this isn't really a big deal. 526 | 527 | # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 528 | # AM_INIT_AUTOMAKE([OPTIONS]) 529 | # ----------------------------------------------- 530 | # The call with PACKAGE and VERSION arguments is the old style 531 | # call (pre autoconf-2.50), which is being phased out. PACKAGE 532 | # and VERSION should now be passed to AC_INIT and removed from 533 | # the call to AM_INIT_AUTOMAKE. 534 | # We support both call styles for the transition. After 535 | # the next Automake release, Autoconf can make the AC_INIT 536 | # arguments mandatory, and then we can depend on a new Autoconf 537 | # release and drop the old call support. 538 | AC_DEFUN([AM_INIT_AUTOMAKE], 539 | [AC_PREREQ([2.58])dnl 540 | dnl Autoconf wants to disallow AM_ names. We explicitly allow 541 | dnl the ones we care about. 542 | m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 543 | AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 544 | AC_REQUIRE([AC_PROG_INSTALL])dnl 545 | # test to see if srcdir already configured 546 | if test "`cd $srcdir && pwd`" != "`pwd`" && 547 | test -f $srcdir/config.status; then 548 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 549 | fi 550 | 551 | # test whether we have cygpath 552 | if test -z "$CYGPATH_W"; then 553 | if (cygpath --version) >/dev/null 2>/dev/null; then 554 | CYGPATH_W='cygpath -w' 555 | else 556 | CYGPATH_W=echo 557 | fi 558 | fi 559 | AC_SUBST([CYGPATH_W]) 560 | 561 | # Define the identity of the package. 562 | dnl Distinguish between old-style and new-style calls. 563 | m4_ifval([$2], 564 | [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 565 | AC_SUBST([PACKAGE], [$1])dnl 566 | AC_SUBST([VERSION], [$2])], 567 | [_AM_SET_OPTIONS([$1])dnl 568 | AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 569 | AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 570 | 571 | _AM_IF_OPTION([no-define],, 572 | [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 573 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 574 | 575 | # Some tools Automake needs. 576 | AC_REQUIRE([AM_SANITY_CHECK])dnl 577 | AC_REQUIRE([AC_ARG_PROGRAM])dnl 578 | AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 579 | AM_MISSING_PROG(AUTOCONF, autoconf) 580 | AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 581 | AM_MISSING_PROG(AUTOHEADER, autoheader) 582 | AM_MISSING_PROG(MAKEINFO, makeinfo) 583 | AM_PROG_INSTALL_SH 584 | AM_PROG_INSTALL_STRIP 585 | AC_REQUIRE([AM_PROG_MKDIR_P])dnl 586 | # We need awk for the "check" target. The system "awk" is bad on 587 | # some platforms. 588 | AC_REQUIRE([AC_PROG_AWK])dnl 589 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl 590 | AC_REQUIRE([AM_SET_LEADING_DOT])dnl 591 | _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 592 | [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 593 | [_AM_PROG_TAR([v7])])]) 594 | _AM_IF_OPTION([no-dependencies],, 595 | [AC_PROVIDE_IFELSE([AC_PROG_CC], 596 | [_AM_DEPENDENCIES(CC)], 597 | [define([AC_PROG_CC], 598 | defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 599 | AC_PROVIDE_IFELSE([AC_PROG_CXX], 600 | [_AM_DEPENDENCIES(CXX)], 601 | [define([AC_PROG_CXX], 602 | defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 603 | ]) 604 | ]) 605 | 606 | 607 | # When config.status generates a header, we must update the stamp-h file. 608 | # This file resides in the same directory as the config header 609 | # that is generated. The stamp files are numbered to have different names. 610 | 611 | # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 612 | # loop where config.status creates the headers, so we can generate 613 | # our stamp files there. 614 | AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 615 | [# Compute $1's index in $config_headers. 616 | _am_stamp_count=1 617 | for _am_header in $config_headers :; do 618 | case $_am_header in 619 | $1 | $1:* ) 620 | break ;; 621 | * ) 622 | _am_stamp_count=`expr $_am_stamp_count + 1` ;; 623 | esac 624 | done 625 | echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) 626 | 627 | # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 628 | # 629 | # This file is free software; the Free Software Foundation 630 | # gives unlimited permission to copy and/or distribute it, 631 | # with or without modifications, as long as this notice is preserved. 632 | 633 | # AM_PROG_INSTALL_SH 634 | # ------------------ 635 | # Define $install_sh. 636 | AC_DEFUN([AM_PROG_INSTALL_SH], 637 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 638 | install_sh=${install_sh-"$am_aux_dir/install-sh"} 639 | AC_SUBST(install_sh)]) 640 | 641 | # Copyright (C) 2003, 2005 Free Software Foundation, Inc. 642 | # 643 | # This file is free software; the Free Software Foundation 644 | # gives unlimited permission to copy and/or distribute it, 645 | # with or without modifications, as long as this notice is preserved. 646 | 647 | # serial 2 648 | 649 | # Check whether the underlying file-system supports filenames 650 | # with a leading dot. For instance MS-DOS doesn't. 651 | AC_DEFUN([AM_SET_LEADING_DOT], 652 | [rm -rf .tst 2>/dev/null 653 | mkdir .tst 2>/dev/null 654 | if test -d .tst; then 655 | am__leading_dot=. 656 | else 657 | am__leading_dot=_ 658 | fi 659 | rmdir .tst 2>/dev/null 660 | AC_SUBST([am__leading_dot])]) 661 | 662 | # Check to see how 'make' treats includes. -*- Autoconf -*- 663 | 664 | # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. 665 | # 666 | # This file is free software; the Free Software Foundation 667 | # gives unlimited permission to copy and/or distribute it, 668 | # with or without modifications, as long as this notice is preserved. 669 | 670 | # serial 3 671 | 672 | # AM_MAKE_INCLUDE() 673 | # ----------------- 674 | # Check to see how make treats includes. 675 | AC_DEFUN([AM_MAKE_INCLUDE], 676 | [am_make=${MAKE-make} 677 | cat > confinc << 'END' 678 | am__doit: 679 | @echo done 680 | .PHONY: am__doit 681 | END 682 | # If we don't find an include directive, just comment out the code. 683 | AC_MSG_CHECKING([for style of include used by $am_make]) 684 | am__include="#" 685 | am__quote= 686 | _am_result=none 687 | # First try GNU make style include. 688 | echo "include confinc" > confmf 689 | # We grep out `Entering directory' and `Leaving directory' 690 | # messages which can occur if `w' ends up in MAKEFLAGS. 691 | # In particular we don't look at `^make:' because GNU make might 692 | # be invoked under some other name (usually "gmake"), in which 693 | # case it prints its new name instead of `make'. 694 | if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then 695 | am__include=include 696 | am__quote= 697 | _am_result=GNU 698 | fi 699 | # Now try BSD make style include. 700 | if test "$am__include" = "#"; then 701 | echo '.include "confinc"' > confmf 702 | if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then 703 | am__include=.include 704 | am__quote="\"" 705 | _am_result=BSD 706 | fi 707 | fi 708 | AC_SUBST([am__include]) 709 | AC_SUBST([am__quote]) 710 | AC_MSG_RESULT([$_am_result]) 711 | rm -f confinc confmf 712 | ]) 713 | 714 | # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 715 | 716 | # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 717 | # Free Software Foundation, Inc. 718 | # 719 | # This file is free software; the Free Software Foundation 720 | # gives unlimited permission to copy and/or distribute it, 721 | # with or without modifications, as long as this notice is preserved. 722 | 723 | # serial 4 724 | 725 | # AM_MISSING_PROG(NAME, PROGRAM) 726 | # ------------------------------ 727 | AC_DEFUN([AM_MISSING_PROG], 728 | [AC_REQUIRE([AM_MISSING_HAS_RUN]) 729 | $1=${$1-"${am_missing_run}$2"} 730 | AC_SUBST($1)]) 731 | 732 | 733 | # AM_MISSING_HAS_RUN 734 | # ------------------ 735 | # Define MISSING if not defined so far and test if it supports --run. 736 | # If it does, set am_missing_run to use it, otherwise, to nothing. 737 | AC_DEFUN([AM_MISSING_HAS_RUN], 738 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 739 | test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" 740 | # Use eval to expand $SHELL 741 | if eval "$MISSING --run true"; then 742 | am_missing_run="$MISSING --run " 743 | else 744 | am_missing_run= 745 | AC_MSG_WARN([`missing' script is too old or missing]) 746 | fi 747 | ]) 748 | 749 | # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. 750 | # 751 | # This file is free software; the Free Software Foundation 752 | # gives unlimited permission to copy and/or distribute it, 753 | # with or without modifications, as long as this notice is preserved. 754 | 755 | # AM_PROG_MKDIR_P 756 | # --------------- 757 | # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. 758 | # 759 | # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories 760 | # created by `make install' are always world readable, even if the 761 | # installer happens to have an overly restrictive umask (e.g. 077). 762 | # This was a mistake. There are at least two reasons why we must not 763 | # use `-m 0755': 764 | # - it causes special bits like SGID to be ignored, 765 | # - it may be too restrictive (some setups expect 775 directories). 766 | # 767 | # Do not use -m 0755 and let people choose whatever they expect by 768 | # setting umask. 769 | # 770 | # We cannot accept any implementation of `mkdir' that recognizes `-p'. 771 | # Some implementations (such as Solaris 8's) are not thread-safe: if a 772 | # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' 773 | # concurrently, both version can detect that a/ is missing, but only 774 | # one can create it and the other will error out. Consequently we 775 | # restrict ourselves to GNU make (using the --version option ensures 776 | # this.) 777 | AC_DEFUN([AM_PROG_MKDIR_P], 778 | [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then 779 | # We used to keeping the `.' as first argument, in order to 780 | # allow $(mkdir_p) to be used without argument. As in 781 | # $(mkdir_p) $(somedir) 782 | # where $(somedir) is conditionally defined. However this is wrong 783 | # for two reasons: 784 | # 1. if the package is installed by a user who cannot write `.' 785 | # make install will fail, 786 | # 2. the above comment should most certainly read 787 | # $(mkdir_p) $(DESTDIR)$(somedir) 788 | # so it does not work when $(somedir) is undefined and 789 | # $(DESTDIR) is not. 790 | # To support the latter case, we have to write 791 | # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), 792 | # so the `.' trick is pointless. 793 | mkdir_p='mkdir -p --' 794 | else 795 | # On NextStep and OpenStep, the `mkdir' command does not 796 | # recognize any option. It will interpret all options as 797 | # directories to create, and then abort because `.' already 798 | # exists. 799 | for d in ./-p ./--version; 800 | do 801 | test -d $d && rmdir $d 802 | done 803 | # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. 804 | if test -f "$ac_aux_dir/mkinstalldirs"; then 805 | mkdir_p='$(mkinstalldirs)' 806 | else 807 | mkdir_p='$(install_sh) -d' 808 | fi 809 | fi 810 | AC_SUBST([mkdir_p])]) 811 | 812 | # Helper functions for option handling. -*- Autoconf -*- 813 | 814 | # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. 815 | # 816 | # This file is free software; the Free Software Foundation 817 | # gives unlimited permission to copy and/or distribute it, 818 | # with or without modifications, as long as this notice is preserved. 819 | 820 | # serial 3 821 | 822 | # _AM_MANGLE_OPTION(NAME) 823 | # ----------------------- 824 | AC_DEFUN([_AM_MANGLE_OPTION], 825 | [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 826 | 827 | # _AM_SET_OPTION(NAME) 828 | # ------------------------------ 829 | # Set option NAME. Presently that only means defining a flag for this option. 830 | AC_DEFUN([_AM_SET_OPTION], 831 | [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 832 | 833 | # _AM_SET_OPTIONS(OPTIONS) 834 | # ---------------------------------- 835 | # OPTIONS is a space-separated list of Automake options. 836 | AC_DEFUN([_AM_SET_OPTIONS], 837 | [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 838 | 839 | # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 840 | # ------------------------------------------- 841 | # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 842 | AC_DEFUN([_AM_IF_OPTION], 843 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 844 | 845 | # Check to make sure that the build environment is sane. -*- Autoconf -*- 846 | 847 | # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 848 | # Free Software Foundation, Inc. 849 | # 850 | # This file is free software; the Free Software Foundation 851 | # gives unlimited permission to copy and/or distribute it, 852 | # with or without modifications, as long as this notice is preserved. 853 | 854 | # serial 4 855 | 856 | # AM_SANITY_CHECK 857 | # --------------- 858 | AC_DEFUN([AM_SANITY_CHECK], 859 | [AC_MSG_CHECKING([whether build environment is sane]) 860 | # Just in case 861 | sleep 1 862 | echo timestamp > conftest.file 863 | # Do `set' in a subshell so we don't clobber the current shell's 864 | # arguments. Must try -L first in case configure is actually a 865 | # symlink; some systems play weird games with the mod time of symlinks 866 | # (eg FreeBSD returns the mod time of the symlink's containing 867 | # directory). 868 | if ( 869 | set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` 870 | if test "$[*]" = "X"; then 871 | # -L didn't work. 872 | set X `ls -t $srcdir/configure conftest.file` 873 | fi 874 | rm -f conftest.file 875 | if test "$[*]" != "X $srcdir/configure conftest.file" \ 876 | && test "$[*]" != "X conftest.file $srcdir/configure"; then 877 | 878 | # If neither matched, then we have a broken ls. This can happen 879 | # if, for instance, CONFIG_SHELL is bash and it inherits a 880 | # broken ls alias from the environment. This has actually 881 | # happened. Such a system could not be considered "sane". 882 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 883 | alias in your environment]) 884 | fi 885 | 886 | test "$[2]" = conftest.file 887 | ) 888 | then 889 | # Ok. 890 | : 891 | else 892 | AC_MSG_ERROR([newly created file is older than distributed files! 893 | Check your system clock]) 894 | fi 895 | AC_MSG_RESULT(yes)]) 896 | 897 | # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 898 | # 899 | # This file is free software; the Free Software Foundation 900 | # gives unlimited permission to copy and/or distribute it, 901 | # with or without modifications, as long as this notice is preserved. 902 | 903 | # AM_PROG_INSTALL_STRIP 904 | # --------------------- 905 | # One issue with vendor `install' (even GNU) is that you can't 906 | # specify the program used to strip binaries. This is especially 907 | # annoying in cross-compiling environments, where the build's strip 908 | # is unlikely to handle the host's binaries. 909 | # Fortunately install-sh will honor a STRIPPROG variable, so we 910 | # always use install-sh in `make install-strip', and initialize 911 | # STRIPPROG with the value of the STRIP variable (set by the user). 912 | AC_DEFUN([AM_PROG_INSTALL_STRIP], 913 | [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 914 | # Installed binaries are usually stripped using `strip' when the user 915 | # run `make install-strip'. However `strip' might not be the right 916 | # tool to use in cross-compilation environments, therefore Automake 917 | # will honor the `STRIP' environment variable to overrule this program. 918 | dnl Don't test for $cross_compiling = yes, because it might be `maybe'. 919 | if test "$cross_compiling" != no; then 920 | AC_CHECK_TOOL([STRIP], [strip], :) 921 | fi 922 | INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" 923 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) 924 | 925 | # Check how to create a tarball. -*- Autoconf -*- 926 | 927 | # Copyright (C) 2004, 2005 Free Software Foundation, Inc. 928 | # 929 | # This file is free software; the Free Software Foundation 930 | # gives unlimited permission to copy and/or distribute it, 931 | # with or without modifications, as long as this notice is preserved. 932 | 933 | # serial 2 934 | 935 | # _AM_PROG_TAR(FORMAT) 936 | # -------------------- 937 | # Check how to create a tarball in format FORMAT. 938 | # FORMAT should be one of `v7', `ustar', or `pax'. 939 | # 940 | # Substitute a variable $(am__tar) that is a command 941 | # writing to stdout a FORMAT-tarball containing the directory 942 | # $tardir. 943 | # tardir=directory && $(am__tar) > result.tar 944 | # 945 | # Substitute a variable $(am__untar) that extract such 946 | # a tarball read from stdin. 947 | # $(am__untar) < result.tar 948 | AC_DEFUN([_AM_PROG_TAR], 949 | [# Always define AMTAR for backward compatibility. 950 | AM_MISSING_PROG([AMTAR], [tar]) 951 | m4_if([$1], [v7], 952 | [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 953 | [m4_case([$1], [ustar],, [pax],, 954 | [m4_fatal([Unknown tar format])]) 955 | AC_MSG_CHECKING([how to create a $1 tar archive]) 956 | # Loop over all known methods to create a tar archive until one works. 957 | _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 958 | _am_tools=${am_cv_prog_tar_$1-$_am_tools} 959 | # Do not fold the above two line into one, because Tru64 sh and 960 | # Solaris sh will not grok spaces in the rhs of `-'. 961 | for _am_tool in $_am_tools 962 | do 963 | case $_am_tool in 964 | gnutar) 965 | for _am_tar in tar gnutar gtar; 966 | do 967 | AM_RUN_LOG([$_am_tar --version]) && break 968 | done 969 | am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 970 | am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 971 | am__untar="$_am_tar -xf -" 972 | ;; 973 | plaintar) 974 | # Must skip GNU tar: if it does not support --format= it doesn't create 975 | # ustar tarball either. 976 | (tar --version) >/dev/null 2>&1 && continue 977 | am__tar='tar chf - "$$tardir"' 978 | am__tar_='tar chf - "$tardir"' 979 | am__untar='tar xf -' 980 | ;; 981 | pax) 982 | am__tar='pax -L -x $1 -w "$$tardir"' 983 | am__tar_='pax -L -x $1 -w "$tardir"' 984 | am__untar='pax -r' 985 | ;; 986 | cpio) 987 | am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 988 | am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 989 | am__untar='cpio -i -H $1 -d' 990 | ;; 991 | none) 992 | am__tar=false 993 | am__tar_=false 994 | am__untar=false 995 | ;; 996 | esac 997 | 998 | # If the value was cached, stop now. We just wanted to have am__tar 999 | # and am__untar set. 1000 | test -n "${am_cv_prog_tar_$1}" && break 1001 | 1002 | # tar/untar a dummy directory, and stop if the command works 1003 | rm -rf conftest.dir 1004 | mkdir conftest.dir 1005 | echo GrepMe > conftest.dir/file 1006 | AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 1007 | rm -rf conftest.dir 1008 | if test -s conftest.tar; then 1009 | AM_RUN_LOG([$am__untar /dev/null 2>&1 && break 1011 | fi 1012 | done 1013 | rm -rf conftest.dir 1014 | 1015 | AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 1016 | AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 1017 | AC_SUBST([am__tar]) 1018 | AC_SUBST([am__untar]) 1019 | ]) # _AM_PROG_TAR 1020 | 1021 | --------------------------------------------------------------------------------