├── COPYING ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── aclocal.m4 ├── config.guess ├── config.h.in ├── config.sub ├── configure ├── configure.ac ├── depcomp ├── install-sh ├── ltmain.sh ├── m4 ├── libtool.m4 ├── ltoptions.m4 ├── ltsugar.m4 ├── ltversion.m4 └── lt~obsolete.m4 ├── missing └── src ├── Makefile.am ├── Makefile.in ├── city-test.cc ├── city.cc ├── city.h └── citycrc.h /COPYING: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | SUBDIRS = src 3 | 4 | dist_doc_DATA = README NEWS COPYING 5 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.3 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 6 | # Foundation, Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | 18 | VPATH = @srcdir@ 19 | pkgdatadir = $(datadir)/@PACKAGE@ 20 | pkgincludedir = $(includedir)/@PACKAGE@ 21 | pkglibdir = $(libdir)/@PACKAGE@ 22 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 23 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 24 | install_sh_DATA = $(install_sh) -c -m 644 25 | install_sh_PROGRAM = $(install_sh) -c 26 | install_sh_SCRIPT = $(install_sh) -c 27 | INSTALL_HEADER = $(INSTALL_DATA) 28 | transform = $(program_transform_name) 29 | NORMAL_INSTALL = : 30 | PRE_INSTALL = : 31 | POST_INSTALL = : 32 | NORMAL_UNINSTALL = : 33 | PRE_UNINSTALL = : 34 | POST_UNINSTALL = : 35 | build_triplet = @build@ 36 | host_triplet = @host@ 37 | subdir = . 38 | DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \ 39 | $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ 40 | $(srcdir)/config.h.in $(top_srcdir)/configure COPYING NEWS \ 41 | config.guess config.sub depcomp install-sh ltmain.sh missing 42 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 43 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ 44 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ 45 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ 46 | $(top_srcdir)/configure.ac 47 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 48 | $(ACLOCAL_M4) 49 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ 50 | configure.lineno config.status.lineno 51 | mkinstalldirs = $(install_sh) -d 52 | CONFIG_HEADER = config.h 53 | CONFIG_CLEAN_FILES = 54 | CONFIG_CLEAN_VPATH_FILES = 55 | SOURCES = 56 | DIST_SOURCES = 57 | RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ 58 | html-recursive info-recursive install-data-recursive \ 59 | install-dvi-recursive install-exec-recursive \ 60 | install-html-recursive install-info-recursive \ 61 | install-pdf-recursive install-ps-recursive install-recursive \ 62 | installcheck-recursive installdirs-recursive pdf-recursive \ 63 | ps-recursive uninstall-recursive 64 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 65 | am__vpath_adj = case $$p in \ 66 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 67 | *) f=$$p;; \ 68 | esac; 69 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; 70 | am__install_max = 40 71 | am__nobase_strip_setup = \ 72 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` 73 | am__nobase_strip = \ 74 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" 75 | am__nobase_list = $(am__nobase_strip_setup); \ 76 | for p in $$list; do echo "$$p $$p"; done | \ 77 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ 78 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ 79 | if (++n[$$2] == $(am__install_max)) \ 80 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ 81 | END { for (dir in files) print dir, files[dir] }' 82 | am__base_list = \ 83 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 84 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 85 | am__uninstall_files_from_dir = { \ 86 | test -z "$$files" \ 87 | || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ 88 | || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ 89 | $(am__cd) "$$dir" && rm -f $$files; }; \ 90 | } 91 | am__installdirs = "$(DESTDIR)$(docdir)" 92 | DATA = $(dist_doc_DATA) 93 | RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ 94 | distclean-recursive maintainer-clean-recursive 95 | AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ 96 | $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ 97 | distdir dist dist-all distcheck 98 | ETAGS = etags 99 | CTAGS = ctags 100 | DIST_SUBDIRS = $(SUBDIRS) 101 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 102 | distdir = $(PACKAGE)-$(VERSION) 103 | top_distdir = $(distdir) 104 | am__remove_distdir = \ 105 | if test -d "$(distdir)"; then \ 106 | find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ 107 | && rm -rf "$(distdir)" \ 108 | || { sleep 5 && rm -rf "$(distdir)"; }; \ 109 | else :; fi 110 | am__relativize = \ 111 | dir0=`pwd`; \ 112 | sed_first='s,^\([^/]*\)/.*$$,\1,'; \ 113 | sed_rest='s,^[^/]*/*,,'; \ 114 | sed_last='s,^.*/\([^/]*\)$$,\1,'; \ 115 | sed_butlast='s,/*[^/]*$$,,'; \ 116 | while test -n "$$dir1"; do \ 117 | first=`echo "$$dir1" | sed -e "$$sed_first"`; \ 118 | if test "$$first" != "."; then \ 119 | if test "$$first" = ".."; then \ 120 | dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ 121 | dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ 122 | else \ 123 | first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ 124 | if test "$$first2" = "$$first"; then \ 125 | dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ 126 | else \ 127 | dir2="../$$dir2"; \ 128 | fi; \ 129 | dir0="$$dir0"/"$$first"; \ 130 | fi; \ 131 | fi; \ 132 | dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ 133 | done; \ 134 | reldir="$$dir2" 135 | DIST_ARCHIVES = $(distdir).tar.gz 136 | GZIP_ENV = --best 137 | distuninstallcheck_listfiles = find . -type f -print 138 | am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ 139 | | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' 140 | distcleancheck_listfiles = find . -type f -print 141 | ACLOCAL = @ACLOCAL@ 142 | AMTAR = @AMTAR@ 143 | AR = @AR@ 144 | AUTOCONF = @AUTOCONF@ 145 | AUTOHEADER = @AUTOHEADER@ 146 | AUTOMAKE = @AUTOMAKE@ 147 | AWK = @AWK@ 148 | CC = @CC@ 149 | CCDEPMODE = @CCDEPMODE@ 150 | CFLAGS = @CFLAGS@ 151 | CPP = @CPP@ 152 | CPPFLAGS = @CPPFLAGS@ 153 | CXX = @CXX@ 154 | CXXCPP = @CXXCPP@ 155 | CXXDEPMODE = @CXXDEPMODE@ 156 | CXXFLAGS = @CXXFLAGS@ 157 | CYGPATH_W = @CYGPATH_W@ 158 | DEFS = @DEFS@ 159 | DEPDIR = @DEPDIR@ 160 | DLLTOOL = @DLLTOOL@ 161 | DSYMUTIL = @DSYMUTIL@ 162 | DUMPBIN = @DUMPBIN@ 163 | ECHO_C = @ECHO_C@ 164 | ECHO_N = @ECHO_N@ 165 | ECHO_T = @ECHO_T@ 166 | EGREP = @EGREP@ 167 | EXEEXT = @EXEEXT@ 168 | FGREP = @FGREP@ 169 | GREP = @GREP@ 170 | INSTALL = @INSTALL@ 171 | INSTALL_DATA = @INSTALL_DATA@ 172 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 173 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 174 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 175 | LD = @LD@ 176 | LDFLAGS = @LDFLAGS@ 177 | LIBOBJS = @LIBOBJS@ 178 | LIBS = @LIBS@ 179 | LIBTOOL = @LIBTOOL@ 180 | LIPO = @LIPO@ 181 | LN_S = @LN_S@ 182 | LTLIBOBJS = @LTLIBOBJS@ 183 | MAKEINFO = @MAKEINFO@ 184 | MANIFEST_TOOL = @MANIFEST_TOOL@ 185 | MKDIR_P = @MKDIR_P@ 186 | NM = @NM@ 187 | NMEDIT = @NMEDIT@ 188 | OBJDUMP = @OBJDUMP@ 189 | OBJEXT = @OBJEXT@ 190 | OTOOL = @OTOOL@ 191 | OTOOL64 = @OTOOL64@ 192 | PACKAGE = @PACKAGE@ 193 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 194 | PACKAGE_NAME = @PACKAGE_NAME@ 195 | PACKAGE_STRING = @PACKAGE_STRING@ 196 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 197 | PACKAGE_URL = @PACKAGE_URL@ 198 | PACKAGE_VERSION = @PACKAGE_VERSION@ 199 | PATH_SEPARATOR = @PATH_SEPARATOR@ 200 | RANLIB = @RANLIB@ 201 | SED = @SED@ 202 | SET_MAKE = @SET_MAKE@ 203 | SHELL = @SHELL@ 204 | STRIP = @STRIP@ 205 | VERSION = @VERSION@ 206 | abs_builddir = @abs_builddir@ 207 | abs_srcdir = @abs_srcdir@ 208 | abs_top_builddir = @abs_top_builddir@ 209 | abs_top_srcdir = @abs_top_srcdir@ 210 | ac_ct_AR = @ac_ct_AR@ 211 | ac_ct_CC = @ac_ct_CC@ 212 | ac_ct_CXX = @ac_ct_CXX@ 213 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 214 | am__include = @am__include@ 215 | am__leading_dot = @am__leading_dot@ 216 | am__quote = @am__quote@ 217 | am__tar = @am__tar@ 218 | am__untar = @am__untar@ 219 | bindir = @bindir@ 220 | build = @build@ 221 | build_alias = @build_alias@ 222 | build_cpu = @build_cpu@ 223 | build_os = @build_os@ 224 | build_vendor = @build_vendor@ 225 | builddir = @builddir@ 226 | datadir = @datadir@ 227 | datarootdir = @datarootdir@ 228 | docdir = @docdir@ 229 | dvidir = @dvidir@ 230 | exec_prefix = @exec_prefix@ 231 | host = @host@ 232 | host_alias = @host_alias@ 233 | host_cpu = @host_cpu@ 234 | host_os = @host_os@ 235 | host_vendor = @host_vendor@ 236 | htmldir = @htmldir@ 237 | includedir = @includedir@ 238 | infodir = @infodir@ 239 | install_sh = @install_sh@ 240 | libdir = @libdir@ 241 | libexecdir = @libexecdir@ 242 | localedir = @localedir@ 243 | localstatedir = @localstatedir@ 244 | mandir = @mandir@ 245 | mkdir_p = @mkdir_p@ 246 | oldincludedir = @oldincludedir@ 247 | pdfdir = @pdfdir@ 248 | prefix = @prefix@ 249 | program_transform_name = @program_transform_name@ 250 | psdir = @psdir@ 251 | sbindir = @sbindir@ 252 | sharedstatedir = @sharedstatedir@ 253 | srcdir = @srcdir@ 254 | sysconfdir = @sysconfdir@ 255 | target_alias = @target_alias@ 256 | top_build_prefix = @top_build_prefix@ 257 | top_builddir = @top_builddir@ 258 | top_srcdir = @top_srcdir@ 259 | ACLOCAL_AMFLAGS = -I m4 260 | SUBDIRS = src 261 | dist_doc_DATA = README NEWS COPYING 262 | all: config.h 263 | $(MAKE) $(AM_MAKEFLAGS) all-recursive 264 | 265 | .SUFFIXES: 266 | am--refresh: Makefile 267 | @: 268 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 269 | @for dep in $?; do \ 270 | case '$(am__configure_deps)' in \ 271 | *$$dep*) \ 272 | echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ 273 | $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ 274 | && exit 0; \ 275 | exit 1;; \ 276 | esac; \ 277 | done; \ 278 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ 279 | $(am__cd) $(top_srcdir) && \ 280 | $(AUTOMAKE) --foreign Makefile 281 | .PRECIOUS: Makefile 282 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 283 | @case '$?' in \ 284 | *config.status*) \ 285 | echo ' $(SHELL) ./config.status'; \ 286 | $(SHELL) ./config.status;; \ 287 | *) \ 288 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ 289 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ 290 | esac; 291 | 292 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 293 | $(SHELL) ./config.status --recheck 294 | 295 | $(top_srcdir)/configure: $(am__configure_deps) 296 | $(am__cd) $(srcdir) && $(AUTOCONF) 297 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 298 | $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 299 | $(am__aclocal_m4_deps): 300 | 301 | config.h: stamp-h1 302 | @if test ! -f $@; then rm -f stamp-h1; else :; fi 303 | @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi 304 | 305 | stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status 306 | @rm -f stamp-h1 307 | cd $(top_builddir) && $(SHELL) ./config.status config.h 308 | $(srcdir)/config.h.in: $(am__configure_deps) 309 | ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) 310 | rm -f stamp-h1 311 | touch $@ 312 | 313 | distclean-hdr: 314 | -rm -f config.h stamp-h1 315 | 316 | mostlyclean-libtool: 317 | -rm -f *.lo 318 | 319 | clean-libtool: 320 | -rm -rf .libs _libs 321 | 322 | distclean-libtool: 323 | -rm -f libtool config.lt 324 | install-dist_docDATA: $(dist_doc_DATA) 325 | @$(NORMAL_INSTALL) 326 | test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)" 327 | @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ 328 | for p in $$list; do \ 329 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ 330 | echo "$$d$$p"; \ 331 | done | $(am__base_list) | \ 332 | while read files; do \ 333 | echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ 334 | $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ 335 | done 336 | 337 | uninstall-dist_docDATA: 338 | @$(NORMAL_UNINSTALL) 339 | @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ 340 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ 341 | dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) 342 | 343 | # This directory's subdirectories are mostly independent; you can cd 344 | # into them and run `make' without going through this Makefile. 345 | # To change the values of `make' variables: instead of editing Makefiles, 346 | # (1) if the variable is set in `config.status', edit `config.status' 347 | # (which will cause the Makefiles to be regenerated when you run `make'); 348 | # (2) otherwise, pass the desired values on the `make' command line. 349 | $(RECURSIVE_TARGETS): 350 | @fail= failcom='exit 1'; \ 351 | for f in x $$MAKEFLAGS; do \ 352 | case $$f in \ 353 | *=* | --[!k]*);; \ 354 | *k*) failcom='fail=yes';; \ 355 | esac; \ 356 | done; \ 357 | dot_seen=no; \ 358 | target=`echo $@ | sed s/-recursive//`; \ 359 | list='$(SUBDIRS)'; for subdir in $$list; do \ 360 | echo "Making $$target in $$subdir"; \ 361 | if test "$$subdir" = "."; then \ 362 | dot_seen=yes; \ 363 | local_target="$$target-am"; \ 364 | else \ 365 | local_target="$$target"; \ 366 | fi; \ 367 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 368 | || eval $$failcom; \ 369 | done; \ 370 | if test "$$dot_seen" = "no"; then \ 371 | $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ 372 | fi; test -z "$$fail" 373 | 374 | $(RECURSIVE_CLEAN_TARGETS): 375 | @fail= failcom='exit 1'; \ 376 | for f in x $$MAKEFLAGS; do \ 377 | case $$f in \ 378 | *=* | --[!k]*);; \ 379 | *k*) failcom='fail=yes';; \ 380 | esac; \ 381 | done; \ 382 | dot_seen=no; \ 383 | case "$@" in \ 384 | distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ 385 | *) list='$(SUBDIRS)' ;; \ 386 | esac; \ 387 | rev=''; for subdir in $$list; do \ 388 | if test "$$subdir" = "."; then :; else \ 389 | rev="$$subdir $$rev"; \ 390 | fi; \ 391 | done; \ 392 | rev="$$rev ."; \ 393 | target=`echo $@ | sed s/-recursive//`; \ 394 | for subdir in $$rev; do \ 395 | echo "Making $$target in $$subdir"; \ 396 | if test "$$subdir" = "."; then \ 397 | local_target="$$target-am"; \ 398 | else \ 399 | local_target="$$target"; \ 400 | fi; \ 401 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 402 | || eval $$failcom; \ 403 | done && test -z "$$fail" 404 | tags-recursive: 405 | list='$(SUBDIRS)'; for subdir in $$list; do \ 406 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ 407 | done 408 | ctags-recursive: 409 | list='$(SUBDIRS)'; for subdir in $$list; do \ 410 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ 411 | done 412 | 413 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 414 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 415 | unique=`for i in $$list; do \ 416 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 417 | done | \ 418 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 419 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 420 | mkid -fID $$unique 421 | tags: TAGS 422 | 423 | TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ 424 | $(TAGS_FILES) $(LISP) 425 | set x; \ 426 | here=`pwd`; \ 427 | if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ 428 | include_option=--etags-include; \ 429 | empty_fix=.; \ 430 | else \ 431 | include_option=--include; \ 432 | empty_fix=; \ 433 | fi; \ 434 | list='$(SUBDIRS)'; for subdir in $$list; do \ 435 | if test "$$subdir" = .; then :; else \ 436 | test ! -f $$subdir/TAGS || \ 437 | set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ 438 | fi; \ 439 | done; \ 440 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ 441 | unique=`for i in $$list; do \ 442 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 443 | done | \ 444 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 445 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 446 | shift; \ 447 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 448 | test -n "$$unique" || unique=$$empty_fix; \ 449 | if test $$# -gt 0; then \ 450 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 451 | "$$@" $$unique; \ 452 | else \ 453 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 454 | $$unique; \ 455 | fi; \ 456 | fi 457 | ctags: CTAGS 458 | CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ 459 | $(TAGS_FILES) $(LISP) 460 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ 461 | unique=`for i in $$list; do \ 462 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 463 | done | \ 464 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 465 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 466 | test -z "$(CTAGS_ARGS)$$unique" \ 467 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 468 | $$unique 469 | 470 | GTAGS: 471 | here=`$(am__cd) $(top_builddir) && pwd` \ 472 | && $(am__cd) $(top_srcdir) \ 473 | && gtags -i $(GTAGS_ARGS) "$$here" 474 | 475 | distclean-tags: 476 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 477 | 478 | distdir: $(DISTFILES) 479 | $(am__remove_distdir) 480 | test -d "$(distdir)" || mkdir "$(distdir)" 481 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 482 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 483 | list='$(DISTFILES)'; \ 484 | dist_files=`for file in $$list; do echo $$file; done | \ 485 | sed -e "s|^$$srcdirstrip/||;t" \ 486 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 487 | case $$dist_files in \ 488 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 489 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 490 | sort -u` ;; \ 491 | esac; \ 492 | for file in $$dist_files; do \ 493 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 494 | if test -d $$d/$$file; then \ 495 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 496 | if test -d "$(distdir)/$$file"; then \ 497 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 498 | fi; \ 499 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 500 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 501 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 502 | fi; \ 503 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 504 | else \ 505 | test -f "$(distdir)/$$file" \ 506 | || cp -p $$d/$$file "$(distdir)/$$file" \ 507 | || exit 1; \ 508 | fi; \ 509 | done 510 | @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 511 | if test "$$subdir" = .; then :; else \ 512 | test -d "$(distdir)/$$subdir" \ 513 | || $(MKDIR_P) "$(distdir)/$$subdir" \ 514 | || exit 1; \ 515 | fi; \ 516 | done 517 | @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 518 | if test "$$subdir" = .; then :; else \ 519 | dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ 520 | $(am__relativize); \ 521 | new_distdir=$$reldir; \ 522 | dir1=$$subdir; dir2="$(top_distdir)"; \ 523 | $(am__relativize); \ 524 | new_top_distdir=$$reldir; \ 525 | echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ 526 | echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ 527 | ($(am__cd) $$subdir && \ 528 | $(MAKE) $(AM_MAKEFLAGS) \ 529 | top_distdir="$$new_top_distdir" \ 530 | distdir="$$new_distdir" \ 531 | am__remove_distdir=: \ 532 | am__skip_length_check=: \ 533 | am__skip_mode_fix=: \ 534 | distdir) \ 535 | || exit 1; \ 536 | fi; \ 537 | done 538 | -test -n "$(am__skip_mode_fix)" \ 539 | || find "$(distdir)" -type d ! -perm -755 \ 540 | -exec chmod u+rwx,go+rx {} \; -o \ 541 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ 542 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ 543 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ 544 | || chmod -R a+r "$(distdir)" 545 | dist-gzip: distdir 546 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 547 | $(am__remove_distdir) 548 | 549 | dist-bzip2: distdir 550 | tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 551 | $(am__remove_distdir) 552 | 553 | dist-lzip: distdir 554 | tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz 555 | $(am__remove_distdir) 556 | 557 | dist-lzma: distdir 558 | tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma 559 | $(am__remove_distdir) 560 | 561 | dist-xz: distdir 562 | tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz 563 | $(am__remove_distdir) 564 | 565 | dist-tarZ: distdir 566 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z 567 | $(am__remove_distdir) 568 | 569 | dist-shar: distdir 570 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz 571 | $(am__remove_distdir) 572 | 573 | dist-zip: distdir 574 | -rm -f $(distdir).zip 575 | zip -rq $(distdir).zip $(distdir) 576 | $(am__remove_distdir) 577 | 578 | dist dist-all: distdir 579 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 580 | $(am__remove_distdir) 581 | 582 | # This target untars the dist file and tries a VPATH configuration. Then 583 | # it guarantees that the distribution is self-contained by making another 584 | # tarfile. 585 | distcheck: dist 586 | case '$(DIST_ARCHIVES)' in \ 587 | *.tar.gz*) \ 588 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ 589 | *.tar.bz2*) \ 590 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ 591 | *.tar.lzma*) \ 592 | lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ 593 | *.tar.lz*) \ 594 | lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ 595 | *.tar.xz*) \ 596 | xz -dc $(distdir).tar.xz | $(am__untar) ;;\ 597 | *.tar.Z*) \ 598 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ 599 | *.shar.gz*) \ 600 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ 601 | *.zip*) \ 602 | unzip $(distdir).zip ;;\ 603 | esac 604 | chmod -R a-w $(distdir); chmod a+w $(distdir) 605 | mkdir $(distdir)/_build 606 | mkdir $(distdir)/_inst 607 | chmod a-w $(distdir) 608 | test -d $(distdir)/_build || exit 0; \ 609 | dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ 610 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ 611 | && am__cwd=`pwd` \ 612 | && $(am__cd) $(distdir)/_build \ 613 | && ../configure --srcdir=.. --prefix="$$dc_install_base" \ 614 | $(AM_DISTCHECK_CONFIGURE_FLAGS) \ 615 | $(DISTCHECK_CONFIGURE_FLAGS) \ 616 | && $(MAKE) $(AM_MAKEFLAGS) \ 617 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ 618 | && $(MAKE) $(AM_MAKEFLAGS) check \ 619 | && $(MAKE) $(AM_MAKEFLAGS) install \ 620 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ 621 | && $(MAKE) $(AM_MAKEFLAGS) uninstall \ 622 | && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ 623 | distuninstallcheck \ 624 | && chmod -R a-w "$$dc_install_base" \ 625 | && ({ \ 626 | (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ 627 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ 628 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ 629 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ 630 | distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ 631 | } || { rm -rf "$$dc_destdir"; exit 1; }) \ 632 | && rm -rf "$$dc_destdir" \ 633 | && $(MAKE) $(AM_MAKEFLAGS) dist \ 634 | && rm -rf $(DIST_ARCHIVES) \ 635 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ 636 | && cd "$$am__cwd" \ 637 | || exit 1 638 | $(am__remove_distdir) 639 | @(echo "$(distdir) archives ready for distribution: "; \ 640 | list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ 641 | sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' 642 | distuninstallcheck: 643 | @test -n '$(distuninstallcheck_dir)' || { \ 644 | echo 'ERROR: trying to run $@ with an empty' \ 645 | '$$(distuninstallcheck_dir)' >&2; \ 646 | exit 1; \ 647 | }; \ 648 | $(am__cd) '$(distuninstallcheck_dir)' || { \ 649 | echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ 650 | exit 1; \ 651 | }; \ 652 | test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ 653 | || { echo "ERROR: files left after uninstall:" ; \ 654 | if test -n "$(DESTDIR)"; then \ 655 | echo " (check DESTDIR support)"; \ 656 | fi ; \ 657 | $(distuninstallcheck_listfiles) ; \ 658 | exit 1; } >&2 659 | distcleancheck: distclean 660 | @if test '$(srcdir)' = . ; then \ 661 | echo "ERROR: distcleancheck can only run from a VPATH build" ; \ 662 | exit 1 ; \ 663 | fi 664 | @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ 665 | || { echo "ERROR: files left in build directory after distclean:" ; \ 666 | $(distcleancheck_listfiles) ; \ 667 | exit 1; } >&2 668 | check-am: all-am 669 | check: check-recursive 670 | all-am: Makefile $(DATA) config.h 671 | installdirs: installdirs-recursive 672 | installdirs-am: 673 | for dir in "$(DESTDIR)$(docdir)"; do \ 674 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 675 | done 676 | install: install-recursive 677 | install-exec: install-exec-recursive 678 | install-data: install-data-recursive 679 | uninstall: uninstall-recursive 680 | 681 | install-am: all-am 682 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 683 | 684 | installcheck: installcheck-recursive 685 | install-strip: 686 | if test -z '$(STRIP)'; then \ 687 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 688 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 689 | install; \ 690 | else \ 691 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 692 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 693 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 694 | fi 695 | mostlyclean-generic: 696 | 697 | clean-generic: 698 | 699 | distclean-generic: 700 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 701 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 702 | 703 | maintainer-clean-generic: 704 | @echo "This command is intended for maintainers to use" 705 | @echo "it deletes files that may require special tools to rebuild." 706 | clean: clean-recursive 707 | 708 | clean-am: clean-generic clean-libtool mostlyclean-am 709 | 710 | distclean: distclean-recursive 711 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 712 | -rm -f Makefile 713 | distclean-am: clean-am distclean-generic distclean-hdr \ 714 | distclean-libtool distclean-tags 715 | 716 | dvi: dvi-recursive 717 | 718 | dvi-am: 719 | 720 | html: html-recursive 721 | 722 | html-am: 723 | 724 | info: info-recursive 725 | 726 | info-am: 727 | 728 | install-data-am: install-dist_docDATA 729 | 730 | install-dvi: install-dvi-recursive 731 | 732 | install-dvi-am: 733 | 734 | install-exec-am: 735 | 736 | install-html: install-html-recursive 737 | 738 | install-html-am: 739 | 740 | install-info: install-info-recursive 741 | 742 | install-info-am: 743 | 744 | install-man: 745 | 746 | install-pdf: install-pdf-recursive 747 | 748 | install-pdf-am: 749 | 750 | install-ps: install-ps-recursive 751 | 752 | install-ps-am: 753 | 754 | installcheck-am: 755 | 756 | maintainer-clean: maintainer-clean-recursive 757 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 758 | -rm -rf $(top_srcdir)/autom4te.cache 759 | -rm -f Makefile 760 | maintainer-clean-am: distclean-am maintainer-clean-generic 761 | 762 | mostlyclean: mostlyclean-recursive 763 | 764 | mostlyclean-am: mostlyclean-generic mostlyclean-libtool 765 | 766 | pdf: pdf-recursive 767 | 768 | pdf-am: 769 | 770 | ps: ps-recursive 771 | 772 | ps-am: 773 | 774 | uninstall-am: uninstall-dist_docDATA 775 | 776 | .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ 777 | ctags-recursive install-am install-strip tags-recursive 778 | 779 | .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ 780 | all all-am am--refresh check check-am clean clean-generic \ 781 | clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ 782 | dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ 783 | dist-zip distcheck distclean distclean-generic distclean-hdr \ 784 | distclean-libtool distclean-tags distcleancheck distdir \ 785 | distuninstallcheck dvi dvi-am html html-am info info-am \ 786 | install install-am install-data install-data-am \ 787 | install-dist_docDATA install-dvi install-dvi-am install-exec \ 788 | install-exec-am install-html install-html-am install-info \ 789 | install-info-am install-man install-pdf install-pdf-am \ 790 | install-ps install-ps-am install-strip installcheck \ 791 | installcheck-am installdirs installdirs-am maintainer-clean \ 792 | maintainer-clean-generic mostlyclean mostlyclean-generic \ 793 | mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ 794 | uninstall uninstall-am uninstall-dist_docDATA 795 | 796 | 797 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 798 | # Otherwise a system limit (for SysV at least) may be exceeded. 799 | .NOEXPORT: 800 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | CityHash v1.1.1, June 17, 2013 2 | 3 | * Fix CityHash32() so platforms that disagree about whether 'char' is signed 4 | use the same mathematical function. For most people this changes nothing 5 | as most popular platforms agree with x86 about whether 'char' is signed. 6 | * No changes to any of the functions, unless you had been using CityHash32() 7 | despite "make check" reporting a failure on your platform. 8 | * Slightly modernize and improve configuration and portability. 9 | 10 | CityHash v1.1, October 22, 2012 11 | 12 | * Add CityHash32(), intended for 32-bit platforms. 13 | * Change existing functions to improve their hash quality and/or speed. Most 14 | of the changes were minor, but CityHashCrc* was substantially reworked 15 | (and made perhaps 10% slower, unfortunately). 16 | * Improve README. 17 | 18 | CityHash v1.0.3, October 6, 2011 19 | 20 | * Change all the functions to improve their hash quality. Most of the 21 | changes were minor. Special thanks to Bob Jenkins for reporting some 22 | issues that he'd found. The speed of the functions after these changes is 23 | roughly unchanged, except that CityHash128() and CityHash128WithSeed() are 24 | slower. 25 | * To improve portability, replace the one use of ssize_t with signed long. 26 | * Improve README. 27 | 28 | CityHash v1.0.2, May 8, 2011 29 | 30 | * Correct a problem in CityHashCrc256(); for inputs under 240 bytes the 31 | scheme of padding to 240 bytes was causing the empty string and an input 32 | of exactly 240 NULs to have the same hash code. That is now fixed. 33 | Most strings less than 240 bytes long will have a different hash than 34 | they did in v1.0.1. 35 | * Other hash functions are unchanged. 36 | * Minor corrections and improvements to README. 37 | 38 | CityHash v1.0.1, April 28, 2011 39 | 40 | * Added README, NEWS, and COPYING. The README contains installation and 41 | usage instructions, information on "hash quality," and other goodies. 42 | * Improved how CityHash128() and CityHash128WithSeed() handle very short 43 | input strings. 44 | * Added new functions that are faster on long strings on 64-bit CPUs with 45 | a CRC32 instruction: CityHashCrc128(), CityHashCrc128WithSeed(), and 46 | CityHashCrc256(). 47 | * Removed our assumption that "*(const uint64*)p" and such is safe. Now we 48 | memcpy() instead. It has no speed penalty and makes our intent explicit 49 | to the compiler. 50 | * Changed #include "city.h" to #include , suggested by Robert Escriva. 51 | * Added build system, a modified version of one contributed by Robert Escriva. 52 | * We now use __builtin_expect if the configure script can make it work, rather 53 | than just on gcc. 54 | * Added a test: use "make check" to run it. If you compile CityHash in a way 55 | that causes it to return unexpected results, the test should fail. 56 | * Added untested big-endian support. Please let us know if you try it! 57 | * Other than CityHash128() and CityHash128WithSeed(), the hash functions in 58 | the previous release are unchanged. 59 | 60 | CityHash v1, April 11, 2011 61 | 62 | * Initial release 63 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | CityHash, a family of hash functions for strings. 2 | 3 | 4 | Introduction 5 | ============ 6 | 7 | CityHash provides hash functions for strings. The functions mix the 8 | input bits thoroughly but are not suitable for cryptography. See 9 | "Hash Quality," below, for details on how CityHash was tested and so on. 10 | 11 | We provide reference implementations in C++, with a friendly MIT license. 12 | 13 | CityHash32() returns a 32-bit hash. 14 | 15 | CityHash64() and similar return a 64-bit hash. 16 | 17 | CityHash128() and similar return a 128-bit hash and are tuned for 18 | strings of at least a few hundred bytes. Depending on your compiler 19 | and hardware, it's likely faster than CityHash64() on sufficiently long 20 | strings. It's slower than necessary on shorter strings, but we expect 21 | that case to be relatively unimportant. 22 | 23 | CityHashCrc128() and similar are variants of CityHash128() that depend 24 | on _mm_crc32_u64(), an intrinsic that compiles to a CRC32 instruction 25 | on some CPUs. However, none of the functions we provide are CRCs. 26 | 27 | CityHashCrc256() is a variant of CityHashCrc128() that also depends 28 | on _mm_crc32_u64(). It returns a 256-bit hash. 29 | 30 | All members of the CityHash family were designed with heavy reliance 31 | on previous work by Austin Appleby, Bob Jenkins, and others. 32 | For example, CityHash32 has many similarities with Murmur3a. 33 | 34 | Performance on long strings: 64-bit CPUs 35 | ======================================== 36 | 37 | We are most excited by the performance of CityHash64() and its variants on 38 | short strings, but long strings are interesting as well. 39 | 40 | CityHash is intended to be fast, under the constraint that it hash very 41 | well. For CPUs with the CRC32 instruction, CRC is speedy, but CRC wasn't 42 | designed as a hash function and shouldn't be used as one. CityHashCrc128() 43 | is not a CRC, but it uses the CRC32 machinery. 44 | 45 | On a single core of a 2.67GHz Intel Xeon X5550, CityHashCrc256 peaks at about 46 | 5 to 5.5 bytes/cycle. The other CityHashCrc functions are wrappers around 47 | CityHashCrc256 and should have similar performance on long strings. 48 | (CityHashCrc256 in v1.0.3 was even faster, but we decided it wasn't as thorough 49 | as it should be.) CityHash128 peaks at about 4.3 bytes/cycle. The fastest 50 | Murmur variant on that hardware, Murmur3F, peaks at about 2.4 bytes/cycle. 51 | We expect the peak speed of CityHash128 to dominate CityHash64, which is 52 | aimed more toward short strings or use in hash tables. 53 | 54 | For long strings, a new function by Bob Jenkins, SpookyHash, is just 55 | slightly slower than CityHash128 on Intel x86-64 CPUs, but noticeably 56 | faster on AMD x86-64 CPUs. For hashing long strings on AMD CPUs 57 | and/or CPUs without the CRC instruction, SpookyHash may be just as 58 | good or better than any of the CityHash variants. 59 | 60 | Performance on short strings: 64-bit CPUs 61 | ========================================= 62 | 63 | For short strings, e.g., most hash table keys, CityHash64 is faster than 64 | CityHash128, and probably faster than all the aforementioned functions, 65 | depending on the mix of string lengths. Here are a few results from that 66 | same hardware, where we (unrealistically) tested a single string length over 67 | and over again: 68 | 69 | Hash Results 70 | ------------------------------------------------------------------------------ 71 | CityHash64 v1.0.3 7ns for 1 byte, or 6ns for 8 bytes, or 9ns for 64 bytes 72 | Murmur2 (64-bit) 6ns for 1 byte, or 6ns for 8 bytes, or 15ns for 64 bytes 73 | Murmur3F 14ns for 1 byte, or 15ns for 8 bytes, or 23ns for 64 bytes 74 | 75 | We don't have CityHash64 benchmarks results for v1.1, but we expect the 76 | numbers to be similar. 77 | 78 | Performance: 32-bit CPUs 79 | ======================== 80 | 81 | CityHash32 is the newest variant of CityHash. It is intended for 82 | 32-bit hardware in general but has been mostly tested on x86. Our benchmarks 83 | suggest that Murmur3 is the nearest competitor to CityHash32 on x86. 84 | We don't know of anything faster that has comparable quality. The speed rankings 85 | in our testing: CityHash32 > Murmur3f > Murmur3a (for long strings), and 86 | CityHash32 > Murmur3a > Murmur3f (for short strings). 87 | 88 | Installation 89 | ============ 90 | 91 | We provide reference implementations of several CityHash functions, written 92 | in C++. The build system is based on autoconf. It defaults the C++ 93 | compiler flags to "-g -O2", which is probably slower than -O3 if you are 94 | using gcc. YMMV. 95 | 96 | On systems with gcc, we generally recommend: 97 | 98 | ./configure 99 | make all check CXXFLAGS="-g -O3" 100 | sudo make install 101 | 102 | Or, if your system has the CRC32 instruction, and you want to build everything: 103 | 104 | ./configure --enable-sse4.2 105 | make all check CXXFLAGS="-g -O3 -msse4.2" 106 | sudo make install 107 | 108 | Note that our build system doesn't try to determine the appropriate compiler 109 | flag for enabling SSE4.2. For gcc it is "-msse4.2". The --enable-sse4.2 110 | flag to the configure script controls whether citycrc.h is installed when 111 | you "make install." In general, picking the right compiler flags can be 112 | tricky, and may depend on your compiler, your hardware, and even how you 113 | plan to use the library. 114 | 115 | For generic information about how to configure this software, please try: 116 | 117 | ./configure --help 118 | 119 | Failing that, please work from city.cc and city*.h, as they contain all the 120 | necessary code. 121 | 122 | 123 | Usage 124 | ===== 125 | 126 | The above installation instructions will produce a single library. It will 127 | contain CityHash32(), CityHash64(), and CityHash128(), and their variants, 128 | and possibly CityHashCrc128(), CityHashCrc128WithSeed(), and 129 | CityHashCrc256(). The functions with Crc in the name are declared in 130 | citycrc.h; the rest are declared in city.h. 131 | 132 | 133 | Limitations 134 | =========== 135 | 136 | 1) CityHash32 is intended for little-endian 32-bit code, and everything else in 137 | the current version of CityHash is intended for little-endian 64-bit CPUs. 138 | 139 | All functions that don't use the CRC32 instruction should work in 140 | little-endian 32-bit or 64-bit code. CityHash should work on big-endian CPUs 141 | as well, but we haven't tested that very thoroughly yet. 142 | 143 | 2) CityHash is fairly complex. As a result of its complexity, it may not 144 | perform as expected on some compilers. For example, preliminary reports 145 | suggest that some Microsoft compilers compile CityHash to assembly that's 146 | 10-20% slower than it could be. 147 | 148 | 149 | Hash Quality 150 | ============ 151 | 152 | We like to test hash functions with SMHasher, among other things. 153 | SMHasher isn't perfect, but it seems to find almost any significant flaw. 154 | SMHasher is available at http://code.google.com/p/smhasher/ 155 | 156 | SMHasher is designed to pass a 32-bit seed to the hash functions it tests. 157 | No CityHash function is designed to work that way, so we adapt as follows: 158 | For our functions that accept a seed, we use the given seed directly (padded 159 | with zeroes); for our functions that don't accept a seed, we hash the 160 | concatenation of the given seed and the input string. 161 | 162 | The CityHash functions have the following flaws according to SMHasher: 163 | 164 | (1) CityHash64: none 165 | 166 | (2) CityHash64WithSeed: none 167 | 168 | (3) CityHash64WithSeeds: did not test 169 | 170 | (4) CityHash128: none 171 | 172 | (5) CityHash128WithSeed: none 173 | 174 | (6) CityHashCrc128: none 175 | 176 | (7) CityHashCrc128WithSeed: none 177 | 178 | (8) CityHashCrc256: none 179 | 180 | (9) CityHash32: none 181 | 182 | Some minor flaws in 32-bit and 64-bit functions are harmless, as we 183 | expect the primary use of these functions will be in hash tables. We 184 | may have gone slightly overboard in trying to please SMHasher and other 185 | similar tests, but we don't want anyone to choose a different hash function 186 | because of some minor issue reported by a quality test. 187 | 188 | 189 | For more information 190 | ==================== 191 | 192 | http://code.google.com/p/cityhash/ 193 | 194 | cityhash-discuss@googlegroups.com 195 | 196 | Please feel free to send us comments, questions, bug reports, or patches. 197 | -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | # generated automatically by aclocal 1.11.3 -*- Autoconf -*- 2 | 3 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4 | # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, 5 | # Inc. 6 | # This file 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 | m4_ifndef([AC_AUTOCONF_VERSION], 16 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 17 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, 18 | [m4_warning([this file was generated for autoconf 2.69. 19 | You have another version of autoconf. It may work, but is not guaranteed to. 20 | If you have problems, you may need to regenerate the build system entirely. 21 | To do so, use the procedure documented by the package, typically `autoreconf'.])]) 22 | 23 | # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software 24 | # Foundation, Inc. 25 | # 26 | # This file is free software; the Free Software Foundation 27 | # gives unlimited permission to copy and/or distribute it, 28 | # with or without modifications, as long as this notice is preserved. 29 | 30 | # serial 1 31 | 32 | # AM_AUTOMAKE_VERSION(VERSION) 33 | # ---------------------------- 34 | # Automake X.Y traces this macro to ensure aclocal.m4 has been 35 | # generated from the m4 files accompanying Automake X.Y. 36 | # (This private macro should not be called outside this file.) 37 | AC_DEFUN([AM_AUTOMAKE_VERSION], 38 | [am__api_version='1.11' 39 | dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 40 | dnl require some minimum version. Point them to the right macro. 41 | m4_if([$1], [1.11.3], [], 42 | [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 43 | ]) 44 | 45 | # _AM_AUTOCONF_VERSION(VERSION) 46 | # ----------------------------- 47 | # aclocal traces this macro to find the Autoconf version. 48 | # This is a private macro too. Using m4_define simplifies 49 | # the logic in aclocal, which can simply ignore this definition. 50 | m4_define([_AM_AUTOCONF_VERSION], []) 51 | 52 | # AM_SET_CURRENT_AUTOMAKE_VERSION 53 | # ------------------------------- 54 | # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 55 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 56 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 57 | [AM_AUTOMAKE_VERSION([1.11.3])dnl 58 | m4_ifndef([AC_AUTOCONF_VERSION], 59 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 60 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 61 | 62 | # AM_AUX_DIR_EXPAND -*- Autoconf -*- 63 | 64 | # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. 65 | # 66 | # This file is free software; the Free Software Foundation 67 | # gives unlimited permission to copy and/or distribute it, 68 | # with or without modifications, as long as this notice is preserved. 69 | 70 | # serial 1 71 | 72 | # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 73 | # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 74 | # `$srcdir', `$srcdir/..', or `$srcdir/../..'. 75 | # 76 | # Of course, Automake must honor this variable whenever it calls a 77 | # tool from the auxiliary directory. The problem is that $srcdir (and 78 | # therefore $ac_aux_dir as well) can be either absolute or relative, 79 | # depending on how configure is run. This is pretty annoying, since 80 | # it makes $ac_aux_dir quite unusable in subdirectories: in the top 81 | # source directory, any form will work fine, but in subdirectories a 82 | # relative path needs to be adjusted first. 83 | # 84 | # $ac_aux_dir/missing 85 | # fails when called from a subdirectory if $ac_aux_dir is relative 86 | # $top_srcdir/$ac_aux_dir/missing 87 | # fails if $ac_aux_dir is absolute, 88 | # fails when called from a subdirectory in a VPATH build with 89 | # a relative $ac_aux_dir 90 | # 91 | # The reason of the latter failure is that $top_srcdir and $ac_aux_dir 92 | # are both prefixed by $srcdir. In an in-source build this is usually 93 | # harmless because $srcdir is `.', but things will broke when you 94 | # start a VPATH build or use an absolute $srcdir. 95 | # 96 | # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 97 | # iff we strip the leading $srcdir from $ac_aux_dir. That would be: 98 | # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 99 | # and then we would define $MISSING as 100 | # MISSING="\${SHELL} $am_aux_dir/missing" 101 | # This will work as long as MISSING is not called from configure, because 102 | # unfortunately $(top_srcdir) has no meaning in configure. 103 | # However there are other variables, like CC, which are often used in 104 | # configure, and could therefore not use this "fixed" $ac_aux_dir. 105 | # 106 | # Another solution, used here, is to always expand $ac_aux_dir to an 107 | # absolute PATH. The drawback is that using absolute paths prevent a 108 | # configured tree to be moved without reconfiguration. 109 | 110 | AC_DEFUN([AM_AUX_DIR_EXPAND], 111 | [dnl Rely on autoconf to set up CDPATH properly. 112 | AC_PREREQ([2.50])dnl 113 | # expand $ac_aux_dir to an absolute path 114 | am_aux_dir=`cd $ac_aux_dir && pwd` 115 | ]) 116 | 117 | # AM_CONDITIONAL -*- Autoconf -*- 118 | 119 | # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 120 | # Free Software Foundation, Inc. 121 | # 122 | # This file is free software; the Free Software Foundation 123 | # gives unlimited permission to copy and/or distribute it, 124 | # with or without modifications, as long as this notice is preserved. 125 | 126 | # serial 9 127 | 128 | # AM_CONDITIONAL(NAME, SHELL-CONDITION) 129 | # ------------------------------------- 130 | # Define a conditional. 131 | AC_DEFUN([AM_CONDITIONAL], 132 | [AC_PREREQ(2.52)dnl 133 | ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 134 | [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 135 | AC_SUBST([$1_TRUE])dnl 136 | AC_SUBST([$1_FALSE])dnl 137 | _AM_SUBST_NOTMAKE([$1_TRUE])dnl 138 | _AM_SUBST_NOTMAKE([$1_FALSE])dnl 139 | m4_define([_AM_COND_VALUE_$1], [$2])dnl 140 | if $2; then 141 | $1_TRUE= 142 | $1_FALSE='#' 143 | else 144 | $1_TRUE='#' 145 | $1_FALSE= 146 | fi 147 | AC_CONFIG_COMMANDS_PRE( 148 | [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 149 | AC_MSG_ERROR([[conditional "$1" was never defined. 150 | Usually this means the macro was only invoked conditionally.]]) 151 | fi])]) 152 | 153 | # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 154 | # 2010, 2011 Free Software Foundation, Inc. 155 | # 156 | # This file is free software; the Free Software Foundation 157 | # gives unlimited permission to copy and/or distribute it, 158 | # with or without modifications, as long as this notice is preserved. 159 | 160 | # serial 12 161 | 162 | # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 163 | # written in clear, in which case automake, when reading aclocal.m4, 164 | # will think it sees a *use*, and therefore will trigger all it's 165 | # C support machinery. Also note that it means that autoscan, seeing 166 | # CC etc. in the Makefile, will ask for an AC_PROG_CC use... 167 | 168 | 169 | # _AM_DEPENDENCIES(NAME) 170 | # ---------------------- 171 | # See how the compiler implements dependency checking. 172 | # NAME is "CC", "CXX", "GCJ", or "OBJC". 173 | # We try a few techniques and use that to set a single cache variable. 174 | # 175 | # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 176 | # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 177 | # dependency, and given that the user is not expected to run this macro, 178 | # just rely on AC_PROG_CC. 179 | AC_DEFUN([_AM_DEPENDENCIES], 180 | [AC_REQUIRE([AM_SET_DEPDIR])dnl 181 | AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 182 | AC_REQUIRE([AM_MAKE_INCLUDE])dnl 183 | AC_REQUIRE([AM_DEP_TRACK])dnl 184 | 185 | ifelse([$1], CC, [depcc="$CC" am_compiler_list=], 186 | [$1], CXX, [depcc="$CXX" am_compiler_list=], 187 | [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 188 | [$1], UPC, [depcc="$UPC" am_compiler_list=], 189 | [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 190 | [depcc="$$1" am_compiler_list=]) 191 | 192 | AC_CACHE_CHECK([dependency style of $depcc], 193 | [am_cv_$1_dependencies_compiler_type], 194 | [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 195 | # We make a subdir and do the tests there. Otherwise we can end up 196 | # making bogus files that we don't know about and never remove. For 197 | # instance it was reported that on HP-UX the gcc test will end up 198 | # making a dummy file named `D' -- because `-MD' means `put the output 199 | # in D'. 200 | rm -rf conftest.dir 201 | mkdir conftest.dir 202 | # Copy depcomp to subdir because otherwise we won't find it if we're 203 | # using a relative directory. 204 | cp "$am_depcomp" conftest.dir 205 | cd conftest.dir 206 | # We will build objects and dependencies in a subdirectory because 207 | # it helps to detect inapplicable dependency modes. For instance 208 | # both Tru64's cc and ICC support -MD to output dependencies as a 209 | # side effect of compilation, but ICC will put the dependencies in 210 | # the current directory while Tru64 will put them in the object 211 | # directory. 212 | mkdir sub 213 | 214 | am_cv_$1_dependencies_compiler_type=none 215 | if test "$am_compiler_list" = ""; then 216 | am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 217 | fi 218 | am__universal=false 219 | m4_case([$1], [CC], 220 | [case " $depcc " in #( 221 | *\ -arch\ *\ -arch\ *) am__universal=true ;; 222 | esac], 223 | [CXX], 224 | [case " $depcc " in #( 225 | *\ -arch\ *\ -arch\ *) am__universal=true ;; 226 | esac]) 227 | 228 | for depmode in $am_compiler_list; do 229 | # Setup a source with many dependencies, because some compilers 230 | # like to wrap large dependency lists on column 80 (with \), and 231 | # we should not choose a depcomp mode which is confused by this. 232 | # 233 | # We need to recreate these files for each test, as the compiler may 234 | # overwrite some of them when testing with obscure command lines. 235 | # This happens at least with the AIX C compiler. 236 | : > sub/conftest.c 237 | for i in 1 2 3 4 5 6; do 238 | echo '#include "conftst'$i'.h"' >> sub/conftest.c 239 | # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 240 | # Solaris 8's {/usr,}/bin/sh. 241 | touch sub/conftst$i.h 242 | done 243 | echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 244 | 245 | # We check with `-c' and `-o' for the sake of the "dashmstdout" 246 | # mode. It turns out that the SunPro C++ compiler does not properly 247 | # handle `-M -o', and we need to detect this. Also, some Intel 248 | # versions had trouble with output in subdirs 249 | am__obj=sub/conftest.${OBJEXT-o} 250 | am__minus_obj="-o $am__obj" 251 | case $depmode in 252 | gcc) 253 | # This depmode causes a compiler race in universal mode. 254 | test "$am__universal" = false || continue 255 | ;; 256 | nosideeffect) 257 | # after this tag, mechanisms are not by side-effect, so they'll 258 | # only be used when explicitly requested 259 | if test "x$enable_dependency_tracking" = xyes; then 260 | continue 261 | else 262 | break 263 | fi 264 | ;; 265 | msvc7 | msvc7msys | msvisualcpp | msvcmsys) 266 | # This compiler won't grok `-c -o', but also, the minuso test has 267 | # not run yet. These depmodes are late enough in the game, and 268 | # so weak that their functioning should not be impacted. 269 | am__obj=conftest.${OBJEXT-o} 270 | am__minus_obj= 271 | ;; 272 | none) break ;; 273 | esac 274 | if depmode=$depmode \ 275 | source=sub/conftest.c object=$am__obj \ 276 | depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 277 | $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 278 | >/dev/null 2>conftest.err && 279 | grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 280 | grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 281 | grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 282 | ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 283 | # icc doesn't choke on unknown options, it will just issue warnings 284 | # or remarks (even with -Werror). So we grep stderr for any message 285 | # that says an option was ignored or not supported. 286 | # When given -MP, icc 7.0 and 7.1 complain thusly: 287 | # icc: Command line warning: ignoring option '-M'; no argument required 288 | # The diagnosis changed in icc 8.0: 289 | # icc: Command line remark: option '-MP' not supported 290 | if (grep 'ignoring option' conftest.err || 291 | grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 292 | am_cv_$1_dependencies_compiler_type=$depmode 293 | break 294 | fi 295 | fi 296 | done 297 | 298 | cd .. 299 | rm -rf conftest.dir 300 | else 301 | am_cv_$1_dependencies_compiler_type=none 302 | fi 303 | ]) 304 | AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 305 | AM_CONDITIONAL([am__fastdep$1], [ 306 | test "x$enable_dependency_tracking" != xno \ 307 | && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 308 | ]) 309 | 310 | 311 | # AM_SET_DEPDIR 312 | # ------------- 313 | # Choose a directory name for dependency files. 314 | # This macro is AC_REQUIREd in _AM_DEPENDENCIES 315 | AC_DEFUN([AM_SET_DEPDIR], 316 | [AC_REQUIRE([AM_SET_LEADING_DOT])dnl 317 | AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 318 | ]) 319 | 320 | 321 | # AM_DEP_TRACK 322 | # ------------ 323 | AC_DEFUN([AM_DEP_TRACK], 324 | [AC_ARG_ENABLE(dependency-tracking, 325 | [ --disable-dependency-tracking speeds up one-time build 326 | --enable-dependency-tracking do not reject slow dependency extractors]) 327 | if test "x$enable_dependency_tracking" != xno; then 328 | am_depcomp="$ac_aux_dir/depcomp" 329 | AMDEPBACKSLASH='\' 330 | am__nodep='_no' 331 | fi 332 | AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 333 | AC_SUBST([AMDEPBACKSLASH])dnl 334 | _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 335 | AC_SUBST([am__nodep])dnl 336 | _AM_SUBST_NOTMAKE([am__nodep])dnl 337 | ]) 338 | 339 | # Generate code to set up dependency tracking. -*- Autoconf -*- 340 | 341 | # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 342 | # Free Software Foundation, Inc. 343 | # 344 | # This file is free software; the Free Software Foundation 345 | # gives unlimited permission to copy and/or distribute it, 346 | # with or without modifications, as long as this notice is preserved. 347 | 348 | #serial 5 349 | 350 | # _AM_OUTPUT_DEPENDENCY_COMMANDS 351 | # ------------------------------ 352 | AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 353 | [{ 354 | # Autoconf 2.62 quotes --file arguments for eval, but not when files 355 | # are listed without --file. Let's play safe and only enable the eval 356 | # if we detect the quoting. 357 | case $CONFIG_FILES in 358 | *\'*) eval set x "$CONFIG_FILES" ;; 359 | *) set x $CONFIG_FILES ;; 360 | esac 361 | shift 362 | for mf 363 | do 364 | # Strip MF so we end up with the name of the file. 365 | mf=`echo "$mf" | sed -e 's/:.*$//'` 366 | # Check whether this is an Automake generated Makefile or not. 367 | # We used to match only the files named `Makefile.in', but 368 | # some people rename them; so instead we look at the file content. 369 | # Grep'ing the first line is not enough: some people post-process 370 | # each Makefile.in and add a new line on top of each file to say so. 371 | # Grep'ing the whole file is not good either: AIX grep has a line 372 | # limit of 2048, but all sed's we know have understand at least 4000. 373 | if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 374 | dirpart=`AS_DIRNAME("$mf")` 375 | else 376 | continue 377 | fi 378 | # Extract the definition of DEPDIR, am__include, and am__quote 379 | # from the Makefile without running `make'. 380 | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 381 | test -z "$DEPDIR" && continue 382 | am__include=`sed -n 's/^am__include = //p' < "$mf"` 383 | test -z "am__include" && continue 384 | am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 385 | # When using ansi2knr, U may be empty or an underscore; expand it 386 | U=`sed -n 's/^U = //p' < "$mf"` 387 | # Find all dependency output files, they are included files with 388 | # $(DEPDIR) in their names. We invoke sed twice because it is the 389 | # simplest approach to changing $(DEPDIR) to its actual value in the 390 | # expansion. 391 | for file in `sed -n " 392 | s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 393 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 394 | # Make sure the directory exists. 395 | test -f "$dirpart/$file" && continue 396 | fdir=`AS_DIRNAME(["$file"])` 397 | AS_MKDIR_P([$dirpart/$fdir]) 398 | # echo "creating $dirpart/$file" 399 | echo '# dummy' > "$dirpart/$file" 400 | done 401 | done 402 | } 403 | ])# _AM_OUTPUT_DEPENDENCY_COMMANDS 404 | 405 | 406 | # AM_OUTPUT_DEPENDENCY_COMMANDS 407 | # ----------------------------- 408 | # This macro should only be invoked once -- use via AC_REQUIRE. 409 | # 410 | # This code is only required when automatic dependency tracking 411 | # is enabled. FIXME. This creates each `.P' file that we will 412 | # need in order to bootstrap the dependency handling code. 413 | AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 414 | [AC_CONFIG_COMMANDS([depfiles], 415 | [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 416 | [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 417 | ]) 418 | 419 | # Do all the work for Automake. -*- Autoconf -*- 420 | 421 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 422 | # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 423 | # 424 | # This file is free software; the Free Software Foundation 425 | # gives unlimited permission to copy and/or distribute it, 426 | # with or without modifications, as long as this notice is preserved. 427 | 428 | # serial 16 429 | 430 | # This macro actually does too much. Some checks are only needed if 431 | # your package does certain things. But this isn't really a big deal. 432 | 433 | # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 434 | # AM_INIT_AUTOMAKE([OPTIONS]) 435 | # ----------------------------------------------- 436 | # The call with PACKAGE and VERSION arguments is the old style 437 | # call (pre autoconf-2.50), which is being phased out. PACKAGE 438 | # and VERSION should now be passed to AC_INIT and removed from 439 | # the call to AM_INIT_AUTOMAKE. 440 | # We support both call styles for the transition. After 441 | # the next Automake release, Autoconf can make the AC_INIT 442 | # arguments mandatory, and then we can depend on a new Autoconf 443 | # release and drop the old call support. 444 | AC_DEFUN([AM_INIT_AUTOMAKE], 445 | [AC_PREREQ([2.62])dnl 446 | dnl Autoconf wants to disallow AM_ names. We explicitly allow 447 | dnl the ones we care about. 448 | m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 449 | AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 450 | AC_REQUIRE([AC_PROG_INSTALL])dnl 451 | if test "`cd $srcdir && pwd`" != "`pwd`"; then 452 | # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 453 | # is not polluted with repeated "-I." 454 | AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 455 | # test to see if srcdir already configured 456 | if test -f $srcdir/config.status; then 457 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 458 | fi 459 | fi 460 | 461 | # test whether we have cygpath 462 | if test -z "$CYGPATH_W"; then 463 | if (cygpath --version) >/dev/null 2>/dev/null; then 464 | CYGPATH_W='cygpath -w' 465 | else 466 | CYGPATH_W=echo 467 | fi 468 | fi 469 | AC_SUBST([CYGPATH_W]) 470 | 471 | # Define the identity of the package. 472 | dnl Distinguish between old-style and new-style calls. 473 | m4_ifval([$2], 474 | [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 475 | AC_SUBST([PACKAGE], [$1])dnl 476 | AC_SUBST([VERSION], [$2])], 477 | [_AM_SET_OPTIONS([$1])dnl 478 | dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 479 | m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 480 | [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 481 | AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 482 | AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 483 | 484 | _AM_IF_OPTION([no-define],, 485 | [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 486 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 487 | 488 | # Some tools Automake needs. 489 | AC_REQUIRE([AM_SANITY_CHECK])dnl 490 | AC_REQUIRE([AC_ARG_PROGRAM])dnl 491 | AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 492 | AM_MISSING_PROG(AUTOCONF, autoconf) 493 | AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 494 | AM_MISSING_PROG(AUTOHEADER, autoheader) 495 | AM_MISSING_PROG(MAKEINFO, makeinfo) 496 | AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 497 | AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 498 | AC_REQUIRE([AM_PROG_MKDIR_P])dnl 499 | # We need awk for the "check" target. The system "awk" is bad on 500 | # some platforms. 501 | AC_REQUIRE([AC_PROG_AWK])dnl 502 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl 503 | AC_REQUIRE([AM_SET_LEADING_DOT])dnl 504 | _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 505 | [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 506 | [_AM_PROG_TAR([v7])])]) 507 | _AM_IF_OPTION([no-dependencies],, 508 | [AC_PROVIDE_IFELSE([AC_PROG_CC], 509 | [_AM_DEPENDENCIES(CC)], 510 | [define([AC_PROG_CC], 511 | defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 512 | AC_PROVIDE_IFELSE([AC_PROG_CXX], 513 | [_AM_DEPENDENCIES(CXX)], 514 | [define([AC_PROG_CXX], 515 | defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 516 | AC_PROVIDE_IFELSE([AC_PROG_OBJC], 517 | [_AM_DEPENDENCIES(OBJC)], 518 | [define([AC_PROG_OBJC], 519 | defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 520 | ]) 521 | _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 522 | dnl The `parallel-tests' driver may need to know about EXEEXT, so add the 523 | dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 524 | dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 525 | AC_CONFIG_COMMANDS_PRE(dnl 526 | [m4_provide_if([_AM_COMPILER_EXEEXT], 527 | [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 528 | ]) 529 | 530 | dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 531 | dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 532 | dnl mangled by Autoconf and run in a shell conditional statement. 533 | m4_define([_AC_COMPILER_EXEEXT], 534 | m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 535 | 536 | 537 | # When config.status generates a header, we must update the stamp-h file. 538 | # This file resides in the same directory as the config header 539 | # that is generated. The stamp files are numbered to have different names. 540 | 541 | # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 542 | # loop where config.status creates the headers, so we can generate 543 | # our stamp files there. 544 | AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 545 | [# Compute $1's index in $config_headers. 546 | _am_arg=$1 547 | _am_stamp_count=1 548 | for _am_header in $config_headers :; do 549 | case $_am_header in 550 | $_am_arg | $_am_arg:* ) 551 | break ;; 552 | * ) 553 | _am_stamp_count=`expr $_am_stamp_count + 1` ;; 554 | esac 555 | done 556 | echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 557 | 558 | # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, 559 | # Inc. 560 | # 561 | # This file is free software; the Free Software Foundation 562 | # gives unlimited permission to copy and/or distribute it, 563 | # with or without modifications, as long as this notice is preserved. 564 | 565 | # serial 1 566 | 567 | # AM_PROG_INSTALL_SH 568 | # ------------------ 569 | # Define $install_sh. 570 | AC_DEFUN([AM_PROG_INSTALL_SH], 571 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 572 | if test x"${install_sh}" != xset; then 573 | case $am_aux_dir in 574 | *\ * | *\ *) 575 | install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 576 | *) 577 | install_sh="\${SHELL} $am_aux_dir/install-sh" 578 | esac 579 | fi 580 | AC_SUBST(install_sh)]) 581 | 582 | # Copyright (C) 2003, 2005 Free Software Foundation, Inc. 583 | # 584 | # This file is free software; the Free Software Foundation 585 | # gives unlimited permission to copy and/or distribute it, 586 | # with or without modifications, as long as this notice is preserved. 587 | 588 | # serial 2 589 | 590 | # Check whether the underlying file-system supports filenames 591 | # with a leading dot. For instance MS-DOS doesn't. 592 | AC_DEFUN([AM_SET_LEADING_DOT], 593 | [rm -rf .tst 2>/dev/null 594 | mkdir .tst 2>/dev/null 595 | if test -d .tst; then 596 | am__leading_dot=. 597 | else 598 | am__leading_dot=_ 599 | fi 600 | rmdir .tst 2>/dev/null 601 | AC_SUBST([am__leading_dot])]) 602 | 603 | # Check to see how 'make' treats includes. -*- Autoconf -*- 604 | 605 | # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 606 | # 607 | # This file is free software; the Free Software Foundation 608 | # gives unlimited permission to copy and/or distribute it, 609 | # with or without modifications, as long as this notice is preserved. 610 | 611 | # serial 4 612 | 613 | # AM_MAKE_INCLUDE() 614 | # ----------------- 615 | # Check to see how make treats includes. 616 | AC_DEFUN([AM_MAKE_INCLUDE], 617 | [am_make=${MAKE-make} 618 | cat > confinc << 'END' 619 | am__doit: 620 | @echo this is the am__doit target 621 | .PHONY: am__doit 622 | END 623 | # If we don't find an include directive, just comment out the code. 624 | AC_MSG_CHECKING([for style of include used by $am_make]) 625 | am__include="#" 626 | am__quote= 627 | _am_result=none 628 | # First try GNU make style include. 629 | echo "include confinc" > confmf 630 | # Ignore all kinds of additional output from `make'. 631 | case `$am_make -s -f confmf 2> /dev/null` in #( 632 | *the\ am__doit\ target*) 633 | am__include=include 634 | am__quote= 635 | _am_result=GNU 636 | ;; 637 | esac 638 | # Now try BSD make style include. 639 | if test "$am__include" = "#"; then 640 | echo '.include "confinc"' > confmf 641 | case `$am_make -s -f confmf 2> /dev/null` in #( 642 | *the\ am__doit\ target*) 643 | am__include=.include 644 | am__quote="\"" 645 | _am_result=BSD 646 | ;; 647 | esac 648 | fi 649 | AC_SUBST([am__include]) 650 | AC_SUBST([am__quote]) 651 | AC_MSG_RESULT([$_am_result]) 652 | rm -f confinc confmf 653 | ]) 654 | 655 | # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 656 | 657 | # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 658 | # Free Software Foundation, Inc. 659 | # 660 | # This file is free software; the Free Software Foundation 661 | # gives unlimited permission to copy and/or distribute it, 662 | # with or without modifications, as long as this notice is preserved. 663 | 664 | # serial 6 665 | 666 | # AM_MISSING_PROG(NAME, PROGRAM) 667 | # ------------------------------ 668 | AC_DEFUN([AM_MISSING_PROG], 669 | [AC_REQUIRE([AM_MISSING_HAS_RUN]) 670 | $1=${$1-"${am_missing_run}$2"} 671 | AC_SUBST($1)]) 672 | 673 | 674 | # AM_MISSING_HAS_RUN 675 | # ------------------ 676 | # Define MISSING if not defined so far and test if it supports --run. 677 | # If it does, set am_missing_run to use it, otherwise, to nothing. 678 | AC_DEFUN([AM_MISSING_HAS_RUN], 679 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 680 | AC_REQUIRE_AUX_FILE([missing])dnl 681 | if test x"${MISSING+set}" != xset; then 682 | case $am_aux_dir in 683 | *\ * | *\ *) 684 | MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 685 | *) 686 | MISSING="\${SHELL} $am_aux_dir/missing" ;; 687 | esac 688 | fi 689 | # Use eval to expand $SHELL 690 | if eval "$MISSING --run true"; then 691 | am_missing_run="$MISSING --run " 692 | else 693 | am_missing_run= 694 | AC_MSG_WARN([`missing' script is too old or missing]) 695 | fi 696 | ]) 697 | 698 | # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, 699 | # Inc. 700 | # 701 | # This file is free software; the Free Software Foundation 702 | # gives unlimited permission to copy and/or distribute it, 703 | # with or without modifications, as long as this notice is preserved. 704 | 705 | # serial 1 706 | 707 | # AM_PROG_MKDIR_P 708 | # --------------- 709 | # Check for `mkdir -p'. 710 | AC_DEFUN([AM_PROG_MKDIR_P], 711 | [AC_PREREQ([2.60])dnl 712 | AC_REQUIRE([AC_PROG_MKDIR_P])dnl 713 | dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 714 | dnl while keeping a definition of mkdir_p for backward compatibility. 715 | dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 716 | dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 717 | dnl Makefile.ins that do not define MKDIR_P, so we do our own 718 | dnl adjustment using top_builddir (which is defined more often than 719 | dnl MKDIR_P). 720 | AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 721 | case $mkdir_p in 722 | [[\\/$]]* | ?:[[\\/]]*) ;; 723 | */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 724 | esac 725 | ]) 726 | 727 | # Helper functions for option handling. -*- Autoconf -*- 728 | 729 | # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software 730 | # Foundation, Inc. 731 | # 732 | # This file is free software; the Free Software Foundation 733 | # gives unlimited permission to copy and/or distribute it, 734 | # with or without modifications, as long as this notice is preserved. 735 | 736 | # serial 5 737 | 738 | # _AM_MANGLE_OPTION(NAME) 739 | # ----------------------- 740 | AC_DEFUN([_AM_MANGLE_OPTION], 741 | [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 742 | 743 | # _AM_SET_OPTION(NAME) 744 | # -------------------- 745 | # Set option NAME. Presently that only means defining a flag for this option. 746 | AC_DEFUN([_AM_SET_OPTION], 747 | [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 748 | 749 | # _AM_SET_OPTIONS(OPTIONS) 750 | # ------------------------ 751 | # OPTIONS is a space-separated list of Automake options. 752 | AC_DEFUN([_AM_SET_OPTIONS], 753 | [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 754 | 755 | # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 756 | # ------------------------------------------- 757 | # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 758 | AC_DEFUN([_AM_IF_OPTION], 759 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 760 | 761 | # Check to make sure that the build environment is sane. -*- Autoconf -*- 762 | 763 | # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 764 | # Free Software Foundation, Inc. 765 | # 766 | # This file is free software; the Free Software Foundation 767 | # gives unlimited permission to copy and/or distribute it, 768 | # with or without modifications, as long as this notice is preserved. 769 | 770 | # serial 5 771 | 772 | # AM_SANITY_CHECK 773 | # --------------- 774 | AC_DEFUN([AM_SANITY_CHECK], 775 | [AC_MSG_CHECKING([whether build environment is sane]) 776 | # Just in case 777 | sleep 1 778 | echo timestamp > conftest.file 779 | # Reject unsafe characters in $srcdir or the absolute working directory 780 | # name. Accept space and tab only in the latter. 781 | am_lf=' 782 | ' 783 | case `pwd` in 784 | *[[\\\"\#\$\&\'\`$am_lf]]*) 785 | AC_MSG_ERROR([unsafe absolute working directory name]);; 786 | esac 787 | case $srcdir in 788 | *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 789 | AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 790 | esac 791 | 792 | # Do `set' in a subshell so we don't clobber the current shell's 793 | # arguments. Must try -L first in case configure is actually a 794 | # symlink; some systems play weird games with the mod time of symlinks 795 | # (eg FreeBSD returns the mod time of the symlink's containing 796 | # directory). 797 | if ( 798 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 799 | if test "$[*]" = "X"; then 800 | # -L didn't work. 801 | set X `ls -t "$srcdir/configure" conftest.file` 802 | fi 803 | rm -f conftest.file 804 | if test "$[*]" != "X $srcdir/configure conftest.file" \ 805 | && test "$[*]" != "X conftest.file $srcdir/configure"; then 806 | 807 | # If neither matched, then we have a broken ls. This can happen 808 | # if, for instance, CONFIG_SHELL is bash and it inherits a 809 | # broken ls alias from the environment. This has actually 810 | # happened. Such a system could not be considered "sane". 811 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 812 | alias in your environment]) 813 | fi 814 | 815 | test "$[2]" = conftest.file 816 | ) 817 | then 818 | # Ok. 819 | : 820 | else 821 | AC_MSG_ERROR([newly created file is older than distributed files! 822 | Check your system clock]) 823 | fi 824 | AC_MSG_RESULT(yes)]) 825 | 826 | # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. 827 | # 828 | # This file is free software; the Free Software Foundation 829 | # gives unlimited permission to copy and/or distribute it, 830 | # with or without modifications, as long as this notice is preserved. 831 | 832 | # serial 1 833 | 834 | # AM_PROG_INSTALL_STRIP 835 | # --------------------- 836 | # One issue with vendor `install' (even GNU) is that you can't 837 | # specify the program used to strip binaries. This is especially 838 | # annoying in cross-compiling environments, where the build's strip 839 | # is unlikely to handle the host's binaries. 840 | # Fortunately install-sh will honor a STRIPPROG variable, so we 841 | # always use install-sh in `make install-strip', and initialize 842 | # STRIPPROG with the value of the STRIP variable (set by the user). 843 | AC_DEFUN([AM_PROG_INSTALL_STRIP], 844 | [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 845 | # Installed binaries are usually stripped using `strip' when the user 846 | # run `make install-strip'. However `strip' might not be the right 847 | # tool to use in cross-compilation environments, therefore Automake 848 | # will honor the `STRIP' environment variable to overrule this program. 849 | dnl Don't test for $cross_compiling = yes, because it might be `maybe'. 850 | if test "$cross_compiling" != no; then 851 | AC_CHECK_TOOL([STRIP], [strip], :) 852 | fi 853 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 854 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) 855 | 856 | # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. 857 | # 858 | # This file is free software; the Free Software Foundation 859 | # gives unlimited permission to copy and/or distribute it, 860 | # with or without modifications, as long as this notice is preserved. 861 | 862 | # serial 3 863 | 864 | # _AM_SUBST_NOTMAKE(VARIABLE) 865 | # --------------------------- 866 | # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 867 | # This macro is traced by Automake. 868 | AC_DEFUN([_AM_SUBST_NOTMAKE]) 869 | 870 | # AM_SUBST_NOTMAKE(VARIABLE) 871 | # -------------------------- 872 | # Public sister of _AM_SUBST_NOTMAKE. 873 | AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 874 | 875 | # Check how to create a tarball. -*- Autoconf -*- 876 | 877 | # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. 878 | # 879 | # This file is free software; the Free Software Foundation 880 | # gives unlimited permission to copy and/or distribute it, 881 | # with or without modifications, as long as this notice is preserved. 882 | 883 | # serial 2 884 | 885 | # _AM_PROG_TAR(FORMAT) 886 | # -------------------- 887 | # Check how to create a tarball in format FORMAT. 888 | # FORMAT should be one of `v7', `ustar', or `pax'. 889 | # 890 | # Substitute a variable $(am__tar) that is a command 891 | # writing to stdout a FORMAT-tarball containing the directory 892 | # $tardir. 893 | # tardir=directory && $(am__tar) > result.tar 894 | # 895 | # Substitute a variable $(am__untar) that extract such 896 | # a tarball read from stdin. 897 | # $(am__untar) < result.tar 898 | AC_DEFUN([_AM_PROG_TAR], 899 | [# Always define AMTAR for backward compatibility. Yes, it's still used 900 | # in the wild :-( We should find a proper way to deprecate it ... 901 | AC_SUBST([AMTAR], ['$${TAR-tar}']) 902 | m4_if([$1], [v7], 903 | [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], 904 | [m4_case([$1], [ustar],, [pax],, 905 | [m4_fatal([Unknown tar format])]) 906 | AC_MSG_CHECKING([how to create a $1 tar archive]) 907 | # Loop over all known methods to create a tar archive until one works. 908 | _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 909 | _am_tools=${am_cv_prog_tar_$1-$_am_tools} 910 | # Do not fold the above two line into one, because Tru64 sh and 911 | # Solaris sh will not grok spaces in the rhs of `-'. 912 | for _am_tool in $_am_tools 913 | do 914 | case $_am_tool in 915 | gnutar) 916 | for _am_tar in tar gnutar gtar; 917 | do 918 | AM_RUN_LOG([$_am_tar --version]) && break 919 | done 920 | am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 921 | am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 922 | am__untar="$_am_tar -xf -" 923 | ;; 924 | plaintar) 925 | # Must skip GNU tar: if it does not support --format= it doesn't create 926 | # ustar tarball either. 927 | (tar --version) >/dev/null 2>&1 && continue 928 | am__tar='tar chf - "$$tardir"' 929 | am__tar_='tar chf - "$tardir"' 930 | am__untar='tar xf -' 931 | ;; 932 | pax) 933 | am__tar='pax -L -x $1 -w "$$tardir"' 934 | am__tar_='pax -L -x $1 -w "$tardir"' 935 | am__untar='pax -r' 936 | ;; 937 | cpio) 938 | am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 939 | am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 940 | am__untar='cpio -i -H $1 -d' 941 | ;; 942 | none) 943 | am__tar=false 944 | am__tar_=false 945 | am__untar=false 946 | ;; 947 | esac 948 | 949 | # If the value was cached, stop now. We just wanted to have am__tar 950 | # and am__untar set. 951 | test -n "${am_cv_prog_tar_$1}" && break 952 | 953 | # tar/untar a dummy directory, and stop if the command works 954 | rm -rf conftest.dir 955 | mkdir conftest.dir 956 | echo GrepMe > conftest.dir/file 957 | AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 958 | rm -rf conftest.dir 959 | if test -s conftest.tar; then 960 | AM_RUN_LOG([$am__untar /dev/null 2>&1 && break 962 | fi 963 | done 964 | rm -rf conftest.dir 965 | 966 | AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 967 | AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 968 | AC_SUBST([am__tar]) 969 | AC_SUBST([am__untar]) 970 | ]) # _AM_PROG_TAR 971 | 972 | m4_include([m4/libtool.m4]) 973 | m4_include([m4/ltoptions.m4]) 974 | m4_include([m4/ltsugar.m4]) 975 | m4_include([m4/ltversion.m4]) 976 | m4_include([m4/lt~obsolete.m4]) 977 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define if building universal (internal helper macro) */ 4 | #undef AC_APPLE_UNIVERSAL_BUILD 5 | 6 | /* Define to 1 if the compiler supports __builtin_expect. */ 7 | #undef HAVE_BUILTIN_EXPECT 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_DLFCN_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_INTTYPES_H 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_MEMORY_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_STDINT_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_STDLIB_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STRINGS_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_STRING_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_SYS_STAT_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_SYS_TYPES_H 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #undef HAVE_UNISTD_H 38 | 39 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 40 | */ 41 | #undef LT_OBJDIR 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #undef PACKAGE_BUGREPORT 45 | 46 | /* Define to the full name of this package. */ 47 | #undef PACKAGE_NAME 48 | 49 | /* Define to the full name and version of this package. */ 50 | #undef PACKAGE_STRING 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #undef PACKAGE_TARNAME 54 | 55 | /* Define to the home page for this package. */ 56 | #undef PACKAGE_URL 57 | 58 | /* Define to the version of this package. */ 59 | #undef PACKAGE_VERSION 60 | 61 | /* Define to 1 if you have the ANSI C header files. */ 62 | #undef STDC_HEADERS 63 | 64 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 65 | significant byte first (like Motorola and SPARC, unlike Intel). */ 66 | #if defined AC_APPLE_UNIVERSAL_BUILD 67 | # if defined __BIG_ENDIAN__ 68 | # define WORDS_BIGENDIAN 1 69 | # endif 70 | #else 71 | # ifndef WORDS_BIGENDIAN 72 | # undef WORDS_BIGENDIAN 73 | # endif 74 | #endif 75 | 76 | /* Define for Solaris 2.5.1 so the uint32_t typedef from , 77 | , or is not used. If the typedef were allowed, the 78 | #define below would cause a syntax error. */ 79 | #undef _UINT32_T 80 | 81 | /* Define for Solaris 2.5.1 so the uint64_t typedef from , 82 | , or is not used. If the typedef were allowed, the 83 | #define below would cause a syntax error. */ 84 | #undef _UINT64_T 85 | 86 | /* Define for Solaris 2.5.1 so the uint8_t typedef from , 87 | , or is not used. If the typedef were allowed, the 88 | #define below would cause a syntax error. */ 89 | #undef _UINT8_T 90 | 91 | /* Define to `__inline__' or `__inline' if that's what the C compiler 92 | calls it, or to nothing if 'inline' is not supported under any name. */ 93 | #ifndef __cplusplus 94 | #undef inline 95 | #endif 96 | 97 | /* Define to `unsigned int' if does not define. */ 98 | #undef size_t 99 | 100 | /* Define to `int' if does not define. */ 101 | #undef ssize_t 102 | 103 | /* Define to the type of an unsigned integer type of width exactly 32 bits if 104 | such a type exists and the standard includes do not define it. */ 105 | #undef uint32_t 106 | 107 | /* Define to the type of an unsigned integer type of width exactly 64 bits if 108 | such a type exists and the standard includes do not define it. */ 109 | #undef uint64_t 110 | 111 | /* Define to the type of an unsigned integer type of width exactly 8 bits if 112 | such a type exists and the standard includes do not define it. */ 113 | #undef uint8_t 114 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | m4_define([cityhash_major], [1]) 2 | m4_define([cityhash_minor], [1]) 3 | m4_define([cityhash_patchlevel], [1]) 4 | 5 | # Libtool shared library interface versions (current:revision:age) 6 | # Update this value for every release! (A:B:C will map to foo.so.(A-C).C.B) 7 | # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html 8 | m4_define([cityhash_ltversion], [4:0:0]) 9 | 10 | AC_PREREQ([2.65]) 11 | AC_INIT([CityHash], [cityhash_major.cityhash_minor.cityhash_patchlevel], [cityhash-discuss@googlegroups.com]) 12 | AC_CONFIG_HEADERS([config.h]) 13 | AM_INIT_AUTOMAKE([1.10 no-define foreign]) 14 | LT_PREREQ([2.2]) 15 | LT_INIT 16 | 17 | AC_CONFIG_FILES([Makefile 18 | src/Makefile]) 19 | AC_CONFIG_SRCDIR([src/city.h]) 20 | AC_CONFIG_MACRO_DIR([m4]) 21 | 22 | AC_ARG_ENABLE([sse4.2], 23 | AS_HELP_STRING("Build CityHash variants that depend on the _mm_crc32_u64 intrinsic."), 24 | [ cityhash_sse42=true ], 25 | []) 26 | AM_CONDITIONAL([SSE42], [test x$cityhash_sse42 = xtrue ]) 27 | 28 | # Checks for programs. 29 | AC_PROG_CXX 30 | AC_LANG([C++]) 31 | AC_C_BIGENDIAN 32 | 33 | # Checks for libraries. 34 | 35 | # Checks for header files. 36 | AC_CHECK_HEADERS([stdint.h stdlib.h]) 37 | 38 | # Checks for typedefs, structures, and compiler characteristics. 39 | AC_C_INLINE 40 | AC_TYPE_SIZE_T 41 | AC_TYPE_SSIZE_T 42 | AC_TYPE_UINT32_T 43 | AC_TYPE_UINT64_T 44 | AC_TYPE_UINT8_T 45 | 46 | # Check for __builtin_expect 47 | AC_MSG_CHECKING([if the compiler supports __builtin_expect]) 48 | AC_COMPILE_IFELSE( 49 | [AC_LANG_PROGRAM(, [[return __builtin_expect(1, 1) ? 1 : 0;]])], 50 | [ 51 | cityhash_have_builtin_expect=yes 52 | AC_MSG_RESULT([yes]) 53 | ], [ 54 | cityhash_have_builtin_expect=no 55 | AC_MSG_RESULT([no]) 56 | ]) 57 | if test x$cityhash_have_builtin_expect = xyes ; then 58 | AC_DEFINE([HAVE_BUILTIN_EXPECT], [1], [Define to 1 if the compiler supports __builtin_expect.]) 59 | fi 60 | 61 | AC_OUTPUT 62 | 63 | echo \ 64 | "------------------------------------------------- 65 | 66 | ${PACKAGE_NAME} Version ${PACKAGE_VERSION} 67 | 68 | Prefix: '${prefix}'. 69 | Compiler: '${CXX} ${CXXFLAGS}' 70 | 71 | Now type 'make @<:@@:>@' 72 | where the optional is: 73 | all - build everything 74 | check - build and run tests 75 | install - install everything 76 | 77 | --------------------------------------------------" 78 | -------------------------------------------------------------------------------- /depcomp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # depcomp - compile a program generating dependencies as side-effects 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free 7 | # Software Foundation, Inc. 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 | # Originally written by Alexandre Oliva . 28 | 29 | case $1 in 30 | '') 31 | echo "$0: No command. Try \`$0 --help' for more information." 1>&2 32 | exit 1; 33 | ;; 34 | -h | --h*) 35 | cat <<\EOF 36 | Usage: depcomp [--help] [--version] PROGRAM [ARGS] 37 | 38 | Run PROGRAMS ARGS to compile a file, generating dependencies 39 | as side-effects. 40 | 41 | Environment variables: 42 | depmode Dependency tracking mode. 43 | source Source file read by `PROGRAMS ARGS'. 44 | object Object file output by `PROGRAMS ARGS'. 45 | DEPDIR directory where to store dependencies. 46 | depfile Dependency file to output. 47 | tmpdepfile Temporary file to use when outputing dependencies. 48 | libtool Whether libtool is used (yes/no). 49 | 50 | Report bugs to . 51 | EOF 52 | exit $? 53 | ;; 54 | -v | --v*) 55 | echo "depcomp $scriptversion" 56 | exit $? 57 | ;; 58 | esac 59 | 60 | if test -z "$depmode" || test -z "$source" || test -z "$object"; then 61 | echo "depcomp: Variables source, object and depmode must be set" 1>&2 62 | exit 1 63 | fi 64 | 65 | # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. 66 | depfile=${depfile-`echo "$object" | 67 | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} 68 | tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} 69 | 70 | rm -f "$tmpdepfile" 71 | 72 | # Some modes work just like other modes, but use different flags. We 73 | # parameterize here, but still list the modes in the big case below, 74 | # to make depend.m4 easier to write. Note that we *cannot* use a case 75 | # here, because this file can only contain one case statement. 76 | if test "$depmode" = hp; then 77 | # HP compiler uses -M and no extra arg. 78 | gccflag=-M 79 | depmode=gcc 80 | fi 81 | 82 | if test "$depmode" = dashXmstdout; then 83 | # This is just like dashmstdout with a different argument. 84 | dashmflag=-xM 85 | depmode=dashmstdout 86 | fi 87 | 88 | cygpath_u="cygpath -u -f -" 89 | if test "$depmode" = msvcmsys; then 90 | # This is just like msvisualcpp but w/o cygpath translation. 91 | # Just convert the backslash-escaped backslashes to single forward 92 | # slashes to satisfy depend.m4 93 | cygpath_u="sed s,\\\\\\\\,/,g" 94 | depmode=msvisualcpp 95 | fi 96 | 97 | case "$depmode" in 98 | gcc3) 99 | ## gcc 3 implements dependency tracking that does exactly what 100 | ## we want. Yay! Note: for some reason libtool 1.4 doesn't like 101 | ## it if -MD -MP comes after the -MF stuff. Hmm. 102 | ## Unfortunately, FreeBSD c89 acceptance of flags depends upon 103 | ## the command line argument order; so add the flags where they 104 | ## appear in depend2.am. Note that the slowdown incurred here 105 | ## affects only configure: in makefiles, %FASTDEP% shortcuts this. 106 | for arg 107 | do 108 | case $arg in 109 | -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; 110 | *) set fnord "$@" "$arg" ;; 111 | esac 112 | shift # fnord 113 | shift # $arg 114 | done 115 | "$@" 116 | stat=$? 117 | if test $stat -eq 0; then : 118 | else 119 | rm -f "$tmpdepfile" 120 | exit $stat 121 | fi 122 | mv "$tmpdepfile" "$depfile" 123 | ;; 124 | 125 | gcc) 126 | ## There are various ways to get dependency output from gcc. Here's 127 | ## why we pick this rather obscure method: 128 | ## - Don't want to use -MD because we'd like the dependencies to end 129 | ## up in a subdir. Having to rename by hand is ugly. 130 | ## (We might end up doing this anyway to support other compilers.) 131 | ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like 132 | ## -MM, not -M (despite what the docs say). 133 | ## - Using -M directly means running the compiler twice (even worse 134 | ## than renaming). 135 | if test -z "$gccflag"; then 136 | gccflag=-MD, 137 | fi 138 | "$@" -Wp,"$gccflag$tmpdepfile" 139 | stat=$? 140 | if test $stat -eq 0; then : 141 | else 142 | rm -f "$tmpdepfile" 143 | exit $stat 144 | fi 145 | rm -f "$depfile" 146 | echo "$object : \\" > "$depfile" 147 | alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 148 | ## The second -e expression handles DOS-style file names with drive letters. 149 | sed -e 's/^[^:]*: / /' \ 150 | -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" 151 | ## This next piece of magic avoids the `deleted header file' problem. 152 | ## The problem is that when a header file which appears in a .P file 153 | ## is deleted, the dependency causes make to die (because there is 154 | ## typically no way to rebuild the header). We avoid this by adding 155 | ## dummy dependencies for each header file. Too bad gcc doesn't do 156 | ## this for us directly. 157 | tr ' ' ' 158 | ' < "$tmpdepfile" | 159 | ## Some versions of gcc put a space before the `:'. On the theory 160 | ## that the space means something, we add a space to the output as 161 | ## well. 162 | ## Some versions of the HPUX 10.20 sed can't process this invocation 163 | ## correctly. Breaking it into two sed invocations is a workaround. 164 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 165 | rm -f "$tmpdepfile" 166 | ;; 167 | 168 | hp) 169 | # This case exists only to let depend.m4 do its work. It works by 170 | # looking at the text of this script. This case will never be run, 171 | # since it is checked for above. 172 | exit 1 173 | ;; 174 | 175 | sgi) 176 | if test "$libtool" = yes; then 177 | "$@" "-Wp,-MDupdate,$tmpdepfile" 178 | else 179 | "$@" -MDupdate "$tmpdepfile" 180 | fi 181 | stat=$? 182 | if test $stat -eq 0; then : 183 | else 184 | rm -f "$tmpdepfile" 185 | exit $stat 186 | fi 187 | rm -f "$depfile" 188 | 189 | if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files 190 | echo "$object : \\" > "$depfile" 191 | 192 | # Clip off the initial element (the dependent). Don't try to be 193 | # clever and replace this with sed code, as IRIX sed won't handle 194 | # lines with more than a fixed number of characters (4096 in 195 | # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; 196 | # the IRIX cc adds comments like `#:fec' to the end of the 197 | # dependency line. 198 | tr ' ' ' 199 | ' < "$tmpdepfile" \ 200 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ 201 | tr ' 202 | ' ' ' >> "$depfile" 203 | echo >> "$depfile" 204 | 205 | # The second pass generates a dummy entry for each header file. 206 | tr ' ' ' 207 | ' < "$tmpdepfile" \ 208 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ 209 | >> "$depfile" 210 | else 211 | # The sourcefile does not contain any dependencies, so just 212 | # store a dummy comment line, to avoid errors with the Makefile 213 | # "include basename.Plo" scheme. 214 | echo "#dummy" > "$depfile" 215 | fi 216 | rm -f "$tmpdepfile" 217 | ;; 218 | 219 | aix) 220 | # The C for AIX Compiler uses -M and outputs the dependencies 221 | # in a .u file. In older versions, this file always lives in the 222 | # current directory. Also, the AIX compiler puts `$object:' at the 223 | # start of each line; $object doesn't have directory information. 224 | # Version 6 uses the directory in both cases. 225 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 226 | test "x$dir" = "x$object" && dir= 227 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 228 | if test "$libtool" = yes; then 229 | tmpdepfile1=$dir$base.u 230 | tmpdepfile2=$base.u 231 | tmpdepfile3=$dir.libs/$base.u 232 | "$@" -Wc,-M 233 | else 234 | tmpdepfile1=$dir$base.u 235 | tmpdepfile2=$dir$base.u 236 | tmpdepfile3=$dir$base.u 237 | "$@" -M 238 | fi 239 | stat=$? 240 | 241 | if test $stat -eq 0; then : 242 | else 243 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 244 | exit $stat 245 | fi 246 | 247 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 248 | do 249 | test -f "$tmpdepfile" && break 250 | done 251 | if test -f "$tmpdepfile"; then 252 | # Each line is of the form `foo.o: dependent.h'. 253 | # Do two passes, one to just change these to 254 | # `$object: dependent.h' and one to simply `dependent.h:'. 255 | sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 256 | # That's a tab and a space in the []. 257 | sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 258 | else 259 | # The sourcefile does not contain any dependencies, so just 260 | # store a dummy comment line, to avoid errors with the Makefile 261 | # "include basename.Plo" scheme. 262 | echo "#dummy" > "$depfile" 263 | fi 264 | rm -f "$tmpdepfile" 265 | ;; 266 | 267 | icc) 268 | # Intel's C compiler understands `-MD -MF file'. However on 269 | # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c 270 | # ICC 7.0 will fill foo.d with something like 271 | # foo.o: sub/foo.c 272 | # foo.o: sub/foo.h 273 | # which is wrong. We want: 274 | # sub/foo.o: sub/foo.c 275 | # sub/foo.o: sub/foo.h 276 | # sub/foo.c: 277 | # sub/foo.h: 278 | # ICC 7.1 will output 279 | # foo.o: sub/foo.c sub/foo.h 280 | # and will wrap long lines using \ : 281 | # foo.o: sub/foo.c ... \ 282 | # sub/foo.h ... \ 283 | # ... 284 | 285 | "$@" -MD -MF "$tmpdepfile" 286 | stat=$? 287 | if test $stat -eq 0; then : 288 | else 289 | rm -f "$tmpdepfile" 290 | exit $stat 291 | fi 292 | rm -f "$depfile" 293 | # Each line is of the form `foo.o: dependent.h', 294 | # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. 295 | # Do two passes, one to just change these to 296 | # `$object: dependent.h' and one to simply `dependent.h:'. 297 | sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" 298 | # Some versions of the HPUX 10.20 sed can't process this invocation 299 | # correctly. Breaking it into two sed invocations is a workaround. 300 | sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | 301 | sed -e 's/$/ :/' >> "$depfile" 302 | rm -f "$tmpdepfile" 303 | ;; 304 | 305 | hp2) 306 | # The "hp" stanza above does not work with aCC (C++) and HP's ia64 307 | # compilers, which have integrated preprocessors. The correct option 308 | # to use with these is +Maked; it writes dependencies to a file named 309 | # 'foo.d', which lands next to the object file, wherever that 310 | # happens to be. 311 | # Much of this is similar to the tru64 case; see comments there. 312 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 313 | test "x$dir" = "x$object" && dir= 314 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 315 | if test "$libtool" = yes; then 316 | tmpdepfile1=$dir$base.d 317 | tmpdepfile2=$dir.libs/$base.d 318 | "$@" -Wc,+Maked 319 | else 320 | tmpdepfile1=$dir$base.d 321 | tmpdepfile2=$dir$base.d 322 | "$@" +Maked 323 | fi 324 | stat=$? 325 | if test $stat -eq 0; then : 326 | else 327 | rm -f "$tmpdepfile1" "$tmpdepfile2" 328 | exit $stat 329 | fi 330 | 331 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" 332 | do 333 | test -f "$tmpdepfile" && break 334 | done 335 | if test -f "$tmpdepfile"; then 336 | sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" 337 | # Add `dependent.h:' lines. 338 | sed -ne '2,${ 339 | s/^ *// 340 | s/ \\*$// 341 | s/$/:/ 342 | p 343 | }' "$tmpdepfile" >> "$depfile" 344 | else 345 | echo "#dummy" > "$depfile" 346 | fi 347 | rm -f "$tmpdepfile" "$tmpdepfile2" 348 | ;; 349 | 350 | tru64) 351 | # The Tru64 compiler uses -MD to generate dependencies as a side 352 | # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. 353 | # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 354 | # dependencies in `foo.d' instead, so we check for that too. 355 | # Subdirectories are respected. 356 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 357 | test "x$dir" = "x$object" && dir= 358 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 359 | 360 | if test "$libtool" = yes; then 361 | # With Tru64 cc, shared objects can also be used to make a 362 | # static library. This mechanism is used in libtool 1.4 series to 363 | # handle both shared and static libraries in a single compilation. 364 | # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. 365 | # 366 | # With libtool 1.5 this exception was removed, and libtool now 367 | # generates 2 separate objects for the 2 libraries. These two 368 | # compilations output dependencies in $dir.libs/$base.o.d and 369 | # in $dir$base.o.d. We have to check for both files, because 370 | # one of the two compilations can be disabled. We should prefer 371 | # $dir$base.o.d over $dir.libs/$base.o.d because the latter is 372 | # automatically cleaned when .libs/ is deleted, while ignoring 373 | # the former would cause a distcleancheck panic. 374 | tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 375 | tmpdepfile2=$dir$base.o.d # libtool 1.5 376 | tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 377 | tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 378 | "$@" -Wc,-MD 379 | else 380 | tmpdepfile1=$dir$base.o.d 381 | tmpdepfile2=$dir$base.d 382 | tmpdepfile3=$dir$base.d 383 | tmpdepfile4=$dir$base.d 384 | "$@" -MD 385 | fi 386 | 387 | stat=$? 388 | if test $stat -eq 0; then : 389 | else 390 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 391 | exit $stat 392 | fi 393 | 394 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 395 | do 396 | test -f "$tmpdepfile" && break 397 | done 398 | if test -f "$tmpdepfile"; then 399 | sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 400 | # That's a tab and a space in the []. 401 | sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 402 | else 403 | echo "#dummy" > "$depfile" 404 | fi 405 | rm -f "$tmpdepfile" 406 | ;; 407 | 408 | #nosideeffect) 409 | # This comment above is used by automake to tell side-effect 410 | # dependency tracking mechanisms from slower ones. 411 | 412 | dashmstdout) 413 | # Important note: in order to support this mode, a compiler *must* 414 | # always write the preprocessed file to stdout, regardless of -o. 415 | "$@" || exit $? 416 | 417 | # Remove the call to Libtool. 418 | if test "$libtool" = yes; then 419 | while test "X$1" != 'X--mode=compile'; do 420 | shift 421 | done 422 | shift 423 | fi 424 | 425 | # Remove `-o $object'. 426 | IFS=" " 427 | for arg 428 | do 429 | case $arg in 430 | -o) 431 | shift 432 | ;; 433 | $object) 434 | shift 435 | ;; 436 | *) 437 | set fnord "$@" "$arg" 438 | shift # fnord 439 | shift # $arg 440 | ;; 441 | esac 442 | done 443 | 444 | test -z "$dashmflag" && dashmflag=-M 445 | # Require at least two characters before searching for `:' 446 | # in the target name. This is to cope with DOS-style filenames: 447 | # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. 448 | "$@" $dashmflag | 449 | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" 450 | rm -f "$depfile" 451 | cat < "$tmpdepfile" > "$depfile" 452 | tr ' ' ' 453 | ' < "$tmpdepfile" | \ 454 | ## Some versions of the HPUX 10.20 sed can't process this invocation 455 | ## correctly. Breaking it into two sed invocations is a workaround. 456 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 457 | rm -f "$tmpdepfile" 458 | ;; 459 | 460 | dashXmstdout) 461 | # This case only exists to satisfy depend.m4. It is never actually 462 | # run, as this mode is specially recognized in the preamble. 463 | exit 1 464 | ;; 465 | 466 | makedepend) 467 | "$@" || exit $? 468 | # Remove any Libtool call 469 | if test "$libtool" = yes; then 470 | while test "X$1" != 'X--mode=compile'; do 471 | shift 472 | done 473 | shift 474 | fi 475 | # X makedepend 476 | shift 477 | cleared=no eat=no 478 | for arg 479 | do 480 | case $cleared in 481 | no) 482 | set ""; shift 483 | cleared=yes ;; 484 | esac 485 | if test $eat = yes; then 486 | eat=no 487 | continue 488 | fi 489 | case "$arg" in 490 | -D*|-I*) 491 | set fnord "$@" "$arg"; shift ;; 492 | # Strip any option that makedepend may not understand. Remove 493 | # the object too, otherwise makedepend will parse it as a source file. 494 | -arch) 495 | eat=yes ;; 496 | -*|$object) 497 | ;; 498 | *) 499 | set fnord "$@" "$arg"; shift ;; 500 | esac 501 | done 502 | obj_suffix=`echo "$object" | sed 's/^.*\././'` 503 | touch "$tmpdepfile" 504 | ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" 505 | rm -f "$depfile" 506 | cat < "$tmpdepfile" > "$depfile" 507 | sed '1,2d' "$tmpdepfile" | tr ' ' ' 508 | ' | \ 509 | ## Some versions of the HPUX 10.20 sed can't process this invocation 510 | ## correctly. Breaking it into two sed invocations is a workaround. 511 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 512 | rm -f "$tmpdepfile" "$tmpdepfile".bak 513 | ;; 514 | 515 | cpp) 516 | # Important note: in order to support this mode, a compiler *must* 517 | # always write the preprocessed file to stdout. 518 | "$@" || exit $? 519 | 520 | # Remove the call to Libtool. 521 | if test "$libtool" = yes; then 522 | while test "X$1" != 'X--mode=compile'; do 523 | shift 524 | done 525 | shift 526 | fi 527 | 528 | # Remove `-o $object'. 529 | IFS=" " 530 | for arg 531 | do 532 | case $arg in 533 | -o) 534 | shift 535 | ;; 536 | $object) 537 | shift 538 | ;; 539 | *) 540 | set fnord "$@" "$arg" 541 | shift # fnord 542 | shift # $arg 543 | ;; 544 | esac 545 | done 546 | 547 | "$@" -E | 548 | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 549 | -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | 550 | sed '$ s: \\$::' > "$tmpdepfile" 551 | rm -f "$depfile" 552 | echo "$object : \\" > "$depfile" 553 | cat < "$tmpdepfile" >> "$depfile" 554 | sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" 555 | rm -f "$tmpdepfile" 556 | ;; 557 | 558 | msvisualcpp) 559 | # Important note: in order to support this mode, a compiler *must* 560 | # always write the preprocessed file to stdout. 561 | "$@" || exit $? 562 | 563 | # Remove the call to Libtool. 564 | if test "$libtool" = yes; then 565 | while test "X$1" != 'X--mode=compile'; do 566 | shift 567 | done 568 | shift 569 | fi 570 | 571 | IFS=" " 572 | for arg 573 | do 574 | case "$arg" in 575 | -o) 576 | shift 577 | ;; 578 | $object) 579 | shift 580 | ;; 581 | "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") 582 | set fnord "$@" 583 | shift 584 | shift 585 | ;; 586 | *) 587 | set fnord "$@" "$arg" 588 | shift 589 | shift 590 | ;; 591 | esac 592 | done 593 | "$@" -E 2>/dev/null | 594 | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" 595 | rm -f "$depfile" 596 | echo "$object : \\" > "$depfile" 597 | sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" 598 | echo " " >> "$depfile" 599 | sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" 600 | rm -f "$tmpdepfile" 601 | ;; 602 | 603 | msvcmsys) 604 | # This case exists only to let depend.m4 do its work. It works by 605 | # looking at the text of this script. This case will never be run, 606 | # since it is checked for above. 607 | exit 1 608 | ;; 609 | 610 | none) 611 | exec "$@" 612 | ;; 613 | 614 | *) 615 | echo "Unknown depmode $depmode" 1>&2 616 | exit 1 617 | ;; 618 | esac 619 | 620 | exit 0 621 | 622 | # Local Variables: 623 | # mode: shell-script 624 | # sh-indentation: 2 625 | # eval: (add-hook 'write-file-hooks 'time-stamp) 626 | # time-stamp-start: "scriptversion=" 627 | # time-stamp-format: "%:y-%02m-%02d.%02H" 628 | # time-stamp-time-zone: "UTC" 629 | # time-stamp-end: "; # UTC" 630 | # End: 631 | -------------------------------------------------------------------------------- /install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # install - install a program, script, or datafile 3 | 4 | scriptversion=2009-04-28.21; # 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 | shift;; 160 | 161 | -T) no_target_directory=true;; 162 | 163 | --version) echo "$0 $scriptversion"; exit $?;; 164 | 165 | --) shift 166 | break;; 167 | 168 | -*) echo "$0: invalid option: $1" >&2 169 | exit 1;; 170 | 171 | *) break;; 172 | esac 173 | shift 174 | done 175 | 176 | if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then 177 | # When -d is used, all remaining arguments are directories to create. 178 | # When -t is used, the destination is already specified. 179 | # Otherwise, the last argument is the destination. Remove it from $@. 180 | for arg 181 | do 182 | if test -n "$dst_arg"; then 183 | # $@ is not empty: it contains at least $arg. 184 | set fnord "$@" "$dst_arg" 185 | shift # fnord 186 | fi 187 | shift # arg 188 | dst_arg=$arg 189 | done 190 | fi 191 | 192 | if test $# -eq 0; then 193 | if test -z "$dir_arg"; then 194 | echo "$0: no input file specified." >&2 195 | exit 1 196 | fi 197 | # It's OK to call `install-sh -d' without argument. 198 | # This can happen when creating conditional directories. 199 | exit 0 200 | fi 201 | 202 | if test -z "$dir_arg"; then 203 | trap '(exit $?); exit' 1 2 13 15 204 | 205 | # Set umask so as not to create temps with too-generous modes. 206 | # However, 'strip' requires both read and write access to temps. 207 | case $mode in 208 | # Optimize common cases. 209 | *644) cp_umask=133;; 210 | *755) cp_umask=22;; 211 | 212 | *[0-7]) 213 | if test -z "$stripcmd"; then 214 | u_plus_rw= 215 | else 216 | u_plus_rw='% 200' 217 | fi 218 | cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; 219 | *) 220 | if test -z "$stripcmd"; then 221 | u_plus_rw= 222 | else 223 | u_plus_rw=,u+rw 224 | fi 225 | cp_umask=$mode$u_plus_rw;; 226 | esac 227 | fi 228 | 229 | for src 230 | do 231 | # Protect names starting with `-'. 232 | case $src in 233 | -*) src=./$src;; 234 | esac 235 | 236 | if test -n "$dir_arg"; then 237 | dst=$src 238 | dstdir=$dst 239 | test -d "$dstdir" 240 | dstdir_status=$? 241 | else 242 | 243 | # Waiting for this to be detected by the "$cpprog $src $dsttmp" command 244 | # might cause directories to be created, which would be especially bad 245 | # if $src (and thus $dsttmp) contains '*'. 246 | if test ! -f "$src" && test ! -d "$src"; then 247 | echo "$0: $src does not exist." >&2 248 | exit 1 249 | fi 250 | 251 | if test -z "$dst_arg"; then 252 | echo "$0: no destination specified." >&2 253 | exit 1 254 | fi 255 | 256 | dst=$dst_arg 257 | # Protect names starting with `-'. 258 | case $dst in 259 | -*) dst=./$dst;; 260 | esac 261 | 262 | # If destination is a directory, append the input filename; won't work 263 | # if double slashes aren't ignored. 264 | if test -d "$dst"; then 265 | if test -n "$no_target_directory"; then 266 | echo "$0: $dst_arg: Is a directory" >&2 267 | exit 1 268 | fi 269 | dstdir=$dst 270 | dst=$dstdir/`basename "$src"` 271 | dstdir_status=0 272 | else 273 | # Prefer dirname, but fall back on a substitute if dirname fails. 274 | dstdir=` 275 | (dirname "$dst") 2>/dev/null || 276 | expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 277 | X"$dst" : 'X\(//\)[^/]' \| \ 278 | X"$dst" : 'X\(//\)$' \| \ 279 | X"$dst" : 'X\(/\)' \| . 2>/dev/null || 280 | echo X"$dst" | 281 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ 282 | s//\1/ 283 | q 284 | } 285 | /^X\(\/\/\)[^/].*/{ 286 | s//\1/ 287 | q 288 | } 289 | /^X\(\/\/\)$/{ 290 | s//\1/ 291 | q 292 | } 293 | /^X\(\/\).*/{ 294 | s//\1/ 295 | q 296 | } 297 | s/.*/./; q' 298 | ` 299 | 300 | test -d "$dstdir" 301 | dstdir_status=$? 302 | fi 303 | fi 304 | 305 | obsolete_mkdir_used=false 306 | 307 | if test $dstdir_status != 0; then 308 | case $posix_mkdir in 309 | '') 310 | # Create intermediate dirs using mode 755 as modified by the umask. 311 | # This is like FreeBSD 'install' as of 1997-10-28. 312 | umask=`umask` 313 | case $stripcmd.$umask in 314 | # Optimize common cases. 315 | *[2367][2367]) mkdir_umask=$umask;; 316 | .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; 317 | 318 | *[0-7]) 319 | mkdir_umask=`expr $umask + 22 \ 320 | - $umask % 100 % 40 + $umask % 20 \ 321 | - $umask % 10 % 4 + $umask % 2 322 | `;; 323 | *) mkdir_umask=$umask,go-w;; 324 | esac 325 | 326 | # With -d, create the new directory with the user-specified mode. 327 | # Otherwise, rely on $mkdir_umask. 328 | if test -n "$dir_arg"; then 329 | mkdir_mode=-m$mode 330 | else 331 | mkdir_mode= 332 | fi 333 | 334 | posix_mkdir=false 335 | case $umask in 336 | *[123567][0-7][0-7]) 337 | # POSIX mkdir -p sets u+wx bits regardless of umask, which 338 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. 339 | ;; 340 | *) 341 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ 342 | trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 343 | 344 | if (umask $mkdir_umask && 345 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 346 | then 347 | if test -z "$dir_arg" || { 348 | # Check for POSIX incompatibilities with -m. 349 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or 350 | # other-writeable bit of parent directory when it shouldn't. 351 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. 352 | ls_ld_tmpdir=`ls -ld "$tmpdir"` 353 | case $ls_ld_tmpdir in 354 | d????-?r-*) different_mode=700;; 355 | d????-?--*) different_mode=755;; 356 | *) false;; 357 | esac && 358 | $mkdirprog -m$different_mode -p -- "$tmpdir" && { 359 | ls_ld_tmpdir_1=`ls -ld "$tmpdir"` 360 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" 361 | } 362 | } 363 | then posix_mkdir=: 364 | fi 365 | rmdir "$tmpdir/d" "$tmpdir" 366 | else 367 | # Remove any dirs left behind by ancient mkdir implementations. 368 | rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null 369 | fi 370 | trap '' 0;; 371 | esac;; 372 | esac 373 | 374 | if 375 | $posix_mkdir && ( 376 | umask $mkdir_umask && 377 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" 378 | ) 379 | then : 380 | else 381 | 382 | # The umask is ridiculous, or mkdir does not conform to POSIX, 383 | # or it failed possibly due to a race condition. Create the 384 | # directory the slow way, step by step, checking for races as we go. 385 | 386 | case $dstdir in 387 | /*) prefix='/';; 388 | -*) prefix='./';; 389 | *) prefix='';; 390 | esac 391 | 392 | eval "$initialize_posix_glob" 393 | 394 | oIFS=$IFS 395 | IFS=/ 396 | $posix_glob set -f 397 | set fnord $dstdir 398 | shift 399 | $posix_glob set +f 400 | IFS=$oIFS 401 | 402 | prefixes= 403 | 404 | for d 405 | do 406 | test -z "$d" && continue 407 | 408 | prefix=$prefix$d 409 | if test -d "$prefix"; then 410 | prefixes= 411 | else 412 | if $posix_mkdir; then 413 | (umask=$mkdir_umask && 414 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break 415 | # Don't fail if two instances are running concurrently. 416 | test -d "$prefix" || exit 1 417 | else 418 | case $prefix in 419 | *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; 420 | *) qprefix=$prefix;; 421 | esac 422 | prefixes="$prefixes '$qprefix'" 423 | fi 424 | fi 425 | prefix=$prefix/ 426 | done 427 | 428 | if test -n "$prefixes"; then 429 | # Don't fail if two instances are running concurrently. 430 | (umask $mkdir_umask && 431 | eval "\$doit_exec \$mkdirprog $prefixes") || 432 | test -d "$dstdir" || exit 1 433 | obsolete_mkdir_used=true 434 | fi 435 | fi 436 | fi 437 | 438 | if test -n "$dir_arg"; then 439 | { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && 440 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && 441 | { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || 442 | test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 443 | else 444 | 445 | # Make a couple of temp file names in the proper directory. 446 | dsttmp=$dstdir/_inst.$$_ 447 | rmtmp=$dstdir/_rm.$$_ 448 | 449 | # Trap to clean up those temp files at exit. 450 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 451 | 452 | # Copy the file name to the temp name. 453 | (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && 454 | 455 | # and set any options; do chmod last to preserve setuid bits. 456 | # 457 | # If any of these fail, we abort the whole thing. If we want to 458 | # ignore errors from any of these, just make sure not to ignore 459 | # errors from the above "$doit $cpprog $src $dsttmp" command. 460 | # 461 | { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && 462 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && 463 | { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && 464 | { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && 465 | 466 | # If -C, don't bother to copy if it wouldn't change the file. 467 | if $copy_on_change && 468 | old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && 469 | new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && 470 | 471 | eval "$initialize_posix_glob" && 472 | $posix_glob set -f && 473 | set X $old && old=:$2:$4:$5:$6 && 474 | set X $new && new=:$2:$4:$5:$6 && 475 | $posix_glob set +f && 476 | 477 | test "$old" = "$new" && 478 | $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 479 | then 480 | rm -f "$dsttmp" 481 | else 482 | # Rename the file to the real destination. 483 | $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || 484 | 485 | # The rename failed, perhaps because mv can't rename something else 486 | # to itself, or perhaps because mv is so ancient that it does not 487 | # support -f. 488 | { 489 | # Now remove or move aside any old file at destination location. 490 | # We try this two ways since rm can't unlink itself on some 491 | # systems and the destination file might be busy for other 492 | # reasons. In this case, the final cleanup might fail but the new 493 | # file should still install successfully. 494 | { 495 | test ! -f "$dst" || 496 | $doit $rmcmd -f "$dst" 2>/dev/null || 497 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && 498 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } 499 | } || 500 | { echo "$0: cannot unlink or rename $dst" >&2 501 | (exit 1); exit 1 502 | } 503 | } && 504 | 505 | # Now rename the file to the real destination. 506 | $doit $mvcmd "$dsttmp" "$dst" 507 | } 508 | fi || exit 1 509 | 510 | trap '' 0 511 | fi 512 | done 513 | 514 | # Local variables: 515 | # eval: (add-hook 'write-file-hooks 'time-stamp) 516 | # time-stamp-start: "scriptversion=" 517 | # time-stamp-format: "%:y-%02m-%02d.%02H" 518 | # time-stamp-time-zone: "UTC" 519 | # time-stamp-end: "; # UTC" 520 | # End: 521 | -------------------------------------------------------------------------------- /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], 330 | [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], 331 | [pic_mode="$withval"], 332 | [pic_mode=default]) 333 | 334 | test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) 335 | 336 | _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl 337 | ])# _LT_WITH_PIC 338 | 339 | LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) 340 | LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) 341 | 342 | # Old name: 343 | AU_DEFUN([AC_LIBTOOL_PICMODE], 344 | [_LT_SET_OPTION([LT_INIT], [pic-only]) 345 | AC_DIAGNOSE([obsolete], 346 | [$0: Remove this warning and the call to _LT_SET_OPTION when you 347 | put the `pic-only' option into LT_INIT's first parameter.]) 348 | ]) 349 | 350 | dnl aclocal-1.4 backwards compatibility: 351 | dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) 352 | 353 | ## ----------------- ## 354 | ## LTDL_INIT Options ## 355 | ## ----------------- ## 356 | 357 | m4_define([_LTDL_MODE], []) 358 | LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], 359 | [m4_define([_LTDL_MODE], [nonrecursive])]) 360 | LT_OPTION_DEFINE([LTDL_INIT], [recursive], 361 | [m4_define([_LTDL_MODE], [recursive])]) 362 | LT_OPTION_DEFINE([LTDL_INIT], [subproject], 363 | [m4_define([_LTDL_MODE], [subproject])]) 364 | 365 | m4_define([_LTDL_TYPE], []) 366 | LT_OPTION_DEFINE([LTDL_INIT], [installable], 367 | [m4_define([_LTDL_TYPE], [installable])]) 368 | LT_OPTION_DEFINE([LTDL_INIT], [convenience], 369 | [m4_define([_LTDL_TYPE], [convenience])]) 370 | -------------------------------------------------------------------------------- /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 3293 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3293]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4' 20 | macro_revision='1.3293' 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 | -------------------------------------------------------------------------------- /missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 7 | # 2008, 2009 Free Software Foundation, Inc. 8 | # Originally by Fran,cois Pinard , 1996. 9 | 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, 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 | if test $# -eq 0; then 29 | echo 1>&2 "Try \`$0 --help' for more information" 30 | exit 1 31 | fi 32 | 33 | run=: 34 | sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' 35 | sed_minuso='s/.* -o \([^ ]*\).*/\1/p' 36 | 37 | # In the cases where this matters, `missing' is being run in the 38 | # srcdir already. 39 | if test -f configure.ac; then 40 | configure_ac=configure.ac 41 | else 42 | configure_ac=configure.in 43 | fi 44 | 45 | msg="missing on your system" 46 | 47 | case $1 in 48 | --run) 49 | # Try to run requested program, and just exit if it succeeds. 50 | run= 51 | shift 52 | "$@" && exit 0 53 | # Exit code 63 means version mismatch. This often happens 54 | # when the user try to use an ancient version of a tool on 55 | # a file that requires a minimum version. In this case we 56 | # we should proceed has if the program had been absent, or 57 | # if --run hadn't been passed. 58 | if test $? = 63; then 59 | run=: 60 | msg="probably too old" 61 | fi 62 | ;; 63 | 64 | -h|--h|--he|--hel|--help) 65 | echo "\ 66 | $0 [OPTION]... PROGRAM [ARGUMENT]... 67 | 68 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 69 | error status if there is no known handling for PROGRAM. 70 | 71 | Options: 72 | -h, --help display this help and exit 73 | -v, --version output version information and exit 74 | --run try to run the given command, and emulate it if it fails 75 | 76 | Supported PROGRAM values: 77 | aclocal touch file \`aclocal.m4' 78 | autoconf touch file \`configure' 79 | autoheader touch file \`config.h.in' 80 | autom4te touch the output file, or create a stub one 81 | automake touch all \`Makefile.in' files 82 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 83 | flex create \`lex.yy.c', if possible, from existing .c 84 | help2man touch the output file 85 | lex create \`lex.yy.c', if possible, from existing .c 86 | makeinfo touch the output file 87 | tar try tar, gnutar, gtar, then tar without non-portable flags 88 | yacc create \`y.tab.[ch]', if possible, from existing .[ch] 89 | 90 | Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and 91 | \`g' are ignored when checking the name. 92 | 93 | Send bug reports to ." 94 | exit $? 95 | ;; 96 | 97 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 98 | echo "missing $scriptversion (GNU Automake)" 99 | exit $? 100 | ;; 101 | 102 | -*) 103 | echo 1>&2 "$0: Unknown \`$1' option" 104 | echo 1>&2 "Try \`$0 --help' for more information" 105 | exit 1 106 | ;; 107 | 108 | esac 109 | 110 | # normalize program name to check for. 111 | program=`echo "$1" | sed ' 112 | s/^gnu-//; t 113 | s/^gnu//; t 114 | s/^g//; t'` 115 | 116 | # Now exit if we have it, but it failed. Also exit now if we 117 | # don't have it and --version was passed (most likely to detect 118 | # the program). This is about non-GNU programs, so use $1 not 119 | # $program. 120 | case $1 in 121 | lex*|yacc*) 122 | # Not GNU programs, they don't have --version. 123 | ;; 124 | 125 | tar*) 126 | if test -n "$run"; then 127 | echo 1>&2 "ERROR: \`tar' requires --run" 128 | exit 1 129 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 130 | exit 1 131 | fi 132 | ;; 133 | 134 | *) 135 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 136 | # We have it, but it failed. 137 | exit 1 138 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 139 | # Could not run --version or --help. This is probably someone 140 | # running `$TOOL --version' or `$TOOL --help' to check whether 141 | # $TOOL exists and not knowing $TOOL uses missing. 142 | exit 1 143 | fi 144 | ;; 145 | esac 146 | 147 | # If it does not exist, or fails to run (possibly an outdated version), 148 | # try to emulate it. 149 | case $program in 150 | aclocal*) 151 | echo 1>&2 "\ 152 | WARNING: \`$1' is $msg. You should only need it if 153 | you modified \`acinclude.m4' or \`${configure_ac}'. You might want 154 | to install the \`Automake' and \`Perl' packages. Grab them from 155 | any GNU archive site." 156 | touch aclocal.m4 157 | ;; 158 | 159 | autoconf*) 160 | echo 1>&2 "\ 161 | WARNING: \`$1' is $msg. You should only need it if 162 | you modified \`${configure_ac}'. You might want to install the 163 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 164 | archive site." 165 | touch configure 166 | ;; 167 | 168 | autoheader*) 169 | echo 1>&2 "\ 170 | WARNING: \`$1' is $msg. You should only need it if 171 | you modified \`acconfig.h' or \`${configure_ac}'. You might want 172 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 173 | from any GNU archive site." 174 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 175 | test -z "$files" && files="config.h" 176 | touch_files= 177 | for f in $files; do 178 | case $f in 179 | *:*) touch_files="$touch_files "`echo "$f" | 180 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 181 | *) touch_files="$touch_files $f.in";; 182 | esac 183 | done 184 | touch $touch_files 185 | ;; 186 | 187 | automake*) 188 | echo 1>&2 "\ 189 | WARNING: \`$1' is $msg. You should only need it if 190 | you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 191 | You might want to install the \`Automake' and \`Perl' packages. 192 | Grab them from any GNU archive site." 193 | find . -type f -name Makefile.am -print | 194 | sed 's/\.am$/.in/' | 195 | while read f; do touch "$f"; done 196 | ;; 197 | 198 | autom4te*) 199 | echo 1>&2 "\ 200 | WARNING: \`$1' is needed, but is $msg. 201 | You might have modified some files without having the 202 | proper tools for further handling them. 203 | You can get \`$1' as part of \`Autoconf' from any GNU 204 | archive site." 205 | 206 | file=`echo "$*" | sed -n "$sed_output"` 207 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 208 | if test -f "$file"; then 209 | touch $file 210 | else 211 | test -z "$file" || exec >$file 212 | echo "#! /bin/sh" 213 | echo "# Created by GNU Automake missing as a replacement of" 214 | echo "# $ $@" 215 | echo "exit 0" 216 | chmod +x $file 217 | exit 1 218 | fi 219 | ;; 220 | 221 | bison*|yacc*) 222 | echo 1>&2 "\ 223 | WARNING: \`$1' $msg. You should only need it if 224 | you modified a \`.y' file. You may need the \`Bison' package 225 | in order for those modifications to take effect. You can get 226 | \`Bison' from any GNU archive site." 227 | rm -f y.tab.c y.tab.h 228 | if test $# -ne 1; then 229 | eval LASTARG="\${$#}" 230 | case $LASTARG in 231 | *.y) 232 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 233 | if test -f "$SRCFILE"; then 234 | cp "$SRCFILE" y.tab.c 235 | fi 236 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 237 | if test -f "$SRCFILE"; then 238 | cp "$SRCFILE" y.tab.h 239 | fi 240 | ;; 241 | esac 242 | fi 243 | if test ! -f y.tab.h; then 244 | echo >y.tab.h 245 | fi 246 | if test ! -f y.tab.c; then 247 | echo 'main() { return 0; }' >y.tab.c 248 | fi 249 | ;; 250 | 251 | lex*|flex*) 252 | echo 1>&2 "\ 253 | WARNING: \`$1' is $msg. You should only need it if 254 | you modified a \`.l' file. You may need the \`Flex' package 255 | in order for those modifications to take effect. You can get 256 | \`Flex' from any GNU archive site." 257 | rm -f lex.yy.c 258 | if test $# -ne 1; then 259 | eval LASTARG="\${$#}" 260 | case $LASTARG in 261 | *.l) 262 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 263 | if test -f "$SRCFILE"; then 264 | cp "$SRCFILE" lex.yy.c 265 | fi 266 | ;; 267 | esac 268 | fi 269 | if test ! -f lex.yy.c; then 270 | echo 'main() { return 0; }' >lex.yy.c 271 | fi 272 | ;; 273 | 274 | help2man*) 275 | echo 1>&2 "\ 276 | WARNING: \`$1' is $msg. You should only need it if 277 | you modified a dependency of a manual page. You may need the 278 | \`Help2man' package in order for those modifications to take 279 | effect. You can get \`Help2man' from any GNU archive site." 280 | 281 | file=`echo "$*" | sed -n "$sed_output"` 282 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 283 | if test -f "$file"; then 284 | touch $file 285 | else 286 | test -z "$file" || exec >$file 287 | echo ".ab help2man is required to generate this page" 288 | exit $? 289 | fi 290 | ;; 291 | 292 | makeinfo*) 293 | echo 1>&2 "\ 294 | WARNING: \`$1' is $msg. You should only need it if 295 | you modified a \`.texi' or \`.texinfo' file, or any other file 296 | indirectly affecting the aspect of the manual. The spurious 297 | call might also be the consequence of using a buggy \`make' (AIX, 298 | DU, IRIX). You might want to install the \`Texinfo' package or 299 | the \`GNU make' package. Grab either from any GNU archive site." 300 | # The file to touch is that specified with -o ... 301 | file=`echo "$*" | sed -n "$sed_output"` 302 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 303 | if test -z "$file"; then 304 | # ... or it is the one specified with @setfilename ... 305 | infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 306 | file=`sed -n ' 307 | /^@setfilename/{ 308 | s/.* \([^ ]*\) *$/\1/ 309 | p 310 | q 311 | }' $infile` 312 | # ... or it is derived from the source name (dir/f.texi becomes f.info) 313 | test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 314 | fi 315 | # If the file does not exist, the user really needs makeinfo; 316 | # let's fail without touching anything. 317 | test -f $file || exit 1 318 | touch $file 319 | ;; 320 | 321 | tar*) 322 | shift 323 | 324 | # We have already tried tar in the generic part. 325 | # Look for gnutar/gtar before invocation to avoid ugly error 326 | # messages. 327 | if (gnutar --version > /dev/null 2>&1); then 328 | gnutar "$@" && exit 0 329 | fi 330 | if (gtar --version > /dev/null 2>&1); then 331 | gtar "$@" && exit 0 332 | fi 333 | firstarg="$1" 334 | if shift; then 335 | case $firstarg in 336 | *o*) 337 | firstarg=`echo "$firstarg" | sed s/o//` 338 | tar "$firstarg" "$@" && exit 0 339 | ;; 340 | esac 341 | case $firstarg in 342 | *h*) 343 | firstarg=`echo "$firstarg" | sed s/h//` 344 | tar "$firstarg" "$@" && exit 0 345 | ;; 346 | esac 347 | fi 348 | 349 | echo 1>&2 "\ 350 | WARNING: I can't seem to be able to run \`tar' with the given arguments. 351 | You may want to install GNU tar or Free paxutils, or check the 352 | command line arguments." 353 | exit 1 354 | ;; 355 | 356 | *) 357 | echo 1>&2 "\ 358 | WARNING: \`$1' is needed, and is $msg. 359 | You might have modified some files without having the 360 | proper tools for further handling them. Check the \`README' file, 361 | it often tells you about the needed prerequisites for installing 362 | this package. You may also peek at any GNU archive site, in case 363 | some other package would contain this missing \`$1' program." 364 | exit 1 365 | ;; 366 | esac 367 | 368 | exit 0 369 | 370 | # Local variables: 371 | # eval: (add-hook 'write-file-hooks 'time-stamp) 372 | # time-stamp-start: "scriptversion=" 373 | # time-stamp-format: "%:y-%02m-%02d.%02H" 374 | # time-stamp-time-zone: "UTC" 375 | # time-stamp-end: "; # UTC" 376 | # End: 377 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | # library 2 | lib_LTLIBRARIES = libcityhash.la 3 | libcityhash_la_SOURCES = city.cc 4 | if SSE42 5 | include_HEADERS = city.h citycrc.h 6 | else 7 | include_HEADERS = city.h 8 | endif 9 | 10 | # test 11 | cityhash_unittest_SOURCES = city-test.cc 12 | cityhash_unittest_LDADD = libcityhash.la 13 | TESTS = cityhash_unittest 14 | noinst_PROGRAMS = $(TESTS) 15 | -------------------------------------------------------------------------------- /src/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.3 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 6 | # Foundation, Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | 18 | 19 | 20 | VPATH = @srcdir@ 21 | pkgdatadir = $(datadir)/@PACKAGE@ 22 | pkgincludedir = $(includedir)/@PACKAGE@ 23 | pkglibdir = $(libdir)/@PACKAGE@ 24 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 25 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 26 | install_sh_DATA = $(install_sh) -c -m 644 27 | install_sh_PROGRAM = $(install_sh) -c 28 | install_sh_SCRIPT = $(install_sh) -c 29 | INSTALL_HEADER = $(INSTALL_DATA) 30 | transform = $(program_transform_name) 31 | NORMAL_INSTALL = : 32 | PRE_INSTALL = : 33 | POST_INSTALL = : 34 | NORMAL_UNINSTALL = : 35 | PRE_UNINSTALL = : 36 | POST_UNINSTALL = : 37 | build_triplet = @build@ 38 | host_triplet = @host@ 39 | TESTS = cityhash_unittest$(EXEEXT) 40 | noinst_PROGRAMS = $(am__EXEEXT_1) 41 | subdir = src 42 | DIST_COMMON = $(am__include_HEADERS_DIST) $(srcdir)/Makefile.am \ 43 | $(srcdir)/Makefile.in 44 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 45 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ 46 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ 47 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ 48 | $(top_srcdir)/configure.ac 49 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 50 | $(ACLOCAL_M4) 51 | mkinstalldirs = $(install_sh) -d 52 | CONFIG_HEADER = $(top_builddir)/config.h 53 | CONFIG_CLEAN_FILES = 54 | CONFIG_CLEAN_VPATH_FILES = 55 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 56 | am__vpath_adj = case $$p in \ 57 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 58 | *) f=$$p;; \ 59 | esac; 60 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; 61 | am__install_max = 40 62 | am__nobase_strip_setup = \ 63 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` 64 | am__nobase_strip = \ 65 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" 66 | am__nobase_list = $(am__nobase_strip_setup); \ 67 | for p in $$list; do echo "$$p $$p"; done | \ 68 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ 69 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ 70 | if (++n[$$2] == $(am__install_max)) \ 71 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ 72 | END { for (dir in files) print dir, files[dir] }' 73 | am__base_list = \ 74 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 75 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 76 | am__uninstall_files_from_dir = { \ 77 | test -z "$$files" \ 78 | || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ 79 | || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ 80 | $(am__cd) "$$dir" && rm -f $$files; }; \ 81 | } 82 | am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" 83 | LTLIBRARIES = $(lib_LTLIBRARIES) 84 | libcityhash_la_LIBADD = 85 | am_libcityhash_la_OBJECTS = city.lo 86 | libcityhash_la_OBJECTS = $(am_libcityhash_la_OBJECTS) 87 | am__EXEEXT_1 = cityhash_unittest$(EXEEXT) 88 | PROGRAMS = $(noinst_PROGRAMS) 89 | am_cityhash_unittest_OBJECTS = city-test.$(OBJEXT) 90 | cityhash_unittest_OBJECTS = $(am_cityhash_unittest_OBJECTS) 91 | cityhash_unittest_DEPENDENCIES = libcityhash.la 92 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) 93 | depcomp = $(SHELL) $(top_srcdir)/depcomp 94 | am__depfiles_maybe = depfiles 95 | am__mv = mv -f 96 | CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 97 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) 98 | LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ 99 | --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 100 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) 101 | CXXLD = $(CXX) 102 | CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ 103 | --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ 104 | $(LDFLAGS) -o $@ 105 | SOURCES = $(libcityhash_la_SOURCES) $(cityhash_unittest_SOURCES) 106 | DIST_SOURCES = $(libcityhash_la_SOURCES) $(cityhash_unittest_SOURCES) 107 | am__include_HEADERS_DIST = city.h citycrc.h 108 | HEADERS = $(include_HEADERS) 109 | ETAGS = etags 110 | CTAGS = ctags 111 | am__tty_colors = \ 112 | red=; grn=; lgn=; blu=; std= 113 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 114 | ACLOCAL = @ACLOCAL@ 115 | AMTAR = @AMTAR@ 116 | AR = @AR@ 117 | AUTOCONF = @AUTOCONF@ 118 | AUTOHEADER = @AUTOHEADER@ 119 | AUTOMAKE = @AUTOMAKE@ 120 | AWK = @AWK@ 121 | CC = @CC@ 122 | CCDEPMODE = @CCDEPMODE@ 123 | CFLAGS = @CFLAGS@ 124 | CPP = @CPP@ 125 | CPPFLAGS = @CPPFLAGS@ 126 | CXX = @CXX@ 127 | CXXCPP = @CXXCPP@ 128 | CXXDEPMODE = @CXXDEPMODE@ 129 | CXXFLAGS = @CXXFLAGS@ 130 | CYGPATH_W = @CYGPATH_W@ 131 | DEFS = @DEFS@ 132 | DEPDIR = @DEPDIR@ 133 | DLLTOOL = @DLLTOOL@ 134 | DSYMUTIL = @DSYMUTIL@ 135 | DUMPBIN = @DUMPBIN@ 136 | ECHO_C = @ECHO_C@ 137 | ECHO_N = @ECHO_N@ 138 | ECHO_T = @ECHO_T@ 139 | EGREP = @EGREP@ 140 | EXEEXT = @EXEEXT@ 141 | FGREP = @FGREP@ 142 | GREP = @GREP@ 143 | INSTALL = @INSTALL@ 144 | INSTALL_DATA = @INSTALL_DATA@ 145 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 146 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 147 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 148 | LD = @LD@ 149 | LDFLAGS = @LDFLAGS@ 150 | LIBOBJS = @LIBOBJS@ 151 | LIBS = @LIBS@ 152 | LIBTOOL = @LIBTOOL@ 153 | LIPO = @LIPO@ 154 | LN_S = @LN_S@ 155 | LTLIBOBJS = @LTLIBOBJS@ 156 | MAKEINFO = @MAKEINFO@ 157 | MANIFEST_TOOL = @MANIFEST_TOOL@ 158 | MKDIR_P = @MKDIR_P@ 159 | NM = @NM@ 160 | NMEDIT = @NMEDIT@ 161 | OBJDUMP = @OBJDUMP@ 162 | OBJEXT = @OBJEXT@ 163 | OTOOL = @OTOOL@ 164 | OTOOL64 = @OTOOL64@ 165 | PACKAGE = @PACKAGE@ 166 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 167 | PACKAGE_NAME = @PACKAGE_NAME@ 168 | PACKAGE_STRING = @PACKAGE_STRING@ 169 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 170 | PACKAGE_URL = @PACKAGE_URL@ 171 | PACKAGE_VERSION = @PACKAGE_VERSION@ 172 | PATH_SEPARATOR = @PATH_SEPARATOR@ 173 | RANLIB = @RANLIB@ 174 | SED = @SED@ 175 | SET_MAKE = @SET_MAKE@ 176 | SHELL = @SHELL@ 177 | STRIP = @STRIP@ 178 | VERSION = @VERSION@ 179 | abs_builddir = @abs_builddir@ 180 | abs_srcdir = @abs_srcdir@ 181 | abs_top_builddir = @abs_top_builddir@ 182 | abs_top_srcdir = @abs_top_srcdir@ 183 | ac_ct_AR = @ac_ct_AR@ 184 | ac_ct_CC = @ac_ct_CC@ 185 | ac_ct_CXX = @ac_ct_CXX@ 186 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 187 | am__include = @am__include@ 188 | am__leading_dot = @am__leading_dot@ 189 | am__quote = @am__quote@ 190 | am__tar = @am__tar@ 191 | am__untar = @am__untar@ 192 | bindir = @bindir@ 193 | build = @build@ 194 | build_alias = @build_alias@ 195 | build_cpu = @build_cpu@ 196 | build_os = @build_os@ 197 | build_vendor = @build_vendor@ 198 | builddir = @builddir@ 199 | datadir = @datadir@ 200 | datarootdir = @datarootdir@ 201 | docdir = @docdir@ 202 | dvidir = @dvidir@ 203 | exec_prefix = @exec_prefix@ 204 | host = @host@ 205 | host_alias = @host_alias@ 206 | host_cpu = @host_cpu@ 207 | host_os = @host_os@ 208 | host_vendor = @host_vendor@ 209 | htmldir = @htmldir@ 210 | includedir = @includedir@ 211 | infodir = @infodir@ 212 | install_sh = @install_sh@ 213 | libdir = @libdir@ 214 | libexecdir = @libexecdir@ 215 | localedir = @localedir@ 216 | localstatedir = @localstatedir@ 217 | mandir = @mandir@ 218 | mkdir_p = @mkdir_p@ 219 | oldincludedir = @oldincludedir@ 220 | pdfdir = @pdfdir@ 221 | prefix = @prefix@ 222 | program_transform_name = @program_transform_name@ 223 | psdir = @psdir@ 224 | sbindir = @sbindir@ 225 | sharedstatedir = @sharedstatedir@ 226 | srcdir = @srcdir@ 227 | sysconfdir = @sysconfdir@ 228 | target_alias = @target_alias@ 229 | top_build_prefix = @top_build_prefix@ 230 | top_builddir = @top_builddir@ 231 | top_srcdir = @top_srcdir@ 232 | 233 | # library 234 | lib_LTLIBRARIES = libcityhash.la 235 | libcityhash_la_SOURCES = city.cc 236 | @SSE42_FALSE@include_HEADERS = city.h 237 | @SSE42_TRUE@include_HEADERS = city.h citycrc.h 238 | 239 | # test 240 | cityhash_unittest_SOURCES = city-test.cc 241 | cityhash_unittest_LDADD = libcityhash.la 242 | all: all-am 243 | 244 | .SUFFIXES: 245 | .SUFFIXES: .cc .lo .o .obj 246 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 247 | @for dep in $?; do \ 248 | case '$(am__configure_deps)' in \ 249 | *$$dep*) \ 250 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 251 | && { if test -f $@; then exit 0; else break; fi; }; \ 252 | exit 1;; \ 253 | esac; \ 254 | done; \ 255 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ 256 | $(am__cd) $(top_srcdir) && \ 257 | $(AUTOMAKE) --foreign src/Makefile 258 | .PRECIOUS: Makefile 259 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 260 | @case '$?' in \ 261 | *config.status*) \ 262 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 263 | *) \ 264 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 265 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 266 | esac; 267 | 268 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 269 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 270 | 271 | $(top_srcdir)/configure: $(am__configure_deps) 272 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 273 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 274 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 275 | $(am__aclocal_m4_deps): 276 | install-libLTLIBRARIES: $(lib_LTLIBRARIES) 277 | @$(NORMAL_INSTALL) 278 | test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" 279 | @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ 280 | list2=; for p in $$list; do \ 281 | if test -f $$p; then \ 282 | list2="$$list2 $$p"; \ 283 | else :; fi; \ 284 | done; \ 285 | test -z "$$list2" || { \ 286 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ 287 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ 288 | } 289 | 290 | uninstall-libLTLIBRARIES: 291 | @$(NORMAL_UNINSTALL) 292 | @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ 293 | for p in $$list; do \ 294 | $(am__strip_dir) \ 295 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ 296 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ 297 | done 298 | 299 | clean-libLTLIBRARIES: 300 | -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) 301 | @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ 302 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ 303 | test "$$dir" != "$$p" || dir=.; \ 304 | echo "rm -f \"$${dir}/so_locations\""; \ 305 | rm -f "$${dir}/so_locations"; \ 306 | done 307 | libcityhash.la: $(libcityhash_la_OBJECTS) $(libcityhash_la_DEPENDENCIES) $(EXTRA_libcityhash_la_DEPENDENCIES) 308 | $(CXXLINK) -rpath $(libdir) $(libcityhash_la_OBJECTS) $(libcityhash_la_LIBADD) $(LIBS) 309 | 310 | clean-noinstPROGRAMS: 311 | @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ 312 | echo " rm -f" $$list; \ 313 | rm -f $$list || exit $$?; \ 314 | test -n "$(EXEEXT)" || exit 0; \ 315 | list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ 316 | echo " rm -f" $$list; \ 317 | rm -f $$list 318 | cityhash_unittest$(EXEEXT): $(cityhash_unittest_OBJECTS) $(cityhash_unittest_DEPENDENCIES) $(EXTRA_cityhash_unittest_DEPENDENCIES) 319 | @rm -f cityhash_unittest$(EXEEXT) 320 | $(CXXLINK) $(cityhash_unittest_OBJECTS) $(cityhash_unittest_LDADD) $(LIBS) 321 | 322 | mostlyclean-compile: 323 | -rm -f *.$(OBJEXT) 324 | 325 | distclean-compile: 326 | -rm -f *.tab.c 327 | 328 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/city-test.Po@am__quote@ 329 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/city.Plo@am__quote@ 330 | 331 | .cc.o: 332 | @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 333 | @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 334 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 335 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 336 | @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< 337 | 338 | .cc.obj: 339 | @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` 340 | @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 341 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 342 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 343 | @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` 344 | 345 | .cc.lo: 346 | @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 347 | @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo 348 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ 349 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 350 | @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< 351 | 352 | mostlyclean-libtool: 353 | -rm -f *.lo 354 | 355 | clean-libtool: 356 | -rm -rf .libs _libs 357 | install-includeHEADERS: $(include_HEADERS) 358 | @$(NORMAL_INSTALL) 359 | test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" 360 | @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ 361 | for p in $$list; do \ 362 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ 363 | echo "$$d$$p"; \ 364 | done | $(am__base_list) | \ 365 | while read files; do \ 366 | echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ 367 | $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ 368 | done 369 | 370 | uninstall-includeHEADERS: 371 | @$(NORMAL_UNINSTALL) 372 | @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ 373 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ 374 | dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) 375 | 376 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 377 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 378 | unique=`for i in $$list; do \ 379 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 380 | done | \ 381 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 382 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 383 | mkid -fID $$unique 384 | tags: TAGS 385 | 386 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 387 | $(TAGS_FILES) $(LISP) 388 | set x; \ 389 | here=`pwd`; \ 390 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 391 | unique=`for i in $$list; do \ 392 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 393 | done | \ 394 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 395 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 396 | shift; \ 397 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 398 | test -n "$$unique" || unique=$$empty_fix; \ 399 | if test $$# -gt 0; then \ 400 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 401 | "$$@" $$unique; \ 402 | else \ 403 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 404 | $$unique; \ 405 | fi; \ 406 | fi 407 | ctags: CTAGS 408 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 409 | $(TAGS_FILES) $(LISP) 410 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 411 | unique=`for i in $$list; do \ 412 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 413 | done | \ 414 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 415 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 416 | test -z "$(CTAGS_ARGS)$$unique" \ 417 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 418 | $$unique 419 | 420 | GTAGS: 421 | here=`$(am__cd) $(top_builddir) && pwd` \ 422 | && $(am__cd) $(top_srcdir) \ 423 | && gtags -i $(GTAGS_ARGS) "$$here" 424 | 425 | distclean-tags: 426 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 427 | 428 | check-TESTS: $(TESTS) 429 | @failed=0; all=0; xfail=0; xpass=0; skip=0; \ 430 | srcdir=$(srcdir); export srcdir; \ 431 | list=' $(TESTS) '; \ 432 | $(am__tty_colors); \ 433 | if test -n "$$list"; then \ 434 | for tst in $$list; do \ 435 | if test -f ./$$tst; then dir=./; \ 436 | elif test -f $$tst; then dir=; \ 437 | else dir="$(srcdir)/"; fi; \ 438 | if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ 439 | all=`expr $$all + 1`; \ 440 | case " $(XFAIL_TESTS) " in \ 441 | *[\ \ ]$$tst[\ \ ]*) \ 442 | xpass=`expr $$xpass + 1`; \ 443 | failed=`expr $$failed + 1`; \ 444 | col=$$red; res=XPASS; \ 445 | ;; \ 446 | *) \ 447 | col=$$grn; res=PASS; \ 448 | ;; \ 449 | esac; \ 450 | elif test $$? -ne 77; then \ 451 | all=`expr $$all + 1`; \ 452 | case " $(XFAIL_TESTS) " in \ 453 | *[\ \ ]$$tst[\ \ ]*) \ 454 | xfail=`expr $$xfail + 1`; \ 455 | col=$$lgn; res=XFAIL; \ 456 | ;; \ 457 | *) \ 458 | failed=`expr $$failed + 1`; \ 459 | col=$$red; res=FAIL; \ 460 | ;; \ 461 | esac; \ 462 | else \ 463 | skip=`expr $$skip + 1`; \ 464 | col=$$blu; res=SKIP; \ 465 | fi; \ 466 | echo "$${col}$$res$${std}: $$tst"; \ 467 | done; \ 468 | if test "$$all" -eq 1; then \ 469 | tests="test"; \ 470 | All=""; \ 471 | else \ 472 | tests="tests"; \ 473 | All="All "; \ 474 | fi; \ 475 | if test "$$failed" -eq 0; then \ 476 | if test "$$xfail" -eq 0; then \ 477 | banner="$$All$$all $$tests passed"; \ 478 | else \ 479 | if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ 480 | banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ 481 | fi; \ 482 | else \ 483 | if test "$$xpass" -eq 0; then \ 484 | banner="$$failed of $$all $$tests failed"; \ 485 | else \ 486 | if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ 487 | banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ 488 | fi; \ 489 | fi; \ 490 | dashes="$$banner"; \ 491 | skipped=""; \ 492 | if test "$$skip" -ne 0; then \ 493 | if test "$$skip" -eq 1; then \ 494 | skipped="($$skip test was not run)"; \ 495 | else \ 496 | skipped="($$skip tests were not run)"; \ 497 | fi; \ 498 | test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ 499 | dashes="$$skipped"; \ 500 | fi; \ 501 | report=""; \ 502 | if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ 503 | report="Please report to $(PACKAGE_BUGREPORT)"; \ 504 | test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ 505 | dashes="$$report"; \ 506 | fi; \ 507 | dashes=`echo "$$dashes" | sed s/./=/g`; \ 508 | if test "$$failed" -eq 0; then \ 509 | col="$$grn"; \ 510 | else \ 511 | col="$$red"; \ 512 | fi; \ 513 | echo "$${col}$$dashes$${std}"; \ 514 | echo "$${col}$$banner$${std}"; \ 515 | test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ 516 | test -z "$$report" || echo "$${col}$$report$${std}"; \ 517 | echo "$${col}$$dashes$${std}"; \ 518 | test "$$failed" -eq 0; \ 519 | else :; fi 520 | 521 | distdir: $(DISTFILES) 522 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 523 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 524 | list='$(DISTFILES)'; \ 525 | dist_files=`for file in $$list; do echo $$file; done | \ 526 | sed -e "s|^$$srcdirstrip/||;t" \ 527 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 528 | case $$dist_files in \ 529 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 530 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 531 | sort -u` ;; \ 532 | esac; \ 533 | for file in $$dist_files; do \ 534 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 535 | if test -d $$d/$$file; then \ 536 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 537 | if test -d "$(distdir)/$$file"; then \ 538 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 539 | fi; \ 540 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 541 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 542 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 543 | fi; \ 544 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 545 | else \ 546 | test -f "$(distdir)/$$file" \ 547 | || cp -p $$d/$$file "$(distdir)/$$file" \ 548 | || exit 1; \ 549 | fi; \ 550 | done 551 | check-am: all-am 552 | $(MAKE) $(AM_MAKEFLAGS) check-TESTS 553 | check: check-am 554 | all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) 555 | installdirs: 556 | for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ 557 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 558 | done 559 | install: install-am 560 | install-exec: install-exec-am 561 | install-data: install-data-am 562 | uninstall: uninstall-am 563 | 564 | install-am: all-am 565 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 566 | 567 | installcheck: installcheck-am 568 | install-strip: 569 | if test -z '$(STRIP)'; then \ 570 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 571 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 572 | install; \ 573 | else \ 574 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 575 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 576 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 577 | fi 578 | mostlyclean-generic: 579 | 580 | clean-generic: 581 | 582 | distclean-generic: 583 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 584 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 585 | 586 | maintainer-clean-generic: 587 | @echo "This command is intended for maintainers to use" 588 | @echo "it deletes files that may require special tools to rebuild." 589 | clean: clean-am 590 | 591 | clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ 592 | clean-noinstPROGRAMS mostlyclean-am 593 | 594 | distclean: distclean-am 595 | -rm -rf ./$(DEPDIR) 596 | -rm -f Makefile 597 | distclean-am: clean-am distclean-compile distclean-generic \ 598 | distclean-tags 599 | 600 | dvi: dvi-am 601 | 602 | dvi-am: 603 | 604 | html: html-am 605 | 606 | html-am: 607 | 608 | info: info-am 609 | 610 | info-am: 611 | 612 | install-data-am: install-includeHEADERS 613 | 614 | install-dvi: install-dvi-am 615 | 616 | install-dvi-am: 617 | 618 | install-exec-am: install-libLTLIBRARIES 619 | 620 | install-html: install-html-am 621 | 622 | install-html-am: 623 | 624 | install-info: install-info-am 625 | 626 | install-info-am: 627 | 628 | install-man: 629 | 630 | install-pdf: install-pdf-am 631 | 632 | install-pdf-am: 633 | 634 | install-ps: install-ps-am 635 | 636 | install-ps-am: 637 | 638 | installcheck-am: 639 | 640 | maintainer-clean: maintainer-clean-am 641 | -rm -rf ./$(DEPDIR) 642 | -rm -f Makefile 643 | maintainer-clean-am: distclean-am maintainer-clean-generic 644 | 645 | mostlyclean: mostlyclean-am 646 | 647 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ 648 | mostlyclean-libtool 649 | 650 | pdf: pdf-am 651 | 652 | pdf-am: 653 | 654 | ps: ps-am 655 | 656 | ps-am: 657 | 658 | uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES 659 | 660 | .MAKE: check-am install-am install-strip 661 | 662 | .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ 663 | clean-generic clean-libLTLIBRARIES clean-libtool \ 664 | clean-noinstPROGRAMS ctags distclean distclean-compile \ 665 | distclean-generic distclean-libtool distclean-tags distdir dvi \ 666 | dvi-am html html-am info info-am install install-am \ 667 | install-data install-data-am install-dvi install-dvi-am \ 668 | install-exec install-exec-am install-html install-html-am \ 669 | install-includeHEADERS install-info install-info-am \ 670 | install-libLTLIBRARIES install-man install-pdf install-pdf-am \ 671 | install-ps install-ps-am install-strip installcheck \ 672 | installcheck-am installdirs maintainer-clean \ 673 | maintainer-clean-generic mostlyclean mostlyclean-compile \ 674 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ 675 | tags uninstall uninstall-am uninstall-includeHEADERS \ 676 | uninstall-libLTLIBRARIES 677 | 678 | 679 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 680 | # Otherwise a system limit (for SysV at least) may be exceeded. 681 | .NOEXPORT: 682 | -------------------------------------------------------------------------------- /src/city.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | // 21 | // CityHash, by Geoff Pike and Jyrki Alakuijala 22 | // 23 | // This file provides CityHash64() and related functions. 24 | // 25 | // It's probably possible to create even faster hash functions by 26 | // writing a program that systematically explores some of the space of 27 | // possible hash functions, by using SIMD instructions, or by 28 | // compromising on hash quality. 29 | 30 | #include "config.h" 31 | #include 32 | 33 | #include 34 | #include // for memcpy and memset 35 | 36 | using namespace std; 37 | 38 | static uint64 UNALIGNED_LOAD64(const char *p) { 39 | uint64 result; 40 | memcpy(&result, p, sizeof(result)); 41 | return result; 42 | } 43 | 44 | static uint32 UNALIGNED_LOAD32(const char *p) { 45 | uint32 result; 46 | memcpy(&result, p, sizeof(result)); 47 | return result; 48 | } 49 | 50 | #ifdef _MSC_VER 51 | 52 | #include 53 | #define bswap_32(x) _byteswap_ulong(x) 54 | #define bswap_64(x) _byteswap_uint64(x) 55 | 56 | #elif defined(__APPLE__) 57 | 58 | // Mac OS X / Darwin features 59 | #include 60 | #define bswap_32(x) OSSwapInt32(x) 61 | #define bswap_64(x) OSSwapInt64(x) 62 | 63 | #elif defined(__sun) || defined(sun) 64 | 65 | #include 66 | #define bswap_32(x) BSWAP_32(x) 67 | #define bswap_64(x) BSWAP_64(x) 68 | 69 | #elif defined(__FreeBSD__) 70 | 71 | #include 72 | #define bswap_32(x) bswap32(x) 73 | #define bswap_64(x) bswap64(x) 74 | 75 | #elif defined(__OpenBSD__) 76 | 77 | #include 78 | #define bswap_32(x) swap32(x) 79 | #define bswap_64(x) swap64(x) 80 | 81 | #elif defined(__NetBSD__) 82 | 83 | #include 84 | #include 85 | #if defined(__BSWAP_RENAME) && !defined(__bswap_32) 86 | #define bswap_32(x) bswap32(x) 87 | #define bswap_64(x) bswap64(x) 88 | #endif 89 | 90 | #else 91 | 92 | #include 93 | 94 | #endif 95 | 96 | #ifdef WORDS_BIGENDIAN 97 | #define uint32_in_expected_order(x) (bswap_32(x)) 98 | #define uint64_in_expected_order(x) (bswap_64(x)) 99 | #else 100 | #define uint32_in_expected_order(x) (x) 101 | #define uint64_in_expected_order(x) (x) 102 | #endif 103 | 104 | #if !defined(LIKELY) 105 | #if HAVE_BUILTIN_EXPECT 106 | #define LIKELY(x) (__builtin_expect(!!(x), 1)) 107 | #else 108 | #define LIKELY(x) (x) 109 | #endif 110 | #endif 111 | 112 | static uint64 Fetch64(const char *p) { 113 | return uint64_in_expected_order(UNALIGNED_LOAD64(p)); 114 | } 115 | 116 | static uint32 Fetch32(const char *p) { 117 | return uint32_in_expected_order(UNALIGNED_LOAD32(p)); 118 | } 119 | 120 | // Some primes between 2^63 and 2^64 for various uses. 121 | static const uint64 k0 = 0xc3a5c85c97cb3127ULL; 122 | static const uint64 k1 = 0xb492b66fbe98f273ULL; 123 | static const uint64 k2 = 0x9ae16a3b2f90404fULL; 124 | 125 | // Magic numbers for 32-bit hashing. Copied from Murmur3. 126 | static const uint32 c1 = 0xcc9e2d51; 127 | static const uint32 c2 = 0x1b873593; 128 | 129 | // A 32-bit to 32-bit integer hash copied from Murmur3. 130 | static uint32 fmix(uint32 h) 131 | { 132 | h ^= h >> 16; 133 | h *= 0x85ebca6b; 134 | h ^= h >> 13; 135 | h *= 0xc2b2ae35; 136 | h ^= h >> 16; 137 | return h; 138 | } 139 | 140 | static uint32 Rotate32(uint32 val, int shift) { 141 | // Avoid shifting by 32: doing so yields an undefined result. 142 | return shift == 0 ? val : ((val >> shift) | (val << (32 - shift))); 143 | } 144 | 145 | #undef PERMUTE3 146 | #define PERMUTE3(a, b, c) do { std::swap(a, b); std::swap(a, c); } while (0) 147 | 148 | static uint32 Mur(uint32 a, uint32 h) { 149 | // Helper from Murmur3 for combining two 32-bit values. 150 | a *= c1; 151 | a = Rotate32(a, 17); 152 | a *= c2; 153 | h ^= a; 154 | h = Rotate32(h, 19); 155 | return h * 5 + 0xe6546b64; 156 | } 157 | 158 | static uint32 Hash32Len13to24(const char *s, size_t len) { 159 | uint32 a = Fetch32(s - 4 + (len >> 1)); 160 | uint32 b = Fetch32(s + 4); 161 | uint32 c = Fetch32(s + len - 8); 162 | uint32 d = Fetch32(s + (len >> 1)); 163 | uint32 e = Fetch32(s); 164 | uint32 f = Fetch32(s + len - 4); 165 | uint32 h = static_cast(len); 166 | 167 | return fmix(Mur(f, Mur(e, Mur(d, Mur(c, Mur(b, Mur(a, h))))))); 168 | } 169 | 170 | static uint32 Hash32Len0to4(const char *s, size_t len) { 171 | uint32 b = 0; 172 | uint32 c = 9; 173 | for (size_t i = 0; i < len; i++) { 174 | signed char v = static_cast(s[i]); 175 | b = b * c1 + static_cast(v); 176 | c ^= b; 177 | } 178 | return fmix(Mur(b, Mur(static_cast(len), c))); 179 | } 180 | 181 | static uint32 Hash32Len5to12(const char *s, size_t len) { 182 | uint32 a = static_cast(len), b = a * 5, c = 9, d = b; 183 | a += Fetch32(s); 184 | b += Fetch32(s + len - 4); 185 | c += Fetch32(s + ((len >> 1) & 4)); 186 | return fmix(Mur(c, Mur(b, Mur(a, d)))); 187 | } 188 | 189 | uint32 CityHash32(const char *s, size_t len) { 190 | if (len <= 24) { 191 | return len <= 12 ? 192 | (len <= 4 ? Hash32Len0to4(s, len) : Hash32Len5to12(s, len)) : 193 | Hash32Len13to24(s, len); 194 | } 195 | 196 | // len > 24 197 | uint32 h = static_cast(len), g = c1 * h, f = g; 198 | uint32 a0 = Rotate32(Fetch32(s + len - 4) * c1, 17) * c2; 199 | uint32 a1 = Rotate32(Fetch32(s + len - 8) * c1, 17) * c2; 200 | uint32 a2 = Rotate32(Fetch32(s + len - 16) * c1, 17) * c2; 201 | uint32 a3 = Rotate32(Fetch32(s + len - 12) * c1, 17) * c2; 202 | uint32 a4 = Rotate32(Fetch32(s + len - 20) * c1, 17) * c2; 203 | h ^= a0; 204 | h = Rotate32(h, 19); 205 | h = h * 5 + 0xe6546b64; 206 | h ^= a2; 207 | h = Rotate32(h, 19); 208 | h = h * 5 + 0xe6546b64; 209 | g ^= a1; 210 | g = Rotate32(g, 19); 211 | g = g * 5 + 0xe6546b64; 212 | g ^= a3; 213 | g = Rotate32(g, 19); 214 | g = g * 5 + 0xe6546b64; 215 | f += a4; 216 | f = Rotate32(f, 19); 217 | f = f * 5 + 0xe6546b64; 218 | size_t iters = (len - 1) / 20; 219 | do { 220 | uint32 a0 = Rotate32(Fetch32(s) * c1, 17) * c2; 221 | uint32 a1 = Fetch32(s + 4); 222 | uint32 a2 = Rotate32(Fetch32(s + 8) * c1, 17) * c2; 223 | uint32 a3 = Rotate32(Fetch32(s + 12) * c1, 17) * c2; 224 | uint32 a4 = Fetch32(s + 16); 225 | h ^= a0; 226 | h = Rotate32(h, 18); 227 | h = h * 5 + 0xe6546b64; 228 | f += a1; 229 | f = Rotate32(f, 19); 230 | f = f * c1; 231 | g += a2; 232 | g = Rotate32(g, 18); 233 | g = g * 5 + 0xe6546b64; 234 | h ^= a3 + a1; 235 | h = Rotate32(h, 19); 236 | h = h * 5 + 0xe6546b64; 237 | g ^= a4; 238 | g = bswap_32(g) * 5; 239 | h += a4 * 5; 240 | h = bswap_32(h); 241 | f += a0; 242 | PERMUTE3(f, h, g); 243 | s += 20; 244 | } while (--iters != 0); 245 | g = Rotate32(g, 11) * c1; 246 | g = Rotate32(g, 17) * c1; 247 | f = Rotate32(f, 11) * c1; 248 | f = Rotate32(f, 17) * c1; 249 | h = Rotate32(h + g, 19); 250 | h = h * 5 + 0xe6546b64; 251 | h = Rotate32(h, 17) * c1; 252 | h = Rotate32(h + f, 19); 253 | h = h * 5 + 0xe6546b64; 254 | h = Rotate32(h, 17) * c1; 255 | return h; 256 | } 257 | 258 | // Bitwise right rotate. Normally this will compile to a single 259 | // instruction, especially if the shift is a manifest constant. 260 | static uint64 Rotate(uint64 val, int shift) { 261 | // Avoid shifting by 64: doing so yields an undefined result. 262 | return shift == 0 ? val : ((val >> shift) | (val << (64 - shift))); 263 | } 264 | 265 | static uint64 ShiftMix(uint64 val) { 266 | return val ^ (val >> 47); 267 | } 268 | 269 | static uint64 HashLen16(uint64 u, uint64 v) { 270 | return Hash128to64(uint128(u, v)); 271 | } 272 | 273 | static uint64 HashLen16(uint64 u, uint64 v, uint64 mul) { 274 | // Murmur-inspired hashing. 275 | uint64 a = (u ^ v) * mul; 276 | a ^= (a >> 47); 277 | uint64 b = (v ^ a) * mul; 278 | b ^= (b >> 47); 279 | b *= mul; 280 | return b; 281 | } 282 | 283 | static uint64 HashLen0to16(const char *s, size_t len) { 284 | if (len >= 8) { 285 | uint64 mul = k2 + len * 2; 286 | uint64 a = Fetch64(s) + k2; 287 | uint64 b = Fetch64(s + len - 8); 288 | uint64 c = Rotate(b, 37) * mul + a; 289 | uint64 d = (Rotate(a, 25) + b) * mul; 290 | return HashLen16(c, d, mul); 291 | } 292 | if (len >= 4) { 293 | uint64 mul = k2 + len * 2; 294 | uint64 a = Fetch32(s); 295 | return HashLen16(len + (a << 3), Fetch32(s + len - 4), mul); 296 | } 297 | if (len > 0) { 298 | uint8 a = static_cast(s[0]); 299 | uint8 b = static_cast(s[len >> 1]); 300 | uint8 c = static_cast(s[len - 1]); 301 | uint32 y = static_cast(a) + (static_cast(b) << 8); 302 | uint32 z = static_cast(len) + (static_cast(c) << 2); 303 | return ShiftMix(y * k2 ^ z * k0) * k2; 304 | } 305 | return k2; 306 | } 307 | 308 | // This probably works well for 16-byte strings as well, but it may be overkill 309 | // in that case. 310 | static uint64 HashLen17to32(const char *s, size_t len) { 311 | uint64 mul = k2 + len * 2; 312 | uint64 a = Fetch64(s) * k1; 313 | uint64 b = Fetch64(s + 8); 314 | uint64 c = Fetch64(s + len - 8) * mul; 315 | uint64 d = Fetch64(s + len - 16) * k2; 316 | return HashLen16(Rotate(a + b, 43) + Rotate(c, 30) + d, 317 | a + Rotate(b + k2, 18) + c, mul); 318 | } 319 | 320 | // Return a 16-byte hash for 48 bytes. Quick and dirty. 321 | // Callers do best to use "random-looking" values for a and b. 322 | static pair WeakHashLen32WithSeeds( 323 | uint64 w, uint64 x, uint64 y, uint64 z, uint64 a, uint64 b) { 324 | a += w; 325 | b = Rotate(b + a + z, 21); 326 | uint64 c = a; 327 | a += x; 328 | a += y; 329 | b += Rotate(a, 44); 330 | return make_pair(a + z, b + c); 331 | } 332 | 333 | // Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty. 334 | static pair WeakHashLen32WithSeeds( 335 | const char* s, uint64 a, uint64 b) { 336 | return WeakHashLen32WithSeeds(Fetch64(s), 337 | Fetch64(s + 8), 338 | Fetch64(s + 16), 339 | Fetch64(s + 24), 340 | a, 341 | b); 342 | } 343 | 344 | // Return an 8-byte hash for 33 to 64 bytes. 345 | static uint64 HashLen33to64(const char *s, size_t len) { 346 | uint64 mul = k2 + len * 2; 347 | uint64 a = Fetch64(s) * k2; 348 | uint64 b = Fetch64(s + 8); 349 | uint64 c = Fetch64(s + len - 24); 350 | uint64 d = Fetch64(s + len - 32); 351 | uint64 e = Fetch64(s + 16) * k2; 352 | uint64 f = Fetch64(s + 24) * 9; 353 | uint64 g = Fetch64(s + len - 8); 354 | uint64 h = Fetch64(s + len - 16) * mul; 355 | uint64 u = Rotate(a + g, 43) + (Rotate(b, 30) + c) * 9; 356 | uint64 v = ((a + g) ^ d) + f + 1; 357 | uint64 w = bswap_64((u + v) * mul) + h; 358 | uint64 x = Rotate(e + f, 42) + c; 359 | uint64 y = (bswap_64((v + w) * mul) + g) * mul; 360 | uint64 z = e + f + c; 361 | a = bswap_64((x + z) * mul + y) + b; 362 | b = ShiftMix((z + a) * mul + d + h) * mul; 363 | return b + x; 364 | } 365 | 366 | uint64 CityHash64(const char *s, size_t len) { 367 | if (len <= 32) { 368 | if (len <= 16) { 369 | return HashLen0to16(s, len); 370 | } else { 371 | return HashLen17to32(s, len); 372 | } 373 | } else if (len <= 64) { 374 | return HashLen33to64(s, len); 375 | } 376 | 377 | // For strings over 64 bytes we hash the end first, and then as we 378 | // loop we keep 56 bytes of state: v, w, x, y, and z. 379 | uint64 x = Fetch64(s + len - 40); 380 | uint64 y = Fetch64(s + len - 16) + Fetch64(s + len - 56); 381 | uint64 z = HashLen16(Fetch64(s + len - 48) + len, Fetch64(s + len - 24)); 382 | pair v = WeakHashLen32WithSeeds(s + len - 64, len, z); 383 | pair w = WeakHashLen32WithSeeds(s + len - 32, y + k1, x); 384 | x = x * k1 + Fetch64(s); 385 | 386 | // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks. 387 | len = (len - 1) & ~static_cast(63); 388 | do { 389 | x = Rotate(x + y + v.first + Fetch64(s + 8), 37) * k1; 390 | y = Rotate(y + v.second + Fetch64(s + 48), 42) * k1; 391 | x ^= w.second; 392 | y += v.first + Fetch64(s + 40); 393 | z = Rotate(z + w.first, 33) * k1; 394 | v = WeakHashLen32WithSeeds(s, v.second * k1, x + w.first); 395 | w = WeakHashLen32WithSeeds(s + 32, z + w.second, y + Fetch64(s + 16)); 396 | std::swap(z, x); 397 | s += 64; 398 | len -= 64; 399 | } while (len != 0); 400 | return HashLen16(HashLen16(v.first, w.first) + ShiftMix(y) * k1 + z, 401 | HashLen16(v.second, w.second) + x); 402 | } 403 | 404 | uint64 CityHash64WithSeed(const char *s, size_t len, uint64 seed) { 405 | return CityHash64WithSeeds(s, len, k2, seed); 406 | } 407 | 408 | uint64 CityHash64WithSeeds(const char *s, size_t len, 409 | uint64 seed0, uint64 seed1) { 410 | return HashLen16(CityHash64(s, len) - seed0, seed1); 411 | } 412 | 413 | // A subroutine for CityHash128(). Returns a decent 128-bit hash for strings 414 | // of any length representable in signed long. Based on City and Murmur. 415 | static uint128 CityMurmur(const char *s, size_t len, uint128 seed) { 416 | uint64 a = Uint128Low64(seed); 417 | uint64 b = Uint128High64(seed); 418 | uint64 c = 0; 419 | uint64 d = 0; 420 | if (len <= 16) { 421 | a = ShiftMix(a * k1) * k1; 422 | c = b * k1 + HashLen0to16(s, len); 423 | d = ShiftMix(a + (len >= 8 ? Fetch64(s) : c)); 424 | } else { 425 | c = HashLen16(Fetch64(s + len - 8) + k1, a); 426 | d = HashLen16(b + len, c + Fetch64(s + len - 16)); 427 | a += d; 428 | // len > 16 here, so do...while is safe 429 | do { 430 | a ^= ShiftMix(Fetch64(s) * k1) * k1; 431 | a *= k1; 432 | b ^= a; 433 | c ^= ShiftMix(Fetch64(s + 8) * k1) * k1; 434 | c *= k1; 435 | d ^= c; 436 | s += 16; 437 | len -= 16; 438 | } while (len > 16); 439 | } 440 | a = HashLen16(a, c); 441 | b = HashLen16(d, b); 442 | return uint128(a ^ b, HashLen16(b, a)); 443 | } 444 | 445 | uint128 CityHash128WithSeed(const char *s, size_t len, uint128 seed) { 446 | if (len < 128) { 447 | return CityMurmur(s, len, seed); 448 | } 449 | 450 | // We expect len >= 128 to be the common case. Keep 56 bytes of state: 451 | // v, w, x, y, and z. 452 | pair v, w; 453 | uint64 x = Uint128Low64(seed); 454 | uint64 y = Uint128High64(seed); 455 | uint64 z = len * k1; 456 | v.first = Rotate(y ^ k1, 49) * k1 + Fetch64(s); 457 | v.second = Rotate(v.first, 42) * k1 + Fetch64(s + 8); 458 | w.first = Rotate(y + z, 35) * k1 + x; 459 | w.second = Rotate(x + Fetch64(s + 88), 53) * k1; 460 | 461 | // This is the same inner loop as CityHash64(), manually unrolled. 462 | do { 463 | x = Rotate(x + y + v.first + Fetch64(s + 8), 37) * k1; 464 | y = Rotate(y + v.second + Fetch64(s + 48), 42) * k1; 465 | x ^= w.second; 466 | y += v.first + Fetch64(s + 40); 467 | z = Rotate(z + w.first, 33) * k1; 468 | v = WeakHashLen32WithSeeds(s, v.second * k1, x + w.first); 469 | w = WeakHashLen32WithSeeds(s + 32, z + w.second, y + Fetch64(s + 16)); 470 | std::swap(z, x); 471 | s += 64; 472 | x = Rotate(x + y + v.first + Fetch64(s + 8), 37) * k1; 473 | y = Rotate(y + v.second + Fetch64(s + 48), 42) * k1; 474 | x ^= w.second; 475 | y += v.first + Fetch64(s + 40); 476 | z = Rotate(z + w.first, 33) * k1; 477 | v = WeakHashLen32WithSeeds(s, v.second * k1, x + w.first); 478 | w = WeakHashLen32WithSeeds(s + 32, z + w.second, y + Fetch64(s + 16)); 479 | std::swap(z, x); 480 | s += 64; 481 | len -= 128; 482 | } while (LIKELY(len >= 128)); 483 | x += Rotate(v.first + z, 49) * k0; 484 | y = y * k0 + Rotate(w.second, 37); 485 | z = z * k0 + Rotate(w.first, 27); 486 | w.first *= 9; 487 | v.first *= k0; 488 | // If 0 < len < 128, hash up to 4 chunks of 32 bytes each from the end of s. 489 | for (size_t tail_done = 0; tail_done < len; ) { 490 | tail_done += 32; 491 | y = Rotate(x + y, 42) * k0 + v.second; 492 | w.first += Fetch64(s + len - tail_done + 16); 493 | x = x * k0 + w.first; 494 | z += w.second + Fetch64(s + len - tail_done); 495 | w.second += v.first; 496 | v = WeakHashLen32WithSeeds(s + len - tail_done, v.first + z, v.second); 497 | v.first *= k0; 498 | } 499 | // At this point our 56 bytes of state should contain more than 500 | // enough information for a strong 128-bit hash. We use two 501 | // different 56-byte-to-8-byte hashes to get a 16-byte final result. 502 | x = HashLen16(x, v.first); 503 | y = HashLen16(y + z, w.first); 504 | return uint128(HashLen16(x + v.second, w.second) + y, 505 | HashLen16(x + w.second, y + v.second)); 506 | } 507 | 508 | uint128 CityHash128(const char *s, size_t len) { 509 | return len >= 16 ? 510 | CityHash128WithSeed(s + 16, len - 16, 511 | uint128(Fetch64(s), Fetch64(s + 8) + k0)) : 512 | CityHash128WithSeed(s, len, uint128(k0, k1)); 513 | } 514 | 515 | #ifdef __SSE4_2__ 516 | #include 517 | #include 518 | 519 | // Requires len >= 240. 520 | static void CityHashCrc256Long(const char *s, size_t len, 521 | uint32 seed, uint64 *result) { 522 | uint64 a = Fetch64(s + 56) + k0; 523 | uint64 b = Fetch64(s + 96) + k0; 524 | uint64 c = result[0] = HashLen16(b, len); 525 | uint64 d = result[1] = Fetch64(s + 120) * k0 + len; 526 | uint64 e = Fetch64(s + 184) + seed; 527 | uint64 f = 0; 528 | uint64 g = 0; 529 | uint64 h = c + d; 530 | uint64 x = seed; 531 | uint64 y = 0; 532 | uint64 z = 0; 533 | 534 | // 240 bytes of input per iter. 535 | size_t iters = len / 240; 536 | len -= iters * 240; 537 | do { 538 | #undef CHUNK 539 | #define CHUNK(r) \ 540 | PERMUTE3(x, z, y); \ 541 | b += Fetch64(s); \ 542 | c += Fetch64(s + 8); \ 543 | d += Fetch64(s + 16); \ 544 | e += Fetch64(s + 24); \ 545 | f += Fetch64(s + 32); \ 546 | a += b; \ 547 | h += f; \ 548 | b += c; \ 549 | f += d; \ 550 | g += e; \ 551 | e += z; \ 552 | g += x; \ 553 | z = _mm_crc32_u64(z, b + g); \ 554 | y = _mm_crc32_u64(y, e + h); \ 555 | x = _mm_crc32_u64(x, f + a); \ 556 | e = Rotate(e, r); \ 557 | c += e; \ 558 | s += 40 559 | 560 | CHUNK(0); PERMUTE3(a, h, c); 561 | CHUNK(33); PERMUTE3(a, h, f); 562 | CHUNK(0); PERMUTE3(b, h, f); 563 | CHUNK(42); PERMUTE3(b, h, d); 564 | CHUNK(0); PERMUTE3(b, h, e); 565 | CHUNK(33); PERMUTE3(a, h, e); 566 | } while (--iters > 0); 567 | 568 | while (len >= 40) { 569 | CHUNK(29); 570 | e ^= Rotate(a, 20); 571 | h += Rotate(b, 30); 572 | g ^= Rotate(c, 40); 573 | f += Rotate(d, 34); 574 | PERMUTE3(c, h, g); 575 | len -= 40; 576 | } 577 | if (len > 0) { 578 | s = s + len - 40; 579 | CHUNK(33); 580 | e ^= Rotate(a, 43); 581 | h += Rotate(b, 42); 582 | g ^= Rotate(c, 41); 583 | f += Rotate(d, 40); 584 | } 585 | result[0] ^= h; 586 | result[1] ^= g; 587 | g += h; 588 | a = HashLen16(a, g + z); 589 | x += y << 32; 590 | b += x; 591 | c = HashLen16(c, z) + h; 592 | d = HashLen16(d, e + result[0]); 593 | g += e; 594 | h += HashLen16(x, f); 595 | e = HashLen16(a, d) + g; 596 | z = HashLen16(b, c) + a; 597 | y = HashLen16(g, h) + c; 598 | result[0] = e + z + y + x; 599 | a = ShiftMix((a + y) * k0) * k0 + b; 600 | result[1] += a + result[0]; 601 | a = ShiftMix(a * k0) * k0 + c; 602 | result[2] = a + result[1]; 603 | a = ShiftMix((a + e) * k0) * k0; 604 | result[3] = a + result[2]; 605 | } 606 | 607 | // Requires len < 240. 608 | static void CityHashCrc256Short(const char *s, size_t len, uint64 *result) { 609 | char buf[240]; 610 | memcpy(buf, s, len); 611 | memset(buf + len, 0, 240 - len); 612 | CityHashCrc256Long(buf, 240, ~static_cast(len), result); 613 | } 614 | 615 | void CityHashCrc256(const char *s, size_t len, uint64 *result) { 616 | if (LIKELY(len >= 240)) { 617 | CityHashCrc256Long(s, len, 0, result); 618 | } else { 619 | CityHashCrc256Short(s, len, result); 620 | } 621 | } 622 | 623 | uint128 CityHashCrc128WithSeed(const char *s, size_t len, uint128 seed) { 624 | if (len <= 900) { 625 | return CityHash128WithSeed(s, len, seed); 626 | } else { 627 | uint64 result[4]; 628 | CityHashCrc256(s, len, result); 629 | uint64 u = Uint128High64(seed) + result[0]; 630 | uint64 v = Uint128Low64(seed) + result[1]; 631 | return uint128(HashLen16(u, v + result[2]), 632 | HashLen16(Rotate(v, 32), u * k0 + result[3])); 633 | } 634 | } 635 | 636 | uint128 CityHashCrc128(const char *s, size_t len) { 637 | if (len <= 900) { 638 | return CityHash128(s, len); 639 | } else { 640 | uint64 result[4]; 641 | CityHashCrc256(s, len, result); 642 | return uint128(result[2], result[3]); 643 | } 644 | } 645 | 646 | #endif 647 | -------------------------------------------------------------------------------- /src/city.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | // 21 | // CityHash, by Geoff Pike and Jyrki Alakuijala 22 | // 23 | // http://code.google.com/p/cityhash/ 24 | // 25 | // This file provides a few functions for hashing strings. All of them are 26 | // high-quality functions in the sense that they pass standard tests such 27 | // as Austin Appleby's SMHasher. They are also fast. 28 | // 29 | // For 64-bit x86 code, on short strings, we don't know of anything faster than 30 | // CityHash64 that is of comparable quality. We believe our nearest competitor 31 | // is Murmur3. For 64-bit x86 code, CityHash64 is an excellent choice for hash 32 | // tables and most other hashing (excluding cryptography). 33 | // 34 | // For 64-bit x86 code, on long strings, the picture is more complicated. 35 | // On many recent Intel CPUs, such as Nehalem, Westmere, Sandy Bridge, etc., 36 | // CityHashCrc128 appears to be faster than all competitors of comparable 37 | // quality. CityHash128 is also good but not quite as fast. We believe our 38 | // nearest competitor is Bob Jenkins' Spooky. We don't have great data for 39 | // other 64-bit CPUs, but for long strings we know that Spooky is slightly 40 | // faster than CityHash on some relatively recent AMD x86-64 CPUs, for example. 41 | // Note that CityHashCrc128 is declared in citycrc.h. 42 | // 43 | // For 32-bit x86 code, we don't know of anything faster than CityHash32 that 44 | // is of comparable quality. We believe our nearest competitor is Murmur3A. 45 | // (On 64-bit CPUs, it is typically faster to use the other CityHash variants.) 46 | // 47 | // Functions in the CityHash family are not suitable for cryptography. 48 | // 49 | // Please see CityHash's README file for more details on our performance 50 | // measurements and so on. 51 | // 52 | // WARNING: This code has been only lightly tested on big-endian platforms! 53 | // It is known to work well on little-endian platforms that have a small penalty 54 | // for unaligned reads, such as current Intel and AMD moderate-to-high-end CPUs. 55 | // It should work on all 32-bit and 64-bit platforms that allow unaligned reads; 56 | // bug reports are welcome. 57 | // 58 | // By the way, for some hash functions, given strings a and b, the hash 59 | // of a+b is easily derived from the hashes of a and b. This property 60 | // doesn't hold for any hash functions in this file. 61 | 62 | #ifndef CITY_HASH_H_ 63 | #define CITY_HASH_H_ 64 | 65 | #include // for size_t. 66 | #include 67 | #include 68 | 69 | typedef uint8_t uint8; 70 | typedef uint32_t uint32; 71 | typedef uint64_t uint64; 72 | typedef std::pair uint128; 73 | 74 | inline uint64 Uint128Low64(const uint128& x) { return x.first; } 75 | inline uint64 Uint128High64(const uint128& x) { return x.second; } 76 | 77 | // Hash function for a byte array. 78 | uint64 CityHash64(const char *buf, size_t len); 79 | 80 | // Hash function for a byte array. For convenience, a 64-bit seed is also 81 | // hashed into the result. 82 | uint64 CityHash64WithSeed(const char *buf, size_t len, uint64 seed); 83 | 84 | // Hash function for a byte array. For convenience, two seeds are also 85 | // hashed into the result. 86 | uint64 CityHash64WithSeeds(const char *buf, size_t len, 87 | uint64 seed0, uint64 seed1); 88 | 89 | // Hash function for a byte array. 90 | uint128 CityHash128(const char *s, size_t len); 91 | 92 | // Hash function for a byte array. For convenience, a 128-bit seed is also 93 | // hashed into the result. 94 | uint128 CityHash128WithSeed(const char *s, size_t len, uint128 seed); 95 | 96 | // Hash function for a byte array. Most useful in 32-bit binaries. 97 | uint32 CityHash32(const char *buf, size_t len); 98 | 99 | // Hash 128 input bits down to 64 bits of output. 100 | // This is intended to be a reasonably good hash function. 101 | inline uint64 Hash128to64(const uint128& x) { 102 | // Murmur-inspired hashing. 103 | const uint64 kMul = 0x9ddfea08eb382d69ULL; 104 | uint64 a = (Uint128Low64(x) ^ Uint128High64(x)) * kMul; 105 | a ^= (a >> 47); 106 | uint64 b = (Uint128High64(x) ^ a) * kMul; 107 | b ^= (b >> 47); 108 | b *= kMul; 109 | return b; 110 | } 111 | 112 | #endif // CITY_HASH_H_ 113 | -------------------------------------------------------------------------------- /src/citycrc.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | // 21 | // CityHash, by Geoff Pike and Jyrki Alakuijala 22 | // 23 | // This file declares the subset of the CityHash functions that require 24 | // _mm_crc32_u64(). See the CityHash README for details. 25 | // 26 | // Functions in the CityHash family are not suitable for cryptography. 27 | 28 | #ifndef CITY_HASH_CRC_H_ 29 | #define CITY_HASH_CRC_H_ 30 | 31 | #include 32 | 33 | // Hash function for a byte array. 34 | uint128 CityHashCrc128(const char *s, size_t len); 35 | 36 | // Hash function for a byte array. For convenience, a 128-bit seed is also 37 | // hashed into the result. 38 | uint128 CityHashCrc128WithSeed(const char *s, size_t len, uint128 seed); 39 | 40 | // Hash function for a byte array. Sets result[0] ... result[3]. 41 | void CityHashCrc256(const char *s, size_t len, uint64 *result); 42 | 43 | #endif // CITY_HASH_CRC_H_ 44 | --------------------------------------------------------------------------------