├── COPYING ├── INSTALL ├── LICENSE ├── Makefile.am ├── Makefile.in ├── README.md ├── TODO ├── aclocal.m4 ├── build-aux ├── ar-lib ├── compile ├── config.guess ├── config.sub ├── depcomp ├── install-sh ├── ltmain.sh ├── missing └── test-driver ├── config.h.in ├── configure ├── configure.ac ├── m4 ├── libtool.m4 ├── ltoptions.m4 ├── ltsugar.m4 ├── ltversion.m4 └── lt~obsolete.m4 ├── src ├── Makefile.am ├── Makefile.in ├── creep.c ├── creep.h ├── creep_main.c ├── def_error_messages.h ├── def_sizes.h └── main.c └── tests ├── Makefile.am ├── Makefile.in └── check_creep.c /INSTALL: -------------------------------------------------------------------------------- 1 | Installation Instructions 2 | ************************* 3 | 4 | Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, 5 | Inc. 6 | 7 | Copying and distribution of this file, with or without modification, 8 | are permitted in any medium without royalty provided the copyright 9 | notice and this notice are preserved. This file is offered as-is, 10 | without warranty of any kind. 11 | 12 | Basic Installation 13 | ================== 14 | 15 | Briefly, the shell commands `./configure; make; make install' should 16 | configure, build, and install this package. The following 17 | more-detailed instructions are generic; see the `README' file for 18 | instructions specific to this package. Some packages provide this 19 | `INSTALL' file but do not implement all of the features documented 20 | below. The lack of an optional feature in a given package is not 21 | necessarily a bug. More recommendations for GNU packages can be found 22 | in *note Makefile Conventions: (standards)Makefile Conventions. 23 | 24 | The `configure' shell script attempts to guess correct values for 25 | various system-dependent variables used during compilation. It uses 26 | those values to create a `Makefile' in each directory of the package. 27 | It may also create one or more `.h' files containing system-dependent 28 | definitions. Finally, it creates a shell script `config.status' that 29 | you can run in the future to recreate the current configuration, and a 30 | file `config.log' containing compiler output (useful mainly for 31 | debugging `configure'). 32 | 33 | It can also use an optional file (typically called `config.cache' 34 | and enabled with `--cache-file=config.cache' or simply `-C') that saves 35 | the results of its tests to speed up reconfiguring. Caching is 36 | disabled by default to prevent problems with accidental use of stale 37 | cache files. 38 | 39 | If you need to do unusual things to compile the package, please try 40 | to figure out how `configure' could check whether to do them, and mail 41 | diffs or instructions to the address given in the `README' so they can 42 | be considered for the next release. If you are using the cache, and at 43 | some point `config.cache' contains results you don't want to keep, you 44 | may remove or edit it. 45 | 46 | The file `configure.ac' (or `configure.in') is used to create 47 | `configure' by a program called `autoconf'. You need `configure.ac' if 48 | you want to change it or regenerate `configure' using a newer version 49 | of `autoconf'. 50 | 51 | The simplest way to compile this package is: 52 | 53 | 1. `cd' to the directory containing the package's source code and type 54 | `./configure' to configure the package for your system. 55 | 56 | Running `configure' might take a while. While running, it prints 57 | some messages telling which features it is checking for. 58 | 59 | 2. Type `make' to compile the package. 60 | 61 | 3. Optionally, type `make check' to run any self-tests that come with 62 | the package, generally using the just-built uninstalled binaries. 63 | 64 | 4. Type `make install' to install the programs and any data files and 65 | documentation. When installing into a prefix owned by root, it is 66 | recommended that the package be configured and built as a regular 67 | user, and only the `make install' phase executed with root 68 | privileges. 69 | 70 | 5. Optionally, type `make installcheck' to repeat any self-tests, but 71 | this time using the binaries in their final installed location. 72 | This target does not install anything. Running this target as a 73 | regular user, particularly if the prior `make install' required 74 | root privileges, verifies that the installation completed 75 | correctly. 76 | 77 | 6. You can remove the program binaries and object files from the 78 | source code directory by typing `make clean'. To also remove the 79 | files that `configure' created (so you can compile the package for 80 | a different kind of computer), type `make distclean'. There is 81 | also a `make maintainer-clean' target, but that is intended mainly 82 | for the package's developers. If you use it, you may have to get 83 | all sorts of other programs in order to regenerate files that came 84 | with the distribution. 85 | 86 | 7. Often, you can also type `make uninstall' to remove the installed 87 | files again. In practice, not all packages have tested that 88 | uninstallation works correctly, even though it is required by the 89 | GNU Coding Standards. 90 | 91 | 8. Some packages, particularly those that use Automake, provide `make 92 | distcheck', which can by used by developers to test that all other 93 | targets like `make install' and `make uninstall' work correctly. 94 | This target is generally not run by end users. 95 | 96 | Compilers and Options 97 | ===================== 98 | 99 | Some systems require unusual options for compilation or linking that 100 | the `configure' script does not know about. Run `./configure --help' 101 | for details on some of the pertinent environment variables. 102 | 103 | You can give `configure' initial values for configuration parameters 104 | by setting variables in the command line or in the environment. Here 105 | is an example: 106 | 107 | ./configure CC=c99 CFLAGS=-g LIBS=-lposix 108 | 109 | *Note Defining Variables::, for more details. 110 | 111 | Compiling For Multiple Architectures 112 | ==================================== 113 | 114 | You can compile the package for more than one kind of computer at the 115 | same time, by placing the object files for each architecture in their 116 | own directory. To do this, you can use GNU `make'. `cd' to the 117 | directory where you want the object files and executables to go and run 118 | the `configure' script. `configure' automatically checks for the 119 | source code in the directory that `configure' is in and in `..'. This 120 | is known as a "VPATH" build. 121 | 122 | With a non-GNU `make', it is safer to compile the package for one 123 | architecture at a time in the source code directory. After you have 124 | installed the package for one architecture, use `make distclean' before 125 | reconfiguring for another architecture. 126 | 127 | On MacOS X 10.5 and later systems, you can create libraries and 128 | executables that work on multiple system types--known as "fat" or 129 | "universal" binaries--by specifying multiple `-arch' options to the 130 | compiler but only a single `-arch' option to the preprocessor. Like 131 | this: 132 | 133 | ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ 134 | CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ 135 | CPP="gcc -E" CXXCPP="g++ -E" 136 | 137 | This is not guaranteed to produce working output in all cases, you 138 | may have to build one architecture at a time and combine the results 139 | using the `lipo' tool if you have problems. 140 | 141 | Installation Names 142 | ================== 143 | 144 | By default, `make install' installs the package's commands under 145 | `/usr/local/bin', include files under `/usr/local/include', etc. You 146 | can specify an installation prefix other than `/usr/local' by giving 147 | `configure' the option `--prefix=PREFIX', where PREFIX must be an 148 | absolute file name. 149 | 150 | You can specify separate installation prefixes for 151 | architecture-specific files and architecture-independent files. If you 152 | pass the option `--exec-prefix=PREFIX' to `configure', the package uses 153 | PREFIX as the prefix for installing programs and libraries. 154 | Documentation and other data files still use the regular prefix. 155 | 156 | In addition, if you use an unusual directory layout you can give 157 | options like `--bindir=DIR' to specify different values for particular 158 | kinds of files. Run `configure --help' for a list of the directories 159 | you can set and what kinds of files go in them. In general, the 160 | default for these options is expressed in terms of `${prefix}', so that 161 | specifying just `--prefix' will affect all of the other directory 162 | specifications that were not explicitly provided. 163 | 164 | The most portable way to affect installation locations is to pass the 165 | correct locations to `configure'; however, many packages provide one or 166 | both of the following shortcuts of passing variable assignments to the 167 | `make install' command line to change installation locations without 168 | having to reconfigure or recompile. 169 | 170 | The first method involves providing an override variable for each 171 | affected directory. For example, `make install 172 | prefix=/alternate/directory' will choose an alternate location for all 173 | directory configuration variables that were expressed in terms of 174 | `${prefix}'. Any directories that were specified during `configure', 175 | but not in terms of `${prefix}', must each be overridden at install 176 | time for the entire installation to be relocated. The approach of 177 | makefile variable overrides for each directory variable is required by 178 | the GNU Coding Standards, and ideally causes no recompilation. 179 | However, some platforms have known limitations with the semantics of 180 | shared libraries that end up requiring recompilation when using this 181 | method, particularly noticeable in packages that use GNU Libtool. 182 | 183 | The second method involves providing the `DESTDIR' variable. For 184 | example, `make install DESTDIR=/alternate/directory' will prepend 185 | `/alternate/directory' before all installation names. The approach of 186 | `DESTDIR' overrides is not required by the GNU Coding Standards, and 187 | does not work on platforms that have drive letters. On the other hand, 188 | it does better at avoiding recompilation issues, and works well even 189 | when some directory options were not specified in terms of `${prefix}' 190 | at `configure' time. 191 | 192 | Optional Features 193 | ================= 194 | 195 | If the package supports it, you can cause programs to be installed 196 | with an extra prefix or suffix on their names by giving `configure' the 197 | option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. 198 | 199 | Some packages pay attention to `--enable-FEATURE' options to 200 | `configure', where FEATURE indicates an optional part of the package. 201 | They may also pay attention to `--with-PACKAGE' options, where PACKAGE 202 | is something like `gnu-as' or `x' (for the X Window System). The 203 | `README' should mention any `--enable-' and `--with-' options that the 204 | package recognizes. 205 | 206 | For packages that use the X Window System, `configure' can usually 207 | find the X include and library files automatically, but if it doesn't, 208 | you can use the `configure' options `--x-includes=DIR' and 209 | `--x-libraries=DIR' to specify their locations. 210 | 211 | Some packages offer the ability to configure how verbose the 212 | execution of `make' will be. For these packages, running `./configure 213 | --enable-silent-rules' sets the default to minimal output, which can be 214 | overridden with `make V=1'; while running `./configure 215 | --disable-silent-rules' sets the default to verbose, which can be 216 | overridden with `make V=0'. 217 | 218 | Particular systems 219 | ================== 220 | 221 | On HP-UX, the default C compiler is not ANSI C compatible. If GNU 222 | CC is not installed, it is recommended to use the following options in 223 | order to use an ANSI C compiler: 224 | 225 | ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" 226 | 227 | and if that doesn't work, install pre-built binaries of GCC for HP-UX. 228 | 229 | HP-UX `make' updates targets which have the same time stamps as 230 | their prerequisites, which makes it generally unusable when shipped 231 | generated files such as `configure' are involved. Use GNU `make' 232 | instead. 233 | 234 | On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot 235 | parse its `' header file. The option `-nodtk' can be used as 236 | a workaround. If GNU CC is not installed, it is therefore recommended 237 | to try 238 | 239 | ./configure CC="cc" 240 | 241 | and if that doesn't work, try 242 | 243 | ./configure CC="cc -nodtk" 244 | 245 | On Solaris, don't put `/usr/ucb' early in your `PATH'. This 246 | directory contains several dysfunctional programs; working variants of 247 | these programs are available in `/usr/bin'. So, if you need `/usr/ucb' 248 | in your `PATH', put it _after_ `/usr/bin'. 249 | 250 | On Haiku, software installed for all users goes in `/boot/common', 251 | not `/usr/local'. It is recommended to use the following options: 252 | 253 | ./configure --prefix=/boot/common 254 | 255 | Specifying the System Type 256 | ========================== 257 | 258 | There may be some features `configure' cannot figure out 259 | automatically, but needs to determine by the type of machine the package 260 | will run on. Usually, assuming the package is built to be run on the 261 | _same_ architectures, `configure' can figure that out, but if it prints 262 | a message saying it cannot guess the machine type, give it the 263 | `--build=TYPE' option. TYPE can either be a short name for the system 264 | type, such as `sun4', or a canonical name which has the form: 265 | 266 | CPU-COMPANY-SYSTEM 267 | 268 | where SYSTEM can have one of these forms: 269 | 270 | OS 271 | KERNEL-OS 272 | 273 | See the file `config.sub' for the possible values of each field. If 274 | `config.sub' isn't included in this package, then this package doesn't 275 | need to know the machine type. 276 | 277 | If you are _building_ compiler tools for cross-compiling, you should 278 | use the option `--target=TYPE' to select the type of system they will 279 | produce code for. 280 | 281 | If you want to _use_ a cross compiler, that generates code for a 282 | platform different from the build platform, you should specify the 283 | "host" platform (i.e., that on which the generated programs will 284 | eventually be run) with `--host=TYPE'. 285 | 286 | Sharing Defaults 287 | ================ 288 | 289 | If you want to set default values for `configure' scripts to share, 290 | you can create a site shell script called `config.site' that gives 291 | default values for variables like `CC', `cache_file', and `prefix'. 292 | `configure' looks for `PREFIX/share/config.site' if it exists, then 293 | `PREFIX/etc/config.site' if it exists. Or, you can set the 294 | `CONFIG_SITE' environment variable to the location of the site script. 295 | A warning: not all `configure' scripts look for a site script. 296 | 297 | Defining Variables 298 | ================== 299 | 300 | Variables not defined in a site shell script can be set in the 301 | environment passed to `configure'. However, some packages may run 302 | configure again during the build, and the customized values of these 303 | variables may be lost. In order to avoid this problem, you should set 304 | them in the `configure' command line, using `VAR=value'. For example: 305 | 306 | ./configure CC=/usr/local2/bin/gcc 307 | 308 | causes the specified `gcc' to be used as the C compiler (unless it is 309 | overridden in the site shell script). 310 | 311 | Unfortunately, this technique does not work for `CONFIG_SHELL' due to 312 | an Autoconf limitation. Until the limitation is lifted, you can use 313 | this workaround: 314 | 315 | CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 316 | 317 | `configure' Invocation 318 | ====================== 319 | 320 | `configure' recognizes the following options to control how it 321 | operates. 322 | 323 | `--help' 324 | `-h' 325 | Print a summary of all of the options to `configure', and exit. 326 | 327 | `--help=short' 328 | `--help=recursive' 329 | Print a summary of the options unique to this package's 330 | `configure', and exit. The `short' variant lists options used 331 | only in the top level, while the `recursive' variant lists options 332 | also present in any nested packages. 333 | 334 | `--version' 335 | `-V' 336 | Print the version of Autoconf used to generate the `configure' 337 | script, and exit. 338 | 339 | `--cache-file=FILE' 340 | Enable the cache: use and save the results of the tests in FILE, 341 | traditionally `config.cache'. FILE defaults to `/dev/null' to 342 | disable caching. 343 | 344 | `--config-cache' 345 | `-C' 346 | Alias for `--cache-file=config.cache'. 347 | 348 | `--quiet' 349 | `--silent' 350 | `-q' 351 | Do not print messages saying which checks are being made. To 352 | suppress all normal output, redirect it to `/dev/null' (any error 353 | messages will still be shown). 354 | 355 | `--srcdir=DIR' 356 | Look for the package's source code in directory DIR. Usually 357 | `configure' can determine that directory automatically. 358 | 359 | `--prefix=DIR' 360 | Use DIR as the installation prefix. *note Installation Names:: 361 | for more details, including other options available for fine-tuning 362 | the installation locations. 363 | 364 | `--no-create' 365 | `-n' 366 | Run the configure checks, but stop before creating any output 367 | files. 368 | 369 | `configure' also accepts some other, not widely useful, options. Run 370 | `configure --help' for more details. 371 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | AM_LDFLAGS = -levent 2 | 3 | SUBDIRS = src . tests 4 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.14 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994-2013 Free Software Foundation, Inc. 5 | 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 | VPATH = @srcdir@ 17 | am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 18 | am__make_running_with_option = \ 19 | case $${target_option-} in \ 20 | ?) ;; \ 21 | *) echo "am__make_running_with_option: internal error: invalid" \ 22 | "target option '$${target_option-}' specified" >&2; \ 23 | exit 1;; \ 24 | esac; \ 25 | has_opt=no; \ 26 | sane_makeflags=$$MAKEFLAGS; \ 27 | if $(am__is_gnu_make); then \ 28 | sane_makeflags=$$MFLAGS; \ 29 | else \ 30 | case $$MAKEFLAGS in \ 31 | *\\[\ \ ]*) \ 32 | bs=\\; \ 33 | sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ 34 | | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ 35 | esac; \ 36 | fi; \ 37 | skip_next=no; \ 38 | strip_trailopt () \ 39 | { \ 40 | flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ 41 | }; \ 42 | for flg in $$sane_makeflags; do \ 43 | test $$skip_next = yes && { skip_next=no; continue; }; \ 44 | case $$flg in \ 45 | *=*|--*) continue;; \ 46 | -*I) strip_trailopt 'I'; skip_next=yes;; \ 47 | -*I?*) strip_trailopt 'I';; \ 48 | -*O) strip_trailopt 'O'; skip_next=yes;; \ 49 | -*O?*) strip_trailopt 'O';; \ 50 | -*l) strip_trailopt 'l'; skip_next=yes;; \ 51 | -*l?*) strip_trailopt 'l';; \ 52 | -[dEDm]) skip_next=yes;; \ 53 | -[JT]) skip_next=yes;; \ 54 | esac; \ 55 | case $$flg in \ 56 | *$$target_option*) has_opt=yes; break;; \ 57 | esac; \ 58 | done; \ 59 | test $$has_opt = yes 60 | am__make_dryrun = (target_option=n; $(am__make_running_with_option)) 61 | am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 62 | pkgdatadir = $(datadir)/@PACKAGE@ 63 | pkgincludedir = $(includedir)/@PACKAGE@ 64 | pkglibdir = $(libdir)/@PACKAGE@ 65 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 66 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 67 | install_sh_DATA = $(install_sh) -c -m 644 68 | install_sh_PROGRAM = $(install_sh) -c 69 | install_sh_SCRIPT = $(install_sh) -c 70 | INSTALL_HEADER = $(INSTALL_DATA) 71 | transform = $(program_transform_name) 72 | NORMAL_INSTALL = : 73 | PRE_INSTALL = : 74 | POST_INSTALL = : 75 | NORMAL_UNINSTALL = : 76 | PRE_UNINSTALL = : 77 | POST_UNINSTALL = : 78 | build_triplet = @build@ 79 | host_triplet = @host@ 80 | subdir = . 81 | DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ 82 | $(top_srcdir)/configure $(am__configure_deps) \ 83 | $(srcdir)/config.h.in COPYING INSTALL build-aux/ar-lib \ 84 | build-aux/compile build-aux/config.guess build-aux/config.sub \ 85 | build-aux/depcomp build-aux/install-sh build-aux/missing \ 86 | build-aux/ltmain.sh $(top_srcdir)/build-aux/ar-lib \ 87 | $(top_srcdir)/build-aux/compile \ 88 | $(top_srcdir)/build-aux/config.guess \ 89 | $(top_srcdir)/build-aux/config.sub \ 90 | $(top_srcdir)/build-aux/install-sh \ 91 | $(top_srcdir)/build-aux/ltmain.sh \ 92 | $(top_srcdir)/build-aux/missing 93 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 94 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ 95 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ 96 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ 97 | $(top_srcdir)/configure.ac 98 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 99 | $(ACLOCAL_M4) 100 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ 101 | configure.lineno config.status.lineno 102 | mkinstalldirs = $(install_sh) -d 103 | CONFIG_HEADER = config.h 104 | CONFIG_CLEAN_FILES = 105 | CONFIG_CLEAN_VPATH_FILES = 106 | AM_V_P = $(am__v_P_@AM_V@) 107 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) 108 | am__v_P_0 = false 109 | am__v_P_1 = : 110 | AM_V_GEN = $(am__v_GEN_@AM_V@) 111 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) 112 | am__v_GEN_0 = @echo " GEN " $@; 113 | am__v_GEN_1 = 114 | AM_V_at = $(am__v_at_@AM_V@) 115 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) 116 | am__v_at_0 = @ 117 | am__v_at_1 = 118 | SOURCES = 119 | DIST_SOURCES = 120 | RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ 121 | ctags-recursive dvi-recursive html-recursive info-recursive \ 122 | install-data-recursive install-dvi-recursive \ 123 | install-exec-recursive install-html-recursive \ 124 | install-info-recursive install-pdf-recursive \ 125 | install-ps-recursive install-recursive installcheck-recursive \ 126 | installdirs-recursive pdf-recursive ps-recursive \ 127 | tags-recursive uninstall-recursive 128 | am__can_run_installinfo = \ 129 | case $$AM_UPDATE_INFO_DIR in \ 130 | n|no|NO) false;; \ 131 | *) (install-info --version) >/dev/null 2>&1;; \ 132 | esac 133 | RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ 134 | distclean-recursive maintainer-clean-recursive 135 | am__recursive_targets = \ 136 | $(RECURSIVE_TARGETS) \ 137 | $(RECURSIVE_CLEAN_TARGETS) \ 138 | $(am__extra_recursive_targets) 139 | AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ 140 | cscope distdir dist dist-all distcheck 141 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ 142 | $(LISP)config.h.in 143 | # Read a list of newline-separated strings from the standard input, 144 | # and print each of them once, without duplicates. Input order is 145 | # *not* preserved. 146 | am__uniquify_input = $(AWK) '\ 147 | BEGIN { nonempty = 0; } \ 148 | { items[$$0] = 1; nonempty = 1; } \ 149 | END { if (nonempty) { for (i in items) print i; }; } \ 150 | ' 151 | # Make sure the list of sources is unique. This is necessary because, 152 | # e.g., the same source file might be shared among _SOURCES variables 153 | # for different programs/libraries. 154 | am__define_uniq_tagged_files = \ 155 | list='$(am__tagged_files)'; \ 156 | unique=`for i in $$list; do \ 157 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 158 | done | $(am__uniquify_input)` 159 | ETAGS = etags 160 | CTAGS = ctags 161 | CSCOPE = cscope 162 | DIST_SUBDIRS = $(SUBDIRS) 163 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 164 | distdir = $(PACKAGE)-$(VERSION) 165 | top_distdir = $(distdir) 166 | am__remove_distdir = \ 167 | if test -d "$(distdir)"; then \ 168 | find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ 169 | && rm -rf "$(distdir)" \ 170 | || { sleep 5 && rm -rf "$(distdir)"; }; \ 171 | else :; fi 172 | am__post_remove_distdir = $(am__remove_distdir) 173 | am__relativize = \ 174 | dir0=`pwd`; \ 175 | sed_first='s,^\([^/]*\)/.*$$,\1,'; \ 176 | sed_rest='s,^[^/]*/*,,'; \ 177 | sed_last='s,^.*/\([^/]*\)$$,\1,'; \ 178 | sed_butlast='s,/*[^/]*$$,,'; \ 179 | while test -n "$$dir1"; do \ 180 | first=`echo "$$dir1" | sed -e "$$sed_first"`; \ 181 | if test "$$first" != "."; then \ 182 | if test "$$first" = ".."; then \ 183 | dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ 184 | dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ 185 | else \ 186 | first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ 187 | if test "$$first2" = "$$first"; then \ 188 | dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ 189 | else \ 190 | dir2="../$$dir2"; \ 191 | fi; \ 192 | dir0="$$dir0"/"$$first"; \ 193 | fi; \ 194 | fi; \ 195 | dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ 196 | done; \ 197 | reldir="$$dir2" 198 | DIST_ARCHIVES = $(distdir).tar.gz 199 | GZIP_ENV = --best 200 | DIST_TARGETS = dist-gzip 201 | distuninstallcheck_listfiles = find . -type f -print 202 | am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ 203 | | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' 204 | distcleancheck_listfiles = find . -type f -print 205 | ACLOCAL = @ACLOCAL@ 206 | AMTAR = @AMTAR@ 207 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 208 | AR = @AR@ 209 | AUTOCONF = @AUTOCONF@ 210 | AUTOHEADER = @AUTOHEADER@ 211 | AUTOMAKE = @AUTOMAKE@ 212 | AWK = @AWK@ 213 | CC = @CC@ 214 | CCDEPMODE = @CCDEPMODE@ 215 | CFLAGS = @CFLAGS@ 216 | CHECK_CFLAGS = @CHECK_CFLAGS@ 217 | CHECK_LIBS = @CHECK_LIBS@ 218 | CPP = @CPP@ 219 | CPPFLAGS = @CPPFLAGS@ 220 | CYGPATH_W = @CYGPATH_W@ 221 | DEFS = @DEFS@ 222 | DEPDIR = @DEPDIR@ 223 | DLLTOOL = @DLLTOOL@ 224 | DSYMUTIL = @DSYMUTIL@ 225 | DUMPBIN = @DUMPBIN@ 226 | ECHO_C = @ECHO_C@ 227 | ECHO_N = @ECHO_N@ 228 | ECHO_T = @ECHO_T@ 229 | EGREP = @EGREP@ 230 | EXEEXT = @EXEEXT@ 231 | FGREP = @FGREP@ 232 | GREP = @GREP@ 233 | INSTALL = @INSTALL@ 234 | INSTALL_DATA = @INSTALL_DATA@ 235 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 236 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 237 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 238 | LD = @LD@ 239 | LDFLAGS = @LDFLAGS@ 240 | LIBEVENT_CFLAGS = @LIBEVENT_CFLAGS@ 241 | LIBEVENT_LIBS = @LIBEVENT_LIBS@ 242 | LIBOBJS = @LIBOBJS@ 243 | LIBS = @LIBS@ 244 | LIBTOOL = @LIBTOOL@ 245 | LIPO = @LIPO@ 246 | LN_S = @LN_S@ 247 | LTLIBOBJS = @LTLIBOBJS@ 248 | MAKEINFO = @MAKEINFO@ 249 | MANIFEST_TOOL = @MANIFEST_TOOL@ 250 | MKDIR_P = @MKDIR_P@ 251 | NM = @NM@ 252 | NMEDIT = @NMEDIT@ 253 | OBJDUMP = @OBJDUMP@ 254 | OBJEXT = @OBJEXT@ 255 | OTOOL = @OTOOL@ 256 | OTOOL64 = @OTOOL64@ 257 | PACKAGE = @PACKAGE@ 258 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 259 | PACKAGE_NAME = @PACKAGE_NAME@ 260 | PACKAGE_STRING = @PACKAGE_STRING@ 261 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 262 | PACKAGE_URL = @PACKAGE_URL@ 263 | PACKAGE_VERSION = @PACKAGE_VERSION@ 264 | PATH_SEPARATOR = @PATH_SEPARATOR@ 265 | PKG_CONFIG = @PKG_CONFIG@ 266 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ 267 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 268 | RANLIB = @RANLIB@ 269 | SED = @SED@ 270 | SET_MAKE = @SET_MAKE@ 271 | SHELL = @SHELL@ 272 | STRIP = @STRIP@ 273 | VERSION = @VERSION@ 274 | abs_builddir = @abs_builddir@ 275 | abs_srcdir = @abs_srcdir@ 276 | abs_top_builddir = @abs_top_builddir@ 277 | abs_top_srcdir = @abs_top_srcdir@ 278 | ac_ct_AR = @ac_ct_AR@ 279 | ac_ct_CC = @ac_ct_CC@ 280 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 281 | am__include = @am__include@ 282 | am__leading_dot = @am__leading_dot@ 283 | am__quote = @am__quote@ 284 | am__tar = @am__tar@ 285 | am__untar = @am__untar@ 286 | bindir = @bindir@ 287 | build = @build@ 288 | build_alias = @build_alias@ 289 | build_cpu = @build_cpu@ 290 | build_os = @build_os@ 291 | build_vendor = @build_vendor@ 292 | builddir = @builddir@ 293 | datadir = @datadir@ 294 | datarootdir = @datarootdir@ 295 | docdir = @docdir@ 296 | dvidir = @dvidir@ 297 | exec_prefix = @exec_prefix@ 298 | host = @host@ 299 | host_alias = @host_alias@ 300 | host_cpu = @host_cpu@ 301 | host_os = @host_os@ 302 | host_vendor = @host_vendor@ 303 | htmldir = @htmldir@ 304 | includedir = @includedir@ 305 | infodir = @infodir@ 306 | install_sh = @install_sh@ 307 | libdir = @libdir@ 308 | libexecdir = @libexecdir@ 309 | localedir = @localedir@ 310 | localstatedir = @localstatedir@ 311 | mandir = @mandir@ 312 | mkdir_p = @mkdir_p@ 313 | oldincludedir = @oldincludedir@ 314 | pdfdir = @pdfdir@ 315 | prefix = @prefix@ 316 | program_transform_name = @program_transform_name@ 317 | psdir = @psdir@ 318 | sbindir = @sbindir@ 319 | sharedstatedir = @sharedstatedir@ 320 | srcdir = @srcdir@ 321 | sysconfdir = @sysconfdir@ 322 | target_alias = @target_alias@ 323 | top_build_prefix = @top_build_prefix@ 324 | top_builddir = @top_builddir@ 325 | top_srcdir = @top_srcdir@ 326 | AM_LDFLAGS = -levent 327 | SUBDIRS = src . tests 328 | all: config.h 329 | $(MAKE) $(AM_MAKEFLAGS) all-recursive 330 | 331 | .SUFFIXES: 332 | am--refresh: Makefile 333 | @: 334 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 335 | @for dep in $?; do \ 336 | case '$(am__configure_deps)' in \ 337 | *$$dep*) \ 338 | echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ 339 | $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ 340 | && exit 0; \ 341 | exit 1;; \ 342 | esac; \ 343 | done; \ 344 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ 345 | $(am__cd) $(top_srcdir) && \ 346 | $(AUTOMAKE) --foreign Makefile 347 | .PRECIOUS: Makefile 348 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 349 | @case '$?' in \ 350 | *config.status*) \ 351 | echo ' $(SHELL) ./config.status'; \ 352 | $(SHELL) ./config.status;; \ 353 | *) \ 354 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ 355 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ 356 | esac; 357 | 358 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 359 | $(SHELL) ./config.status --recheck 360 | 361 | $(top_srcdir)/configure: $(am__configure_deps) 362 | $(am__cd) $(srcdir) && $(AUTOCONF) 363 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 364 | $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 365 | $(am__aclocal_m4_deps): 366 | 367 | config.h: stamp-h1 368 | @test -f $@ || rm -f stamp-h1 369 | @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 370 | 371 | stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status 372 | @rm -f stamp-h1 373 | cd $(top_builddir) && $(SHELL) ./config.status config.h 374 | $(srcdir)/config.h.in: $(am__configure_deps) 375 | ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) 376 | rm -f stamp-h1 377 | touch $@ 378 | 379 | distclean-hdr: 380 | -rm -f config.h stamp-h1 381 | 382 | mostlyclean-libtool: 383 | -rm -f *.lo 384 | 385 | clean-libtool: 386 | -rm -rf .libs _libs 387 | 388 | distclean-libtool: 389 | -rm -f libtool config.lt 390 | 391 | # This directory's subdirectories are mostly independent; you can cd 392 | # into them and run 'make' without going through this Makefile. 393 | # To change the values of 'make' variables: instead of editing Makefiles, 394 | # (1) if the variable is set in 'config.status', edit 'config.status' 395 | # (which will cause the Makefiles to be regenerated when you run 'make'); 396 | # (2) otherwise, pass the desired values on the 'make' command line. 397 | $(am__recursive_targets): 398 | @fail=; \ 399 | if $(am__make_keepgoing); then \ 400 | failcom='fail=yes'; \ 401 | else \ 402 | failcom='exit 1'; \ 403 | fi; \ 404 | dot_seen=no; \ 405 | target=`echo $@ | sed s/-recursive//`; \ 406 | case "$@" in \ 407 | distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ 408 | *) list='$(SUBDIRS)' ;; \ 409 | esac; \ 410 | for subdir in $$list; do \ 411 | echo "Making $$target in $$subdir"; \ 412 | if test "$$subdir" = "."; then \ 413 | dot_seen=yes; \ 414 | local_target="$$target-am"; \ 415 | else \ 416 | local_target="$$target"; \ 417 | fi; \ 418 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 419 | || eval $$failcom; \ 420 | done; \ 421 | if test "$$dot_seen" = "no"; then \ 422 | $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ 423 | fi; test -z "$$fail" 424 | 425 | ID: $(am__tagged_files) 426 | $(am__define_uniq_tagged_files); mkid -fID $$unique 427 | tags: tags-recursive 428 | TAGS: tags 429 | 430 | tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 431 | set x; \ 432 | here=`pwd`; \ 433 | if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ 434 | include_option=--etags-include; \ 435 | empty_fix=.; \ 436 | else \ 437 | include_option=--include; \ 438 | empty_fix=; \ 439 | fi; \ 440 | list='$(SUBDIRS)'; for subdir in $$list; do \ 441 | if test "$$subdir" = .; then :; else \ 442 | test ! -f $$subdir/TAGS || \ 443 | set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ 444 | fi; \ 445 | done; \ 446 | $(am__define_uniq_tagged_files); \ 447 | shift; \ 448 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 449 | test -n "$$unique" || unique=$$empty_fix; \ 450 | if test $$# -gt 0; then \ 451 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 452 | "$$@" $$unique; \ 453 | else \ 454 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 455 | $$unique; \ 456 | fi; \ 457 | fi 458 | ctags: ctags-recursive 459 | 460 | CTAGS: ctags 461 | ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 462 | $(am__define_uniq_tagged_files); \ 463 | test -z "$(CTAGS_ARGS)$$unique" \ 464 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 465 | $$unique 466 | 467 | GTAGS: 468 | here=`$(am__cd) $(top_builddir) && pwd` \ 469 | && $(am__cd) $(top_srcdir) \ 470 | && gtags -i $(GTAGS_ARGS) "$$here" 471 | cscope: cscope.files 472 | test ! -s cscope.files \ 473 | || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) 474 | clean-cscope: 475 | -rm -f cscope.files 476 | cscope.files: clean-cscope cscopelist 477 | cscopelist: cscopelist-recursive 478 | 479 | cscopelist-am: $(am__tagged_files) 480 | list='$(am__tagged_files)'; \ 481 | case "$(srcdir)" in \ 482 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ 483 | *) sdir=$(subdir)/$(srcdir) ;; \ 484 | esac; \ 485 | for i in $$list; do \ 486 | if test -f "$$i"; then \ 487 | echo "$(subdir)/$$i"; \ 488 | else \ 489 | echo "$$sdir/$$i"; \ 490 | fi; \ 491 | done >> $(top_builddir)/cscope.files 492 | 493 | distclean-tags: 494 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 495 | -rm -f cscope.out cscope.in.out cscope.po.out cscope.files 496 | 497 | distdir: $(DISTFILES) 498 | $(am__remove_distdir) 499 | test -d "$(distdir)" || mkdir "$(distdir)" 500 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 501 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 502 | list='$(DISTFILES)'; \ 503 | dist_files=`for file in $$list; do echo $$file; done | \ 504 | sed -e "s|^$$srcdirstrip/||;t" \ 505 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 506 | case $$dist_files in \ 507 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 508 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 509 | sort -u` ;; \ 510 | esac; \ 511 | for file in $$dist_files; do \ 512 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 513 | if test -d $$d/$$file; then \ 514 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 515 | if test -d "$(distdir)/$$file"; then \ 516 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 517 | fi; \ 518 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 519 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 520 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 521 | fi; \ 522 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 523 | else \ 524 | test -f "$(distdir)/$$file" \ 525 | || cp -p $$d/$$file "$(distdir)/$$file" \ 526 | || exit 1; \ 527 | fi; \ 528 | done 529 | @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 530 | if test "$$subdir" = .; then :; else \ 531 | $(am__make_dryrun) \ 532 | || test -d "$(distdir)/$$subdir" \ 533 | || $(MKDIR_P) "$(distdir)/$$subdir" \ 534 | || exit 1; \ 535 | dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ 536 | $(am__relativize); \ 537 | new_distdir=$$reldir; \ 538 | dir1=$$subdir; dir2="$(top_distdir)"; \ 539 | $(am__relativize); \ 540 | new_top_distdir=$$reldir; \ 541 | echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ 542 | echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ 543 | ($(am__cd) $$subdir && \ 544 | $(MAKE) $(AM_MAKEFLAGS) \ 545 | top_distdir="$$new_top_distdir" \ 546 | distdir="$$new_distdir" \ 547 | am__remove_distdir=: \ 548 | am__skip_length_check=: \ 549 | am__skip_mode_fix=: \ 550 | distdir) \ 551 | || exit 1; \ 552 | fi; \ 553 | done 554 | -test -n "$(am__skip_mode_fix)" \ 555 | || find "$(distdir)" -type d ! -perm -755 \ 556 | -exec chmod u+rwx,go+rx {} \; -o \ 557 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ 558 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ 559 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ 560 | || chmod -R a+r "$(distdir)" 561 | dist-gzip: distdir 562 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 563 | $(am__post_remove_distdir) 564 | 565 | dist-bzip2: distdir 566 | tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 567 | $(am__post_remove_distdir) 568 | 569 | dist-lzip: distdir 570 | tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz 571 | $(am__post_remove_distdir) 572 | 573 | dist-xz: distdir 574 | tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz 575 | $(am__post_remove_distdir) 576 | 577 | dist-tarZ: distdir 578 | @echo WARNING: "Support for shar distribution archives is" \ 579 | "deprecated." >&2 580 | @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 581 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z 582 | $(am__post_remove_distdir) 583 | 584 | dist-shar: distdir 585 | @echo WARNING: "Support for distribution archives compressed with" \ 586 | "legacy program 'compress' is deprecated." >&2 587 | @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 588 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz 589 | $(am__post_remove_distdir) 590 | 591 | dist-zip: distdir 592 | -rm -f $(distdir).zip 593 | zip -rq $(distdir).zip $(distdir) 594 | $(am__post_remove_distdir) 595 | 596 | dist dist-all: 597 | $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' 598 | $(am__post_remove_distdir) 599 | 600 | # This target untars the dist file and tries a VPATH configuration. Then 601 | # it guarantees that the distribution is self-contained by making another 602 | # tarfile. 603 | distcheck: dist 604 | case '$(DIST_ARCHIVES)' in \ 605 | *.tar.gz*) \ 606 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ 607 | *.tar.bz2*) \ 608 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ 609 | *.tar.lz*) \ 610 | lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ 611 | *.tar.xz*) \ 612 | xz -dc $(distdir).tar.xz | $(am__untar) ;;\ 613 | *.tar.Z*) \ 614 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ 615 | *.shar.gz*) \ 616 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ 617 | *.zip*) \ 618 | unzip $(distdir).zip ;;\ 619 | esac 620 | chmod -R a-w $(distdir) 621 | chmod u+w $(distdir) 622 | mkdir $(distdir)/_build $(distdir)/_inst 623 | chmod a-w $(distdir) 624 | test -d $(distdir)/_build || exit 0; \ 625 | dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ 626 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ 627 | && am__cwd=`pwd` \ 628 | && $(am__cd) $(distdir)/_build \ 629 | && ../configure --srcdir=.. --prefix="$$dc_install_base" \ 630 | $(AM_DISTCHECK_CONFIGURE_FLAGS) \ 631 | $(DISTCHECK_CONFIGURE_FLAGS) \ 632 | && $(MAKE) $(AM_MAKEFLAGS) \ 633 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ 634 | && $(MAKE) $(AM_MAKEFLAGS) check \ 635 | && $(MAKE) $(AM_MAKEFLAGS) install \ 636 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ 637 | && $(MAKE) $(AM_MAKEFLAGS) uninstall \ 638 | && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ 639 | distuninstallcheck \ 640 | && chmod -R a-w "$$dc_install_base" \ 641 | && ({ \ 642 | (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ 643 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ 644 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ 645 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ 646 | distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ 647 | } || { rm -rf "$$dc_destdir"; exit 1; }) \ 648 | && rm -rf "$$dc_destdir" \ 649 | && $(MAKE) $(AM_MAKEFLAGS) dist \ 650 | && rm -rf $(DIST_ARCHIVES) \ 651 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ 652 | && cd "$$am__cwd" \ 653 | || exit 1 654 | $(am__post_remove_distdir) 655 | @(echo "$(distdir) archives ready for distribution: "; \ 656 | list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ 657 | sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' 658 | distuninstallcheck: 659 | @test -n '$(distuninstallcheck_dir)' || { \ 660 | echo 'ERROR: trying to run $@ with an empty' \ 661 | '$$(distuninstallcheck_dir)' >&2; \ 662 | exit 1; \ 663 | }; \ 664 | $(am__cd) '$(distuninstallcheck_dir)' || { \ 665 | echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ 666 | exit 1; \ 667 | }; \ 668 | test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ 669 | || { echo "ERROR: files left after uninstall:" ; \ 670 | if test -n "$(DESTDIR)"; then \ 671 | echo " (check DESTDIR support)"; \ 672 | fi ; \ 673 | $(distuninstallcheck_listfiles) ; \ 674 | exit 1; } >&2 675 | distcleancheck: distclean 676 | @if test '$(srcdir)' = . ; then \ 677 | echo "ERROR: distcleancheck can only run from a VPATH build" ; \ 678 | exit 1 ; \ 679 | fi 680 | @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ 681 | || { echo "ERROR: files left in build directory after distclean:" ; \ 682 | $(distcleancheck_listfiles) ; \ 683 | exit 1; } >&2 684 | check-am: all-am 685 | check: check-recursive 686 | all-am: Makefile config.h 687 | installdirs: installdirs-recursive 688 | installdirs-am: 689 | install: install-recursive 690 | install-exec: install-exec-recursive 691 | install-data: install-data-recursive 692 | uninstall: uninstall-recursive 693 | 694 | install-am: all-am 695 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 696 | 697 | installcheck: installcheck-recursive 698 | install-strip: 699 | if test -z '$(STRIP)'; then \ 700 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 701 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 702 | install; \ 703 | else \ 704 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 705 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 706 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 707 | fi 708 | mostlyclean-generic: 709 | 710 | clean-generic: 711 | 712 | distclean-generic: 713 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 714 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 715 | 716 | maintainer-clean-generic: 717 | @echo "This command is intended for maintainers to use" 718 | @echo "it deletes files that may require special tools to rebuild." 719 | clean: clean-recursive 720 | 721 | clean-am: clean-generic clean-libtool mostlyclean-am 722 | 723 | distclean: distclean-recursive 724 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 725 | -rm -f Makefile 726 | distclean-am: clean-am distclean-generic distclean-hdr \ 727 | distclean-libtool distclean-tags 728 | 729 | dvi: dvi-recursive 730 | 731 | dvi-am: 732 | 733 | html: html-recursive 734 | 735 | html-am: 736 | 737 | info: info-recursive 738 | 739 | info-am: 740 | 741 | install-data-am: 742 | 743 | install-dvi: install-dvi-recursive 744 | 745 | install-dvi-am: 746 | 747 | install-exec-am: 748 | 749 | install-html: install-html-recursive 750 | 751 | install-html-am: 752 | 753 | install-info: install-info-recursive 754 | 755 | install-info-am: 756 | 757 | install-man: 758 | 759 | install-pdf: install-pdf-recursive 760 | 761 | install-pdf-am: 762 | 763 | install-ps: install-ps-recursive 764 | 765 | install-ps-am: 766 | 767 | installcheck-am: 768 | 769 | maintainer-clean: maintainer-clean-recursive 770 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 771 | -rm -rf $(top_srcdir)/autom4te.cache 772 | -rm -f Makefile 773 | maintainer-clean-am: distclean-am maintainer-clean-generic 774 | 775 | mostlyclean: mostlyclean-recursive 776 | 777 | mostlyclean-am: mostlyclean-generic mostlyclean-libtool 778 | 779 | pdf: pdf-recursive 780 | 781 | pdf-am: 782 | 783 | ps: ps-recursive 784 | 785 | ps-am: 786 | 787 | uninstall-am: 788 | 789 | .MAKE: $(am__recursive_targets) all install-am install-strip 790 | 791 | .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ 792 | am--refresh check check-am clean clean-cscope clean-generic \ 793 | clean-libtool cscope cscopelist-am ctags ctags-am dist \ 794 | dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ 795 | dist-xz dist-zip distcheck distclean distclean-generic \ 796 | distclean-hdr distclean-libtool distclean-tags distcleancheck \ 797 | distdir distuninstallcheck dvi dvi-am html html-am info \ 798 | info-am install install-am install-data install-data-am \ 799 | install-dvi install-dvi-am install-exec install-exec-am \ 800 | install-html install-html-am install-info install-info-am \ 801 | install-man install-pdf install-pdf-am install-ps \ 802 | install-ps-am install-strip installcheck installcheck-am \ 803 | installdirs installdirs-am maintainer-clean \ 804 | maintainer-clean-generic mostlyclean mostlyclean-generic \ 805 | mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ 806 | uninstall-am 807 | 808 | 809 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 810 | # Otherwise a system limit (for SysV at least) may be exceeded. 811 | .NOEXPORT: 812 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | creep-web-app-scanner 2 | ===================== 3 | 4 | A (very) primitive website scanner currently under development by an NCC Group employee and University graduate with 20% research time. creep currently crawls a site, and searches for potentially interesting information within each page. 5 | 6 | creep will crawl your (HTTP only) target and pull interesting info on the site, including: 7 | 8 | * Source code comments 9 | * Errors (MySQL errors, warnings, fatals, etc) 10 | * Linux file paths 11 | 12 | creep will also perform file/dir bashing on existing known locations to try and locate potentially interesting files/dirs (test.php, admin/, etc) 13 | 14 | creep will (in the near future) perform parameter bashing and compile a list of potentially interesting results by calculating the hashes of resource output, requesting the page using specific parameters, and then comparing the hash of the new output with that of the original to determine if a different output was generated. 15 | 16 | Other things and features to be added to creep include: 17 | 18 | * Unit testing 19 | * Search engine, site specific search (Google's site: inurl: etc..) 20 | * Form processing. Pulling action resources and (possibly) brute forcing 21 | * Potentially interesting parameters (file, debug, open, etc..) 22 | * Equivalent status code definitions. Some websites return 200 regardless of whether the requested resource is actually available/exists 23 | * Concurrent network IO 24 | * Loading/saving data to SQL db (SQLite) 25 | * Cross reference version strings with CVE database 26 | * Rulesets. Ability to customise what creep should be looking for 27 | 28 | Comments and questions should be sent to aidan dot marlin at nccgroup dot com 29 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | * Derp, HTTPS support? 2 | * Read robots.txt 3 | * Read comments 4 | * Return code 5 | * Source code 6 | * Brute force / dictionary files and directories 7 | * Read Error / Warning messages 8 | * Pull / determine GET requests per page 9 | * File paths 10 | * Search engine 11 | * Potentially interesting parameters 12 | * CVE version referencing 13 | ** Rulesets 14 | 15 | -- 16 | 17 | * Be wary of crawl holes 18 | -------------------------------------------------------------------------------- /build-aux/ar-lib: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Wrapper for Microsoft lib.exe 3 | 4 | me=ar-lib 5 | scriptversion=2012-03-01.08; # UTC 6 | 7 | # Copyright (C) 2010-2013 Free Software Foundation, Inc. 8 | # Written by Peter Rosin . 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, see . 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 | # This file is maintained in Automake, please report 29 | # bugs to or send patches to 30 | # . 31 | 32 | 33 | # func_error message 34 | func_error () 35 | { 36 | echo "$me: $1" 1>&2 37 | exit 1 38 | } 39 | 40 | file_conv= 41 | 42 | # func_file_conv build_file 43 | # Convert a $build file to $host form and store it in $file 44 | # Currently only supports Windows hosts. 45 | func_file_conv () 46 | { 47 | file=$1 48 | case $file in 49 | / | /[!/]*) # absolute file, and not a UNC file 50 | if test -z "$file_conv"; then 51 | # lazily determine how to convert abs files 52 | case `uname -s` in 53 | MINGW*) 54 | file_conv=mingw 55 | ;; 56 | CYGWIN*) 57 | file_conv=cygwin 58 | ;; 59 | *) 60 | file_conv=wine 61 | ;; 62 | esac 63 | fi 64 | case $file_conv in 65 | mingw) 66 | file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` 67 | ;; 68 | cygwin) 69 | file=`cygpath -m "$file" || echo "$file"` 70 | ;; 71 | wine) 72 | file=`winepath -w "$file" || echo "$file"` 73 | ;; 74 | esac 75 | ;; 76 | esac 77 | } 78 | 79 | # func_at_file at_file operation archive 80 | # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE 81 | # for each of them. 82 | # When interpreting the content of the @FILE, do NOT use func_file_conv, 83 | # since the user would need to supply preconverted file names to 84 | # binutils ar, at least for MinGW. 85 | func_at_file () 86 | { 87 | operation=$2 88 | archive=$3 89 | at_file_contents=`cat "$1"` 90 | eval set x "$at_file_contents" 91 | shift 92 | 93 | for member 94 | do 95 | $AR -NOLOGO $operation:"$member" "$archive" || exit $? 96 | done 97 | } 98 | 99 | case $1 in 100 | '') 101 | func_error "no command. Try '$0 --help' for more information." 102 | ;; 103 | -h | --h*) 104 | cat <. 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, or (at your option) 12 | # 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, see . 21 | 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | # This file is maintained in Automake, please report 28 | # bugs to or send patches to 29 | # . 30 | 31 | nl=' 32 | ' 33 | 34 | # We need space, tab and new line, in precisely that order. Quoting is 35 | # there to prevent tools from complaining about whitespace usage. 36 | IFS=" "" $nl" 37 | 38 | file_conv= 39 | 40 | # func_file_conv build_file lazy 41 | # Convert a $build file to $host form and store it in $file 42 | # Currently only supports Windows hosts. If the determined conversion 43 | # type is listed in (the comma separated) LAZY, no conversion will 44 | # take place. 45 | func_file_conv () 46 | { 47 | file=$1 48 | case $file in 49 | / | /[!/]*) # absolute file, and not a UNC file 50 | if test -z "$file_conv"; then 51 | # lazily determine how to convert abs files 52 | case `uname -s` in 53 | MINGW*) 54 | file_conv=mingw 55 | ;; 56 | CYGWIN*) 57 | file_conv=cygwin 58 | ;; 59 | *) 60 | file_conv=wine 61 | ;; 62 | esac 63 | fi 64 | case $file_conv/,$2, in 65 | *,$file_conv,*) 66 | ;; 67 | mingw/*) 68 | file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` 69 | ;; 70 | cygwin/*) 71 | file=`cygpath -m "$file" || echo "$file"` 72 | ;; 73 | wine/*) 74 | file=`winepath -w "$file" || echo "$file"` 75 | ;; 76 | esac 77 | ;; 78 | esac 79 | } 80 | 81 | # func_cl_dashL linkdir 82 | # Make cl look for libraries in LINKDIR 83 | func_cl_dashL () 84 | { 85 | func_file_conv "$1" 86 | if test -z "$lib_path"; then 87 | lib_path=$file 88 | else 89 | lib_path="$lib_path;$file" 90 | fi 91 | linker_opts="$linker_opts -LIBPATH:$file" 92 | } 93 | 94 | # func_cl_dashl library 95 | # Do a library search-path lookup for cl 96 | func_cl_dashl () 97 | { 98 | lib=$1 99 | found=no 100 | save_IFS=$IFS 101 | IFS=';' 102 | for dir in $lib_path $LIB 103 | do 104 | IFS=$save_IFS 105 | if $shared && test -f "$dir/$lib.dll.lib"; then 106 | found=yes 107 | lib=$dir/$lib.dll.lib 108 | break 109 | fi 110 | if test -f "$dir/$lib.lib"; then 111 | found=yes 112 | lib=$dir/$lib.lib 113 | break 114 | fi 115 | if test -f "$dir/lib$lib.a"; then 116 | found=yes 117 | lib=$dir/lib$lib.a 118 | break 119 | fi 120 | done 121 | IFS=$save_IFS 122 | 123 | if test "$found" != yes; then 124 | lib=$lib.lib 125 | fi 126 | } 127 | 128 | # func_cl_wrapper cl arg... 129 | # Adjust compile command to suit cl 130 | func_cl_wrapper () 131 | { 132 | # Assume a capable shell 133 | lib_path= 134 | shared=: 135 | linker_opts= 136 | for arg 137 | do 138 | if test -n "$eat"; then 139 | eat= 140 | else 141 | case $1 in 142 | -o) 143 | # configure might choose to run compile as 'compile cc -o foo foo.c'. 144 | eat=1 145 | case $2 in 146 | *.o | *.[oO][bB][jJ]) 147 | func_file_conv "$2" 148 | set x "$@" -Fo"$file" 149 | shift 150 | ;; 151 | *) 152 | func_file_conv "$2" 153 | set x "$@" -Fe"$file" 154 | shift 155 | ;; 156 | esac 157 | ;; 158 | -I) 159 | eat=1 160 | func_file_conv "$2" mingw 161 | set x "$@" -I"$file" 162 | shift 163 | ;; 164 | -I*) 165 | func_file_conv "${1#-I}" mingw 166 | set x "$@" -I"$file" 167 | shift 168 | ;; 169 | -l) 170 | eat=1 171 | func_cl_dashl "$2" 172 | set x "$@" "$lib" 173 | shift 174 | ;; 175 | -l*) 176 | func_cl_dashl "${1#-l}" 177 | set x "$@" "$lib" 178 | shift 179 | ;; 180 | -L) 181 | eat=1 182 | func_cl_dashL "$2" 183 | ;; 184 | -L*) 185 | func_cl_dashL "${1#-L}" 186 | ;; 187 | -static) 188 | shared=false 189 | ;; 190 | -Wl,*) 191 | arg=${1#-Wl,} 192 | save_ifs="$IFS"; IFS=',' 193 | for flag in $arg; do 194 | IFS="$save_ifs" 195 | linker_opts="$linker_opts $flag" 196 | done 197 | IFS="$save_ifs" 198 | ;; 199 | -Xlinker) 200 | eat=1 201 | linker_opts="$linker_opts $2" 202 | ;; 203 | -*) 204 | set x "$@" "$1" 205 | shift 206 | ;; 207 | *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) 208 | func_file_conv "$1" 209 | set x "$@" -Tp"$file" 210 | shift 211 | ;; 212 | *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) 213 | func_file_conv "$1" mingw 214 | set x "$@" "$file" 215 | shift 216 | ;; 217 | *) 218 | set x "$@" "$1" 219 | shift 220 | ;; 221 | esac 222 | fi 223 | shift 224 | done 225 | if test -n "$linker_opts"; then 226 | linker_opts="-link$linker_opts" 227 | fi 228 | exec "$@" $linker_opts 229 | exit 1 230 | } 231 | 232 | eat= 233 | 234 | case $1 in 235 | '') 236 | echo "$0: No command. Try '$0 --help' for more information." 1>&2 237 | exit 1; 238 | ;; 239 | -h | --h*) 240 | cat <<\EOF 241 | Usage: compile [--help] [--version] PROGRAM [ARGS] 242 | 243 | Wrapper for compilers which do not understand '-c -o'. 244 | Remove '-o dest.o' from ARGS, run PROGRAM with the remaining 245 | arguments, and rename the output as expected. 246 | 247 | If you are trying to build a whole package this is not the 248 | right script to run: please start by reading the file 'INSTALL'. 249 | 250 | Report bugs to . 251 | EOF 252 | exit $? 253 | ;; 254 | -v | --v*) 255 | echo "compile $scriptversion" 256 | exit $? 257 | ;; 258 | cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) 259 | func_cl_wrapper "$@" # Doesn't return... 260 | ;; 261 | esac 262 | 263 | ofile= 264 | cfile= 265 | 266 | for arg 267 | do 268 | if test -n "$eat"; then 269 | eat= 270 | else 271 | case $1 in 272 | -o) 273 | # configure might choose to run compile as 'compile cc -o foo foo.c'. 274 | # So we strip '-o arg' only if arg is an object. 275 | eat=1 276 | case $2 in 277 | *.o | *.obj) 278 | ofile=$2 279 | ;; 280 | *) 281 | set x "$@" -o "$2" 282 | shift 283 | ;; 284 | esac 285 | ;; 286 | *.c) 287 | cfile=$1 288 | set x "$@" "$1" 289 | shift 290 | ;; 291 | *) 292 | set x "$@" "$1" 293 | shift 294 | ;; 295 | esac 296 | fi 297 | shift 298 | done 299 | 300 | if test -z "$ofile" || test -z "$cfile"; then 301 | # If no '-o' option was seen then we might have been invoked from a 302 | # pattern rule where we don't need one. That is ok -- this is a 303 | # normal compilation that the losing compiler can handle. If no 304 | # '.c' file was seen then we are probably linking. That is also 305 | # ok. 306 | exec "$@" 307 | fi 308 | 309 | # Name of file we expect compiler to create. 310 | cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` 311 | 312 | # Create the lock directory. 313 | # Note: use '[/\\:.-]' here to ensure that we don't use the same name 314 | # that we are using for the .o file. Also, base the name on the expected 315 | # object file name, since that is what matters with a parallel build. 316 | lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d 317 | while true; do 318 | if mkdir "$lockdir" >/dev/null 2>&1; then 319 | break 320 | fi 321 | sleep 1 322 | done 323 | # FIXME: race condition here if user kills between mkdir and trap. 324 | trap "rmdir '$lockdir'; exit 1" 1 2 15 325 | 326 | # Run the compile. 327 | "$@" 328 | ret=$? 329 | 330 | if test -f "$cofile"; then 331 | test "$cofile" = "$ofile" || mv "$cofile" "$ofile" 332 | elif test -f "${cofile}bj"; then 333 | test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" 334 | fi 335 | 336 | rmdir "$lockdir" 337 | exit $ret 338 | 339 | # Local Variables: 340 | # mode: shell-script 341 | # sh-indentation: 2 342 | # eval: (add-hook 'write-file-hooks 'time-stamp) 343 | # time-stamp-start: "scriptversion=" 344 | # time-stamp-format: "%:y-%02m-%02d.%02H" 345 | # time-stamp-time-zone: "UTC" 346 | # time-stamp-end: "; # UTC" 347 | # End: 348 | -------------------------------------------------------------------------------- /build-aux/depcomp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # depcomp - compile a program generating dependencies as side-effects 3 | 4 | scriptversion=2013-05-30.07; # UTC 5 | 6 | # Copyright (C) 1999-2013 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, see . 20 | 21 | # As a special exception to the GNU General Public License, if you 22 | # distribute this file as part of a program that contains a 23 | # configuration script generated by Autoconf, you may include it under 24 | # the same distribution terms that you use for the rest of that program. 25 | 26 | # Originally written by Alexandre Oliva . 27 | 28 | case $1 in 29 | '') 30 | echo "$0: No command. Try '$0 --help' for more information." 1>&2 31 | exit 1; 32 | ;; 33 | -h | --h*) 34 | cat <<\EOF 35 | Usage: depcomp [--help] [--version] PROGRAM [ARGS] 36 | 37 | Run PROGRAMS ARGS to compile a file, generating dependencies 38 | as side-effects. 39 | 40 | Environment variables: 41 | depmode Dependency tracking mode. 42 | source Source file read by 'PROGRAMS ARGS'. 43 | object Object file output by 'PROGRAMS ARGS'. 44 | DEPDIR directory where to store dependencies. 45 | depfile Dependency file to output. 46 | tmpdepfile Temporary file to use when outputting dependencies. 47 | libtool Whether libtool is used (yes/no). 48 | 49 | Report bugs to . 50 | EOF 51 | exit $? 52 | ;; 53 | -v | --v*) 54 | echo "depcomp $scriptversion" 55 | exit $? 56 | ;; 57 | esac 58 | 59 | # Get the directory component of the given path, and save it in the 60 | # global variables '$dir'. Note that this directory component will 61 | # be either empty or ending with a '/' character. This is deliberate. 62 | set_dir_from () 63 | { 64 | case $1 in 65 | */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; 66 | *) dir=;; 67 | esac 68 | } 69 | 70 | # Get the suffix-stripped basename of the given path, and save it the 71 | # global variable '$base'. 72 | set_base_from () 73 | { 74 | base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` 75 | } 76 | 77 | # If no dependency file was actually created by the compiler invocation, 78 | # we still have to create a dummy depfile, to avoid errors with the 79 | # Makefile "include basename.Plo" scheme. 80 | make_dummy_depfile () 81 | { 82 | echo "#dummy" > "$depfile" 83 | } 84 | 85 | # Factor out some common post-processing of the generated depfile. 86 | # Requires the auxiliary global variable '$tmpdepfile' to be set. 87 | aix_post_process_depfile () 88 | { 89 | # If the compiler actually managed to produce a dependency file, 90 | # post-process it. 91 | if test -f "$tmpdepfile"; then 92 | # Each line is of the form 'foo.o: dependency.h'. 93 | # Do two passes, one to just change these to 94 | # $object: dependency.h 95 | # and one to simply output 96 | # dependency.h: 97 | # which is needed to avoid the deleted-header problem. 98 | { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" 99 | sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" 100 | } > "$depfile" 101 | rm -f "$tmpdepfile" 102 | else 103 | make_dummy_depfile 104 | fi 105 | } 106 | 107 | # A tabulation character. 108 | tab=' ' 109 | # A newline character. 110 | nl=' 111 | ' 112 | # Character ranges might be problematic outside the C locale. 113 | # These definitions help. 114 | upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ 115 | lower=abcdefghijklmnopqrstuvwxyz 116 | digits=0123456789 117 | alpha=${upper}${lower} 118 | 119 | if test -z "$depmode" || test -z "$source" || test -z "$object"; then 120 | echo "depcomp: Variables source, object and depmode must be set" 1>&2 121 | exit 1 122 | fi 123 | 124 | # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. 125 | depfile=${depfile-`echo "$object" | 126 | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} 127 | tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} 128 | 129 | rm -f "$tmpdepfile" 130 | 131 | # Avoid interferences from the environment. 132 | gccflag= dashmflag= 133 | 134 | # Some modes work just like other modes, but use different flags. We 135 | # parameterize here, but still list the modes in the big case below, 136 | # to make depend.m4 easier to write. Note that we *cannot* use a case 137 | # here, because this file can only contain one case statement. 138 | if test "$depmode" = hp; then 139 | # HP compiler uses -M and no extra arg. 140 | gccflag=-M 141 | depmode=gcc 142 | fi 143 | 144 | if test "$depmode" = dashXmstdout; then 145 | # This is just like dashmstdout with a different argument. 146 | dashmflag=-xM 147 | depmode=dashmstdout 148 | fi 149 | 150 | cygpath_u="cygpath -u -f -" 151 | if test "$depmode" = msvcmsys; then 152 | # This is just like msvisualcpp but w/o cygpath translation. 153 | # Just convert the backslash-escaped backslashes to single forward 154 | # slashes to satisfy depend.m4 155 | cygpath_u='sed s,\\\\,/,g' 156 | depmode=msvisualcpp 157 | fi 158 | 159 | if test "$depmode" = msvc7msys; then 160 | # This is just like msvc7 but w/o cygpath translation. 161 | # Just convert the backslash-escaped backslashes to single forward 162 | # slashes to satisfy depend.m4 163 | cygpath_u='sed s,\\\\,/,g' 164 | depmode=msvc7 165 | fi 166 | 167 | if test "$depmode" = xlc; then 168 | # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. 169 | gccflag=-qmakedep=gcc,-MF 170 | depmode=gcc 171 | fi 172 | 173 | case "$depmode" in 174 | gcc3) 175 | ## gcc 3 implements dependency tracking that does exactly what 176 | ## we want. Yay! Note: for some reason libtool 1.4 doesn't like 177 | ## it if -MD -MP comes after the -MF stuff. Hmm. 178 | ## Unfortunately, FreeBSD c89 acceptance of flags depends upon 179 | ## the command line argument order; so add the flags where they 180 | ## appear in depend2.am. Note that the slowdown incurred here 181 | ## affects only configure: in makefiles, %FASTDEP% shortcuts this. 182 | for arg 183 | do 184 | case $arg in 185 | -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; 186 | *) set fnord "$@" "$arg" ;; 187 | esac 188 | shift # fnord 189 | shift # $arg 190 | done 191 | "$@" 192 | stat=$? 193 | if test $stat -ne 0; then 194 | rm -f "$tmpdepfile" 195 | exit $stat 196 | fi 197 | mv "$tmpdepfile" "$depfile" 198 | ;; 199 | 200 | gcc) 201 | ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. 202 | ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. 203 | ## (see the conditional assignment to $gccflag above). 204 | ## There are various ways to get dependency output from gcc. Here's 205 | ## why we pick this rather obscure method: 206 | ## - Don't want to use -MD because we'd like the dependencies to end 207 | ## up in a subdir. Having to rename by hand is ugly. 208 | ## (We might end up doing this anyway to support other compilers.) 209 | ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like 210 | ## -MM, not -M (despite what the docs say). Also, it might not be 211 | ## supported by the other compilers which use the 'gcc' depmode. 212 | ## - Using -M directly means running the compiler twice (even worse 213 | ## than renaming). 214 | if test -z "$gccflag"; then 215 | gccflag=-MD, 216 | fi 217 | "$@" -Wp,"$gccflag$tmpdepfile" 218 | stat=$? 219 | if test $stat -ne 0; then 220 | rm -f "$tmpdepfile" 221 | exit $stat 222 | fi 223 | rm -f "$depfile" 224 | echo "$object : \\" > "$depfile" 225 | # The second -e expression handles DOS-style file names with drive 226 | # letters. 227 | sed -e 's/^[^:]*: / /' \ 228 | -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" 229 | ## This next piece of magic avoids the "deleted header file" problem. 230 | ## The problem is that when a header file which appears in a .P file 231 | ## is deleted, the dependency causes make to die (because there is 232 | ## typically no way to rebuild the header). We avoid this by adding 233 | ## dummy dependencies for each header file. Too bad gcc doesn't do 234 | ## this for us directly. 235 | ## Some versions of gcc put a space before the ':'. On the theory 236 | ## that the space means something, we add a space to the output as 237 | ## well. hp depmode also adds that space, but also prefixes the VPATH 238 | ## to the object. Take care to not repeat it in the output. 239 | ## Some versions of the HPUX 10.20 sed can't process this invocation 240 | ## correctly. Breaking it into two sed invocations is a workaround. 241 | tr ' ' "$nl" < "$tmpdepfile" \ 242 | | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ 243 | | sed -e 's/$/ :/' >> "$depfile" 244 | rm -f "$tmpdepfile" 245 | ;; 246 | 247 | hp) 248 | # This case exists only to let depend.m4 do its work. It works by 249 | # looking at the text of this script. This case will never be run, 250 | # since it is checked for above. 251 | exit 1 252 | ;; 253 | 254 | sgi) 255 | if test "$libtool" = yes; then 256 | "$@" "-Wp,-MDupdate,$tmpdepfile" 257 | else 258 | "$@" -MDupdate "$tmpdepfile" 259 | fi 260 | stat=$? 261 | if test $stat -ne 0; then 262 | rm -f "$tmpdepfile" 263 | exit $stat 264 | fi 265 | rm -f "$depfile" 266 | 267 | if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files 268 | echo "$object : \\" > "$depfile" 269 | # Clip off the initial element (the dependent). Don't try to be 270 | # clever and replace this with sed code, as IRIX sed won't handle 271 | # lines with more than a fixed number of characters (4096 in 272 | # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; 273 | # the IRIX cc adds comments like '#:fec' to the end of the 274 | # dependency line. 275 | tr ' ' "$nl" < "$tmpdepfile" \ 276 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ 277 | | tr "$nl" ' ' >> "$depfile" 278 | echo >> "$depfile" 279 | # The second pass generates a dummy entry for each header file. 280 | tr ' ' "$nl" < "$tmpdepfile" \ 281 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ 282 | >> "$depfile" 283 | else 284 | make_dummy_depfile 285 | fi 286 | rm -f "$tmpdepfile" 287 | ;; 288 | 289 | xlc) 290 | # This case exists only to let depend.m4 do its work. It works by 291 | # looking at the text of this script. This case will never be run, 292 | # since it is checked for above. 293 | exit 1 294 | ;; 295 | 296 | aix) 297 | # The C for AIX Compiler uses -M and outputs the dependencies 298 | # in a .u file. In older versions, this file always lives in the 299 | # current directory. Also, the AIX compiler puts '$object:' at the 300 | # start of each line; $object doesn't have directory information. 301 | # Version 6 uses the directory in both cases. 302 | set_dir_from "$object" 303 | set_base_from "$object" 304 | if test "$libtool" = yes; then 305 | tmpdepfile1=$dir$base.u 306 | tmpdepfile2=$base.u 307 | tmpdepfile3=$dir.libs/$base.u 308 | "$@" -Wc,-M 309 | else 310 | tmpdepfile1=$dir$base.u 311 | tmpdepfile2=$dir$base.u 312 | tmpdepfile3=$dir$base.u 313 | "$@" -M 314 | fi 315 | stat=$? 316 | if test $stat -ne 0; then 317 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 318 | exit $stat 319 | fi 320 | 321 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 322 | do 323 | test -f "$tmpdepfile" && break 324 | done 325 | aix_post_process_depfile 326 | ;; 327 | 328 | tcc) 329 | # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 330 | # FIXME: That version still under development at the moment of writing. 331 | # Make that this statement remains true also for stable, released 332 | # versions. 333 | # It will wrap lines (doesn't matter whether long or short) with a 334 | # trailing '\', as in: 335 | # 336 | # foo.o : \ 337 | # foo.c \ 338 | # foo.h \ 339 | # 340 | # It will put a trailing '\' even on the last line, and will use leading 341 | # spaces rather than leading tabs (at least since its commit 0394caf7 342 | # "Emit spaces for -MD"). 343 | "$@" -MD -MF "$tmpdepfile" 344 | stat=$? 345 | if test $stat -ne 0; then 346 | rm -f "$tmpdepfile" 347 | exit $stat 348 | fi 349 | rm -f "$depfile" 350 | # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. 351 | # We have to change lines of the first kind to '$object: \'. 352 | sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" 353 | # And for each line of the second kind, we have to emit a 'dep.h:' 354 | # dummy dependency, to avoid the deleted-header problem. 355 | sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" 356 | rm -f "$tmpdepfile" 357 | ;; 358 | 359 | ## The order of this option in the case statement is important, since the 360 | ## shell code in configure will try each of these formats in the order 361 | ## listed in this file. A plain '-MD' option would be understood by many 362 | ## compilers, so we must ensure this comes after the gcc and icc options. 363 | pgcc) 364 | # Portland's C compiler understands '-MD'. 365 | # Will always output deps to 'file.d' where file is the root name of the 366 | # source file under compilation, even if file resides in a subdirectory. 367 | # The object file name does not affect the name of the '.d' file. 368 | # pgcc 10.2 will output 369 | # foo.o: sub/foo.c sub/foo.h 370 | # and will wrap long lines using '\' : 371 | # foo.o: sub/foo.c ... \ 372 | # sub/foo.h ... \ 373 | # ... 374 | set_dir_from "$object" 375 | # Use the source, not the object, to determine the base name, since 376 | # that's sadly what pgcc will do too. 377 | set_base_from "$source" 378 | tmpdepfile=$base.d 379 | 380 | # For projects that build the same source file twice into different object 381 | # files, the pgcc approach of using the *source* file root name can cause 382 | # problems in parallel builds. Use a locking strategy to avoid stomping on 383 | # the same $tmpdepfile. 384 | lockdir=$base.d-lock 385 | trap " 386 | echo '$0: caught signal, cleaning up...' >&2 387 | rmdir '$lockdir' 388 | exit 1 389 | " 1 2 13 15 390 | numtries=100 391 | i=$numtries 392 | while test $i -gt 0; do 393 | # mkdir is a portable test-and-set. 394 | if mkdir "$lockdir" 2>/dev/null; then 395 | # This process acquired the lock. 396 | "$@" -MD 397 | stat=$? 398 | # Release the lock. 399 | rmdir "$lockdir" 400 | break 401 | else 402 | # If the lock is being held by a different process, wait 403 | # until the winning process is done or we timeout. 404 | while test -d "$lockdir" && test $i -gt 0; do 405 | sleep 1 406 | i=`expr $i - 1` 407 | done 408 | fi 409 | i=`expr $i - 1` 410 | done 411 | trap - 1 2 13 15 412 | if test $i -le 0; then 413 | echo "$0: failed to acquire lock after $numtries attempts" >&2 414 | echo "$0: check lockdir '$lockdir'" >&2 415 | exit 1 416 | fi 417 | 418 | if test $stat -ne 0; then 419 | rm -f "$tmpdepfile" 420 | exit $stat 421 | fi 422 | rm -f "$depfile" 423 | # Each line is of the form `foo.o: dependent.h', 424 | # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. 425 | # Do two passes, one to just change these to 426 | # `$object: dependent.h' and one to simply `dependent.h:'. 427 | sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" 428 | # Some versions of the HPUX 10.20 sed can't process this invocation 429 | # correctly. Breaking it into two sed invocations is a workaround. 430 | sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ 431 | | sed -e 's/$/ :/' >> "$depfile" 432 | rm -f "$tmpdepfile" 433 | ;; 434 | 435 | hp2) 436 | # The "hp" stanza above does not work with aCC (C++) and HP's ia64 437 | # compilers, which have integrated preprocessors. The correct option 438 | # to use with these is +Maked; it writes dependencies to a file named 439 | # 'foo.d', which lands next to the object file, wherever that 440 | # happens to be. 441 | # Much of this is similar to the tru64 case; see comments there. 442 | set_dir_from "$object" 443 | set_base_from "$object" 444 | if test "$libtool" = yes; then 445 | tmpdepfile1=$dir$base.d 446 | tmpdepfile2=$dir.libs/$base.d 447 | "$@" -Wc,+Maked 448 | else 449 | tmpdepfile1=$dir$base.d 450 | tmpdepfile2=$dir$base.d 451 | "$@" +Maked 452 | fi 453 | stat=$? 454 | if test $stat -ne 0; then 455 | rm -f "$tmpdepfile1" "$tmpdepfile2" 456 | exit $stat 457 | fi 458 | 459 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" 460 | do 461 | test -f "$tmpdepfile" && break 462 | done 463 | if test -f "$tmpdepfile"; then 464 | sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" 465 | # Add 'dependent.h:' lines. 466 | sed -ne '2,${ 467 | s/^ *// 468 | s/ \\*$// 469 | s/$/:/ 470 | p 471 | }' "$tmpdepfile" >> "$depfile" 472 | else 473 | make_dummy_depfile 474 | fi 475 | rm -f "$tmpdepfile" "$tmpdepfile2" 476 | ;; 477 | 478 | tru64) 479 | # The Tru64 compiler uses -MD to generate dependencies as a side 480 | # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. 481 | # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 482 | # dependencies in 'foo.d' instead, so we check for that too. 483 | # Subdirectories are respected. 484 | set_dir_from "$object" 485 | set_base_from "$object" 486 | 487 | if test "$libtool" = yes; then 488 | # Libtool generates 2 separate objects for the 2 libraries. These 489 | # two compilations output dependencies in $dir.libs/$base.o.d and 490 | # in $dir$base.o.d. We have to check for both files, because 491 | # one of the two compilations can be disabled. We should prefer 492 | # $dir$base.o.d over $dir.libs/$base.o.d because the latter is 493 | # automatically cleaned when .libs/ is deleted, while ignoring 494 | # the former would cause a distcleancheck panic. 495 | tmpdepfile1=$dir$base.o.d # libtool 1.5 496 | tmpdepfile2=$dir.libs/$base.o.d # Likewise. 497 | tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 498 | "$@" -Wc,-MD 499 | else 500 | tmpdepfile1=$dir$base.d 501 | tmpdepfile2=$dir$base.d 502 | tmpdepfile3=$dir$base.d 503 | "$@" -MD 504 | fi 505 | 506 | stat=$? 507 | if test $stat -ne 0; then 508 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 509 | exit $stat 510 | fi 511 | 512 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 513 | do 514 | test -f "$tmpdepfile" && break 515 | done 516 | # Same post-processing that is required for AIX mode. 517 | aix_post_process_depfile 518 | ;; 519 | 520 | msvc7) 521 | if test "$libtool" = yes; then 522 | showIncludes=-Wc,-showIncludes 523 | else 524 | showIncludes=-showIncludes 525 | fi 526 | "$@" $showIncludes > "$tmpdepfile" 527 | stat=$? 528 | grep -v '^Note: including file: ' "$tmpdepfile" 529 | if test $stat -ne 0; then 530 | rm -f "$tmpdepfile" 531 | exit $stat 532 | fi 533 | rm -f "$depfile" 534 | echo "$object : \\" > "$depfile" 535 | # The first sed program below extracts the file names and escapes 536 | # backslashes for cygpath. The second sed program outputs the file 537 | # name when reading, but also accumulates all include files in the 538 | # hold buffer in order to output them again at the end. This only 539 | # works with sed implementations that can handle large buffers. 540 | sed < "$tmpdepfile" -n ' 541 | /^Note: including file: *\(.*\)/ { 542 | s//\1/ 543 | s/\\/\\\\/g 544 | p 545 | }' | $cygpath_u | sort -u | sed -n ' 546 | s/ /\\ /g 547 | s/\(.*\)/'"$tab"'\1 \\/p 548 | s/.\(.*\) \\/\1:/ 549 | H 550 | $ { 551 | s/.*/'"$tab"'/ 552 | G 553 | p 554 | }' >> "$depfile" 555 | echo >> "$depfile" # make sure the fragment doesn't end with a backslash 556 | rm -f "$tmpdepfile" 557 | ;; 558 | 559 | msvc7msys) 560 | # This case exists only to let depend.m4 do its work. It works by 561 | # looking at the text of this script. This case will never be run, 562 | # since it is checked for above. 563 | exit 1 564 | ;; 565 | 566 | #nosideeffect) 567 | # This comment above is used by automake to tell side-effect 568 | # dependency tracking mechanisms from slower ones. 569 | 570 | dashmstdout) 571 | # Important note: in order to support this mode, a compiler *must* 572 | # always write the preprocessed file to stdout, regardless of -o. 573 | "$@" || exit $? 574 | 575 | # Remove the call to Libtool. 576 | if test "$libtool" = yes; then 577 | while test "X$1" != 'X--mode=compile'; do 578 | shift 579 | done 580 | shift 581 | fi 582 | 583 | # Remove '-o $object'. 584 | IFS=" " 585 | for arg 586 | do 587 | case $arg in 588 | -o) 589 | shift 590 | ;; 591 | $object) 592 | shift 593 | ;; 594 | *) 595 | set fnord "$@" "$arg" 596 | shift # fnord 597 | shift # $arg 598 | ;; 599 | esac 600 | done 601 | 602 | test -z "$dashmflag" && dashmflag=-M 603 | # Require at least two characters before searching for ':' 604 | # in the target name. This is to cope with DOS-style filenames: 605 | # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. 606 | "$@" $dashmflag | 607 | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" 608 | rm -f "$depfile" 609 | cat < "$tmpdepfile" > "$depfile" 610 | # Some versions of the HPUX 10.20 sed can't process this sed invocation 611 | # correctly. Breaking it into two sed invocations is a workaround. 612 | tr ' ' "$nl" < "$tmpdepfile" \ 613 | | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ 614 | | sed -e 's/$/ :/' >> "$depfile" 615 | rm -f "$tmpdepfile" 616 | ;; 617 | 618 | dashXmstdout) 619 | # This case only exists to satisfy depend.m4. It is never actually 620 | # run, as this mode is specially recognized in the preamble. 621 | exit 1 622 | ;; 623 | 624 | makedepend) 625 | "$@" || exit $? 626 | # Remove any Libtool call 627 | if test "$libtool" = yes; then 628 | while test "X$1" != 'X--mode=compile'; do 629 | shift 630 | done 631 | shift 632 | fi 633 | # X makedepend 634 | shift 635 | cleared=no eat=no 636 | for arg 637 | do 638 | case $cleared in 639 | no) 640 | set ""; shift 641 | cleared=yes ;; 642 | esac 643 | if test $eat = yes; then 644 | eat=no 645 | continue 646 | fi 647 | case "$arg" in 648 | -D*|-I*) 649 | set fnord "$@" "$arg"; shift ;; 650 | # Strip any option that makedepend may not understand. Remove 651 | # the object too, otherwise makedepend will parse it as a source file. 652 | -arch) 653 | eat=yes ;; 654 | -*|$object) 655 | ;; 656 | *) 657 | set fnord "$@" "$arg"; shift ;; 658 | esac 659 | done 660 | obj_suffix=`echo "$object" | sed 's/^.*\././'` 661 | touch "$tmpdepfile" 662 | ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" 663 | rm -f "$depfile" 664 | # makedepend may prepend the VPATH from the source file name to the object. 665 | # No need to regex-escape $object, excess matching of '.' is harmless. 666 | sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" 667 | # Some versions of the HPUX 10.20 sed can't process the last invocation 668 | # correctly. Breaking it into two sed invocations is a workaround. 669 | sed '1,2d' "$tmpdepfile" \ 670 | | tr ' ' "$nl" \ 671 | | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ 672 | | sed -e 's/$/ :/' >> "$depfile" 673 | rm -f "$tmpdepfile" "$tmpdepfile".bak 674 | ;; 675 | 676 | cpp) 677 | # Important note: in order to support this mode, a compiler *must* 678 | # always write the preprocessed file to stdout. 679 | "$@" || exit $? 680 | 681 | # Remove the call to Libtool. 682 | if test "$libtool" = yes; then 683 | while test "X$1" != 'X--mode=compile'; do 684 | shift 685 | done 686 | shift 687 | fi 688 | 689 | # Remove '-o $object'. 690 | IFS=" " 691 | for arg 692 | do 693 | case $arg in 694 | -o) 695 | shift 696 | ;; 697 | $object) 698 | shift 699 | ;; 700 | *) 701 | set fnord "$@" "$arg" 702 | shift # fnord 703 | shift # $arg 704 | ;; 705 | esac 706 | done 707 | 708 | "$@" -E \ 709 | | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 710 | -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 711 | | sed '$ s: \\$::' > "$tmpdepfile" 712 | rm -f "$depfile" 713 | echo "$object : \\" > "$depfile" 714 | cat < "$tmpdepfile" >> "$depfile" 715 | sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" 716 | rm -f "$tmpdepfile" 717 | ;; 718 | 719 | msvisualcpp) 720 | # Important note: in order to support this mode, a compiler *must* 721 | # always write the preprocessed file to stdout. 722 | "$@" || exit $? 723 | 724 | # Remove the call to Libtool. 725 | if test "$libtool" = yes; then 726 | while test "X$1" != 'X--mode=compile'; do 727 | shift 728 | done 729 | shift 730 | fi 731 | 732 | IFS=" " 733 | for arg 734 | do 735 | case "$arg" in 736 | -o) 737 | shift 738 | ;; 739 | $object) 740 | shift 741 | ;; 742 | "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") 743 | set fnord "$@" 744 | shift 745 | shift 746 | ;; 747 | *) 748 | set fnord "$@" "$arg" 749 | shift 750 | shift 751 | ;; 752 | esac 753 | done 754 | "$@" -E 2>/dev/null | 755 | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" 756 | rm -f "$depfile" 757 | echo "$object : \\" > "$depfile" 758 | sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" 759 | echo "$tab" >> "$depfile" 760 | sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" 761 | rm -f "$tmpdepfile" 762 | ;; 763 | 764 | msvcmsys) 765 | # This case exists only to let depend.m4 do its work. It works by 766 | # looking at the text of this script. This case will never be run, 767 | # since it is checked for above. 768 | exit 1 769 | ;; 770 | 771 | none) 772 | exec "$@" 773 | ;; 774 | 775 | *) 776 | echo "Unknown depmode $depmode" 1>&2 777 | exit 1 778 | ;; 779 | esac 780 | 781 | exit 0 782 | 783 | # Local Variables: 784 | # mode: shell-script 785 | # sh-indentation: 2 786 | # eval: (add-hook 'write-file-hooks 'time-stamp) 787 | # time-stamp-start: "scriptversion=" 788 | # time-stamp-format: "%:y-%02m-%02d.%02H" 789 | # time-stamp-time-zone: "UTC" 790 | # time-stamp-end: "; # UTC" 791 | # End: 792 | -------------------------------------------------------------------------------- /build-aux/install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # install - install a program, script, or datafile 3 | 4 | scriptversion=2011-11-20.07; # UTC 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. 43 | 44 | nl=' 45 | ' 46 | IFS=" "" $nl" 47 | 48 | # set DOITPROG to echo to test this script 49 | 50 | # Don't use :- since 4.3BSD and earlier shells don't like it. 51 | doit=${DOITPROG-} 52 | if test -z "$doit"; then 53 | doit_exec=exec 54 | else 55 | doit_exec=$doit 56 | fi 57 | 58 | # Put in absolute file names if you don't have them in your path; 59 | # or use environment vars. 60 | 61 | chgrpprog=${CHGRPPROG-chgrp} 62 | chmodprog=${CHMODPROG-chmod} 63 | chownprog=${CHOWNPROG-chown} 64 | cmpprog=${CMPPROG-cmp} 65 | cpprog=${CPPROG-cp} 66 | mkdirprog=${MKDIRPROG-mkdir} 67 | mvprog=${MVPROG-mv} 68 | rmprog=${RMPROG-rm} 69 | stripprog=${STRIPPROG-strip} 70 | 71 | posix_glob='?' 72 | initialize_posix_glob=' 73 | test "$posix_glob" != "?" || { 74 | if (set -f) 2>/dev/null; then 75 | posix_glob= 76 | else 77 | posix_glob=: 78 | fi 79 | } 80 | ' 81 | 82 | posix_mkdir= 83 | 84 | # Desired mode of installed file. 85 | mode=0755 86 | 87 | chgrpcmd= 88 | chmodcmd=$chmodprog 89 | chowncmd= 90 | mvcmd=$mvprog 91 | rmcmd="$rmprog -f" 92 | stripcmd= 93 | 94 | src= 95 | dst= 96 | dir_arg= 97 | dst_arg= 98 | 99 | copy_on_change=false 100 | no_target_directory= 101 | 102 | usage="\ 103 | Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE 104 | or: $0 [OPTION]... SRCFILES... DIRECTORY 105 | or: $0 [OPTION]... -t DIRECTORY SRCFILES... 106 | or: $0 [OPTION]... -d DIRECTORIES... 107 | 108 | In the 1st form, copy SRCFILE to DSTFILE. 109 | In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. 110 | In the 4th, create DIRECTORIES. 111 | 112 | Options: 113 | --help display this help and exit. 114 | --version display version info and exit. 115 | 116 | -c (ignored) 117 | -C install only if different (preserve the last data modification time) 118 | -d create directories instead of installing files. 119 | -g GROUP $chgrpprog installed files to GROUP. 120 | -m MODE $chmodprog installed files to MODE. 121 | -o USER $chownprog installed files to USER. 122 | -s $stripprog installed files. 123 | -t DIRECTORY install into DIRECTORY. 124 | -T report an error if DSTFILE is a directory. 125 | 126 | Environment variables override the default commands: 127 | CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG 128 | RMPROG STRIPPROG 129 | " 130 | 131 | while test $# -ne 0; do 132 | case $1 in 133 | -c) ;; 134 | 135 | -C) copy_on_change=true;; 136 | 137 | -d) dir_arg=true;; 138 | 139 | -g) chgrpcmd="$chgrpprog $2" 140 | shift;; 141 | 142 | --help) echo "$usage"; exit $?;; 143 | 144 | -m) mode=$2 145 | case $mode in 146 | *' '* | *' '* | *' 147 | '* | *'*'* | *'?'* | *'['*) 148 | echo "$0: invalid mode: $mode" >&2 149 | exit 1;; 150 | esac 151 | shift;; 152 | 153 | -o) chowncmd="$chownprog $2" 154 | shift;; 155 | 156 | -s) stripcmd=$stripprog;; 157 | 158 | -t) dst_arg=$2 159 | # Protect names problematic for 'test' and other utilities. 160 | case $dst_arg in 161 | -* | [=\(\)!]) dst_arg=./$dst_arg;; 162 | esac 163 | shift;; 164 | 165 | -T) no_target_directory=true;; 166 | 167 | --version) echo "$0 $scriptversion"; exit $?;; 168 | 169 | --) shift 170 | break;; 171 | 172 | -*) echo "$0: invalid option: $1" >&2 173 | exit 1;; 174 | 175 | *) break;; 176 | esac 177 | shift 178 | done 179 | 180 | if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then 181 | # When -d is used, all remaining arguments are directories to create. 182 | # When -t is used, the destination is already specified. 183 | # Otherwise, the last argument is the destination. Remove it from $@. 184 | for arg 185 | do 186 | if test -n "$dst_arg"; then 187 | # $@ is not empty: it contains at least $arg. 188 | set fnord "$@" "$dst_arg" 189 | shift # fnord 190 | fi 191 | shift # arg 192 | dst_arg=$arg 193 | # Protect names problematic for 'test' and other utilities. 194 | case $dst_arg in 195 | -* | [=\(\)!]) dst_arg=./$dst_arg;; 196 | esac 197 | done 198 | fi 199 | 200 | if test $# -eq 0; then 201 | if test -z "$dir_arg"; then 202 | echo "$0: no input file specified." >&2 203 | exit 1 204 | fi 205 | # It's OK to call 'install-sh -d' without argument. 206 | # This can happen when creating conditional directories. 207 | exit 0 208 | fi 209 | 210 | if test -z "$dir_arg"; then 211 | do_exit='(exit $ret); exit $ret' 212 | trap "ret=129; $do_exit" 1 213 | trap "ret=130; $do_exit" 2 214 | trap "ret=141; $do_exit" 13 215 | trap "ret=143; $do_exit" 15 216 | 217 | # Set umask so as not to create temps with too-generous modes. 218 | # However, 'strip' requires both read and write access to temps. 219 | case $mode in 220 | # Optimize common cases. 221 | *644) cp_umask=133;; 222 | *755) cp_umask=22;; 223 | 224 | *[0-7]) 225 | if test -z "$stripcmd"; then 226 | u_plus_rw= 227 | else 228 | u_plus_rw='% 200' 229 | fi 230 | cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; 231 | *) 232 | if test -z "$stripcmd"; then 233 | u_plus_rw= 234 | else 235 | u_plus_rw=,u+rw 236 | fi 237 | cp_umask=$mode$u_plus_rw;; 238 | esac 239 | fi 240 | 241 | for src 242 | do 243 | # Protect names problematic for 'test' and other utilities. 244 | case $src in 245 | -* | [=\(\)!]) src=./$src;; 246 | esac 247 | 248 | if test -n "$dir_arg"; then 249 | dst=$src 250 | dstdir=$dst 251 | test -d "$dstdir" 252 | dstdir_status=$? 253 | else 254 | 255 | # Waiting for this to be detected by the "$cpprog $src $dsttmp" command 256 | # might cause directories to be created, which would be especially bad 257 | # if $src (and thus $dsttmp) contains '*'. 258 | if test ! -f "$src" && test ! -d "$src"; then 259 | echo "$0: $src does not exist." >&2 260 | exit 1 261 | fi 262 | 263 | if test -z "$dst_arg"; then 264 | echo "$0: no destination specified." >&2 265 | exit 1 266 | fi 267 | dst=$dst_arg 268 | 269 | # If destination is a directory, append the input filename; won't work 270 | # if double slashes aren't ignored. 271 | if test -d "$dst"; then 272 | if test -n "$no_target_directory"; then 273 | echo "$0: $dst_arg: Is a directory" >&2 274 | exit 1 275 | fi 276 | dstdir=$dst 277 | dst=$dstdir/`basename "$src"` 278 | dstdir_status=0 279 | else 280 | # Prefer dirname, but fall back on a substitute if dirname fails. 281 | dstdir=` 282 | (dirname "$dst") 2>/dev/null || 283 | expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 284 | X"$dst" : 'X\(//\)[^/]' \| \ 285 | X"$dst" : 'X\(//\)$' \| \ 286 | X"$dst" : 'X\(/\)' \| . 2>/dev/null || 287 | echo X"$dst" | 288 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ 289 | s//\1/ 290 | q 291 | } 292 | /^X\(\/\/\)[^/].*/{ 293 | s//\1/ 294 | q 295 | } 296 | /^X\(\/\/\)$/{ 297 | s//\1/ 298 | q 299 | } 300 | /^X\(\/\).*/{ 301 | s//\1/ 302 | q 303 | } 304 | s/.*/./; q' 305 | ` 306 | 307 | test -d "$dstdir" 308 | dstdir_status=$? 309 | fi 310 | fi 311 | 312 | obsolete_mkdir_used=false 313 | 314 | if test $dstdir_status != 0; then 315 | case $posix_mkdir in 316 | '') 317 | # Create intermediate dirs using mode 755 as modified by the umask. 318 | # This is like FreeBSD 'install' as of 1997-10-28. 319 | umask=`umask` 320 | case $stripcmd.$umask in 321 | # Optimize common cases. 322 | *[2367][2367]) mkdir_umask=$umask;; 323 | .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; 324 | 325 | *[0-7]) 326 | mkdir_umask=`expr $umask + 22 \ 327 | - $umask % 100 % 40 + $umask % 20 \ 328 | - $umask % 10 % 4 + $umask % 2 329 | `;; 330 | *) mkdir_umask=$umask,go-w;; 331 | esac 332 | 333 | # With -d, create the new directory with the user-specified mode. 334 | # Otherwise, rely on $mkdir_umask. 335 | if test -n "$dir_arg"; then 336 | mkdir_mode=-m$mode 337 | else 338 | mkdir_mode= 339 | fi 340 | 341 | posix_mkdir=false 342 | case $umask in 343 | *[123567][0-7][0-7]) 344 | # POSIX mkdir -p sets u+wx bits regardless of umask, which 345 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. 346 | ;; 347 | *) 348 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ 349 | trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 350 | 351 | if (umask $mkdir_umask && 352 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 353 | then 354 | if test -z "$dir_arg" || { 355 | # Check for POSIX incompatibilities with -m. 356 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or 357 | # other-writable bit of parent directory when it shouldn't. 358 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. 359 | ls_ld_tmpdir=`ls -ld "$tmpdir"` 360 | case $ls_ld_tmpdir in 361 | d????-?r-*) different_mode=700;; 362 | d????-?--*) different_mode=755;; 363 | *) false;; 364 | esac && 365 | $mkdirprog -m$different_mode -p -- "$tmpdir" && { 366 | ls_ld_tmpdir_1=`ls -ld "$tmpdir"` 367 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" 368 | } 369 | } 370 | then posix_mkdir=: 371 | fi 372 | rmdir "$tmpdir/d" "$tmpdir" 373 | else 374 | # Remove any dirs left behind by ancient mkdir implementations. 375 | rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null 376 | fi 377 | trap '' 0;; 378 | esac;; 379 | esac 380 | 381 | if 382 | $posix_mkdir && ( 383 | umask $mkdir_umask && 384 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" 385 | ) 386 | then : 387 | else 388 | 389 | # The umask is ridiculous, or mkdir does not conform to POSIX, 390 | # or it failed possibly due to a race condition. Create the 391 | # directory the slow way, step by step, checking for races as we go. 392 | 393 | case $dstdir in 394 | /*) prefix='/';; 395 | [-=\(\)!]*) prefix='./';; 396 | *) prefix='';; 397 | esac 398 | 399 | eval "$initialize_posix_glob" 400 | 401 | oIFS=$IFS 402 | IFS=/ 403 | $posix_glob set -f 404 | set fnord $dstdir 405 | shift 406 | $posix_glob set +f 407 | IFS=$oIFS 408 | 409 | prefixes= 410 | 411 | for d 412 | do 413 | test X"$d" = X && continue 414 | 415 | prefix=$prefix$d 416 | if test -d "$prefix"; then 417 | prefixes= 418 | else 419 | if $posix_mkdir; then 420 | (umask=$mkdir_umask && 421 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break 422 | # Don't fail if two instances are running concurrently. 423 | test -d "$prefix" || exit 1 424 | else 425 | case $prefix in 426 | *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; 427 | *) qprefix=$prefix;; 428 | esac 429 | prefixes="$prefixes '$qprefix'" 430 | fi 431 | fi 432 | prefix=$prefix/ 433 | done 434 | 435 | if test -n "$prefixes"; then 436 | # Don't fail if two instances are running concurrently. 437 | (umask $mkdir_umask && 438 | eval "\$doit_exec \$mkdirprog $prefixes") || 439 | test -d "$dstdir" || exit 1 440 | obsolete_mkdir_used=true 441 | fi 442 | fi 443 | fi 444 | 445 | if test -n "$dir_arg"; then 446 | { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && 447 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && 448 | { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || 449 | test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 450 | else 451 | 452 | # Make a couple of temp file names in the proper directory. 453 | dsttmp=$dstdir/_inst.$$_ 454 | rmtmp=$dstdir/_rm.$$_ 455 | 456 | # Trap to clean up those temp files at exit. 457 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 458 | 459 | # Copy the file name to the temp name. 460 | (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && 461 | 462 | # and set any options; do chmod last to preserve setuid bits. 463 | # 464 | # If any of these fail, we abort the whole thing. If we want to 465 | # ignore errors from any of these, just make sure not to ignore 466 | # errors from the above "$doit $cpprog $src $dsttmp" command. 467 | # 468 | { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && 469 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && 470 | { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && 471 | { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && 472 | 473 | # If -C, don't bother to copy if it wouldn't change the file. 474 | if $copy_on_change && 475 | old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && 476 | new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && 477 | 478 | eval "$initialize_posix_glob" && 479 | $posix_glob set -f && 480 | set X $old && old=:$2:$4:$5:$6 && 481 | set X $new && new=:$2:$4:$5:$6 && 482 | $posix_glob set +f && 483 | 484 | test "$old" = "$new" && 485 | $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 486 | then 487 | rm -f "$dsttmp" 488 | else 489 | # Rename the file to the real destination. 490 | $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || 491 | 492 | # The rename failed, perhaps because mv can't rename something else 493 | # to itself, or perhaps because mv is so ancient that it does not 494 | # support -f. 495 | { 496 | # Now remove or move aside any old file at destination location. 497 | # We try this two ways since rm can't unlink itself on some 498 | # systems and the destination file might be busy for other 499 | # reasons. In this case, the final cleanup might fail but the new 500 | # file should still install successfully. 501 | { 502 | test ! -f "$dst" || 503 | $doit $rmcmd -f "$dst" 2>/dev/null || 504 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && 505 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } 506 | } || 507 | { echo "$0: cannot unlink or rename $dst" >&2 508 | (exit 1); exit 1 509 | } 510 | } && 511 | 512 | # Now rename the file to the real destination. 513 | $doit $mvcmd "$dsttmp" "$dst" 514 | } 515 | fi || exit 1 516 | 517 | trap '' 0 518 | fi 519 | done 520 | 521 | # Local variables: 522 | # eval: (add-hook 'write-file-hooks 'time-stamp) 523 | # time-stamp-start: "scriptversion=" 524 | # time-stamp-format: "%:y-%02m-%02d.%02H" 525 | # time-stamp-time-zone: "UTC" 526 | # time-stamp-end: "; # UTC" 527 | # End: 528 | -------------------------------------------------------------------------------- /build-aux/missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common wrapper for a few potentially missing GNU programs. 3 | 4 | scriptversion=2012-06-26.16; # UTC 5 | 6 | # Copyright (C) 1996-2013 Free Software Foundation, Inc. 7 | # Originally written by Fran,cois Pinard , 1996. 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, or (at your option) 12 | # 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, see . 21 | 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | if test $# -eq 0; then 28 | echo 1>&2 "Try '$0 --help' for more information" 29 | exit 1 30 | fi 31 | 32 | case $1 in 33 | 34 | --is-lightweight) 35 | # Used by our autoconf macros to check whether the available missing 36 | # script is modern enough. 37 | exit 0 38 | ;; 39 | 40 | --run) 41 | # Back-compat with the calling convention used by older automake. 42 | shift 43 | ;; 44 | 45 | -h|--h|--he|--hel|--help) 46 | echo "\ 47 | $0 [OPTION]... PROGRAM [ARGUMENT]... 48 | 49 | Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due 50 | to PROGRAM being missing or too old. 51 | 52 | Options: 53 | -h, --help display this help and exit 54 | -v, --version output version information and exit 55 | 56 | Supported PROGRAM values: 57 | aclocal autoconf autoheader autom4te automake makeinfo 58 | bison yacc flex lex help2man 59 | 60 | Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 61 | 'g' are ignored when checking the name. 62 | 63 | Send bug reports to ." 64 | exit $? 65 | ;; 66 | 67 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 68 | echo "missing $scriptversion (GNU Automake)" 69 | exit $? 70 | ;; 71 | 72 | -*) 73 | echo 1>&2 "$0: unknown '$1' option" 74 | echo 1>&2 "Try '$0 --help' for more information" 75 | exit 1 76 | ;; 77 | 78 | esac 79 | 80 | # Run the given program, remember its exit status. 81 | "$@"; st=$? 82 | 83 | # If it succeeded, we are done. 84 | test $st -eq 0 && exit 0 85 | 86 | # Also exit now if we it failed (or wasn't found), and '--version' was 87 | # passed; such an option is passed most likely to detect whether the 88 | # program is present and works. 89 | case $2 in --version|--help) exit $st;; esac 90 | 91 | # Exit code 63 means version mismatch. This often happens when the user 92 | # tries to use an ancient version of a tool on a file that requires a 93 | # minimum version. 94 | if test $st -eq 63; then 95 | msg="probably too old" 96 | elif test $st -eq 127; then 97 | # Program was missing. 98 | msg="missing on your system" 99 | else 100 | # Program was found and executed, but failed. Give up. 101 | exit $st 102 | fi 103 | 104 | perl_URL=http://www.perl.org/ 105 | flex_URL=http://flex.sourceforge.net/ 106 | gnu_software_URL=http://www.gnu.org/software 107 | 108 | program_details () 109 | { 110 | case $1 in 111 | aclocal|automake) 112 | echo "The '$1' program is part of the GNU Automake package:" 113 | echo "<$gnu_software_URL/automake>" 114 | echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" 115 | echo "<$gnu_software_URL/autoconf>" 116 | echo "<$gnu_software_URL/m4/>" 117 | echo "<$perl_URL>" 118 | ;; 119 | autoconf|autom4te|autoheader) 120 | echo "The '$1' program is part of the GNU Autoconf package:" 121 | echo "<$gnu_software_URL/autoconf/>" 122 | echo "It also requires GNU m4 and Perl in order to run:" 123 | echo "<$gnu_software_URL/m4/>" 124 | echo "<$perl_URL>" 125 | ;; 126 | esac 127 | } 128 | 129 | give_advice () 130 | { 131 | # Normalize program name to check for. 132 | normalized_program=`echo "$1" | sed ' 133 | s/^gnu-//; t 134 | s/^gnu//; t 135 | s/^g//; t'` 136 | 137 | printf '%s\n' "'$1' is $msg." 138 | 139 | configure_deps="'configure.ac' or m4 files included by 'configure.ac'" 140 | case $normalized_program in 141 | autoconf*) 142 | echo "You should only need it if you modified 'configure.ac'," 143 | echo "or m4 files included by it." 144 | program_details 'autoconf' 145 | ;; 146 | autoheader*) 147 | echo "You should only need it if you modified 'acconfig.h' or" 148 | echo "$configure_deps." 149 | program_details 'autoheader' 150 | ;; 151 | automake*) 152 | echo "You should only need it if you modified 'Makefile.am' or" 153 | echo "$configure_deps." 154 | program_details 'automake' 155 | ;; 156 | aclocal*) 157 | echo "You should only need it if you modified 'acinclude.m4' or" 158 | echo "$configure_deps." 159 | program_details 'aclocal' 160 | ;; 161 | autom4te*) 162 | echo "You might have modified some maintainer files that require" 163 | echo "the 'automa4te' program to be rebuilt." 164 | program_details 'autom4te' 165 | ;; 166 | bison*|yacc*) 167 | echo "You should only need it if you modified a '.y' file." 168 | echo "You may want to install the GNU Bison package:" 169 | echo "<$gnu_software_URL/bison/>" 170 | ;; 171 | lex*|flex*) 172 | echo "You should only need it if you modified a '.l' file." 173 | echo "You may want to install the Fast Lexical Analyzer package:" 174 | echo "<$flex_URL>" 175 | ;; 176 | help2man*) 177 | echo "You should only need it if you modified a dependency" \ 178 | "of a man page." 179 | echo "You may want to install the GNU Help2man package:" 180 | echo "<$gnu_software_URL/help2man/>" 181 | ;; 182 | makeinfo*) 183 | echo "You should only need it if you modified a '.texi' file, or" 184 | echo "any other file indirectly affecting the aspect of the manual." 185 | echo "You might want to install the Texinfo package:" 186 | echo "<$gnu_software_URL/texinfo/>" 187 | echo "The spurious makeinfo call might also be the consequence of" 188 | echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" 189 | echo "want to install GNU make:" 190 | echo "<$gnu_software_URL/make/>" 191 | ;; 192 | *) 193 | echo "You might have modified some files without having the proper" 194 | echo "tools for further handling them. Check the 'README' file, it" 195 | echo "often tells you about the needed prerequisites for installing" 196 | echo "this package. You may also peek at any GNU archive site, in" 197 | echo "case some other package contains this missing '$1' program." 198 | ;; 199 | esac 200 | } 201 | 202 | give_advice "$1" | sed -e '1s/^/WARNING: /' \ 203 | -e '2,$s/^/ /' >&2 204 | 205 | # Propagate the correct exit status (expected to be 127 for a program 206 | # not found, 63 for a program that failed due to version mismatch). 207 | exit $st 208 | 209 | # Local variables: 210 | # eval: (add-hook 'write-file-hooks 'time-stamp) 211 | # time-stamp-start: "scriptversion=" 212 | # time-stamp-format: "%:y-%02m-%02d.%02H" 213 | # time-stamp-time-zone: "UTC" 214 | # time-stamp-end: "; # UTC" 215 | # End: 216 | -------------------------------------------------------------------------------- /build-aux/test-driver: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # test-driver - basic testsuite driver script. 3 | 4 | scriptversion=2012-06-27.10; # UTC 5 | 6 | # Copyright (C) 2011-2013 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, see . 20 | 21 | # As a special exception to the GNU General Public License, if you 22 | # distribute this file as part of a program that contains a 23 | # configuration script generated by Autoconf, you may include it under 24 | # the same distribution terms that you use for the rest of that program. 25 | 26 | # This file is maintained in Automake, please report 27 | # bugs to or send patches to 28 | # . 29 | 30 | # Make unconditional expansion of undefined variables an error. This 31 | # helps a lot in preventing typo-related bugs. 32 | set -u 33 | 34 | usage_error () 35 | { 36 | echo "$0: $*" >&2 37 | print_usage >&2 38 | exit 2 39 | } 40 | 41 | print_usage () 42 | { 43 | cat <$log_file 2>&1 96 | estatus=$? 97 | if test $enable_hard_errors = no && test $estatus -eq 99; then 98 | estatus=1 99 | fi 100 | 101 | case $estatus:$expect_failure in 102 | 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 103 | 0:*) col=$grn res=PASS recheck=no gcopy=no;; 104 | 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 105 | 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; 106 | *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; 107 | *:*) col=$red res=FAIL recheck=yes gcopy=yes;; 108 | esac 109 | 110 | # Report outcome to console. 111 | echo "${col}${res}${std}: $test_name" 112 | 113 | # Register the test result, and other relevant metadata. 114 | echo ":test-result: $res" > $trs_file 115 | echo ":global-test-result: $res" >> $trs_file 116 | echo ":recheck: $recheck" >> $trs_file 117 | echo ":copy-in-global-log: $gcopy" >> $trs_file 118 | 119 | # Local Variables: 120 | # mode: shell-script 121 | # sh-indentation: 2 122 | # eval: (add-hook 'write-file-hooks 'time-stamp) 123 | # time-stamp-start: "scriptversion=" 124 | # time-stamp-format: "%:y-%02m-%02d.%02H" 125 | # time-stamp-time-zone: "UTC" 126 | # time-stamp-end: "; # UTC" 127 | # End: 128 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if your system has a GNU libc compatible `malloc' function, and 10 | to 0 otherwise. */ 11 | #undef HAVE_MALLOC 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #undef HAVE_MEMORY_H 15 | 16 | /* Define to 1 if you have the header file. */ 17 | #undef HAVE_STDINT_H 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #undef HAVE_STDLIB_H 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #undef HAVE_STRINGS_H 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #undef HAVE_STRING_H 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #undef HAVE_SYS_STAT_H 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #undef HAVE_SYS_TYPES_H 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #undef HAVE_UNISTD_H 36 | 37 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 38 | */ 39 | #undef LT_OBJDIR 40 | 41 | /* Name of package */ 42 | #undef PACKAGE 43 | 44 | /* Define to the address where bug reports for this package should be sent. */ 45 | #undef PACKAGE_BUGREPORT 46 | 47 | /* Define to the full name of this package. */ 48 | #undef PACKAGE_NAME 49 | 50 | /* Define to the full name and version of this package. */ 51 | #undef PACKAGE_STRING 52 | 53 | /* Define to the one symbol short name of this package. */ 54 | #undef PACKAGE_TARNAME 55 | 56 | /* Define to the home page for this package. */ 57 | #undef PACKAGE_URL 58 | 59 | /* Define to the version of this package. */ 60 | #undef PACKAGE_VERSION 61 | 62 | /* Define to 1 if you have the ANSI C header files. */ 63 | #undef STDC_HEADERS 64 | 65 | /* Version number of package */ 66 | #undef VERSION 67 | 68 | /* Define to rpl_malloc if the replacement function should be used. */ 69 | #undef malloc 70 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | # Process this file with autoconf to produce a configure script. 2 | 3 | # Prelude. 4 | AC_PREREQ([2.59]) 5 | AC_INIT([Creep], [0.3], [aidan.marlin AT gmail.com]) 6 | 7 | # unique source file --- primitive safety check 8 | AC_CONFIG_SRCDIR([src/creep.c]) 9 | 10 | # place to put some extra build scripts installed 11 | AC_CONFIG_AUX_DIR([build-aux]) 12 | 13 | # fairly severe build strictness 14 | # change foreign to gnu or gnits to comply with gnu standards 15 | AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.9.6 subdir-objects]) 16 | 17 | # Checks for programs. 18 | AM_PROG_AR 19 | AC_PROG_CC 20 | AC_PROG_LIBTOOL 21 | 22 | AC_CONFIG_MACRO_DIR([m4]) 23 | 24 | # Checks for libraries. 25 | 26 | # This macro is defined in check.m4 and tests if check.h and 27 | # libcheck.a are installed in your system. It sets CHECK_CFLAGS and 28 | # CHECK_LIBS accordingly. 29 | # AM_PATH_CHECK([MINIMUM-VERSION, 30 | # [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) 31 | PKG_CHECK_MODULES([CHECK], [check >= 0.9.4]) 32 | 33 | PKG_CHECK_MODULES([LIBEVENT], [libevent]) 34 | 35 | # Checks for header files. 36 | AC_HEADER_STDC 37 | AC_CHECK_HEADERS([stdlib.h]) 38 | 39 | # Checks for typedefs, structures, and compiler characteristics. 40 | 41 | # Checks for library functions. 42 | AC_FUNC_MALLOC 43 | 44 | # Output files 45 | AC_CONFIG_HEADERS([config.h]) 46 | 47 | AC_CONFIG_FILES([Makefile 48 | src/Makefile 49 | tests/Makefile]) 50 | 51 | AC_OUTPUT 52 | -------------------------------------------------------------------------------- /m4/ltoptions.m4: -------------------------------------------------------------------------------- 1 | # Helper functions for option handling. -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, 4 | # Inc. 5 | # Written by Gary V. Vaughan, 2004 6 | # 7 | # This file is free software; the Free Software Foundation gives 8 | # unlimited permission to copy and/or distribute it, with or without 9 | # modifications, as long as this notice is preserved. 10 | 11 | # serial 7 ltoptions.m4 12 | 13 | # This is to help aclocal find these macros, as it can't see m4_define. 14 | AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) 15 | 16 | 17 | # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) 18 | # ------------------------------------------ 19 | m4_define([_LT_MANGLE_OPTION], 20 | [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) 21 | 22 | 23 | # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) 24 | # --------------------------------------- 25 | # Set option OPTION-NAME for macro MACRO-NAME, and if there is a 26 | # matching handler defined, dispatch to it. Other OPTION-NAMEs are 27 | # saved as a flag. 28 | m4_define([_LT_SET_OPTION], 29 | [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl 30 | m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), 31 | _LT_MANGLE_DEFUN([$1], [$2]), 32 | [m4_warning([Unknown $1 option `$2'])])[]dnl 33 | ]) 34 | 35 | 36 | # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) 37 | # ------------------------------------------------------------ 38 | # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 39 | m4_define([_LT_IF_OPTION], 40 | [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) 41 | 42 | 43 | # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) 44 | # ------------------------------------------------------- 45 | # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME 46 | # are set. 47 | m4_define([_LT_UNLESS_OPTIONS], 48 | [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), 49 | [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), 50 | [m4_define([$0_found])])])[]dnl 51 | m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 52 | ])[]dnl 53 | ]) 54 | 55 | 56 | # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) 57 | # ---------------------------------------- 58 | # OPTION-LIST is a space-separated list of Libtool options associated 59 | # with MACRO-NAME. If any OPTION has a matching handler declared with 60 | # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about 61 | # the unknown option and exit. 62 | m4_defun([_LT_SET_OPTIONS], 63 | [# Set options 64 | m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), 65 | [_LT_SET_OPTION([$1], _LT_Option)]) 66 | 67 | m4_if([$1],[LT_INIT],[ 68 | dnl 69 | dnl Simply set some default values (i.e off) if boolean options were not 70 | dnl specified: 71 | _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no 72 | ]) 73 | _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no 74 | ]) 75 | dnl 76 | dnl If no reference was made to various pairs of opposing options, then 77 | dnl we run the default mode handler for the pair. For example, if neither 78 | dnl `shared' nor `disable-shared' was passed, we enable building of shared 79 | dnl archives by default: 80 | _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) 81 | _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) 82 | _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) 83 | _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], 84 | [_LT_ENABLE_FAST_INSTALL]) 85 | ]) 86 | ])# _LT_SET_OPTIONS 87 | 88 | 89 | ## --------------------------------- ## 90 | ## Macros to handle LT_INIT options. ## 91 | ## --------------------------------- ## 92 | 93 | # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) 94 | # ----------------------------------------- 95 | m4_define([_LT_MANGLE_DEFUN], 96 | [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) 97 | 98 | 99 | # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) 100 | # ----------------------------------------------- 101 | m4_define([LT_OPTION_DEFINE], 102 | [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl 103 | ])# LT_OPTION_DEFINE 104 | 105 | 106 | # dlopen 107 | # ------ 108 | LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes 109 | ]) 110 | 111 | AU_DEFUN([AC_LIBTOOL_DLOPEN], 112 | [_LT_SET_OPTION([LT_INIT], [dlopen]) 113 | AC_DIAGNOSE([obsolete], 114 | [$0: Remove this warning and the call to _LT_SET_OPTION when you 115 | put the `dlopen' option into LT_INIT's first parameter.]) 116 | ]) 117 | 118 | dnl aclocal-1.4 backwards compatibility: 119 | dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) 120 | 121 | 122 | # win32-dll 123 | # --------- 124 | # Declare package support for building win32 dll's. 125 | LT_OPTION_DEFINE([LT_INIT], [win32-dll], 126 | [enable_win32_dll=yes 127 | 128 | case $host in 129 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) 130 | AC_CHECK_TOOL(AS, as, false) 131 | AC_CHECK_TOOL(DLLTOOL, dlltool, false) 132 | AC_CHECK_TOOL(OBJDUMP, objdump, false) 133 | ;; 134 | esac 135 | 136 | test -z "$AS" && AS=as 137 | _LT_DECL([], [AS], [1], [Assembler program])dnl 138 | 139 | test -z "$DLLTOOL" && DLLTOOL=dlltool 140 | _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl 141 | 142 | test -z "$OBJDUMP" && OBJDUMP=objdump 143 | _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl 144 | ])# win32-dll 145 | 146 | AU_DEFUN([AC_LIBTOOL_WIN32_DLL], 147 | [AC_REQUIRE([AC_CANONICAL_HOST])dnl 148 | _LT_SET_OPTION([LT_INIT], [win32-dll]) 149 | AC_DIAGNOSE([obsolete], 150 | [$0: Remove this warning and the call to _LT_SET_OPTION when you 151 | put the `win32-dll' option into LT_INIT's first parameter.]) 152 | ]) 153 | 154 | dnl aclocal-1.4 backwards compatibility: 155 | dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) 156 | 157 | 158 | # _LT_ENABLE_SHARED([DEFAULT]) 159 | # ---------------------------- 160 | # implement the --enable-shared flag, and supports the `shared' and 161 | # `disable-shared' LT_INIT options. 162 | # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. 163 | m4_define([_LT_ENABLE_SHARED], 164 | [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl 165 | AC_ARG_ENABLE([shared], 166 | [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], 167 | [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], 168 | [p=${PACKAGE-default} 169 | case $enableval in 170 | yes) enable_shared=yes ;; 171 | no) enable_shared=no ;; 172 | *) 173 | enable_shared=no 174 | # Look at the argument we got. We use all the common list separators. 175 | lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," 176 | for pkg in $enableval; do 177 | IFS="$lt_save_ifs" 178 | if test "X$pkg" = "X$p"; then 179 | enable_shared=yes 180 | fi 181 | done 182 | IFS="$lt_save_ifs" 183 | ;; 184 | esac], 185 | [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) 186 | 187 | _LT_DECL([build_libtool_libs], [enable_shared], [0], 188 | [Whether or not to build shared libraries]) 189 | ])# _LT_ENABLE_SHARED 190 | 191 | LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) 192 | LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) 193 | 194 | # Old names: 195 | AC_DEFUN([AC_ENABLE_SHARED], 196 | [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) 197 | ]) 198 | 199 | AC_DEFUN([AC_DISABLE_SHARED], 200 | [_LT_SET_OPTION([LT_INIT], [disable-shared]) 201 | ]) 202 | 203 | AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) 204 | AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) 205 | 206 | dnl aclocal-1.4 backwards compatibility: 207 | dnl AC_DEFUN([AM_ENABLE_SHARED], []) 208 | dnl AC_DEFUN([AM_DISABLE_SHARED], []) 209 | 210 | 211 | 212 | # _LT_ENABLE_STATIC([DEFAULT]) 213 | # ---------------------------- 214 | # implement the --enable-static flag, and support the `static' and 215 | # `disable-static' LT_INIT options. 216 | # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. 217 | m4_define([_LT_ENABLE_STATIC], 218 | [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl 219 | AC_ARG_ENABLE([static], 220 | [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], 221 | [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], 222 | [p=${PACKAGE-default} 223 | case $enableval in 224 | yes) enable_static=yes ;; 225 | no) enable_static=no ;; 226 | *) 227 | enable_static=no 228 | # Look at the argument we got. We use all the common list separators. 229 | lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," 230 | for pkg in $enableval; do 231 | IFS="$lt_save_ifs" 232 | if test "X$pkg" = "X$p"; then 233 | enable_static=yes 234 | fi 235 | done 236 | IFS="$lt_save_ifs" 237 | ;; 238 | esac], 239 | [enable_static=]_LT_ENABLE_STATIC_DEFAULT) 240 | 241 | _LT_DECL([build_old_libs], [enable_static], [0], 242 | [Whether or not to build static libraries]) 243 | ])# _LT_ENABLE_STATIC 244 | 245 | LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) 246 | LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) 247 | 248 | # Old names: 249 | AC_DEFUN([AC_ENABLE_STATIC], 250 | [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) 251 | ]) 252 | 253 | AC_DEFUN([AC_DISABLE_STATIC], 254 | [_LT_SET_OPTION([LT_INIT], [disable-static]) 255 | ]) 256 | 257 | AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) 258 | AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) 259 | 260 | dnl aclocal-1.4 backwards compatibility: 261 | dnl AC_DEFUN([AM_ENABLE_STATIC], []) 262 | dnl AC_DEFUN([AM_DISABLE_STATIC], []) 263 | 264 | 265 | 266 | # _LT_ENABLE_FAST_INSTALL([DEFAULT]) 267 | # ---------------------------------- 268 | # implement the --enable-fast-install flag, and support the `fast-install' 269 | # and `disable-fast-install' LT_INIT options. 270 | # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. 271 | m4_define([_LT_ENABLE_FAST_INSTALL], 272 | [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl 273 | AC_ARG_ENABLE([fast-install], 274 | [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], 275 | [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], 276 | [p=${PACKAGE-default} 277 | case $enableval in 278 | yes) enable_fast_install=yes ;; 279 | no) enable_fast_install=no ;; 280 | *) 281 | enable_fast_install=no 282 | # Look at the argument we got. We use all the common list separators. 283 | lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," 284 | for pkg in $enableval; do 285 | IFS="$lt_save_ifs" 286 | if test "X$pkg" = "X$p"; then 287 | enable_fast_install=yes 288 | fi 289 | done 290 | IFS="$lt_save_ifs" 291 | ;; 292 | esac], 293 | [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) 294 | 295 | _LT_DECL([fast_install], [enable_fast_install], [0], 296 | [Whether or not to optimize for fast installation])dnl 297 | ])# _LT_ENABLE_FAST_INSTALL 298 | 299 | LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) 300 | LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) 301 | 302 | # Old names: 303 | AU_DEFUN([AC_ENABLE_FAST_INSTALL], 304 | [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) 305 | AC_DIAGNOSE([obsolete], 306 | [$0: Remove this warning and the call to _LT_SET_OPTION when you put 307 | the `fast-install' option into LT_INIT's first parameter.]) 308 | ]) 309 | 310 | AU_DEFUN([AC_DISABLE_FAST_INSTALL], 311 | [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) 312 | AC_DIAGNOSE([obsolete], 313 | [$0: Remove this warning and the call to _LT_SET_OPTION when you put 314 | the `disable-fast-install' option into LT_INIT's first parameter.]) 315 | ]) 316 | 317 | dnl aclocal-1.4 backwards compatibility: 318 | dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) 319 | dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) 320 | 321 | 322 | # _LT_WITH_PIC([MODE]) 323 | # -------------------- 324 | # implement the --with-pic flag, and support the `pic-only' and `no-pic' 325 | # LT_INIT options. 326 | # MODE is either `yes' or `no'. If omitted, it defaults to `both'. 327 | m4_define([_LT_WITH_PIC], 328 | [AC_ARG_WITH([pic], 329 | [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], 330 | [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], 331 | [lt_p=${PACKAGE-default} 332 | case $withval in 333 | yes|no) pic_mode=$withval ;; 334 | *) 335 | pic_mode=default 336 | # Look at the argument we got. We use all the common list separators. 337 | lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," 338 | for lt_pkg in $withval; do 339 | IFS="$lt_save_ifs" 340 | if test "X$lt_pkg" = "X$lt_p"; then 341 | pic_mode=yes 342 | fi 343 | done 344 | IFS="$lt_save_ifs" 345 | ;; 346 | esac], 347 | [pic_mode=default]) 348 | 349 | test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) 350 | 351 | _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl 352 | ])# _LT_WITH_PIC 353 | 354 | LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) 355 | LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) 356 | 357 | # Old name: 358 | AU_DEFUN([AC_LIBTOOL_PICMODE], 359 | [_LT_SET_OPTION([LT_INIT], [pic-only]) 360 | AC_DIAGNOSE([obsolete], 361 | [$0: Remove this warning and the call to _LT_SET_OPTION when you 362 | put the `pic-only' option into LT_INIT's first parameter.]) 363 | ]) 364 | 365 | dnl aclocal-1.4 backwards compatibility: 366 | dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) 367 | 368 | ## ----------------- ## 369 | ## LTDL_INIT Options ## 370 | ## ----------------- ## 371 | 372 | m4_define([_LTDL_MODE], []) 373 | LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], 374 | [m4_define([_LTDL_MODE], [nonrecursive])]) 375 | LT_OPTION_DEFINE([LTDL_INIT], [recursive], 376 | [m4_define([_LTDL_MODE], [recursive])]) 377 | LT_OPTION_DEFINE([LTDL_INIT], [subproject], 378 | [m4_define([_LTDL_MODE], [subproject])]) 379 | 380 | m4_define([_LTDL_TYPE], []) 381 | LT_OPTION_DEFINE([LTDL_INIT], [installable], 382 | [m4_define([_LTDL_TYPE], [installable])]) 383 | LT_OPTION_DEFINE([LTDL_INIT], [convenience], 384 | [m4_define([_LTDL_TYPE], [convenience])]) 385 | -------------------------------------------------------------------------------- /m4/ltsugar.m4: -------------------------------------------------------------------------------- 1 | # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- 2 | # 3 | # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. 4 | # Written by Gary V. Vaughan, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # serial 6 ltsugar.m4 11 | 12 | # This is to help aclocal find these macros, as it can't see m4_define. 13 | AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) 14 | 15 | 16 | # lt_join(SEP, ARG1, [ARG2...]) 17 | # ----------------------------- 18 | # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their 19 | # associated separator. 20 | # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier 21 | # versions in m4sugar had bugs. 22 | m4_define([lt_join], 23 | [m4_if([$#], [1], [], 24 | [$#], [2], [[$2]], 25 | [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) 26 | m4_define([_lt_join], 27 | [m4_if([$#$2], [2], [], 28 | [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) 29 | 30 | 31 | # lt_car(LIST) 32 | # lt_cdr(LIST) 33 | # ------------ 34 | # Manipulate m4 lists. 35 | # These macros are necessary as long as will still need to support 36 | # Autoconf-2.59 which quotes differently. 37 | m4_define([lt_car], [[$1]]) 38 | m4_define([lt_cdr], 39 | [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], 40 | [$#], 1, [], 41 | [m4_dquote(m4_shift($@))])]) 42 | m4_define([lt_unquote], $1) 43 | 44 | 45 | # lt_append(MACRO-NAME, STRING, [SEPARATOR]) 46 | # ------------------------------------------ 47 | # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. 48 | # Note that neither SEPARATOR nor STRING are expanded; they are appended 49 | # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). 50 | # No SEPARATOR is output if MACRO-NAME was previously undefined (different 51 | # than defined and empty). 52 | # 53 | # This macro is needed until we can rely on Autoconf 2.62, since earlier 54 | # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. 55 | m4_define([lt_append], 56 | [m4_define([$1], 57 | m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) 58 | 59 | 60 | 61 | # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) 62 | # ---------------------------------------------------------- 63 | # Produce a SEP delimited list of all paired combinations of elements of 64 | # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list 65 | # has the form PREFIXmINFIXSUFFIXn. 66 | # Needed until we can rely on m4_combine added in Autoconf 2.62. 67 | m4_define([lt_combine], 68 | [m4_if(m4_eval([$# > 3]), [1], 69 | [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl 70 | [[m4_foreach([_Lt_prefix], [$2], 71 | [m4_foreach([_Lt_suffix], 72 | ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, 73 | [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) 74 | 75 | 76 | # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) 77 | # ----------------------------------------------------------------------- 78 | # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited 79 | # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. 80 | m4_define([lt_if_append_uniq], 81 | [m4_ifdef([$1], 82 | [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], 83 | [lt_append([$1], [$2], [$3])$4], 84 | [$5])], 85 | [lt_append([$1], [$2], [$3])$4])]) 86 | 87 | 88 | # lt_dict_add(DICT, KEY, VALUE) 89 | # ----------------------------- 90 | m4_define([lt_dict_add], 91 | [m4_define([$1($2)], [$3])]) 92 | 93 | 94 | # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) 95 | # -------------------------------------------- 96 | m4_define([lt_dict_add_subkey], 97 | [m4_define([$1($2:$3)], [$4])]) 98 | 99 | 100 | # lt_dict_fetch(DICT, KEY, [SUBKEY]) 101 | # ---------------------------------- 102 | m4_define([lt_dict_fetch], 103 | [m4_ifval([$3], 104 | m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), 105 | m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) 106 | 107 | 108 | # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) 109 | # ----------------------------------------------------------------- 110 | m4_define([lt_if_dict_fetch], 111 | [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], 112 | [$5], 113 | [$6])]) 114 | 115 | 116 | # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) 117 | # -------------------------------------------------------------- 118 | m4_define([lt_dict_filter], 119 | [m4_if([$5], [], [], 120 | [lt_join(m4_quote(m4_default([$4], [[, ]])), 121 | lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), 122 | [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl 123 | ]) 124 | -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 3337 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.2]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3337]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.2' 20 | macro_revision='1.3337' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /m4/lt~obsolete.m4: -------------------------------------------------------------------------------- 1 | # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- 2 | # 3 | # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004. 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # serial 5 lt~obsolete.m4 11 | 12 | # These exist entirely to fool aclocal when bootstrapping libtool. 13 | # 14 | # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) 15 | # which have later been changed to m4_define as they aren't part of the 16 | # exported API, or moved to Autoconf or Automake where they belong. 17 | # 18 | # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN 19 | # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us 20 | # using a macro with the same name in our local m4/libtool.m4 it'll 21 | # pull the old libtool.m4 in (it doesn't see our shiny new m4_define 22 | # and doesn't know about Autoconf macros at all.) 23 | # 24 | # So we provide this file, which has a silly filename so it's always 25 | # included after everything else. This provides aclocal with the 26 | # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything 27 | # because those macros already exist, or will be overwritten later. 28 | # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 29 | # 30 | # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. 31 | # Yes, that means every name once taken will need to remain here until 32 | # we give up compatibility with versions before 1.7, at which point 33 | # we need to keep only those names which we still refer to. 34 | 35 | # This is to help aclocal find these macros, as it can't see m4_define. 36 | AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) 37 | 38 | m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) 39 | m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) 40 | m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) 41 | m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) 42 | m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) 43 | m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) 44 | m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) 45 | m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) 46 | m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) 47 | m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) 48 | m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) 49 | m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) 50 | m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) 51 | m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) 52 | m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) 53 | m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) 54 | m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) 55 | m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) 56 | m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) 57 | m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) 58 | m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) 59 | m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) 60 | m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) 61 | m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) 62 | m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) 63 | m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) 64 | m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) 65 | m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) 66 | m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) 67 | m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) 68 | m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) 69 | m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) 70 | m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) 71 | m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) 72 | m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) 73 | m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) 74 | m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) 75 | m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) 76 | m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) 77 | m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) 78 | m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) 79 | m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) 80 | m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) 81 | m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) 82 | m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) 83 | m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) 84 | m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) 85 | m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) 86 | m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) 87 | m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) 88 | m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) 89 | m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) 90 | m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) 91 | m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) 92 | m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) 93 | m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) 94 | m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) 95 | m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) 96 | m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) 97 | m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) 98 | m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) 99 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | AM_LDFLAGS = -lbsd -levent -lgumbo -luriparser -Wall 4 | 5 | lib_LTLIBRARIES = libcreep.la 6 | libcreep_la_SOURCES = creep.c creep.h 7 | 8 | bin_PROGRAMS = creep 9 | creep_SOURCES = creep_main.c 10 | creep_LDADD = libcreep.la 11 | -------------------------------------------------------------------------------- /src/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.14 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994-2013 Free Software Foundation, Inc. 5 | 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 | 18 | VPATH = @srcdir@ 19 | am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 20 | am__make_running_with_option = \ 21 | case $${target_option-} in \ 22 | ?) ;; \ 23 | *) echo "am__make_running_with_option: internal error: invalid" \ 24 | "target option '$${target_option-}' specified" >&2; \ 25 | exit 1;; \ 26 | esac; \ 27 | has_opt=no; \ 28 | sane_makeflags=$$MAKEFLAGS; \ 29 | if $(am__is_gnu_make); then \ 30 | sane_makeflags=$$MFLAGS; \ 31 | else \ 32 | case $$MAKEFLAGS in \ 33 | *\\[\ \ ]*) \ 34 | bs=\\; \ 35 | sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ 36 | | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ 37 | esac; \ 38 | fi; \ 39 | skip_next=no; \ 40 | strip_trailopt () \ 41 | { \ 42 | flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ 43 | }; \ 44 | for flg in $$sane_makeflags; do \ 45 | test $$skip_next = yes && { skip_next=no; continue; }; \ 46 | case $$flg in \ 47 | *=*|--*) continue;; \ 48 | -*I) strip_trailopt 'I'; skip_next=yes;; \ 49 | -*I?*) strip_trailopt 'I';; \ 50 | -*O) strip_trailopt 'O'; skip_next=yes;; \ 51 | -*O?*) strip_trailopt 'O';; \ 52 | -*l) strip_trailopt 'l'; skip_next=yes;; \ 53 | -*l?*) strip_trailopt 'l';; \ 54 | -[dEDm]) skip_next=yes;; \ 55 | -[JT]) skip_next=yes;; \ 56 | esac; \ 57 | case $$flg in \ 58 | *$$target_option*) has_opt=yes; break;; \ 59 | esac; \ 60 | done; \ 61 | test $$has_opt = yes 62 | am__make_dryrun = (target_option=n; $(am__make_running_with_option)) 63 | am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 64 | pkgdatadir = $(datadir)/@PACKAGE@ 65 | pkgincludedir = $(includedir)/@PACKAGE@ 66 | pkglibdir = $(libdir)/@PACKAGE@ 67 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 68 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 69 | install_sh_DATA = $(install_sh) -c -m 644 70 | install_sh_PROGRAM = $(install_sh) -c 71 | install_sh_SCRIPT = $(install_sh) -c 72 | INSTALL_HEADER = $(INSTALL_DATA) 73 | transform = $(program_transform_name) 74 | NORMAL_INSTALL = : 75 | PRE_INSTALL = : 76 | POST_INSTALL = : 77 | NORMAL_UNINSTALL = : 78 | PRE_UNINSTALL = : 79 | POST_UNINSTALL = : 80 | build_triplet = @build@ 81 | host_triplet = @host@ 82 | bin_PROGRAMS = creep$(EXEEXT) 83 | subdir = src 84 | DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ 85 | $(top_srcdir)/build-aux/depcomp 86 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 87 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ 88 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ 89 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ 90 | $(top_srcdir)/configure.ac 91 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 92 | $(ACLOCAL_M4) 93 | mkinstalldirs = $(install_sh) -d 94 | CONFIG_HEADER = $(top_builddir)/config.h 95 | CONFIG_CLEAN_FILES = 96 | CONFIG_CLEAN_VPATH_FILES = 97 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 98 | am__vpath_adj = case $$p in \ 99 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 100 | *) f=$$p;; \ 101 | esac; 102 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; 103 | am__install_max = 40 104 | am__nobase_strip_setup = \ 105 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` 106 | am__nobase_strip = \ 107 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" 108 | am__nobase_list = $(am__nobase_strip_setup); \ 109 | for p in $$list; do echo "$$p $$p"; done | \ 110 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ 111 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ 112 | if (++n[$$2] == $(am__install_max)) \ 113 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ 114 | END { for (dir in files) print dir, files[dir] }' 115 | am__base_list = \ 116 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 117 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 118 | am__uninstall_files_from_dir = { \ 119 | test -z "$$files" \ 120 | || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ 121 | || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ 122 | $(am__cd) "$$dir" && rm -f $$files; }; \ 123 | } 124 | am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" 125 | LTLIBRARIES = $(lib_LTLIBRARIES) 126 | libcreep_la_LIBADD = 127 | am_libcreep_la_OBJECTS = creep.lo 128 | libcreep_la_OBJECTS = $(am_libcreep_la_OBJECTS) 129 | AM_V_lt = $(am__v_lt_@AM_V@) 130 | am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) 131 | am__v_lt_0 = --silent 132 | am__v_lt_1 = 133 | PROGRAMS = $(bin_PROGRAMS) 134 | am_creep_OBJECTS = creep_main.$(OBJEXT) 135 | creep_OBJECTS = $(am_creep_OBJECTS) 136 | creep_DEPENDENCIES = libcreep.la 137 | AM_V_P = $(am__v_P_@AM_V@) 138 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) 139 | am__v_P_0 = false 140 | am__v_P_1 = : 141 | AM_V_GEN = $(am__v_GEN_@AM_V@) 142 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) 143 | am__v_GEN_0 = @echo " GEN " $@; 144 | am__v_GEN_1 = 145 | AM_V_at = $(am__v_at_@AM_V@) 146 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) 147 | am__v_at_0 = @ 148 | am__v_at_1 = 149 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) 150 | depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp 151 | am__depfiles_maybe = depfiles 152 | am__mv = mv -f 153 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 154 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 155 | LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ 156 | $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ 157 | $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ 158 | $(AM_CFLAGS) $(CFLAGS) 159 | AM_V_CC = $(am__v_CC_@AM_V@) 160 | am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) 161 | am__v_CC_0 = @echo " CC " $@; 162 | am__v_CC_1 = 163 | CCLD = $(CC) 164 | LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ 165 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ 166 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ 167 | AM_V_CCLD = $(am__v_CCLD_@AM_V@) 168 | am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) 169 | am__v_CCLD_0 = @echo " CCLD " $@; 170 | am__v_CCLD_1 = 171 | SOURCES = $(libcreep_la_SOURCES) $(creep_SOURCES) 172 | DIST_SOURCES = $(libcreep_la_SOURCES) $(creep_SOURCES) 173 | am__can_run_installinfo = \ 174 | case $$AM_UPDATE_INFO_DIR in \ 175 | n|no|NO) false;; \ 176 | *) (install-info --version) >/dev/null 2>&1;; \ 177 | esac 178 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 179 | # Read a list of newline-separated strings from the standard input, 180 | # and print each of them once, without duplicates. Input order is 181 | # *not* preserved. 182 | am__uniquify_input = $(AWK) '\ 183 | BEGIN { nonempty = 0; } \ 184 | { items[$$0] = 1; nonempty = 1; } \ 185 | END { if (nonempty) { for (i in items) print i; }; } \ 186 | ' 187 | # Make sure the list of sources is unique. This is necessary because, 188 | # e.g., the same source file might be shared among _SOURCES variables 189 | # for different programs/libraries. 190 | am__define_uniq_tagged_files = \ 191 | list='$(am__tagged_files)'; \ 192 | unique=`for i in $$list; do \ 193 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 194 | done | $(am__uniquify_input)` 195 | ETAGS = etags 196 | CTAGS = ctags 197 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 198 | ACLOCAL = @ACLOCAL@ 199 | AMTAR = @AMTAR@ 200 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 201 | AR = @AR@ 202 | AUTOCONF = @AUTOCONF@ 203 | AUTOHEADER = @AUTOHEADER@ 204 | AUTOMAKE = @AUTOMAKE@ 205 | AWK = @AWK@ 206 | CC = @CC@ 207 | CCDEPMODE = @CCDEPMODE@ 208 | CFLAGS = @CFLAGS@ 209 | CHECK_CFLAGS = @CHECK_CFLAGS@ 210 | CHECK_LIBS = @CHECK_LIBS@ 211 | CPP = @CPP@ 212 | CPPFLAGS = @CPPFLAGS@ 213 | CYGPATH_W = @CYGPATH_W@ 214 | DEFS = @DEFS@ 215 | DEPDIR = @DEPDIR@ 216 | DLLTOOL = @DLLTOOL@ 217 | DSYMUTIL = @DSYMUTIL@ 218 | DUMPBIN = @DUMPBIN@ 219 | ECHO_C = @ECHO_C@ 220 | ECHO_N = @ECHO_N@ 221 | ECHO_T = @ECHO_T@ 222 | EGREP = @EGREP@ 223 | EXEEXT = @EXEEXT@ 224 | FGREP = @FGREP@ 225 | GREP = @GREP@ 226 | INSTALL = @INSTALL@ 227 | INSTALL_DATA = @INSTALL_DATA@ 228 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 229 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 230 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 231 | LD = @LD@ 232 | LDFLAGS = @LDFLAGS@ 233 | LIBEVENT_CFLAGS = @LIBEVENT_CFLAGS@ 234 | LIBEVENT_LIBS = @LIBEVENT_LIBS@ 235 | LIBOBJS = @LIBOBJS@ 236 | LIBS = @LIBS@ 237 | LIBTOOL = @LIBTOOL@ 238 | LIPO = @LIPO@ 239 | LN_S = @LN_S@ 240 | LTLIBOBJS = @LTLIBOBJS@ 241 | MAKEINFO = @MAKEINFO@ 242 | MANIFEST_TOOL = @MANIFEST_TOOL@ 243 | MKDIR_P = @MKDIR_P@ 244 | NM = @NM@ 245 | NMEDIT = @NMEDIT@ 246 | OBJDUMP = @OBJDUMP@ 247 | OBJEXT = @OBJEXT@ 248 | OTOOL = @OTOOL@ 249 | OTOOL64 = @OTOOL64@ 250 | PACKAGE = @PACKAGE@ 251 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 252 | PACKAGE_NAME = @PACKAGE_NAME@ 253 | PACKAGE_STRING = @PACKAGE_STRING@ 254 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 255 | PACKAGE_URL = @PACKAGE_URL@ 256 | PACKAGE_VERSION = @PACKAGE_VERSION@ 257 | PATH_SEPARATOR = @PATH_SEPARATOR@ 258 | PKG_CONFIG = @PKG_CONFIG@ 259 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ 260 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 261 | RANLIB = @RANLIB@ 262 | SED = @SED@ 263 | SET_MAKE = @SET_MAKE@ 264 | SHELL = @SHELL@ 265 | STRIP = @STRIP@ 266 | VERSION = @VERSION@ 267 | abs_builddir = @abs_builddir@ 268 | abs_srcdir = @abs_srcdir@ 269 | abs_top_builddir = @abs_top_builddir@ 270 | abs_top_srcdir = @abs_top_srcdir@ 271 | ac_ct_AR = @ac_ct_AR@ 272 | ac_ct_CC = @ac_ct_CC@ 273 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 274 | am__include = @am__include@ 275 | am__leading_dot = @am__leading_dot@ 276 | am__quote = @am__quote@ 277 | am__tar = @am__tar@ 278 | am__untar = @am__untar@ 279 | bindir = @bindir@ 280 | build = @build@ 281 | build_alias = @build_alias@ 282 | build_cpu = @build_cpu@ 283 | build_os = @build_os@ 284 | build_vendor = @build_vendor@ 285 | builddir = @builddir@ 286 | datadir = @datadir@ 287 | datarootdir = @datarootdir@ 288 | docdir = @docdir@ 289 | dvidir = @dvidir@ 290 | exec_prefix = @exec_prefix@ 291 | host = @host@ 292 | host_alias = @host_alias@ 293 | host_cpu = @host_cpu@ 294 | host_os = @host_os@ 295 | host_vendor = @host_vendor@ 296 | htmldir = @htmldir@ 297 | includedir = @includedir@ 298 | infodir = @infodir@ 299 | install_sh = @install_sh@ 300 | libdir = @libdir@ 301 | libexecdir = @libexecdir@ 302 | localedir = @localedir@ 303 | localstatedir = @localstatedir@ 304 | mandir = @mandir@ 305 | mkdir_p = @mkdir_p@ 306 | oldincludedir = @oldincludedir@ 307 | pdfdir = @pdfdir@ 308 | prefix = @prefix@ 309 | program_transform_name = @program_transform_name@ 310 | psdir = @psdir@ 311 | sbindir = @sbindir@ 312 | sharedstatedir = @sharedstatedir@ 313 | srcdir = @srcdir@ 314 | sysconfdir = @sysconfdir@ 315 | target_alias = @target_alias@ 316 | top_build_prefix = @top_build_prefix@ 317 | top_builddir = @top_builddir@ 318 | top_srcdir = @top_srcdir@ 319 | AM_LDFLAGS = -lbsd -levent -lgumbo -luriparser -Wall 320 | lib_LTLIBRARIES = libcreep.la 321 | libcreep_la_SOURCES = creep.c creep.h 322 | creep_SOURCES = creep_main.c 323 | creep_LDADD = libcreep.la 324 | all: all-am 325 | 326 | .SUFFIXES: 327 | .SUFFIXES: .c .lo .o .obj 328 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 329 | @for dep in $?; do \ 330 | case '$(am__configure_deps)' in \ 331 | *$$dep*) \ 332 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 333 | && { if test -f $@; then exit 0; else break; fi; }; \ 334 | exit 1;; \ 335 | esac; \ 336 | done; \ 337 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ 338 | $(am__cd) $(top_srcdir) && \ 339 | $(AUTOMAKE) --foreign src/Makefile 340 | .PRECIOUS: Makefile 341 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 342 | @case '$?' in \ 343 | *config.status*) \ 344 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 345 | *) \ 346 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 347 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 348 | esac; 349 | 350 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 351 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 352 | 353 | $(top_srcdir)/configure: $(am__configure_deps) 354 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 355 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 356 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 357 | $(am__aclocal_m4_deps): 358 | 359 | install-libLTLIBRARIES: $(lib_LTLIBRARIES) 360 | @$(NORMAL_INSTALL) 361 | @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ 362 | list2=; for p in $$list; do \ 363 | if test -f $$p; then \ 364 | list2="$$list2 $$p"; \ 365 | else :; fi; \ 366 | done; \ 367 | test -z "$$list2" || { \ 368 | echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ 369 | $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ 370 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ 371 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ 372 | } 373 | 374 | uninstall-libLTLIBRARIES: 375 | @$(NORMAL_UNINSTALL) 376 | @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ 377 | for p in $$list; do \ 378 | $(am__strip_dir) \ 379 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ 380 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ 381 | done 382 | 383 | clean-libLTLIBRARIES: 384 | -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) 385 | @list='$(lib_LTLIBRARIES)'; \ 386 | locs=`for p in $$list; do echo $$p; done | \ 387 | sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ 388 | sort -u`; \ 389 | test -z "$$locs" || { \ 390 | echo rm -f $${locs}; \ 391 | rm -f $${locs}; \ 392 | } 393 | 394 | libcreep.la: $(libcreep_la_OBJECTS) $(libcreep_la_DEPENDENCIES) $(EXTRA_libcreep_la_DEPENDENCIES) 395 | $(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libcreep_la_OBJECTS) $(libcreep_la_LIBADD) $(LIBS) 396 | install-binPROGRAMS: $(bin_PROGRAMS) 397 | @$(NORMAL_INSTALL) 398 | @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 399 | if test -n "$$list"; then \ 400 | echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ 401 | $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ 402 | fi; \ 403 | for p in $$list; do echo "$$p $$p"; done | \ 404 | sed 's/$(EXEEXT)$$//' | \ 405 | while read p p1; do if test -f $$p \ 406 | || test -f $$p1 \ 407 | ; then echo "$$p"; echo "$$p"; else :; fi; \ 408 | done | \ 409 | sed -e 'p;s,.*/,,;n;h' \ 410 | -e 's|.*|.|' \ 411 | -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 412 | sed 'N;N;N;s,\n, ,g' | \ 413 | $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ 414 | { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ 415 | if ($$2 == $$4) files[d] = files[d] " " $$1; \ 416 | else { print "f", $$3 "/" $$4, $$1; } } \ 417 | END { for (d in files) print "f", d, files[d] }' | \ 418 | while read type dir files; do \ 419 | if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ 420 | test -z "$$files" || { \ 421 | echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ 422 | $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ 423 | } \ 424 | ; done 425 | 426 | uninstall-binPROGRAMS: 427 | @$(NORMAL_UNINSTALL) 428 | @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 429 | files=`for p in $$list; do echo "$$p"; done | \ 430 | sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ 431 | -e 's/$$/$(EXEEXT)/' \ 432 | `; \ 433 | test -n "$$list" || exit 0; \ 434 | echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ 435 | cd "$(DESTDIR)$(bindir)" && rm -f $$files 436 | 437 | clean-binPROGRAMS: 438 | @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ 439 | echo " rm -f" $$list; \ 440 | rm -f $$list || exit $$?; \ 441 | test -n "$(EXEEXT)" || exit 0; \ 442 | list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ 443 | echo " rm -f" $$list; \ 444 | rm -f $$list 445 | 446 | creep$(EXEEXT): $(creep_OBJECTS) $(creep_DEPENDENCIES) $(EXTRA_creep_DEPENDENCIES) 447 | @rm -f creep$(EXEEXT) 448 | $(AM_V_CCLD)$(LINK) $(creep_OBJECTS) $(creep_LDADD) $(LIBS) 449 | 450 | mostlyclean-compile: 451 | -rm -f *.$(OBJEXT) 452 | 453 | distclean-compile: 454 | -rm -f *.tab.c 455 | 456 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creep.Plo@am__quote@ 457 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creep_main.Po@am__quote@ 458 | 459 | .c.o: 460 | @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ 461 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ 462 | @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po 463 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 464 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 465 | @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< 466 | 467 | .c.obj: 468 | @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ 469 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ 470 | @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po 471 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 472 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 473 | @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` 474 | 475 | .c.lo: 476 | @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ 477 | @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ 478 | @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo 479 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ 480 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 481 | @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< 482 | 483 | mostlyclean-libtool: 484 | -rm -f *.lo 485 | 486 | clean-libtool: 487 | -rm -rf .libs _libs 488 | 489 | ID: $(am__tagged_files) 490 | $(am__define_uniq_tagged_files); mkid -fID $$unique 491 | tags: tags-am 492 | TAGS: tags 493 | 494 | tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 495 | set x; \ 496 | here=`pwd`; \ 497 | $(am__define_uniq_tagged_files); \ 498 | shift; \ 499 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 500 | test -n "$$unique" || unique=$$empty_fix; \ 501 | if test $$# -gt 0; then \ 502 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 503 | "$$@" $$unique; \ 504 | else \ 505 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 506 | $$unique; \ 507 | fi; \ 508 | fi 509 | ctags: ctags-am 510 | 511 | CTAGS: ctags 512 | ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 513 | $(am__define_uniq_tagged_files); \ 514 | test -z "$(CTAGS_ARGS)$$unique" \ 515 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 516 | $$unique 517 | 518 | GTAGS: 519 | here=`$(am__cd) $(top_builddir) && pwd` \ 520 | && $(am__cd) $(top_srcdir) \ 521 | && gtags -i $(GTAGS_ARGS) "$$here" 522 | cscopelist: cscopelist-am 523 | 524 | cscopelist-am: $(am__tagged_files) 525 | list='$(am__tagged_files)'; \ 526 | case "$(srcdir)" in \ 527 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ 528 | *) sdir=$(subdir)/$(srcdir) ;; \ 529 | esac; \ 530 | for i in $$list; do \ 531 | if test -f "$$i"; then \ 532 | echo "$(subdir)/$$i"; \ 533 | else \ 534 | echo "$$sdir/$$i"; \ 535 | fi; \ 536 | done >> $(top_builddir)/cscope.files 537 | 538 | distclean-tags: 539 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 540 | 541 | distdir: $(DISTFILES) 542 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 543 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 544 | list='$(DISTFILES)'; \ 545 | dist_files=`for file in $$list; do echo $$file; done | \ 546 | sed -e "s|^$$srcdirstrip/||;t" \ 547 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 548 | case $$dist_files in \ 549 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 550 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 551 | sort -u` ;; \ 552 | esac; \ 553 | for file in $$dist_files; do \ 554 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 555 | if test -d $$d/$$file; then \ 556 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 557 | if test -d "$(distdir)/$$file"; then \ 558 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 559 | fi; \ 560 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 561 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 562 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 563 | fi; \ 564 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 565 | else \ 566 | test -f "$(distdir)/$$file" \ 567 | || cp -p $$d/$$file "$(distdir)/$$file" \ 568 | || exit 1; \ 569 | fi; \ 570 | done 571 | check-am: all-am 572 | check: check-am 573 | all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) 574 | install-binPROGRAMS: install-libLTLIBRARIES 575 | 576 | installdirs: 577 | for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \ 578 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 579 | done 580 | install: install-am 581 | install-exec: install-exec-am 582 | install-data: install-data-am 583 | uninstall: uninstall-am 584 | 585 | install-am: all-am 586 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 587 | 588 | installcheck: installcheck-am 589 | install-strip: 590 | if test -z '$(STRIP)'; then \ 591 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 592 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 593 | install; \ 594 | else \ 595 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 596 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 597 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 598 | fi 599 | mostlyclean-generic: 600 | 601 | clean-generic: 602 | 603 | distclean-generic: 604 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 605 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 606 | 607 | maintainer-clean-generic: 608 | @echo "This command is intended for maintainers to use" 609 | @echo "it deletes files that may require special tools to rebuild." 610 | clean: clean-am 611 | 612 | clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ 613 | clean-libtool mostlyclean-am 614 | 615 | distclean: distclean-am 616 | -rm -rf ./$(DEPDIR) 617 | -rm -f Makefile 618 | distclean-am: clean-am distclean-compile distclean-generic \ 619 | distclean-tags 620 | 621 | dvi: dvi-am 622 | 623 | dvi-am: 624 | 625 | html: html-am 626 | 627 | html-am: 628 | 629 | info: info-am 630 | 631 | info-am: 632 | 633 | install-data-am: 634 | 635 | install-dvi: install-dvi-am 636 | 637 | install-dvi-am: 638 | 639 | install-exec-am: install-binPROGRAMS install-libLTLIBRARIES 640 | 641 | install-html: install-html-am 642 | 643 | install-html-am: 644 | 645 | install-info: install-info-am 646 | 647 | install-info-am: 648 | 649 | install-man: 650 | 651 | install-pdf: install-pdf-am 652 | 653 | install-pdf-am: 654 | 655 | install-ps: install-ps-am 656 | 657 | install-ps-am: 658 | 659 | installcheck-am: 660 | 661 | maintainer-clean: maintainer-clean-am 662 | -rm -rf ./$(DEPDIR) 663 | -rm -f Makefile 664 | maintainer-clean-am: distclean-am maintainer-clean-generic 665 | 666 | mostlyclean: mostlyclean-am 667 | 668 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ 669 | mostlyclean-libtool 670 | 671 | pdf: pdf-am 672 | 673 | pdf-am: 674 | 675 | ps: ps-am 676 | 677 | ps-am: 678 | 679 | uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES 680 | 681 | .MAKE: install-am install-strip 682 | 683 | .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ 684 | clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ 685 | clean-libtool cscopelist-am ctags ctags-am distclean \ 686 | distclean-compile distclean-generic distclean-libtool \ 687 | distclean-tags distdir dvi dvi-am html html-am info info-am \ 688 | install install-am install-binPROGRAMS install-data \ 689 | install-data-am install-dvi install-dvi-am install-exec \ 690 | install-exec-am install-html install-html-am install-info \ 691 | install-info-am install-libLTLIBRARIES install-man install-pdf \ 692 | install-pdf-am install-ps install-ps-am install-strip \ 693 | installcheck installcheck-am installdirs maintainer-clean \ 694 | maintainer-clean-generic mostlyclean mostlyclean-compile \ 695 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ 696 | tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ 697 | uninstall-libLTLIBRARIES 698 | 699 | 700 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 701 | # Otherwise a system limit (for SysV at least) may be exceeded. 702 | .NOEXPORT: 703 | -------------------------------------------------------------------------------- /src/creep.c: -------------------------------------------------------------------------------- 1 | #ifndef CREEP_H 2 | #define CREEP_H 3 | 4 | #endif /* CREEP_H */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include /* hostent */ 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include "/usr/local/include/gumbo.h" 22 | 23 | #include "../src/creep.h" 24 | #include "../src/def_error_messages.h" 25 | #include "../src/def_sizes.h" 26 | 27 | #define DEF_SIZE_HEADER 128 28 | 29 | /* Globals */ 30 | Error error[DEF_SIZE_ERROR_INSTANCES]; 31 | struct hostent *he; 32 | struct in_addr **addr; 33 | 34 | /* Command line arguments */ 35 | char argDomain[2048]; 36 | char argIP[16]; 37 | char argPort[6]; 38 | int argDebug = 0, argDomainSet = 0, argCrawlSubs = 0, argNoCrawl = 0; 39 | char path[DEF_SIZE_URL]; 40 | 41 | /* 42 | * 43 | * 44 | * DEBUG FUNCTIONS 45 | * 46 | * 47 | */ 48 | 49 | int debugPrintf(char msg[DEF_SIZE_DEBUG_MESSAGE], ...) 50 | { 51 | if (argDebug == 1) 52 | { 53 | va_list args; 54 | va_start(args, msg); 55 | 56 | vprintf(msg, args); 57 | 58 | va_end(args); 59 | } 60 | 61 | return 0; 62 | } 63 | 64 | /* 65 | * 66 | * 67 | * ERROR FUNCTIONS 68 | * 69 | * 70 | */ 71 | 72 | int setup_error_messages() 73 | { 74 | /*typedef struct { 75 | int number; 76 | char message[64]; 77 | uint8_t log; 78 | } Error;*/ 79 | 80 | //DEF_ERROR_1 "Could not find error message for error number, you shouldn't really see this.." 81 | error[1].number = 1; 82 | strcpy(error[1].message, DEF_ERROR_1); 83 | error[1].log = 0x0; 84 | 85 | //DEF_ERROR_10 "Missing argument" 86 | error[10].number = 10; 87 | strcpy(error[10].message, DEF_ERROR_10); 88 | error[10].log = 0x0; 89 | 90 | //DEF_ERROR_20 "Could not malloc" 91 | error[20].number = 20; 92 | strcpy(error[10].message, DEF_ERROR_20); 93 | error[20].log = 0x0; 94 | 95 | //DEF_ERROR_30 "IP address supplied is not a valid v4 address" 96 | error[30].number = 30; 97 | strcpy(error[30].message, DEF_ERROR_30); 98 | error[30].log = 0x0; 99 | 100 | //DEF_ERROR_31 "Domain is not valid" 101 | error[31].number = 31; 102 | strcpy(error[31].message, DEF_ERROR_31); 103 | error[31].log = 0x0; 104 | 105 | //DEF_ERROR_40 "Connection failed" 106 | error[40].number = 40; 107 | strcpy(error[40].message, DEF_ERROR_40); 108 | error[40].log = 0x0; 109 | 110 | //DEF_ERROR_50 "Could not resolve domain" 111 | error[50].number = 50; 112 | strcpy(error[50].message, DEF_ERROR_50); 113 | error[50].log = 0x0; 114 | 115 | return 0; 116 | } 117 | 118 | uint8_t exit_error(int x) 119 | { 120 | printf("Error %d: %s\n", error[x].number, error[x].message); 121 | 122 | exit(error[x].number); 123 | } 124 | 125 | /* 126 | * 127 | * 128 | * CRAWLING STUFF 129 | * 130 | * 131 | */ 132 | 133 | /* Check domain in absolute URLs. Will add subdomain support at some point TODO */ 134 | /* Return 0 if URL is relative or absolute and in scope */ 135 | int checkDomain(char *url) 136 | { 137 | char *domain = NULL; 138 | debugPrintf("checkDomain url == %s\n", url); 139 | 140 | /* 141 | * start with http? - check domain to second / 142 | * start with /? - relative, OK 143 | * start with something else? Probably relative, OK? 144 | */ 145 | 146 | debugPrintf("checkDomain url and \"http://\" compare == %d\n", strncmp(url,"http://",7)); 147 | 148 | /* Uppercase support? TODO */ 149 | if (strncmp(url,"http://",7) == 0) 150 | { 151 | domain = &url[7]; 152 | } else if (strncmp(url,"https://",8) == 0) 153 | { 154 | domain = &url[8]; 155 | } else { 156 | debugPrintf("checkDomain url == %s\n", url); 157 | debugPrintf("checkDomain domain == %s\n", domain); 158 | return 0; 159 | } 160 | 161 | debugPrintf("checkDomain domain == %s\n", domain); 162 | debugPrintf("checkDomain argDomain == %s\n", argDomain); 163 | debugPrintf("checkDomain argDomain and domain compare == %d\n",strncmp(argDomain,domain,strnlen(argDomain,DEF_SIZE_DOMAIN))); 164 | if (strncmp(argDomain,domain,strnlen(argDomain,DEF_SIZE_DOMAIN)) == 0) 165 | { 166 | return 0; 167 | } 168 | 169 | return 1; 170 | } 171 | 172 | const char *findURLs(Target *target, GumboNode *root) 173 | { 174 | int i; 175 | if (root->type != GUMBO_NODE_ELEMENT) { 176 | return; 177 | } 178 | 179 | GumboAttribute* attr; 180 | if (root->v.element.tag == GUMBO_TAG_A && 181 | (attr = gumbo_get_attribute(&root->v.element.attributes, "href"))) { 182 | debugPrintf("a href == %s\n", attr->value); 183 | /* Only care for URLs in scope */ 184 | if (checkDomain((char *) attr->value) == 0) 185 | { 186 | debugPrintf("findURLs calling addPage\n"); 187 | addPage(target,(char *) attr->value); 188 | } 189 | } 190 | 191 | if (root->v.element.tag == GUMBO_TAG_SCRIPT && 192 | (attr = gumbo_get_attribute(&root->v.element.attributes, "src"))) { 193 | debugPrintf("script src == %s\n", attr->value); 194 | /* Only care for URLs in scope */ 195 | if (checkDomain((char *) attr->value) == 0) 196 | { 197 | debugPrintf("findURLs calling addPage\n"); 198 | addPage(target,(char *) attr->value); 199 | } 200 | } 201 | 202 | GumboVector* children = &root->v.element.children; 203 | for (0; i < children->length; ++i) { 204 | findURLs(target, children->data[i]); /* Recursive... */ 205 | } 206 | } 207 | 208 | int searchPageForURLs(Target *target) 209 | { 210 | GumboOutput* output = gumbo_parse_with_options(&kGumboDefaultOptions, target->current_node->source_code, 211 | strnlen(target->current_node->source_code, DEF_SIZE_SOURCE_CODE)); 212 | 213 | //const char* title = find_title(output->root); 214 | //printf("%s\n", title); 215 | //gumbo_destroy_output(&kGumboDefaultOptions, output); 216 | //free(input); 217 | 218 | findURLs(target, output->root); 219 | } 220 | 221 | /* Interface for req to page struct */ 222 | int populatePage(struct evhttp_request *req, Target *target) 223 | { 224 | size_t datalen = DEF_SIZE_SOURCE_CODE; /* Max source code size */ 225 | target->current_node->source_code = malloc(DEF_SIZE_SOURCE_CODE); /* TODO check */ 226 | target->current_node->headers_raw = malloc(DEF_SIZE_HEADERS); /* TODO check */ 227 | char *line = malloc(DEF_SIZE_SOURCE_CODE_LINE); /* TODO check */ 228 | 229 | debugPrintf("populatePage target == %s\n", (char *) target); 230 | if (req == NULL) { 231 | debugPrintf("timed out!\n"); 232 | } else if (req->response_code == 0) { 233 | debugPrintf("connection refused!\n"); 234 | } else if (req->response_code != 200) { 235 | debugPrintf("error: %u %s\n", req->response_code, req->response_code_line); 236 | } else { 237 | evbuffer_copyout(req->input_buffer, target->current_node->source_code, datalen); 238 | scrapeHeaders(req,target); 239 | debugPrintf("source? %s\n", target->current_node->source_code); 240 | } 241 | } 242 | 243 | int processRobotsTxt(Target *target) 244 | { 245 | return 0; 246 | } 247 | 248 | //void reqhandler(struct evhttp_request *req, Target *target) 249 | void reqhandler(struct evhttp_request *req, void *vTarget) 250 | { 251 | /* 252 | - Crawl and find more pages, need to add pages 253 | - Check all pages have been crawled, search pages? 254 | */ 255 | 256 | /* NOTE: No reentrant allowed (doHTTPRequest) */ 257 | 258 | struct evhttp_uri *new_uri = NULL; 259 | const char *new_location = NULL; 260 | char cleanURLStr[DEF_SIZE_URL], relativeURLStr[DEF_SIZE_URL], newLocationStr[DEF_SIZE_URL]; 261 | 262 | /* Typecast */ 263 | Target *target = (Target *) vTarget; 264 | 265 | if (req == NULL) 266 | { 267 | exit_error(40); 268 | } 269 | 270 | /* Deal with robots.txt */ 271 | if (!strncmp(target->current_node->url,"/robots.txt",DEF_SIZE_URL)) 272 | { 273 | processRobotsTxt(target); 274 | } 275 | 276 | debugPrintf("reqhandler req == %d\n", req); 277 | debugPrintf("reqhandler req->response_code == %d\n", req->response_code); 278 | 279 | /* Sort redirects */ 280 | switch(req->response_code) 281 | { 282 | case HTTP_OK: 283 | /* 284 | * Response is received. No futher handling is required. 285 | * Finish 286 | */ 287 | //event_base_loopexit(ctx->base, 0); 288 | break; 289 | 290 | case HTTP_MOVEPERM: 291 | case HTTP_MOVETEMP: 292 | new_location = evhttp_find_header(req->input_headers, "Location"); 293 | strncpy(newLocationStr,new_location,DEF_SIZE_URL); 294 | 295 | strncpy(cleanURLStr,cleanURL(newLocationStr),DEF_SIZE_URL); 296 | strncpy(relativeURLStr,makeURLRelative(target,cleanURLStr),DEF_SIZE_URL); 297 | strncpy(target->current_node->url,relativeURLStr,DEF_SIZE_URL); // TODO check DEF 298 | if (!new_location) 299 | return; 300 | 301 | //strncpy(target->current_node->url,evhttp_uri_parse(new_location),DEF_SIZE_URL); // TODO check DEF 302 | if (!target->current_node->url) 303 | { 304 | return; 305 | } 306 | 307 | return; 308 | } 309 | 310 | /* 311 | * 312 | * POPULATE PAGE STRUCT 313 | * 314 | */ 315 | populatePage(req,target); 316 | 317 | /* 318 | * 319 | * SCRAPE 320 | * 321 | */ 322 | //scrapeComments(target); 323 | //scrapeMessages(target); 324 | 325 | /* 326 | * 327 | * SEARCH PAGE 328 | * 329 | */ 330 | searchPageForURLs(target); 331 | 332 | /* Move forward */ 333 | target->current_node = target->current_node->next_node; 334 | 335 | event_loopexit(NULL); 336 | } 337 | 338 | int doHTTPRequest(Target *target) 339 | { 340 | /* TODO specify port as argument */ 341 | unsigned int port = 80; 342 | int i = 0, allPagesCrawled = 0; 343 | struct evhttp_request *req, *req2; 344 | 345 | req = evhttp_request_new(reqhandler, target); 346 | evhttp_add_header(req->output_headers, "Host", target->domain); 347 | evhttp_add_header(req->output_headers, "Content-Length", "0"); 348 | evhttp_make_request(target->libevent_conn, req, EVHTTP_REQ_GET, target->current_node->url); 349 | event_dispatch(); 350 | 351 | return 0; 352 | } 353 | 354 | int crawl(Target *target) /* Parameters struct at some point? */ 355 | { 356 | Page *target_next_node; 357 | 358 | unsigned int port = 80; 359 | const char *addr = target->ip; 360 | 361 | debugPrintf("target->ip = %s\n", target->ip); 362 | debugPrintf("target->domain = %s\n", target->domain); 363 | debugPrintf("target->current_node->url = %s\n", target->current_node->url); 364 | debugPrintf("crawl while loop target->current_node->next_node == %x\n", target->current_node->next_node); 365 | 366 | debugPrintf("initializing libevent subsystem..\n"); 367 | event_init(); 368 | 369 | /* 370 | - Have some pages to crawl, need to populate pages[x] 371 | - Crawl and find more pages, need to add pages 372 | - Check all pages have been crawled, search pages? 373 | */ 374 | 375 | /* TODO Free conns? */ 376 | target->libevent_conn = evhttp_connection_new(addr, port); 377 | /* TODO timeout spceifier as cmd arg */ 378 | evhttp_connection_set_timeout(target->libevent_conn, 5); 379 | 380 | do { 381 | /* Need this because last element will not be crawled otherwise.. */ 382 | target_next_node = target->current_node->next_node; 383 | doHTTPRequest(target); 384 | } while((target->current_node != NULL) && (argNoCrawl == 0)); 385 | 386 | debugPrintf("starting event loop..\n"); 387 | 388 | return 0; 389 | } 390 | 391 | /* 392 | * 393 | * 394 | * PAGE MAINTENANCE FUNCTIONS 395 | * 396 | * 397 | */ 398 | 399 | int checkURLUnique(Target *target, char url[DEF_SIZE_URL]) 400 | { 401 | Page *old_current_node = target->current_node; 402 | 403 | /* Let's go back to the beginning */ 404 | target->current_node = target->first_node; 405 | 406 | /* While not at the end of the list */ 407 | //while(target->current_node->next_node != NULL) 408 | while(target->current_node != NULL) 409 | { 410 | if (strcmp(url,target->current_node->url) == 0) 411 | { 412 | debugPrintf("checkURLUnique strcmp(url,target->current_node->url) %d\n",strcmp(url,target->current_node->url)); 413 | 414 | debugPrintf("checkURLUnique Not adding %s because %s ### found in ### %s\n",url,url,target->current_node->url); 415 | /* Return to the node we were on */ 416 | target->current_node = old_current_node; 417 | 418 | /* URL found, ditch */ 419 | return 1; 420 | } 421 | 422 | /* Next node */ 423 | target->current_node = target->current_node->next_node; 424 | } 425 | 426 | /* Return to the "old current" node */ 427 | target->current_node = old_current_node; 428 | 429 | return 0; 430 | } 431 | 432 | /* Will make URL relative if it is not */ 433 | char *makeURLRelative(Target *target, char *url) 434 | { 435 | /* TODO Review DEF_SIZE_URL name, it's actually referring 436 | to the path, not the full URL */ 437 | 438 | /* printf("makeURLRelative url == %s\n", url); 439 | printf("makeURLRelative strnstr / working == %d\n", strnstr(url,"/",DEF_SIZE_URL) - url); 440 | printf("makeURLRelative strnstr http working == %d\n", strnstr(url,"http",DEF_SIZE_URL) - url); 441 | printf("checkURLRelative target == %s\n", url); 442 | printf("checkURLRelative strnstr == %s\n", strnstr(url,"http",DEF_SIZE_URL)); 443 | printf("checkURLRelative strnstr str offset == %d\n",strnstr(url,"http",DEF_SIZE_URL) - url); */ 444 | 445 | /* Starts with http */ 446 | if ((strnstr(url,"http",DEF_SIZE_URL) - url) == 0) 447 | { 448 | /* Pull path, 3rd / 449 | + 8 to account for https:// */ 450 | strncpy(path,strnstr((url + 8),"/",DEF_SIZE_URL),DEF_SIZE_URL); 451 | debugPrintf("makeURLRelative path == %s\n", path); 452 | //strncpy(target->current_node->url,path,DEF_SIZE_URL); 453 | /* Does not start with / ? Then add */ 454 | } else if ((strnstr(url,"/",DEF_SIZE_URL) - url) != 0) 455 | { 456 | //strncpy(target->current_node->url,"/",DEF_SIZE_URL); 457 | //strncat(target->current_node->url,path,DEF_SIZE_URL); 458 | strncpy(path,"/",DEF_SIZE_URL); 459 | strncat(path,url,DEF_SIZE_URL); 460 | /* URL is relative, move on */ 461 | } else { 462 | //strncpy(target->current_node->url,url,DEF_SIZE_URL); 463 | strncpy(path,url,DEF_SIZE_URL); 464 | } 465 | 466 | //debugPrintf("makeURLRelative target->current_node->url == %s\n", target->current_node->url); 467 | 468 | return path; 469 | } 470 | 471 | /* Remove # */ 472 | char *cleanURL(char *url) 473 | { 474 | char *hashLocation; 475 | 476 | debugPrintf("cleanURL url before == %s\n",url); 477 | 478 | hashLocation = strnstr(url,"#",DEF_SIZE_URL); 479 | 480 | if (hashLocation == 0) 481 | { 482 | return url; 483 | } 484 | 485 | debugPrintf("cleanURL hashLocation == %s\n",hashLocation); 486 | 487 | *hashLocation = '\0'; 488 | 489 | debugPrintf("cleanURL url after == %s\n",url); 490 | 491 | return url; 492 | } 493 | 494 | /* Returns 1 if header is 'boring' */ 495 | int scrapeHeadersSearch(struct evkeyval *header) 496 | { 497 | debugPrintf("scrapeHeadersSearch header->key == %s\n", header->key); 498 | 499 | /* TODO Need to compare headers across requests to detect discrepencies. 500 | Maybe more than one box serving site. */ 501 | /* Boring headers */ 502 | if (strncmp(header->key,"Description",DEF_SIZE_HEADER) == 0) return 1; 503 | if (strncmp(header->key,"Example",DEF_SIZE_HEADER) == 0) return 1; 504 | if (strncmp(header->key,"Accept",DEF_SIZE_HEADER) == 0) return 1; 505 | if (strncmp(header->key,"Accept-Charset",DEF_SIZE_HEADER) == 0) return 1; 506 | if (strncmp(header->key,"Accept-Encoding",DEF_SIZE_HEADER) == 0) return 1; 507 | if (strncmp(header->key,"Accept-Language",DEF_SIZE_HEADER) == 0) return 1; 508 | if (strncmp(header->key,"Accept-Datetime",DEF_SIZE_HEADER) == 0) return 1; 509 | if (strncmp(header->key,"Authorization",DEF_SIZE_HEADER) == 0) return 1; 510 | if (strncmp(header->key,"Connection",DEF_SIZE_HEADER) == 0) return 1; 511 | if (strncmp(header->key,"Cookie",DEF_SIZE_HEADER) == 0) return 1; 512 | if (strncmp(header->key,"Content-Length",DEF_SIZE_HEADER) == 0) return 1; 513 | if (strncmp(header->key,"Content-MD5",DEF_SIZE_HEADER) == 0) return 1; 514 | if (strncmp(header->key,"Content-Type",DEF_SIZE_HEADER) == 0) return 1; 515 | if (strncmp(header->key,"Date",DEF_SIZE_HEADER) == 0) return 1; 516 | if (strncmp(header->key,"Expect",DEF_SIZE_HEADER) == 0) return 1; 517 | if (strncmp(header->key,"From",DEF_SIZE_HEADER) == 0) return 1; 518 | if (strncmp(header->key,"Host",DEF_SIZE_HEADER) == 0) return 1; 519 | if (strncmp(header->key,"If-Match",DEF_SIZE_HEADER) == 0) return 1; 520 | if (strncmp(header->key,"If-Modified-Since",DEF_SIZE_HEADER) == 0) return 1; 521 | if (strncmp(header->key,"If-None-Match",DEF_SIZE_HEADER) == 0) return 1; 522 | if (strncmp(header->key,"If-Range",DEF_SIZE_HEADER) == 0) return 1; 523 | if (strncmp(header->key,"Max-Forwards",DEF_SIZE_HEADER) == 0) return 1; 524 | if (strncmp(header->key,"Origin",DEF_SIZE_HEADER) == 0) return 1; 525 | if (strncmp(header->key,"Pragma",DEF_SIZE_HEADER) == 0) return 1; 526 | if (strncmp(header->key,"Range",DEF_SIZE_HEADER) == 0) return 1; 527 | if (strncmp(header->key,"Referrer",DEF_SIZE_HEADER) == 0) return 1; 528 | if (strncmp(header->key,"User-Agent",DEF_SIZE_HEADER) == 0) return 1; 529 | if (strncmp(header->key,"Via",DEF_SIZE_HEADER) == 0) return 1; 530 | if (strncmp(header->key,"Description",DEF_SIZE_HEADER) == 0) return 1; 531 | if (strncmp(header->key,"Example",DEF_SIZE_HEADER) == 0) return 1; 532 | if (strncmp(header->key,"X-Forwarded-Proto",DEF_SIZE_HEADER) == 0) return 1; 533 | if (strncmp(header->key,"Front-End-Https",DEF_SIZE_HEADER) == 0) return 1; 534 | if (strncmp(header->key,"X-ATT-DeviceId",DEF_SIZE_HEADER) == 0) return 1; 535 | if (strncmp(header->key,"X-Wap-Profile",DEF_SIZE_HEADER) == 0) return 1; 536 | if (strncmp(header->key,"Proxy-Connection",DEF_SIZE_HEADER) == 0) return 1; 537 | if (strncmp(header->key,"Vary",DEF_SIZE_HEADER) == 0) return 1; 538 | if (strncmp(header->key,"Etag",DEF_SIZE_HEADER) == 0) return 1; 539 | if (strncmp(header->key,"Transfer-Encoding",DEF_SIZE_HEADER) == 0) return 1; 540 | if (strncmp(header->key,"X-Cache-Action",DEF_SIZE_HEADER) == 0) return 1; 541 | if (strncmp(header->key,"X-Cache-Hits",DEF_SIZE_HEADER) == 0) return 1; 542 | if (strncmp(header->key,"X-Cache-Age",DEF_SIZE_HEADER) == 0) return 1; 543 | if (strncmp(header->key,"Cache-Control",DEF_SIZE_HEADER) == 0) return 1; 544 | if (strncmp(header->key,"X-LB-NoCache",DEF_SIZE_HEADER) == 0) return 1; 545 | 546 | return 0; 547 | } 548 | 549 | int scrapeHeaders(struct evhttp_request *req, Target *target) 550 | { 551 | // TODO This code works but you need to sort the req stuff out 552 | struct evkeyvalq *evheaders; 553 | struct evkeyval *header; 554 | 555 | evheaders = evhttp_request_get_input_headers(req); 556 | 557 | TAILQ_FOREACH(header, evheaders, next) 558 | { 559 | /* Interesting header? */ 560 | if (scrapeHeadersSearch(header) == 0) 561 | { 562 | debugPrintf("scrapeHeaders Interesting header? %s --- %s\n", header->key, header->value); 563 | } 564 | } 565 | 566 | return 0; 567 | } 568 | 569 | /* Add new node and copy URL to new node and then return to current node */ 570 | int addPage(Target *target, char *url) 571 | { 572 | Page *old_current_node; 573 | 574 | debugPrintf("addPage url == %s\n",url); 575 | 576 | if (checkURLUnique(target, makeURLRelative(target,cleanURL(url)))) 577 | { 578 | return 1; 579 | } 580 | 581 | debugPrintf("addPage checkURLUnique returned 0 for url %s\n\n", url); 582 | 583 | /* Store current node position */ 584 | old_current_node = target->current_node; 585 | 586 | /* Get to the end of the list */ 587 | target->current_node = target->last_node; 588 | 589 | /* Last item in the list */ 590 | target->current_node->next_node = malloc(sizeof(Page)); /* TODO check */ 591 | /* Move on to next node */ 592 | target->current_node = target->current_node->next_node; 593 | /* Set next next node to nothing */ 594 | target->current_node->next_node = NULL; 595 | /* Set current node's previous node to tmp node position */ 596 | target->current_node->prev_node = old_current_node; 597 | /* Copy url to new node */ 598 | /* Fix absolute URLs | Remove # */ 599 | strncpy(target->current_node->url, makeURLRelative(target,cleanURL(url)),DEF_SIZE_URL); 600 | debugPrintf("addPage Added target->current_node->url == %s\n",target->current_node->url); 601 | /* Set the last node */ 602 | target->last_node = target->current_node; 603 | /* Set current node to old_current_node */ 604 | target->current_node = target->current_node->prev_node; 605 | 606 | return 0; 607 | } 608 | 609 | int bootPages(Target *target) 610 | { 611 | /* First item in the list */ 612 | target->current_node->prev_node = NULL; 613 | 614 | /* Set last node to current node */ 615 | target->last_node = target->current_node; 616 | 617 | /* Page URL */ 618 | strncpy(target->current_node->url,"/",DEF_SIZE_URL); 619 | 620 | debugPrintf("bootPages target->current_node->url == %s\n",target->current_node->url); 621 | 622 | if (argNoCrawl != 1) 623 | { 624 | addPage(target,"/robots.txt"); 625 | } 626 | 627 | debugPrintf("bootPages current_node url == %s\n", target->current_node->url); 628 | 629 | /* Move back to the beginning */ 630 | target->current_node = target->first_node; 631 | debugPrintf("addPage target->current_node->next_node == %x\n", target->current_node->next_node); 632 | debugPrintf("addPage target->current_node->url == %s\n", target->current_node->url); 633 | 634 | /* // Main page structure 635 | typedef struct { 636 | uint8_t crawled; 637 | int status_code; 638 | char *url; 639 | char *source_code; 640 | Findings findings; 641 | Page *prev_node; 642 | Page *next_node; 643 | } Page;*/ 644 | } 645 | 646 | int showHelp() 647 | { 648 | printf("Help is (not) here\n"); 649 | 650 | exit(1); 651 | } 652 | 653 | int assignArgs(int argc, char **argv) 654 | { 655 | /* Flag set by '--verbose'. */ 656 | static int argVerboseFlag; 657 | 658 | int c; 659 | 660 | while (1) 661 | { 662 | static struct option long_options[] = 663 | { 664 | /* These options set a flag. */ 665 | {"verbose", no_argument, &argVerboseFlag, 1}, 666 | {"debug", no_argument, &argDebug, 1}, 667 | //{"brief", no_argument, &argVerboseFlag, 0}, 668 | {"subdomain", no_argument, &argCrawlSubs, 1}, 669 | {"no-crawl", no_argument, &argNoCrawl, 1}, 670 | /* These options don't set a flag. 671 | We distinguish them by their indices. */ 672 | {"append", no_argument, 0, 'b'}, 673 | {"domain", required_argument, 0, 'd'}, 674 | {"ip", required_argument, 0, 'i'}, 675 | {"port", required_argument, 0, 'p'}, 676 | {"file", required_argument, 0, 'f'}, 677 | {0, 0, 0, 0} 678 | }; 679 | 680 | /* getopt_long stores the option index here. */ 681 | int option_index = 0; 682 | 683 | c = getopt_long(argc, argv, "bd:i:p:f:", long_options, &option_index); 684 | 685 | debugPrintf("assignArgs argc == %d\n", argc); 686 | 687 | /* domain is only required argument (ip can be determined via domain) */ 688 | if (argc == 1) 689 | { 690 | /* Only binary called */ 691 | showHelp(); 692 | } 693 | 694 | /* Detect the end of the options. */ 695 | if (c == -1) 696 | break; 697 | 698 | switch (c) 699 | { 700 | case 0: 701 | /* If this option set a flag, do nothing else now. */ 702 | if (long_options[option_index].flag != 0) 703 | break; 704 | 705 | debugPrintf("option %s", long_options[option_index].name); 706 | if (optarg) 707 | debugPrintf(" with arg %s", optarg); 708 | debugPrintf("\n"); 709 | break; 710 | 711 | case 'd': 712 | debugPrintf("option -d with value `%s'\n", optarg); 713 | strncpy(argDomain, optarg, DEF_SIZE_DOMAIN); 714 | argDomainSet = 1; 715 | break; 716 | 717 | case 'b': 718 | puts ("option -b\n"); 719 | break; 720 | 721 | case 'i': 722 | debugPrintf("option -i with value `%s'\n", optarg); 723 | strncpy(argIP, optarg, 16); 724 | break; 725 | 726 | case 'p': 727 | debugPrintf("option -p with value `%s'\n", optarg); 728 | strncpy(argPort, optarg, 6); 729 | break; 730 | 731 | case 'f': 732 | debugPrintf("option -f with value `%s'\n", optarg); 733 | break; 734 | 735 | case '?': 736 | /* getopt_long already printed an error message. */ 737 | break; 738 | 739 | default: 740 | debugPrintf("assignArgs abort to be called\n"); 741 | abort(); 742 | } 743 | } 744 | 745 | /* Instead of reporting '--verbose' 746 | and '--brief' as they are encountered, 747 | we report the final status resulting from them. */ 748 | if (argVerboseFlag) 749 | puts ("verbose flag is set"); 750 | 751 | /* Print any remaining command line arguments (not options). */ 752 | if (optind < argc) 753 | { 754 | debugPrintf ("non-option ARGV-elements: "); 755 | while (optind < argc) 756 | debugPrintf ("%s ", argv[optind++]); 757 | putchar ('\n'); 758 | } 759 | 760 | return 0; 761 | } 762 | 763 | int resolveIP(char IP[16]) 764 | { 765 | struct hostent *he; 766 | struct in_addr **addr_list; 767 | int i; 768 | 769 | if ((he = gethostbyname(argDomain)) == NULL) 770 | { 771 | /* Get host information */ 772 | herror("gethostbyname"); 773 | return 1; 774 | } 775 | 776 | addr_list = (struct in_addr **) he->h_addr_list; 777 | 778 | for(i=0;addr_list[i]!=NULL;i++) 779 | { 780 | //Return the first one; 781 | strcpy(IP,inet_ntoa(*addr_list[i])); 782 | return 0; 783 | } 784 | 785 | return 1; 786 | } 787 | 788 | int validateIP(char IP[16]) 789 | { 790 | if (strnlen(IP,16) == 0) 791 | { 792 | if (resolveIP(IP)) 793 | { 794 | /* Can't resolve? */ 795 | exit_error(50); 796 | } 797 | } 798 | 799 | struct sockaddr_in sa; 800 | int result = inet_pton(AF_INET, IP, &(sa.sin_addr)); 801 | 802 | return result != 0; 803 | } 804 | 805 | int validateDomain(char domain[DEF_SIZE_DOMAIN]) 806 | { 807 | 808 | return 0; 809 | } 810 | 811 | int showCrawledURLs(Target *target) 812 | { 813 | Page *target_next_node; 814 | 815 | target->current_node = target->first_node; 816 | 817 | do { 818 | printf("URL added: %s\n",target->current_node->url); 819 | 820 | /* Need this because last element will not be crawled otherwise.. */ 821 | target->current_node = target->current_node->next_node; 822 | 823 | target_next_node = target->current_node->next_node; 824 | } while(target->current_node != NULL); 825 | 826 | debugPrintf("Last node URL: %s\n",target->last_node->url); 827 | 828 | return 0; 829 | } 830 | 831 | int processArgs(Target *target) 832 | { 833 | /* 834 | - Get args in structures 835 | - If IP not set then determine through supplied domain name 836 | - Validate args 837 | - Domain 838 | - IP 839 | 840 | - What if the IP is specified and the domain is not valid? It should probably pass.. 841 | - What if the domain name and IP are not specified? Bail. 842 | */ 843 | 844 | if (argDomainSet == 0) 845 | { 846 | showHelp(); 847 | } 848 | 849 | if (argIP == NULL) 850 | { 851 | struct hostent *lh = gethostbyname(argDomain); 852 | 853 | if (lh) 854 | { 855 | puts(lh->h_name); 856 | strncpy(argIP, lh->h_name, 16); 857 | } else { 858 | herror("gethostbyname"); 859 | exit(1); /* TODO fix this */ 860 | } 861 | } 862 | 863 | /* Problem? */ 864 | if (validateIP(argIP)) 865 | { 866 | /* exit_error TODO */ 867 | } 868 | 869 | /* Problem? */ 870 | if (validateDomain(argDomain)) 871 | { 872 | /* exit_error TODO */ 873 | } 874 | 875 | strncpy(target->ip,argIP,16); 876 | strncpy(target->domain,argDomain,DEF_SIZE_DOMAIN); 877 | 878 | return 0; 879 | } 880 | -------------------------------------------------------------------------------- /src/creep.h: -------------------------------------------------------------------------------- 1 | #ifndef CREEP_H 2 | #define CREEP_H 3 | 4 | #endif /* MONEY_H */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "../src/def_sizes.h" 10 | 11 | typedef struct Error Error; 12 | typedef struct Findings Findings; 13 | typedef struct Parameters Parameters; 14 | typedef struct Page Page; 15 | typedef struct Target Target; 16 | 17 | /* Application error */ 18 | struct Error { 19 | int number; 20 | char message[DEF_SIZE_ERROR_MESSAGE_LENGTH]; 21 | uint8_t log; 22 | }; 23 | 24 | /* Page findings */ 25 | struct Findings { 26 | char *comments[DEF_SIZE_FINDING_ARRAY_SIZE]; 27 | char *warns[DEF_SIZE_FINDING_ARRAY_SIZE]; 28 | char *fatals[DEF_SIZE_FINDING_ARRAY_SIZE]; 29 | char *errors[DEF_SIZE_FINDING_ARRAY_SIZE]; 30 | char *tag_code[DEF_SIZE_FINDING_ARRAY_SIZE]; 31 | }; 32 | 33 | /* Page parameters */ 34 | struct Parameters { 35 | char *get; 36 | char *post; 37 | /* 64KB */ 38 | char *cookies; 39 | }; 40 | 41 | /* Main page structure */ 42 | struct Page { 43 | uint8_t crawled; 44 | int status_code; 45 | /* URL as is on the page, useful for not 46 | browsing to the same page multiple times*/ 47 | char raw_url[DEF_SIZE_RAW_URL]; 48 | /* TODO Check NULL byte issue str* functions should be DEF - 1? */ 49 | char url[DEF_SIZE_URL]; 50 | /* Unprocessed headers */ 51 | struct evkeyvalq *headers_raw; 52 | char *source_code; 53 | Findings findings; 54 | struct Page *prev_node; 55 | struct Page *next_node; 56 | }; 57 | 58 | struct Target { 59 | char ip[16]; /* v4 only, get over it */ 60 | char domain[DEF_SIZE_DOMAIN]; 61 | struct evhttp_connection *libevent_conn; 62 | struct Page *current_node; 63 | struct Page *first_node; 64 | struct Page *last_node; 65 | }; 66 | 67 | /* Error functions */ 68 | int setup_error_messages(); 69 | uint8_t exit_error(int x); 70 | 71 | /* Page functions */ 72 | int addPage(Target *target, char *URL); 73 | int searchPageForURLs(Target *target); 74 | int populatePage(struct evhttp_request *req, Target *target); 75 | void reqhandler(struct evhttp_request *req, void *target); 76 | int crawl(Target *target); /* Parameters struct at some point? */ 77 | char *makeURLRelative(Target *target, char *url); 78 | char *cleanURL(char *url); 79 | int scrapeHeadersSearch(struct evkeyval *header); 80 | int scrapeHeaders(struct evhttp_request *req, Target *target); 81 | -------------------------------------------------------------------------------- /src/creep_main.c: -------------------------------------------------------------------------------- 1 | #ifndef CREEP_H 2 | #define CREEP_H 3 | 4 | #endif /* CREEP_H */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "../src/creep.h" 14 | #include "../src/def_error_messages.h" 15 | #include "../src/def_sizes.h" 16 | 17 | /* 18 | * 19 | * 20 | * MAIN FUNCTION 21 | * 22 | * 23 | */ 24 | 25 | int main(int argc, char *argv[]) 26 | { 27 | /* 28 | - Check cmd args 29 | - Start loop 30 | - Populate files 31 | */ 32 | 33 | /* Double linked list */ 34 | Target target; 35 | target.first_node = malloc(sizeof(Page)); /* TODO check */ 36 | target.current_node = target.first_node; 37 | setup_error_messages(); 38 | 39 | assignArgs(argc,argv); 40 | processArgs(&target); 41 | bootPages(&target); 42 | crawl(&target); 43 | showCrawledURLs(&target); 44 | 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /src/def_error_messages.h: -------------------------------------------------------------------------------- 1 | #define DEF_ERROR_1 "Could not find error message for error number, you shouldn't really see this.." 2 | #define DEF_ERROR_10 "Missing argument" 3 | #define DEF_ERROR_20 "Could not malloc" 4 | #define DEF_ERROR_30 "IP address supplied is not a valid v4 address" 5 | #define DEF_ERROR_31 "Domain is not valid" 6 | #define DEF_ERROR_40 "Connection failed" 7 | #define DEF_ERROR_50 "Could not resolve domain" 8 | -------------------------------------------------------------------------------- /src/def_sizes.h: -------------------------------------------------------------------------------- 1 | #define DEF_SIZE_RAW_URL 8192 2 | #define DEF_SIZE_URL 4096 3 | #define DEF_SIZE_ERROR_INSTANCES 255 4 | #define DEF_SIZE_ERROR_MESSAGE_LENGTH 128 5 | #define DEF_SIZE_FINDING_ARRAY_SIZE 64 6 | #define DEF_SIZE_DOMAIN 256 7 | #define DEF_SIZE_HTTP_DOMAIN DEF_SIZE_DOMAIN + 8 8 | #define DEF_SIZE_SOURCE_CODE 1048576 9 | #define DEF_SIZE_SOURCE_CODE_LINE 16384 10 | #define DEF_SIZE_DEBUG_MESSAGE 1024 11 | #define DEF_SIZE_HEADERS 1048576 12 | -------------------------------------------------------------------------------- /src/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ===================================================================================== 3 | * 4 | * Filename: main.c 5 | * 6 | * Description: 7 | * 8 | * Version: 1.0 9 | * Created: 04/11/13 20:19:38 10 | * Revision: none 11 | * Compiler: gcc 12 | * 13 | * Author: YOUR NAME (), 14 | * Organization: 15 | * 16 | * ===================================================================================== 17 | */ 18 | 19 | int main(void) 20 | { 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /tests/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | AM_LDFLAGS = -levent 4 | 5 | TESTS = check_creep 6 | check_PROGRAMS = check_creep 7 | check_creep_SOURCES = check_creep.c ../src/creep.h ../src/creep.c 8 | check_creep_CFLAGS = @CHECK_CFLAGS@ 9 | check_creep_LDADD = ../src/libcreep.la @CHECK_LIBS@ 10 | -------------------------------------------------------------------------------- /tests/check_creep.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ===================================================================================== 3 | * 4 | * Filename: check_creep.c 5 | * 6 | * Description: Creep unit tests 7 | * 8 | * Version: 1.0 9 | * Created: 04/11/13 20:04:57 10 | * Revision: none 11 | * Compiler: gcc 12 | * 13 | * Author: Aidan Marlin (aidan.marlin@gmail.com), 14 | * Organization: NCC Group 15 | * 16 | * ===================================================================================== 17 | */ 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include "../src/creep.h" 25 | #include "../src/def_error_messages.h" 26 | 27 | /*START_TEST(test_creep_exit_error) 28 | { 29 | int errorNum = 1; 30 | 31 | // ck_assert(exit_error(errorNum) == errorNum); 32 | // ck_assert(exit_error(255) == 255); 33 | } 34 | END_TEST*/ 35 | 36 | START_TEST(test_creep_exit_message) 37 | { 38 | int errorNum = 1; 39 | Error error[255]; 40 | 41 | /*typedef struct { 42 | int number; 43 | char message[128]; 44 | uint8_t log; 45 | } Error;*/ 46 | 47 | ck_assert(setup_error_messages(error) == 0); 48 | // printf("error msg == %s\nDEF_ERROR_1 == %s",error[1].message,DEF_ERROR_1); 49 | ck_assert(error[1].number == 1); 50 | ck_assert(strcmp(error[1].message,DEF_ERROR_1) == 0); 51 | ck_assert(error[1].log == 0x0); 52 | 53 | ck_assert(error[10].number == 10); 54 | ck_assert(strcmp(error[10].message,DEF_ERROR_10) == 0); 55 | ck_assert(error[10].log == 0x0); 56 | } 57 | END_TEST 58 | 59 | Suite * creep_suite(void) 60 | { 61 | Suite *s = suite_create ("Creep"); 62 | 63 | /* Core test case */ 64 | TCase *tc_core = tcase_create ("Core"); 65 | //tcase_add_test (tc_core, test_creep_exit_error); 66 | tcase_add_test (tc_core, test_creep_exit_message); 67 | suite_add_tcase (s, tc_core); 68 | 69 | return s; 70 | } 71 | 72 | int main(void) 73 | { 74 | int number_failed; 75 | Suite *s = creep_suite (); 76 | SRunner *sr = srunner_create (s); 77 | srunner_run_all (sr, CK_NORMAL); 78 | number_failed = srunner_ntests_failed (sr); 79 | srunner_free (sr); 80 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 81 | } 82 | --------------------------------------------------------------------------------